expected_url = admin_url( 'admin.php?page=xlplugins' ); /** * XL CORE HOOKS */ add_filter( 'xl_optin_notif_show', array( $this, 'xlwcty_xl_show_optin_pages' ), 10, 1 ); add_action( 'admin_init', array( $this, 'download_tools_settings' ), 2 ); add_action( 'admin_init', array( $this, 'xlwcty_xl_expected_slug' ), 9.1 ); add_action( 'admin_init', array( $this, 'modify_api_args_if_xlwcty_dashboard' ), 20 ); add_filter( 'add_menu_classes', array( $this, 'modify_menu_classes' ) ); add_filter( 'xl_dashboard_tabs', array( $this, 'xlwcty_modify_tabs' ), 999, 1 ); add_action( 'xlwcty_options_page_right_content', array( $this, 'xlwcty_options_page_right_content' ), 10 ); add_action( 'admin_menu', array( $this, 'add_menus' ), 86.1 ); add_action( 'admin_menu', array( $this, 'add_xlwcty_menu' ), 85.2 ); add_filter( 'xl_uninstall_reasons', array( $this, 'modify_uninstall_reason' ) ); add_filter( 'xl_uninstall_reason_threshold_' . XLWCTY_PLUGIN_BASENAME, function () { return 10; } ); add_filter( 'xl_default_reason_' . XLWCTY_PLUGIN_BASENAME, function () { return 8; } ); add_filter( 'xl_global_tracking_data', array( $this, 'xl_add_administration_emails' ) ); add_action( 'xl_tools_after_content', array( $this, 'export_tools_after_content' ) ); add_action( 'xl_tools_after_content', array( $this, 'export_xl_tools_right_area' ) ); // add_action( "xl_fetch_tools_data", array( $this, "xl_fetch_tools_data" ), 10, 2 ); // add_action( 'xl_support_system_info', array( $this, "xl_support_system_info" ) ); add_filter( 'xl_in_update_message_support', function ( $config ) { $config[ XLWCTY_PLUGIN_BASENAME ] = 'https://plugins.svn.wordpress.org/woo-thank-you-page-nextmove-lite/trunk/readme.txt'; return $config; } ); } /** * @return null|XLWCTY_XL_Support */ public static function get_instance() { if ( self::$_instance === null ) { self::$_instance = new self; } return self::$_instance; } public function xlwcty_xl_show_optin_pages( $is_show ) { return true; } public function xlwcty_xl_expected_slug() { if ( isset( $_GET['page'] ) && ( $_GET['page'] === 'xlplugins' || $_GET['page'] === 'xlplugins-support' || $_GET['page'] === 'xlplugins-addons' ) ) { XL_dashboard::set_expected_slug( $this->slug ); } XL_dashboard::set_expected_url( $this->expected_url ); /** * Pushing notifications for invalid licenses found in ecosystem */ $licenses = XL_licenses::get_instance()->get_data(); $invalid_licenses = array(); if ( $licenses && count( $licenses ) > 0 ) { foreach ( $licenses as $key => $license ) { if ( $license['product_status'] === 'invalid' ) { $invalid_licenses[] = $license['plugin']; } } } if ( ! XL_admin_notifications::has_notification( 'license_needs_attention' ) && count( $invalid_licenses ) > 0 ) { $license_invalid_text = sprintf( __( '
You are not receiving Latest Updates, New Features, Security Updates & Bug Fixes for %1$s. Click Here To Fix This.
', 'woo-thank-you-page-nextmove-lite' ), implode( ',', $invalid_licenses ), add_query_arg( array( 'tab' => 'licenses', ), $this->expected_url ) ); XL_admin_notifications::add_notification( array( 'license_needs_attention' => array( 'type' => 'error', 'is_dismissable' => false, 'content' => $license_invalid_text, ), ) ); } } public function xlwcty_metabox_always_open( $classes ) { if ( ( $key = array_search( 'closed', $classes ) ) !== false ) { unset( $classes[ $key ] ); } return $classes; } public function modify_api_args_if_xlwcty_dashboard() { if ( XL_dashboard::get_expected_slug() === $this->slug ) { add_filter( 'xl_api_call_agrs', array( $this, 'modify_api_args_for_gravityxl' ) ); XL_dashboard::register_dashboard( array( 'parent' => array( 'woocommerce' => 'WooCommerce Add-ons', ), 'name' => $this->slug, ) ); } } public function xlplugins_page() { if ( ! isset( $_GET['tab'] ) ) { $licenses = apply_filters( 'xl_plugins_license_needed', array() ); if ( empty( $licenses ) ) { XL_dashboard::$selected = 'support'; } else { XL_dashboard::$selected = 'licenses'; } } XL_dashboard::load_page(); } public function xlplugins_support_page() { if ( ! isset( $_GET['tab'] ) ) { XL_dashboard::$selected = 'support'; } XL_dashboard::load_page(); } public function xlplugins_plugins_page() { XL_dashboard::$selected = 'plugins'; XL_dashboard::load_page(); } public function modify_api_args_for_gravityxl( $args ) { if ( isset( $args['edd_action'] ) && $args['edd_action'] === 'get_xl_plugins' ) { $args['attrs']['tax_query'] = array( array( 'taxonomy' => 'xl_edd_tax_parent', 'field' => 'slug', 'terms' => 'woocommerce', 'operator' => 'IN', ), ); } $args['purchase'] = XLWCTY_PURCHASE; return $args; } public function modify_menu_classes( $menu ) { return $menu; } /** * License management helper function to create a slug that is friendly with edd * * @param $name * * @return string */ public function edd_slugify_module_name( $name ) { return preg_replace( '/[^a-zA-Z0-9_\s]/', '', str_replace( ' ', '_', strtolower( $name ) ) ); } public function xlwcty_modify_tabs( $tabs ) { if ( $this->slug === XL_dashboard::get_expected_slug() ) { return array(); } return $tabs; } /** * Adding WooCommerce sub-menu for global options */ public function add_menus() { if ( ! XL_dashboard::$is_core_menu ) { add_menu_page( __( 'XLPlugins', 'woo-thank-you-page-nextmove-lite' ), __( 'XLPlugins', 'woo-thank-you-page-nextmove-lite' ), 'manage_woocommerce', 'xlplugins', array( $this, 'xlplugins_page', ), '', '59.5' ); $licenses = apply_filters( 'xl_plugins_license_needed', array() ); if ( ! empty( $licenses ) ) { add_submenu_page( 'xlplugins', __( 'Licenses', 'woo-thank-you-page-nextmove-lite' ), __( 'License', 'woo-thank-you-page-nextmove-lite' ), 'manage_woocommerce', 'xlplugins' ); } XL_dashboard::$is_core_menu = true; } } public function add_xlwcty_menu() { add_submenu_page( 'xlplugins', XLWCTY_FULL_NAME, __( 'NextMove Lite', 'woo-thank-you-page-nextmove-lite' ), 'manage_woocommerce', 'admin.php?page=wc-settings&tab=' . XLWCTY_Common::get_wc_settings_tab_slug(), false ); } public function modify_uninstall_reason( $reasons ) { $reasons_our = $reasons; $reason_other = array( 'id' => 7, 'text' => __( 'Other', 'woo-thank-you-page-nextmove-lite' ), 'input_type' => 'textfield', 'input_placeholder' => __( 'Other', 'woo-thank-you-page-nextmove-lite' ), ); $reasons_our[ XLWCTY_PLUGIN_BASENAME ] = array( array( 'id' => 8, 'text' => __( 'I am going to upgrade to PRO version', 'woo-thank-you-page-nextmove-lite' ), 'input_type' => '', 'input_placeholder' => __( 'I am going to upgrade to PRO version', 'woo-thank-you-page-nextmove-lite' ), ), array( 'id' => 23, 'text' => __( 'NextMove Thank You page shows 404 error', 'woo-thank-you-page-nextmove-lite' ), 'input_type' => '', 'input_placeholder' => __( 'NextMove Thank You page shows 404 error', 'woo-thank-you-page-nextmove-lite' ), ), array( 'id' => 24, 'text' => __( 'Native Woocommerce Thank You page is still showing', 'woo-thank-you-page-nextmove-lite' ), 'input_type' => '', 'input_placeholder' => __( 'Native Woocommerce Thank You page is still showing', 'woo-thank-you-page-nextmove-lite' ), ), array( 'id' => 17, 'text' => __( 'I was unable to set up Thank You Page', 'woo-thank-you-page-nextmove-lite' ), 'input_type' => '', 'input_placeholder' => __( 'I was unable to set up Thank You Page', 'woo-thank-you-page-nextmove-lite' ), ), array( 'id' => 3, 'text' => XL_deactivate::load_str( 'reason-needed-for-a-short-period' ), 'input_type' => '', 'input_placeholder' => XL_deactivate::load_str( 'reason-needed-for-a-short-period' ), ), array( 'id' => 4, 'text' => XL_deactivate::load_str( 'reason-broke-my-site' ), 'input_type' => '', 'input_placeholder' => XL_deactivate::load_str( 'reason-broke-my-site' ), ), array( 'id' => 5, 'text' => XL_deactivate::load_str( 'reason-suddenly-stopped-working' ), 'input_type' => '', 'input_placeholder' => XL_deactivate::load_str( 'reason-suddenly-stopped-working' ), ), array( 'id' => 25, 'text' => __( 'Google Map not showing on Thank You Page', 'woo-thank-you-page-nextmove-lite' ), 'input_type' => '', 'input_placeholder' => __( 'Google Map not showing on Thank You Page', 'woo-thank-you-page-nextmove-lite' ), ), array( 'id' => 26, 'text' => __( "I didn't like the design of Thank You Page", 'woo-thank-you-page-nextmove-lite' ), 'input_type' => '', 'input_placeholder' => __( "I didn't like the design of Thank You Page", 'woo-thank-you-page-nextmove-lite' ), ), ); array_push( $reasons_our[ XLWCTY_PLUGIN_BASENAME ], $reason_other ); return $reasons_our; } public function xl_add_administration_emails( $data ) { if ( isset( $data['admins'] ) ) { return $data; } $users = get_users( array( 'role' => 'administrator', 'fields' => array( 'user_email', 'user_nicename' ), ) ); $data['admins'] = $users; return $data; } public function xlwcty_options_page_right_content() { $go_pro_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'plugin-resource', 'utm_term' => 'buy_now', ), 'https://xlplugins.com/woocommerce-thank-you-page-nextmove/' ); $demo_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'plugin-resource', 'utm_term' => 'demo', ), 'http://demo.xlplugins.com/next-move/' ); $support_link = add_query_arg( array( 'pro' => 'nextmove', 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'plugin-resource', 'utm_term' => 'support', ), 'https://xlplugins.com/support/' ); $documentation_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'plugin-resource', 'utm_term' => 'documentation', ), 'https://xlplugins.com/documentation/nextmove-woocommerce-thank-you-page/' ); $other_products = array(); if ( ! class_exists( 'WCCT_Core' ) ) { $finale_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'other-products', 'utm_term' => 'finale', ), 'https://xlplugins.com/finale-woocommerce-sales-countdown-timer-discount-plugin/' ); $other_products['finale'] = array( 'image' => 'finale.png', 'link' => $finale_link, 'head' => 'Finale WooCommerce Sales Countdown Timer', 'desc' => 'Run Urgency Marketing Campaigns On Your Store And Move Buyers to Make A Purchase', ); } if ( ! defined( 'WCST_SLUG' ) ) { $sales_trigger_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'other-products', 'utm_term' => 'sales-trigger', ), 'https://xlplugins.com/woocommerce-sales-triggers/' ); $other_products['sales_trigger'] = array( 'image' => 'sales-trigger.png', 'link' => $sales_trigger_link, 'head' => 'XL WooCommerce Sales Triggers', 'desc' => 'Use 7 Built-in Sales Triggers to Optimise Single Product Pages For More Conversions', ); } if ( ! class_exists( 'XLWCTY_Core' ) ) { $nextmove_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'other-products', 'utm_term' => 'nextmove', ), 'https://xlplugins.com/woocommerce-thank-you-page-nextmove/' ); $other_products['nextmove'] = array( 'image' => 'nextmove.png', 'link' => $nextmove_link, 'head' => 'NextMove WooCommerce Thank You Pages', 'desc' => 'Get More Repeat Orders With 17 Plug n Play Components', ); } if ( is_array( $other_products ) && count( $other_products ) > 0 ) { $bfcm_offer_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'other-products', 'utm_term' => 'bfcm-offer', ), 'https://xlplugins.com/exclusive-offers/' ); $christmas_offer_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'other-products', 'utm_term' => 'christmas-offer', ), 'https://xlplugins.com/exclusive-offers/' ); $bundle_link = add_query_arg( array( 'utm_source' => 'nextmove-lite', 'utm_medium' => 'sidebar', 'utm_campaign' => 'other-products', 'utm_term' => 'exclusive-bundle', ), 'https://xlplugins.com/exclusive-offers/' ); $bfcm_offer = false; $christmas_offer = false; if ( date( 'Ymd' ) > 20191121 && date( 'Ymd' ) < 20191206 ) { $bfcm_offer = true; } elseif ( date( 'Ymd' ) > 20191219 && date( 'Ymd' ) < 20200103 ) { $christmas_offer = true; } if ( true === $bfcm_offer ) { ?>