; $no_install = 'no'; $title = __( 'Import Template', 'woofunnels-upstroke-one-click-upsell' ); $install_fail = __( 'We are unable to install the page builder plugin.', 'woofunnels-upstroke-one-click-upsell' ); $activate_fail = __( 'We are unable to activate the page builder plugin.', 'woofunnels-upstroke-one-click-upsell' ); $show_cancel_btn = 'yes'; $plugin_status = isset( $page_builder['status'] ) ? $page_builder['status'] : ''; $theme_status = isset( $page_builder['theme-status'] ) ? $page_builder['theme-status'] : ''; $string = sprintf( __( ' Click the button to install and activate %s.', 'woofunnels-upstroke-one-click-upsell' ), esc_html( $page_builder['title'] ) ); $install = sprintf( __( ' Install and activate %s.', 'woofunnels-upstroke-one-click-upsell' ), esc_html( $page_builder['title'] ) ); $builder_link = ''; /** * If its a divi builder we need to handle few cases down there for best user experience */ if ( 'divi' === $builder ) { if ( 'activated' !== $theme_status && 'activate' === $plugin_status ) { $plugin_string .= $string; } else { $plugin_string .= $install; $button_text = __( 'Install Divi Builder', 'woofunnels-upstroke-one-click-upsell' ); $no_install = 'yes'; $builder_link = esc_url( 'https://www.elegantthemes.com/' ); } } elseif ( 'oxy' === $builder ) { if ( 'install' === $plugin_status ) { $plugin_string .= $string; $button_text = __( 'Install Oxygen Classic Builder', 'woofunnels-upstroke-one-click-upsell' ); $no_install = 'yes'; $builder_link = esc_url( 'https://oxygenbuilder.com/' ); } else { $plugin_string .= $install; } } else { $plugin_string .= $string; } /** * If its a divi builder we need to handle few cases down there for best user experience */ $pageBuildersTexts[ $builder ] = array( 'install_fail' => $install_fail, 'activate_fail' => $activate_fail, 'text' => $plugin_string, 'confirmButtonText' => $button_text, 'noInstall' => $no_install, 'title' => $title, 'show_cancel_btn' => $show_cancel_btn, 'close_btn' => $cancel_btn, 'builder_link' => $builder_link, 'plugin_status' => $plugin_status, ); } return $pageBuildersTexts; } public function get_dependent_plugins_for_page_builder( $page_builder_slug = '', $default = 'elementor' ) { $plugins = $this->get_plugins_groupby_page_builders(); if ( array_key_exists( $page_builder_slug, $plugins ) ) { return $plugins[ $page_builder_slug ]; } return $plugins[ $default ]; } public function maybe_render_css_for_offer_conf() { if ( ! did_action( 'wfocu_front_before_single_page_load' ) && ! did_action( 'wfocu_front_before_custom_offer_page' ) ) { return; } $this->print_internal_css(); } /** * Check if Divi theme is install status. * * @return boolean */ public function is_divi_theme_installed() { foreach ( (array) wp_get_themes() as $theme ) { if ( 'Divi' === $theme->name || 'Divi' === $theme->parent_theme || 'Extra' === $theme->name || 'Extra' === $theme->parent_theme ) { return true; } } return false; } /** * Check if divi theme enabled for post id. * * @param object $theme theme data. * * @return boolean */ public function is_divi_theme_enabled( $theme = false ) { if ( ! $theme ) { $theme = wp_get_theme(); } if ( 'Divi' === $theme->name || 'Divi' === $theme->parent_theme || 'Extra' === $theme->name || 'Extra' === $theme->parent_theme ) { return true; } return false; } public function default_product_key( $product_key ) { if ( ! isset( $this->product_data->products ) ) { return $product_key; } if ( empty( $product_key ) || $product_key === 0 ) { $product_key = key( (array) $this->product_data->products ); } return $product_key; } } if ( class_exists( 'WFOCU_Core' ) ) { WFOCU_Core::register( 'template_loader', 'WFOCU_Template_loader' ); } }