From 5b05e902ef0a571bb8017b6217765e4417448c5d Mon Sep 17 00:00:00 2001 From: Sabuz Date: Tue, 29 Jan 2019 14:57:11 +0600 Subject: [PATCH 01/33] Fixed: Product grid responsive bug --- assets/css/essential-addons-elementor.css | 54 +++++++++++ assets/sass/_woo-products.scss | 111 ++++++++++++++-------- 2 files changed, 127 insertions(+), 38 deletions(-) diff --git a/assets/css/essential-addons-elementor.css b/assets/css/essential-addons-elementor.css index 70dfaea7b..260e33359 100644 --- a/assets/css/essential-addons-elementor.css +++ b/assets/css/essential-addons-elementor.css @@ -1366,22 +1366,76 @@ span.eael-testimonial-quote { .eael-post-grid .woocommerce ul.products.eael-product-columns-2 { grid-template-columns: repeat(2, 1fr); } +@media screen and (max-width: 480px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-2, + .eael-post-grid .woocommerce ul.products.eael-product-columns-2 { + grid-template-columns: repeat(1, 1fr); + } +} .eael-product-grid .woocommerce ul.products.eael-product-columns-3, .eael-post-grid .woocommerce ul.products.eael-product-columns-3 { grid-template-columns: repeat(3, 1fr); } +@media screen and (max-width: 767px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-3, + .eael-post-grid .woocommerce ul.products.eael-product-columns-3 { + grid-template-columns: repeat(2, 1fr); + } +} +@media screen and (max-width: 480px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-3, + .eael-post-grid .woocommerce ul.products.eael-product-columns-3 { + grid-template-columns: repeat(1, 1fr); + } +} .eael-product-grid .woocommerce ul.products.eael-product-columns-4, .eael-post-grid .woocommerce ul.products.eael-product-columns-4 { grid-template-columns: repeat(4, 1fr); } +@media screen and (max-width: 767px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-4, + .eael-post-grid .woocommerce ul.products.eael-product-columns-4 { + grid-template-columns: repeat(2, 1fr); + } +} +@media screen and (max-width: 480px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-4, + .eael-post-grid .woocommerce ul.products.eael-product-columns-4 { + grid-template-columns: repeat(1, 1fr); + } +} .eael-product-grid .woocommerce ul.products.eael-product-columns-5, .eael-post-grid .woocommerce ul.products.eael-product-columns-5 { grid-template-columns: repeat(5, 1fr); } +@media screen and (max-width: 767px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-5, + .eael-post-grid .woocommerce ul.products.eael-product-columns-5 { + grid-template-columns: repeat(2, 1fr); + } +} +@media screen and (max-width: 480px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-5, + .eael-post-grid .woocommerce ul.products.eael-product-columns-5 { + grid-template-columns: repeat(1, 1fr); + } +} .eael-product-grid .woocommerce ul.products.eael-product-columns-6, .eael-post-grid .woocommerce ul.products.eael-product-columns-6 { grid-template-columns: repeat(6, 1fr); } +@media screen and (max-width: 767px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-6, + .eael-post-grid .woocommerce ul.products.eael-product-columns-6 { + grid-template-columns: repeat(2, 1fr); + } +} +@media screen and (max-width: 480px) { + .eael-product-grid .woocommerce ul.products.eael-product-columns-6, + .eael-post-grid .woocommerce ul.products.eael-product-columns-6 { + grid-template-columns: repeat(1, 1fr); + } +} .eael-product-grid.eael-product-simple .woocommerce ul.products li.product, .eael-product-grid.eael-product-reveal .woocommerce ul.products li.product, .eael-post-grid.eael-product-simple .woocommerce ul.products li.product, .eael-post-grid.eael-product-reveal .woocommerce ul.products li.product { diff --git a/assets/sass/_woo-products.scss b/assets/sass/_woo-products.scss index 46ded41a5..12a91730b 100755 --- a/assets/sass/_woo-products.scss +++ b/assets/sass/_woo-products.scss @@ -4,45 +4,80 @@ .eael-product-grid, .eael-post-grid { + .woocommerce { + ul.products { + display: grid; + grid-gap: 25px; + margin: 0 !important; + padding: 0 !important; + + &:before, + &:after { + display: none; + } + + .product { + width: 100%; + margin: 0; + padding: 0; + } + + &.eael-product-columns-1 { + grid-template-columns: 100%; + } + &.eael-product-columns-2 { + grid-template-columns: repeat(2, 1fr); + + @media screen and (max-width: 480px) { + grid-template-columns: repeat(1, 1fr); + } + } + &.eael-product-columns-3 { + grid-template-columns: repeat(3, 1fr); + + @media screen and (max-width: 767px) { + grid-template-columns: repeat(2, 1fr); + } + + @media screen and (max-width: 480px) { + grid-template-columns: repeat(1, 1fr); + } + } + &.eael-product-columns-4 { + grid-template-columns: repeat(4, 1fr); + + @media screen and (max-width: 767px) { + grid-template-columns: repeat(2, 1fr); + } - .woocommerce { - ul.products { - display: grid; - grid-gap: 25px; - margin: 0 !important; - padding: 0 !important; - - &:before, - &:after { - display: none; - } - - .product { - width: 100%; - margin: 0; - padding: 0; - } - - &.eael-product-columns-1 { - grid-template-columns: 100%; - } - &.eael-product-columns-2 { - grid-template-columns: repeat(2, 1fr); - } - &.eael-product-columns-3 { - grid-template-columns: repeat(3, 1fr); - } - &.eael-product-columns-4 { - grid-template-columns: repeat(4, 1fr); - } - &.eael-product-columns-5 { - grid-template-columns: repeat(5, 1fr); - } - &.eael-product-columns-6 { - grid-template-columns: repeat(6, 1fr); - } - } - } + @media screen and (max-width: 480px) { + grid-template-columns: repeat(1, 1fr); + } + } + &.eael-product-columns-5 { + grid-template-columns: repeat(5, 1fr); + + @media screen and (max-width: 767px) { + grid-template-columns: repeat(2, 1fr); + } + + @media screen and (max-width: 480px) { + grid-template-columns: repeat(1, 1fr); + } + } + &.eael-product-columns-6 { + grid-template-columns: repeat(6, 1fr); + + @media screen and (max-width: 767px) { + grid-template-columns: repeat(2, 1fr); + } + + @media screen and (max-width: 480px) { + grid-template-columns: repeat(1, 1fr); + } + } + } + } // simple & reveal style &.eael-product-simple, From f7102d9599dc8083cfbe8d932aa4ee0d7cff86b1 Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Tue, 29 Jan 2019 16:33:09 +0600 Subject: [PATCH 02/33] Opt In Issue Fixed --- includes/class-wpdev-notices.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/includes/class-wpdev-notices.php b/includes/class-wpdev-notices.php index 950a1d0d5..4fcc6812d 100755 --- a/includes/class-wpdev-notices.php +++ b/includes/class-wpdev-notices.php @@ -108,6 +108,7 @@ public function init(){ * @return void */ public function hooks(){ + add_action( 'wpdeveloper_notice_clicked', array( $this, 'clicked' ) ); add_action( 'wp_ajax_wpdeveloper_upsale_notice_dissmiss', array( $this, 'upsale_notice_dissmiss' ) ); add_action( 'wpdeveloper_before_notice', array( $this, 'before' ) ); add_action( 'wpdeveloper_after_notice', array( $this, 'after' ) ); @@ -115,8 +116,8 @@ public function hooks(){ add_action( 'wpdeveloper_after_upsale_notice', array( $this, 'after' ) ); add_action( 'wpdeveloper_notices', array( $this, 'content' ) ); if( current_user_can( 'install_plugins' ) ) { - add_action( 'wpdeveloper_notice_clicked', array( $this, 'clicked' ) ); if( isset( $_GET['plugin'] ) && $_GET['plugin'] == $this->plugin_name ) { + do_action( 'wpdeveloper_notice_clicked' ); /** * Redirect User To the Current URL, but without set query arguments. */ @@ -196,10 +197,7 @@ private function maybe_later( $notice ){ * When links are clicked, this function will invoked. * @return void */ - public function clicked(){ - // if( ! isset( $_GET['plugin'] ) || ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'wpdeveloper-nonce' ) ) { - // return; - // } + public function clicked(){ if( isset( $_GET['plugin'] ) && $_GET['plugin'] === $this->plugin_name ) { $options_data = $this->get_options_data(); $clicked_from = current( $this->next_notice() ); @@ -456,7 +454,6 @@ private function deserve_notice( $notice ) { */ public function admin_notices(){ $current_notice = current( $this->next_notice() ); - do_action( 'wpdeveloper_notice_clicked' ); if( $current_notice == 'opt_in' ) { do_action( 'wpdeveloper_notices' ); return; From 3e3d5067c70ae2ed9ed3a6869afe7b7178dd4dc4 Mon Sep 17 00:00:00 2001 From: Rupok Date: Tue, 29 Jan 2019 17:06:45 +0600 Subject: [PATCH 03/33] update to v2.9.4 --- essential_adons_elementor.php | 8 ++++---- readme.txt | 7 ++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/essential_adons_elementor.php b/essential_adons_elementor.php index dac0b7313..5221b84b8 100755 --- a/essential_adons_elementor.php +++ b/essential_adons_elementor.php @@ -4,7 +4,7 @@ * Description: The ultimate elements library for Elementor page builder plugin for WordPress. * Plugin URI: https://essential-addons.com/elementor/ * Author: WPDeveloper - * Version: 2.9.3 + * Version: 2.9.4 * Author URI: https://wpdeveloper.net/ * * Text Domain: essential-addons-elementor @@ -16,8 +16,8 @@ define( 'ESSENTIAL_ADDONS_EL_URL', plugins_url( '/', __FILE__ ) ); define( 'ESSENTIAL_ADDONS_EL_PATH', plugin_dir_path( __FILE__ ) ); define( 'ESSENTIAL_ADDONS_EL_ROOT', __FILE__ ); -define( 'ESSENTIAL_ADDONS_VERSION', '2.9.3' ); -define( 'ESSENTIAL_ADDONS_STABLE_VERSION', '2.9.3' ); +define( 'ESSENTIAL_ADDONS_VERSION', '2.9.4' ); +define( 'ESSENTIAL_ADDONS_STABLE_VERSION', '2.9.4' ); define( 'ESSENTIAL_ADDONS_BASENAME', plugin_basename( __FILE__ ) ); @@ -28,7 +28,7 @@ require_once ESSENTIAL_ADDONS_EL_PATH.'includes/maintennance.php'; require_once ESSENTIAL_ADDONS_EL_PATH.'includes/eael-rollback.php'; require_once ESSENTIAL_ADDONS_EL_PATH.'admin/settings.php'; -require_once ESSENTIAL_ADDONS_EL_PATH .'includes/extensions.php'; +require_once ESSENTIAL_ADDONS_EL_PATH.'includes/extensions.php'; /** * This function will return true for all activated modules diff --git a/readme.txt b/readme.txt index 0c7e0389d..94adb2ebf 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: elementor, elements, addons, elementor addon, elementor widget, page build Requires at least: 4.0 Tested up to: 5.0.3 Requires PHP: 5.4 -Stable tag: 2.9.3 +Stable tag: 2.9.4 License: GPLv3 License URI: https://opensource.org/licenses/GPL-3.0 @@ -169,6 +169,11 @@ Your existing elements/content will work with premium version. So you won't lose == Changelog == += 2.9.4 = + +- Product Grid layout issue fixed +- Few minor bugfix and improvements + = 2.9.3 = - Fixed: Fatal error Call to undefined function get_plugins() From 9b11a128ea1f058ca91414759bcdbf3dc2e2c44b Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Thu, 31 Jan 2019 10:41:17 +0600 Subject: [PATCH 04/33] Try --- essential_adons_elementor.php | 2 +- includes/class-plugin-usage-tracker.php | 82 +++++++++++++------------ 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/essential_adons_elementor.php b/essential_adons_elementor.php index dac0b7313..f5cab930b 100755 --- a/essential_adons_elementor.php +++ b/essential_adons_elementor.php @@ -315,7 +315,7 @@ function eael_redirect() { function essential_addons_elementor_lite_start_plugin_tracking() { $wisdom = new Eael_Plugin_Usage_Tracker( __FILE__, - 'https://wpdeveloper.net', + 'http://wisdom.test', array(), true, true, diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index 4fc3c14c2..bb81fb2e5 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -14,7 +14,7 @@ class Eael_Plugin_Usage_Tracker { - private $wisdom_version = '1.1.2'; + private $wpins_version = '1.1.2'; private $home_url = ''; private $plugin_file = ''; private $plugin_name = ''; @@ -82,7 +82,7 @@ public function init() { add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); // Use this action for local testing - // add_action( 'admin_init', array( $this, 'do_tracking' ) ); + add_action( 'admin_init', array( $this, 'force_tracking' ) ); // Display the admin notice on activation add_action( 'wpdeveloper_optin_notice', array( $this, 'optin_notice' ) ); @@ -109,6 +109,10 @@ public function schedule_tracking() { } } + public function force_tracking(){ + $this->do_tracking( true ); + } + /** * This is our function to get everything going * Check that user has opted in @@ -192,7 +196,7 @@ public function get_data() { 'site_version' => get_bloginfo( 'version' ), 'site_language' => get_bloginfo( 'language' ), 'charset' => get_bloginfo( 'charset' ), - 'wisdom_version' => $this->wisdom_version, + 'wpins_version' => $this->wpins_version, 'php_version' => phpversion(), 'multisite' => is_multisite(), 'file_location' => __FILE__ @@ -266,7 +270,7 @@ public function get_data() { foreach( $options as $option ) { $fields = get_option( $option ); // Check for permission to send this option - if( isset( $fields['wisdom_registered_setting'] ) ) { + if( isset( $fields['wpins_registered_setting'] ) ) { foreach( $fields as $key=>$value ) { $plugin_options[$key] = $value; } @@ -323,11 +327,11 @@ public function deactivate_this_plugin() { $body['deactivated_date'] = time(); // Add deactivation form data - if( false !== get_option( 'wisdom_deactivation_reason_' . $this->plugin_name ) ) { - $body['deactivation_reason'] = get_option( 'wisdom_deactivation_reason_' . $this->plugin_name ); + if( false !== get_option( 'wpins_deactivation_reason_' . $this->plugin_name ) ) { + $body['deactivation_reason'] = get_option( 'wpins_deactivation_reason_' . $this->plugin_name ); } - if( false !== get_option( 'wisdom_deactivation_details_' . $this->plugin_name ) ) { - $body['deactivation_details'] = get_option( 'wisdom_deactivation_details_' . $this->plugin_name ); + if( false !== get_option( 'wpins_deactivation_details_' . $this->plugin_name ) ) { + $body['deactivation_details'] = get_option( 'wpins_deactivation_details_' . $this->plugin_name ); } $this->send_data( $body ); @@ -345,8 +349,8 @@ public function get_is_tracking_allowed() { $this->set_is_tracking_allowed( false, $this->plugin_name ); return false; } - // The wisdom_allow_tracking option is an array of plugins that are being tracked - $allow_tracking = get_option( 'wisdom_allow_tracking' ); + // The wpins_allow_tracking option is an array of plugins that are being tracked + $allow_tracking = get_option( 'wpins_allow_tracking' ); // If this plugin is in the array, then tracking is allowed if( isset( $allow_tracking[$this->plugin_name] ) ) { return true; @@ -365,8 +369,8 @@ public function set_is_tracking_allowed( $is_allowed, $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } - // The wisdom_allow_tracking option is an array of plugins that are being tracked - $allow_tracking = get_option( 'wisdom_allow_tracking' ); + // The wpins_allow_tracking option is an array of plugins that are being tracked + $allow_tracking = get_option( 'wpins_allow_tracking' ); // If the user has decided to opt out if( $this->has_user_opted_out() ) { @@ -387,7 +391,7 @@ public function set_is_tracking_allowed( $is_allowed, $plugin=null ) { unset( $allow_tracking[$plugin] ); } } - update_option( 'wisdom_allow_tracking', $allow_tracking ); + update_option( 'wpins_allow_tracking', $allow_tracking ); } /** @@ -396,13 +400,13 @@ public function set_is_tracking_allowed( $is_allowed, $plugin=null ) { * @return Boolean */ public function has_user_opted_out() { - // Iterate through the options that are being tracked looking for wisdom_opt_out setting + // Iterate through the options that are being tracked looking for wpins_opt_out setting if( ! empty( $this->options ) ) { foreach( $this->options as $option_name ) { // Check each option $options = get_option( $option_name ); // If we find the setting, return true - if( ! empty( $options['wisdom_opt_out'] ) ) { + if( ! empty( $options['wpins_opt_out'] ) ) { return true; } } @@ -416,7 +420,7 @@ public function has_user_opted_out() { */ public function get_is_time_to_track() { // Let's see if we're due to track this plugin yet - $track_times = get_option( 'wisdom_last_track_time', array() ); + $track_times = get_option( 'wpins_last_track_time', array() ); if( ! isset( $track_times[$this->plugin_name] ) ) { // If we haven't set a time for this plugin yet, then we must track it return true; @@ -435,10 +439,10 @@ public function get_is_time_to_track() { */ public function set_track_time() { // We've tracked, so record the time - $track_times = get_option( 'wisdom_last_track_time', array() ); + $track_times = get_option( 'wpins_last_track_time', array() ); // Set different times according to plugin, in case we are tracking multiple plugins $track_times[$this->plugin_name] = time(); - update_option( 'wisdom_last_track_time', $track_times ); + update_option( 'wpins_last_track_time', $track_times ); } /** @@ -450,7 +454,7 @@ public function update_block_notice( $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } - $block_notice = get_option( 'wisdom_block_notice' ); + $block_notice = get_option( 'wpins_block_notice' ); if( empty( $block_notice ) || ! is_array( $block_notice ) ) { // If nothing exists in the option yet, start a new array with the plugin name $block_notice = array( $plugin => $plugin ); @@ -458,7 +462,7 @@ public function update_block_notice( $plugin=null ) { // Else add the plugin name to the array $block_notice[$plugin] = $plugin; } - update_option( 'wisdom_block_notice', $block_notice ); + update_option( 'wpins_block_notice', $block_notice ); } /** @@ -466,8 +470,8 @@ public function update_block_notice( $plugin=null ) { * @since 1.0.0 */ public function get_can_collect_email() { - // The wisdom_collect_email option is an array of plugins that are being tracked - $collect_email = get_option( 'wisdom_collect_email' ); + // The wpins_collect_email option is an array of plugins that are being tracked + $collect_email = get_option( 'wpins_collect_email' ); // If this plugin is in the array, then we can collect the email address if( isset( $collect_email[$this->plugin_name] ) ) { return true; @@ -486,8 +490,8 @@ public function set_can_collect_email( $can_collect, $plugin=null ) { if( empty( $plugin ) ) { $plugin = $this->plugin_name; } - // The wisdom_collect_email option is an array of plugins that are being tracked - $collect_email = get_option( 'wisdom_collect_email' ); + // The wpins_collect_email option is an array of plugins that are being tracked + $collect_email = get_option( 'wpins_collect_email' ); // If the user has agreed to allow tracking or if opt-in is not required if( $can_collect ) { if( empty( $collect_email ) || ! is_array( $collect_email ) ) { @@ -502,7 +506,7 @@ public function set_can_collect_email( $can_collect, $plugin=null ) { unset( $collect_email[$plugin] ); } } - update_option( 'wisdom_collect_email', $collect_email ); + update_option( 'wpins_collect_email', $collect_email ); } /** @@ -511,8 +515,8 @@ public function set_can_collect_email( $can_collect, $plugin=null ) { * @return Email address */ public function get_admin_email() { - // The wisdom_collect_email option is an array of plugins that are being tracked - $email = get_option( 'wisdom_admin_emails' ); + // The wpins_collect_email option is an array of plugins that are being tracked + $email = get_option( 'wpins_admin_emails' ); // If this plugin is in the array, then we can collect the email address if( isset( $email[$this->plugin_name] ) ) { return $email[$this->plugin_name]; @@ -540,8 +544,8 @@ public function set_admin_email( $email=null, $plugin=null ) { $email = $current_user->user_email; } } - // The wisdom_admin_emails option is an array of admin email addresses - $admin_emails = get_option( 'wisdom_admin_emails' ); + // The wpins_admin_emails option is an array of admin email addresses + $admin_emails = get_option( 'wpins_admin_emails' ); if( empty( $admin_emails ) || ! is_array( $admin_emails ) ) { // If nothing exists in the option yet, start a new array with the plugin name $admin_emails = array( $plugin => sanitize_email( $email ) ); @@ -549,7 +553,7 @@ public function set_admin_email( $email=null, $plugin=null ) { // Else add the email address to the array, if not already set $admin_emails[$plugin] = sanitize_email( $email ); } - update_option( 'wisdom_admin_emails', $admin_emails ); + update_option( 'wpins_admin_emails', $admin_emails ); } /** @@ -572,8 +576,8 @@ public function optin_notice() { } // Check whether to block the notice, e.g. because we're in a local environment - // wisdom_block_notice works the same as wisdom_allow_tracking, an array of plugin names - $block_notice = get_option( 'wisdom_block_notice' ); + // wpins_block_notice works the same as wpins_allow_tracking, an array of plugin names + $block_notice = get_option( 'wpins_block_notice' ); if( isset( $block_notice[$this->plugin_name] ) ) { return; } @@ -622,7 +626,7 @@ public function optin_notice() { $notice_text = __( 'Want to help make Essential Addons for Elementor even more awesome? You can get a 25% discount coupon for Pro upgrade if you allow. What we collect.', 'plugin-usage-tracker' ); } // And we allow you to filter the text anyway - $notice_text = apply_filters( 'wisdom_notice_text_' . esc_attr( $this->plugin_name ), $notice_text ); ?> + $notice_text = apply_filters( 'wpins_notice_text_' . esc_attr( $this->plugin_name ), $notice_text ); ?>

@@ -671,7 +675,7 @@ public function marketing_notice() { ) ); $marketing_text = __( 'Thank you for opting in to tracking. Would you like to receive occasional news about this plugin, including details of new features and special offers?', 'plugin-usage-tracker' ); - $marketing_text = apply_filters( 'wisdom_marketing_text_' . esc_attr( $this->plugin_name ), $marketing_text ); ?> + $marketing_text = apply_filters( 'wpins_marketing_text_' . esc_attr( $this->plugin_name ), $marketing_text ); ?>

' . esc_html( $plugin_name ) . ''; ?>

@@ -732,7 +736,7 @@ public function form_default_text() { */ public function form_filterable_text() { $form = $this->form_default_text(); - return apply_filters( 'wisdom_form_text_' . esc_attr( $this->plugin_name ), $form ); + return apply_filters( 'wpins_form_text_' . esc_attr( $this->plugin_name ), $form ); } /** @@ -836,7 +840,7 @@ public function goodbye_ajax() { 'action': 'goodbye_form', 'values': values, 'details': details, - 'security': "", + 'security': "", 'dataType': "json" } $.post( @@ -863,14 +867,14 @@ function(response){ * @since 1.0.0 */ public function goodbye_form_callback() { - check_ajax_referer( 'wisdom_goodbye_form', 'security' ); + check_ajax_referer( 'wpins_goodbye_form', 'security' ); if( isset( $_POST['values'] ) ) { $values = json_encode( wp_unslash( $_POST['values'] ) ); - update_option( 'wisdom_deactivation_reason_' . $this->plugin_name, $values ); + update_option( 'wpins_deactivation_reason_' . $this->plugin_name, $values ); } if( isset( $_POST['details'] ) ) { $details = sanitize_text_field( $_POST['details'] ); - update_option( 'wisdom_deactivation_details_' . $this->plugin_name, $details ); + update_option( 'wpins_deactivation_details_' . $this->plugin_name, $details ); } $this->do_tracking(); // Run this straightaway echo 'success'; From c641097b65ec1004af02031d02f49583aaf82a10 Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Thu, 31 Jan 2019 10:44:30 +0600 Subject: [PATCH 05/33] Opt In, plugin tracker clicked function added! --- includes/class-plugin-usage-tracker.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index bb81fb2e5..5bd56b6c8 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -79,6 +79,8 @@ public function init() { } // Hook our do_tracking function to the daily action + add_action( 'wpdeveloper_notice_clicked', array( $this, 'clicked' ) ); + add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); // Use this action for local testing @@ -555,13 +557,8 @@ public function set_admin_email( $email=null, $plugin=null ) { } update_option( 'wpins_admin_emails', $admin_emails ); } - - /** - * Display the admin notice to users to allow them to opt in - * - * @since 1.0.0 - */ - public function optin_notice() { + + public function clicked(){ // Check for plugin args if( isset( $_GET['plugin'] ) && isset( $_GET['plugin_action'] ) ) { $plugin = sanitize_text_field( $_GET['plugin'] ); @@ -574,7 +571,14 @@ public function optin_notice() { } $this->update_block_notice( $plugin ); } - + } + + /** + * Display the admin notice to users to allow them to opt in + * + * @since 1.0.0 + */ + public function optin_notice() { // Check whether to block the notice, e.g. because we're in a local environment // wpins_block_notice works the same as wpins_allow_tracking, an array of plugin names $block_notice = get_option( 'wpins_block_notice' ); From 3e4c9781ff48aed40da2d12ec093c5b4ee60595f Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Thu, 31 Jan 2019 11:50:21 +0600 Subject: [PATCH 06/33] Deactivation Form Style Improved. --- includes/class-plugin-usage-tracker.php | 76 +++++++++++++++++++++---- 1 file changed, 64 insertions(+), 12 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index 5bd56b6c8..8fa9454d6 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -23,6 +23,12 @@ class Eael_Plugin_Usage_Tracker { private $include_goodbye_form = true; private $marketing = false; private $collect_email = false; + /** + * for matching the deactivation form header color with plugins appearance. + * @var string + */ + private $header_bg = '#3A56FF'; + private $text_color = '#FFFFFF'; /** * Class constructor @@ -80,7 +86,7 @@ public function init() { // Hook our do_tracking function to the daily action add_action( 'wpdeveloper_notice_clicked', array( $this, 'clicked' ) ); - + add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); // Use this action for local testing @@ -756,15 +762,15 @@ public function goodbye_ajax() { $form = $this->form_default_text(); } // Build the HTML to go in the form - $html = '
' . esc_html( $form['heading'] ) . '
'; + $html = '
' . esc_html( $form['heading'] ) . ' x
'; $html .= '

' . esc_html( $form['body'] ) . '

'; if( is_array( $form['options'] ) ) { - $html .= '

'; + $html .= '

    '; foreach( $form['options'] as $option ) { - $html .= '
    '; + $html .= '
  • '; } - $html .= '

    '; - $html .= '
'; + $html .= '
  • '; + $html .= '
    '; } $html .= '
    '; $html .= '

    ' . __( 'Submitting form', 'plugin-usage-tracker' ) . '

    '; @@ -786,22 +792,52 @@ public function goodbye_ajax() { } .put-form-active .put-goodbye-form-wrapper { display: block; + width: calc(100% - 40px); + height: calc(100% - 40px); + position: fixed; + left: 20px; + top: 20px; } .put-goodbye-form { display: none; } .put-form-active .put-goodbye-form { position: absolute; - bottom: 30px; - left: 0; + bottom: 30px; + left: 50%; max-width: 400px; - background: #fff; + background: #fff; white-space: normal; + margin-left: -200px; + top: 50%; + margin-top: -200px; + height: fit-content; + border-radius: 5px; + overflow: hidden; } .put-goodbye-form-head { - background: #0073aa; - color: #fff; - padding: 8px 18px; + background: header_bg; ?>; + color: text_color; ?>; + padding: 20px; + letter-spacing: 3px; + position: relative; + } + .put-goodbye-form-head > span { + position: absolute; + right: 10px; + top: 50%; + cursor: pointer; + font-size: 12px; + display: inline-block; + width: 30px; + height: 30px; + margin-top: -15px; + border: 1px solid #ffff; + border-radius: 100%; + text-align: center; + line-height: 26px; + padding: 0px 0px 0px 4px; + box-sizing: border-box; } .put-goodbye-form-body { padding: 8px 18px; @@ -819,6 +855,19 @@ public function goodbye_ajax() { .put-goodbye-form-footer { padding: 8px 18px; } + .put-goodbye-form-footer > p { + display: flex; + align-items: center; + } + .put-goodbye-form-footer .button { + /* background-color: header_bg; ?>; */ + /* color: text_color; ?>; */ + padding: 10px 30px; + border: 0px; + height: auto; + flex: 1; + text-align: center; + } Date: Tue, 5 Feb 2019 14:31:44 +0600 Subject: [PATCH 09/33] Deactivation form improved --- includes/class-plugin-usage-tracker.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index 9e59df7cb..5ef816a8f 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -791,31 +791,25 @@ public function goodbye_ajax() { display: none; } .put-form-active .put-goodbye-form-wrapper { - display: block; + display: flex !important; + align-items: center; + justify-content: center; width: 100%; height: 100%; position: fixed; left: 0px; top: 0px; - background: rgba(0, 0, 0, .8); z-index: 9999; } .put-goodbye-form { display: none; } .put-form-active .put-goodbye-form { - position: absolute; - bottom: 30px; - left: 50%; + position: static !important; max-width: 600px; - background: #fff; - white-space: normal; - margin-left: -300px; - top: 50%; - margin-top: -200px; - height: fit-content; border-radius: 5px; overflow: hidden; + display: block; } .put-goodbye-form-head { /* background: header_bg; ?>; */ From ed4c3f3602322dde7592775bc134f38948068eba Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Tue, 5 Feb 2019 15:08:02 +0600 Subject: [PATCH 10/33] Migration Plan done! --- includes/class-plugin-usage-tracker.php | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index 5ef816a8f..d49a199e5 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -14,7 +14,7 @@ class Eael_Plugin_Usage_Tracker { - private $wpins_version = '1.1.2'; + private $wpins_version = '1.1.3'; private $home_url = ''; private $plugin_file = ''; private $plugin_name = ''; @@ -68,8 +68,30 @@ public function __construct( $this->init(); } + /** + * Migrate to the new Insights + * @return void + */ + public function migrate_plan(){ + $old_key = array_flip( [ 'wisdom_allow_tracking', 'wisdom_last_track_time', 'wisdom_block_notice', 'wisdom_collect_email', 'wisdom_admin_emails', 'wisdom_deactivation_reason_' . $this->plugin_name, 'wisdom_deactivation_details_' . $this->plugin_name ] ); + $new_key = [ 'wpins_allow_tracking', 'wpins_last_track_time', 'wpins_block_notice', 'wpins_collect_email', 'wpins_admin_emails', 'wpins_deactivation_reason_' . $this->plugin_name, 'wpins_deactivation_details_' . $this->plugin_name ]; + + foreach( $old_key as $key => $value ) { + $old_data = get_option( $key ); + if( ! $old_data ) { + continue; + } + update_option( $new_key[ $value ], $old_data ); + delete_option( $key ); + } + } public function init() { + + if( version_compare( $this->wpins_version, '1.1.2', '>' ) ) { + $this->migrate_plan(); + } + // Check marketing if( $this->marketing == 3 ) { $this->set_can_collect_email( true, $this->plugin_name ); From 3d3821e445ef9ee91d47f9ab589b2647f9cc950d Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Tue, 5 Feb 2019 15:12:16 +0600 Subject: [PATCH 11/33] Force Tracking weekly action --- includes/class-plugin-usage-tracker.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index d49a199e5..e04956294 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -109,10 +109,11 @@ public function init() { // Hook our do_tracking function to the daily action add_action( 'wpdeveloper_notice_clicked', array( $this, 'clicked' ) ); - add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); + add_action( 'put_do_weekly_action', array( $this, 'force_tracking' ) ); + // add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); // Use this action for local testing - add_action( 'admin_init', array( $this, 'force_tracking' ) ); + // add_action( 'admin_init', array( $this, 'force_tracking' ) ); // Display the admin notice on activation add_action( 'wpdeveloper_optin_notice', array( $this, 'optin_notice' ) ); From ffa1aff04841ef838cdc809ace619c59aca549f0 Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Wed, 6 Feb 2019 11:07:47 +0600 Subject: [PATCH 12/33] Forced Track for one time --- includes/class-plugin-usage-tracker.php | 28 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index d49a199e5..a0787efbf 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -85,18 +85,23 @@ public function migrate_plan(){ delete_option( $key ); } } + + public function force_track_for_one_time(){ + $is_tracked = get_option('eae_force_tracked'); + if( ! $is_tracked ) { + $this->do_tracking( true ); + update_option( 'eae_force_tracked', true ); + } + } public function init() { - if( version_compare( $this->wpins_version, '1.1.2', '>' ) ) { $this->migrate_plan(); } - // Check marketing if( $this->marketing == 3 ) { $this->set_can_collect_email( true, $this->plugin_name ); } - // Check whether opt-in is required // If not, then tracking is allowed if( ! $this->require_optin ) { @@ -105,14 +110,13 @@ public function init() { $this->update_block_notice(); $this->do_tracking( true ); } - // Hook our do_tracking function to the daily action add_action( 'wpdeveloper_notice_clicked', array( $this, 'clicked' ) ); add_action( 'put_do_weekly_action', array( $this, 'do_tracking' ) ); - // Use this action for local testing - add_action( 'admin_init', array( $this, 'force_tracking' ) ); + // Use this action for local testing and for one time force tracking in a life time. + add_action( 'admin_init', array( $this, 'force_track_for_one_time' ) ); // Display the admin notice on activation add_action( 'wpdeveloper_optin_notice', array( $this, 'optin_notice' ) ); @@ -226,7 +230,7 @@ public function get_data() { 'site_version' => get_bloginfo( 'version' ), 'site_language' => get_bloginfo( 'language' ), 'charset' => get_bloginfo( 'charset' ), - 'wpins_version' => $this->wpins_version, + 'wpins_version' => $this->wpins_version, 'php_version' => phpversion(), 'multisite' => is_multisite(), 'file_location' => __FILE__ @@ -829,13 +833,13 @@ public function goodbye_ajax() { .put-form-active .put-goodbye-form { position: static !important; max-width: 600px; + min-width: 600px; border-radius: 5px; overflow: hidden; display: block; + background-color: #fff; } .put-goodbye-form-head { - /* background: header_bg; ?>; */ - /* color: text_color; ?>; */ color: #000; padding: 20px; letter-spacing: 3px; @@ -858,16 +862,20 @@ public function goodbye_ajax() { padding: 0px 0px 0px 4px; box-sizing: border-box; } + .put-goodbye-options textarea { + display: block; + } .put-goodbye-form-body { padding: 8px 18px; color: #444; } .deactivating-spinner { display: none; + padding-bottom: 20px !important; } .deactivating-spinner .spinner { float: none; - margin: 4px 4px 0 18px; + margin: 4px 4px 0px 18px; vertical-align: bottom; visibility: visible; } From d5ce494f98c6a6d84820971e0d3bfd561e05fa5d Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Wed, 6 Feb 2019 11:18:03 +0600 Subject: [PATCH 13/33] Force Tracked key is changed --- includes/class-plugin-usage-tracker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index 80a05ea74..339a1eb1e 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -91,10 +91,10 @@ public function migrate_plan(){ * @return void */ public function force_track_for_one_time(){ - $is_tracked = get_option('eae_force_tracked'); + $is_tracked = get_option( 'wpins_'. $this->plugin_name .'_force_tracked' ); if( ! $is_tracked ) { $this->do_tracking( true ); - update_option( 'eae_force_tracked', true ); + update_option( 'wpins_'. $this->plugin_name .'_force_tracked', true ); } } From 078690afbe7865d3f0b39cdd8f8bb189bb126af6 Mon Sep 17 00:00:00 2001 From: PriyoMukul Date: Wed, 6 Feb 2019 12:09:25 +0600 Subject: [PATCH 14/33] Deactivation Form default design --- includes/class-plugin-usage-tracker.php | 61 ++++++++----------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index 339a1eb1e..06f2c891d 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -632,7 +632,12 @@ public function optin_notice() { // @credit EDD // Don't bother asking user to opt in if they're in local dev - if ( stristr( network_site_url( '/' ), 'dev' ) !== false || stristr( network_site_url( '/' ), 'localhost' ) !== false || stristr( network_site_url( '/' ), ':8888' ) !== false ) { + $is_local = false; + if( stristr( network_site_url( '/' ), '.test' ) !== false || stristr( network_site_url( '/' ), 'localhost' ) !== false || stristr( network_site_url( '/' ), ':8888' ) !== false ) { + $is_local = true; + } + $is_local = apply_filters( 'wpins_is_local_' . $this->plugin_name, $is_local ); + if ( $is_local ) { $this->update_block_notice(); } else { @@ -743,6 +748,8 @@ public function filter_action_links( $links ) { } if( isset( $links['deactivate'] ) && $this->include_goodbye_form ) { $deactivation_link = $links['deactivate']; + + // Insert an onClick action to allow form before deactivating $deactivation_link = str_replace( '
    form_default_text(); } // Build the HTML to go in the form - $html = '
    ' . esc_html( $form['heading'] ) . ' x
    '; + $html = '
    ' . esc_html( $form['heading'] ) . '
    '; $html .= '

    ' . esc_html( $form['body'] ) . '

    '; if( is_array( $form['options'] ) ) { $html .= '
    '; ?> -
    + Date: Thu, 14 Feb 2019 13:08:41 +0600 Subject: [PATCH 21/33] Generalize for all --- includes/class-plugin-usage-tracker.php | 92 ++++++++++++------------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/includes/class-plugin-usage-tracker.php b/includes/class-plugin-usage-tracker.php index f4563ad77..da985d18d 100755 --- a/includes/class-plugin-usage-tracker.php +++ b/includes/class-plugin-usage-tracker.php @@ -24,12 +24,6 @@ class Eael_Plugin_Usage_Tracker { private $marketing = false; private $collect_email = false; private $pro_plugin_name = 'Essential Addons for Elementor Pro'; - /** - * for matching the deactivation form header color with plugins appearance. - * @var string - */ - private $header_bg = '#3A56FF'; - private $text_color = '#FFFFFF'; /** * Class constructor @@ -131,7 +125,7 @@ public function init() { // Deactivation add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ) ); add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) ); - add_action( 'wp_ajax_goodbye_form', array( $this, 'goodbye_form_callback' ) ); + add_action( 'wp_ajax_goodbye_form_' . esc_attr( $this->plugin_name ), array( $this, 'goodbye_form_callback' ) ); } @@ -753,7 +747,7 @@ public function filter_action_links( $links ) { // Insert an onClick action to allow form before deactivating - $deactivation_link = str_replace( '
    form_default_text(); } // Build the HTML to go in the form - $html = '
    ' . esc_html( $form['heading'] ) . '
    '; - $html .= '

    ' . esc_html( $form['body'] ) . '

    '; + $html = '
    ' . esc_html( $form['heading'] ) . '
    '; + $html .= '

    ' . esc_html( $form['body'] ) . '

    '; if( is_array( $form['options'] ) ) { - $html .= '
      '; + $html .= '
        '; foreach( $form['options'] as $option ) { if( is_array( $option ) ) { $id = strtolower( str_replace( " ", "_", esc_attr( $option['label'] ) ) ); + $id = $id . '_' . esc_attr( $this->plugin_name ); $html .= '
      • '; - $html .= ''; + $html .= ''; $html .= '
        '; if( isset( $option[ 'extra_field' ] ) && ! isset( $option['type'] )) { $html .= ''; @@ -831,16 +826,17 @@ public function goodbye_ajax() { $html .= '
      • '; } else { $id = strtolower( str_replace( " ", "_", esc_attr( $option ) ) ); - $html .= '
      • '; + $id = $id . '_' . esc_attr( $this->plugin_name ); + $html .= '
      • '; } } - $html .= '
      '; + $html .= '
    '; } - $html .= '
    '; + $html .= '
    '; $html .= '

    ' . __( 'Submitting form', 'plugin-usage-tracker' ) . '

    '; ?> - add_render_attribute('_wrapper', 'data-theme', $settings['eael_particles_custom_style']); } - } - - + } + } - -EAEL_Particle_Section::instance(); \ No newline at end of file diff --git a/includes/class-wpdev-notices.php b/includes/class-wpdev-notices.php index 540f16189..780bc19c3 100755 --- a/includes/class-wpdev-notices.php +++ b/includes/class-wpdev-notices.php @@ -831,15 +831,6 @@ public function upsale_button_script(){ ) ]; -/** - * This is upsale notice settings - * classes for wrapper, - * Message message for showing. - */ -$notice->classes( 'upsale', 'notice is-dismissible' ); -$notice->message( 'upsale', '

    '. __( 'Get the missing Drag & Drop Post Calendar feature for WordPress for Free!', 'essential-addons-elementor' ) .'

    ' ); -$notice->thumbnail( 'upsale', plugins_url( 'admin/assets/images/wpsp-logo.svg', ESSENTIAL_ADDONS_BASENAME ) ); - /** * This is review message and thumbnail. */ @@ -857,19 +848,12 @@ public function upsale_button_script(){ */ $notice->maybe_later_time = '7 Day'; -$notice->upsale_args = array( - 'slug' => 'wp-scheduled-posts', - 'page_slug' => 'wpsp-schedule-calendar', - 'file' => 'wp-scheduled-posts.php' -); - $notice->text_domain = 'essential-addons-elementor'; $notice->options_args = array( 'notice_will_show' => [ 'opt_in' => $notice->timestamp, 'review' => $notice->makeTime( $notice->timestamp, '4 Day' ), // after 4 days - 'upsale' => $notice->makeTime( $notice->timestamp, '2 Hour' ), // will be after 2 hours ] );