'success'; $response['message'] = __( 'Options updated, successfully!', 'themeisle-companion' ); } } return $response; } /** * Define render function for recommended tab. */ public function get_recommended_plugins() { $plugins = array( 'optimole-wp', 'wp-cloudflare-page-cache', 'feedzy-rss-feeds', 'translatepress-multilingual', 'otter-blocks', 'wp-maintenance-mode', 'multiple-pages-generator-by-porthas', ); $th_plugins = array( 'wp-landing-kit' => array( 'banner' => esc_url( OBFX_URL ) . '/dashboard/assets/wp-landing.jpg', 'name' => 'WP Landing Kit', 'description' => __( 'Turn WordPress into a landing page powerhouse with Landing Kit. Map domains to pages or any other published resource.', 'themeisle-companion' ), 'author' => 'Themeisle', 'action' => 'external', 'url' => tsdk_utmify( 'https://wplandingkit.com/', 'recommendedplugins', 'orbitfox' ), 'premium' => true, ), ); if ( class_exists( 'woocommerce' ) ) { $th_plugins['sparks'] = array( 'banner' => esc_url( OBFX_URL ) . '/dashboard/assets/sparks.jpeg', 'name' => 'Sparks for WooCommerce', 'description' => __( 'Conversion-focused features for your online store.', 'themeisle-companion' ), 'author' => 'Themeisle', 'action' => 'external', 'url' => tsdk_utmify( 'https://themeisle.com/plugins/sparks-for-woocommerce/', 'recommendedplugins', 'orbitfox' ), 'premium' => true, ); } $install_instance = new Orbit_Fox_Plugin_Install(); shuffle( $plugins ); $data = array(); foreach ( $plugins as $plugin ) { $current_plugin = $install_instance->call_plugin_api( $plugin ); if ( ! isset( $current_plugin->name ) ) { continue; } $data[ $plugin ] = array( 'banner' => $current_plugin->banners['low'], 'name' => html_entity_decode( $current_plugin->name ), 'description' => html_entity_decode( $current_plugin->short_description, ENT_QUOTES ), 'version' => $current_plugin->version, 'author' => html_entity_decode( wp_strip_all_tags( $current_plugin->author ) ), 'action' => $install_instance->check_plugin_state( $plugin ), 'path' => $install_instance->get_plugin_path( $plugin ), 'activate' => $install_instance->get_plugin_action_link( $plugin ), 'deactivate' => $install_instance->get_plugin_action_link( $plugin, 'deactivate' ), ); } foreach ( $th_plugins as $plugin_slug => $plugin_data ) { $data[ $plugin_slug ] = $plugin_data; } return $data; } /** * A method to trigger module activation or deavtivation hook * based in active status. * * @codeCoverageIgnore * * @param boolean $active_status The active status. * @param Orbit_Fox_Module_Abstract $module The module referenced. * * @since 2.3.3 * @access public */ public function trigger_activate_deactivate( $active_status, Orbit_Fox_Module_Abstract $module ) { if ( $active_status === true ) { do_action( $module->get_slug() . '_activate' ); } else { do_action( $module->get_slug() . '_deactivate' ); } } /** * Method to display modules page. * * @codeCoverageIgnore * * @since 1.0.0 * @access public */ public function page_modules_render() { echo '
'; // entry point for the React dashboard } /** * Add Black Friday data. * * @param array $configs The configuration array for the loaded products. * * @return array */ public function add_black_friday_data( $configs ) { $config = $configs['default']; // translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name. $message_template = __( 'Brought to you by the team behind %1$s— our biggest sale of the year is here: %2$sup to %3$s OFF%4$s on premium products from %5$s! Limited-time only.', 'themeisle-companion' ); $config['message'] = sprintf( $message_template, 'Orbit Fox Companion', '', '70%', '', 'Themeisle' ); $config['sale_url'] = add_query_arg( array( 'utm_term' => 'free', ), tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/all-bf', 'bfcm', 'themeisle-companion' ) ) ); $configs[ OBX_PRODUCT_SLUG ] = $config; return $configs; } }