Version Description
(2020-02-13) = * Fix JS not loading in all pages for hiding notices.
Download this release
Release Info
Developer | wahid0003 |
Plugin | CTX Feed – WooCommerce Product Feed Manager Plugin |
Version | 3.2.19 |
Comparing to | |
See all releases |
Code changes from version 3.2.18 to 3.2.19
- README.txt +4 -1
- admin/class-woo-feed-admin.php +6 -8
- admin/js/pro.js +0 -19
- includes/classes/class-woo-feed-webappick-api.php +35 -4
- woo-feed.php +2 -2
README.txt
CHANGED
@@ -5,7 +5,7 @@ Tags:product feed,woocommerce product feed,google shopping feed,google shopping,
|
|
5 |
Requires at least: 3.6
|
6 |
Tested Up To: 5.3.2
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 3.2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -305,6 +305,9 @@ Using pro version:
|
|
305 |
|
306 |
== Changelog ==
|
307 |
|
|
|
|
|
|
|
308 |
= 3.2.18 (2020-02-12) =
|
309 |
* Fix User can't hide review and related notice.
|
310 |
* Fix Some WPCS Related Warnings
|
5 |
Requires at least: 3.6
|
6 |
Tested Up To: 5.3.2
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 3.2.19
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
305 |
|
306 |
== Changelog ==
|
307 |
|
308 |
+
= 3.2.19 (2020-02-13) =
|
309 |
+
* Fix JS not loading in all pages for hiding notices.
|
310 |
+
|
311 |
= 3.2.18 (2020-02-12) =
|
312 |
* Fix User can't hide review and related notice.
|
313 |
* Fix Some WPCS Related Warnings
|
admin/class-woo-feed-admin.php
CHANGED
@@ -70,7 +70,7 @@ class Woo_Feed_Admin
|
|
70 |
wp_register_style( 'slick', plugin_dir_url(__FILE__) . 'css/slick.css', array(),$this->version );
|
71 |
wp_register_style( 'slick-theme', plugin_dir_url(__FILE__) . 'css/slick-theme.css', array(),$this->version );
|
72 |
$mainDeps = array( 'selectize' );
|
73 |
-
if (
|
74 |
$mainDeps = array_merge( $mainDeps, array( 'slick', 'slick-theme' ) );
|
75 |
}
|
76 |
}
|
@@ -96,6 +96,8 @@ class Woo_Feed_Admin
|
|
96 |
* between the defined hooks and the functions defined in this
|
97 |
* class.
|
98 |
*/
|
|
|
|
|
99 |
if ( false !== strpos( $hook, 'webappick' ) && false !== strpos( $hook, 'feed' ) ) {
|
100 |
wp_register_script( 'jquery-selectize', plugin_dir_url( __FILE__ ) . 'js/selectize.min.js', array( 'jquery' ), $this->version, false );
|
101 |
wp_register_script( 'jquery-validate', plugin_dir_url( __FILE__ ) . 'js/jquery.validate.min.js', array( 'jquery' ), $this->version, false );
|
@@ -150,16 +152,12 @@ class Woo_Feed_Admin
|
|
150 |
)
|
151 |
);
|
152 |
wp_enqueue_script( $this->woo_feed );
|
153 |
-
|
154 |
-
'jquery',
|
155 |
-
$this->woo_feed,
|
156 |
-
];
|
157 |
if ( 'woo-feed_page_webappick-feed-pro-vs-free' === $hook ) {
|
158 |
-
$feedProScriptDependency = 'jquery-slick';
|
159 |
wp_register_script( 'jquery-slick', plugin_dir_url( __FILE__ ) . 'js/slick.js', array( 'jquery' ), $this->version, false );
|
|
|
|
|
160 |
}
|
161 |
-
wp_register_script( 'feed-pro', plugin_dir_url( __FILE__ ) . 'js/pro.js', $feedProScriptDependency, $this->version, false );
|
162 |
-
wp_enqueue_script( 'feed-pro' );
|
163 |
}
|
164 |
}
|
165 |
|
70 |
wp_register_style( 'slick', plugin_dir_url(__FILE__) . 'css/slick.css', array(),$this->version );
|
71 |
wp_register_style( 'slick-theme', plugin_dir_url(__FILE__) . 'css/slick-theme.css', array(),$this->version );
|
72 |
$mainDeps = array( 'selectize' );
|
73 |
+
if ( 'woo-feed_page_webappick-feed-pro-vs-free' == $hook ) {
|
74 |
$mainDeps = array_merge( $mainDeps, array( 'slick', 'slick-theme' ) );
|
75 |
}
|
76 |
}
|
96 |
* between the defined hooks and the functions defined in this
|
97 |
* class.
|
98 |
*/
|
99 |
+
wp_enqueue_script( 'jquery' );
|
100 |
+
wp_enqueue_script( 'wp-util' );
|
101 |
if ( false !== strpos( $hook, 'webappick' ) && false !== strpos( $hook, 'feed' ) ) {
|
102 |
wp_register_script( 'jquery-selectize', plugin_dir_url( __FILE__ ) . 'js/selectize.min.js', array( 'jquery' ), $this->version, false );
|
103 |
wp_register_script( 'jquery-validate', plugin_dir_url( __FILE__ ) . 'js/jquery.validate.min.js', array( 'jquery' ), $this->version, false );
|
152 |
)
|
153 |
);
|
154 |
wp_enqueue_script( $this->woo_feed );
|
155 |
+
|
|
|
|
|
|
|
156 |
if ( 'woo-feed_page_webappick-feed-pro-vs-free' === $hook ) {
|
|
|
157 |
wp_register_script( 'jquery-slick', plugin_dir_url( __FILE__ ) . 'js/slick.js', array( 'jquery' ), $this->version, false );
|
158 |
+
wp_register_script( 'feed-pro', plugin_dir_url( __FILE__ ) . 'js/pro.js', [ $this->woo_feed, 'jquery-slick' ], $this->version, false );
|
159 |
+
wp_enqueue_script( 'feed-pro' );
|
160 |
}
|
|
|
|
|
161 |
}
|
162 |
}
|
163 |
|
admin/js/pro.js
CHANGED
@@ -16,23 +16,4 @@
|
|
16 |
});
|
17 |
}
|
18 |
} );
|
19 |
-
$(document)
|
20 |
-
.on('click', '.woo-feed-notice a.button', function (e) {
|
21 |
-
e.preventDefault();
|
22 |
-
// noinspection ES6ConvertVarToLetConst
|
23 |
-
var self = $(this), notice = self.attr('data-response');
|
24 |
-
if ( 'given' === notice ) {
|
25 |
-
window.open('https://wordpress.org/support/plugin/webappick-product-feed-for-woocommerce/reviews/?rate=5#new-post', '_blank');
|
26 |
-
}
|
27 |
-
self.closest(".woo-feed-notice").slideUp( 200, 'linear' );
|
28 |
-
// noinspection JSUnresolvedVariable
|
29 |
-
wpAjax.post( 'woo_feed_save_review_notice', { _ajax_nonce: opts.nonce, notice: notice } );
|
30 |
-
})
|
31 |
-
.on('click', '.woo-feed-notice .notice-dismiss', function (e) {
|
32 |
-
e.preventDefault();
|
33 |
-
// noinspection ES6ConvertVarToLetConst
|
34 |
-
var self = $(this), feed_notice = self.closest('.woo-feed-notice'), which = feed_notice.attr('data-which');
|
35 |
-
// noinspection JSUnresolvedVariable
|
36 |
-
wpAjax.post( 'woo_feed_hide_notice', { _wpnonce: opts.nonce, which: which } );
|
37 |
-
});
|
38 |
}( jQuery, window, document, wp.ajax, wpf_ajax_obj ));
|
16 |
});
|
17 |
}
|
18 |
} );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}( jQuery, window, document, wp.ajax, wpf_ajax_obj ));
|
includes/classes/class-woo-feed-webappick-api.php
CHANGED
@@ -289,13 +289,15 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
289 |
*/
|
290 |
public function woo_feed_review_notice() {
|
291 |
global $plugin_page;
|
|
|
292 |
$options = get_option( 'woo_feed_review_notice' );
|
293 |
$installDate = get_option( 'woo-feed-free-activation-time' );
|
294 |
$installDate = strtotime( '-16 days', $installDate );
|
295 |
$pluginName = sprintf( '<b>%s</b>', esc_html__( 'WooCommerce Product Feed', 'woo-feed' ) );
|
296 |
$proLink = sprintf( '<b><a href="http://bit.ly/2KIwvTt" target="_blank">%s</a></b>', esc_html__( 'Premium', 'woo-feed' ) );
|
|
|
297 |
$review_notice = (
|
298 |
-
false === get_option( '
|
299 |
(
|
300 |
! $options && time() >= $installDate + ( DAY_IN_SECONDS * 15 ) ||
|
301 |
(
|
@@ -312,8 +314,9 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
312 |
);
|
313 |
// Review Notice.
|
314 |
if ( $review_notice ) {
|
|
|
315 |
?>
|
316 |
-
<div class="woo-feed-notice notice notice-info is-dismissible" data-which="rating">
|
317 |
<p><?php
|
318 |
printf(
|
319 |
/* translators: 1: plugin name,2: Slightly Smiling Face (Emoji), 3: line break 'br' tag */
|
@@ -334,6 +337,7 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
334 |
// Pro Limit Notice
|
335 |
$limit_notice_pages = [ 'webappick-manage-feeds', 'webappick-new-feed', 'webappick-feed-settings' ];
|
336 |
if ( in_array( $plugin_page, $limit_notice_pages ) && false === get_option( 'woo_feed_product_limit_notice_hidden' ) ) {
|
|
|
337 |
?>
|
338 |
<div class="woo-feed-notice notice notice-warning is-dismissible" data-which="product_limit">
|
339 |
<p><?php
|
@@ -350,6 +354,7 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
350 |
}
|
351 |
// Compatibility Notices.
|
352 |
if ( class_exists( 'SitePress' ) && false === get_option( 'woo_feed_wpml_notice_hidden' ) ) {
|
|
|
353 |
?>
|
354 |
<div class="woo-feed-notice notice notice-success is-dismissible" data-which="wpml">
|
355 |
<p><?php
|
@@ -364,6 +369,7 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
364 |
<?php
|
365 |
}
|
366 |
if ( class_exists( 'RP_WCDPD', false ) && false === get_option( 'woo_feed_rp-wcdpd_notice_hidden' ) ) {
|
|
|
367 |
?>
|
368 |
<div class="woo-feed-notice notice notice-success is-dismissible" data-which="rp-wcdpd">
|
369 |
<p><?php
|
@@ -378,13 +384,38 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
378 |
</div>
|
379 |
<?php
|
380 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
381 |
}
|
382 |
|
383 |
/**
|
384 |
* Show Review request admin notice
|
385 |
*/
|
386 |
public function woo_feed_save_review_notice() {
|
387 |
-
check_ajax_referer( '
|
388 |
$review_actions = [ 'later', 'never', 'given' ];
|
389 |
if ( isset( $_POST['notice'] ) && ! empty( $_POST['notice'] ) && in_array( $_POST['notice'], $review_actions ) ) {
|
390 |
$value = [
|
@@ -403,7 +434,7 @@ if ( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
403 |
* Ajax Action For Hiding Compatibility Notices
|
404 |
*/
|
405 |
public function woo_feed_hide_notice() {
|
406 |
-
check_ajax_referer( '
|
407 |
$notices = [ 'rp-wcdpd', 'wpml', 'rating', 'product_limit' ];
|
408 |
if ( isset( $_REQUEST['which'] ) && ! empty( $_REQUEST['which'] ) && in_array( $_REQUEST['which'], $notices ) ) {
|
409 |
$which = sanitize_text_field( $_REQUEST['which'] );
|
289 |
*/
|
290 |
public function woo_feed_review_notice() {
|
291 |
global $plugin_page;
|
292 |
+
$nonce = wp_create_nonce( 'woo_feed_pro_notice_nonce' );
|
293 |
$options = get_option( 'woo_feed_review_notice' );
|
294 |
$installDate = get_option( 'woo-feed-free-activation-time' );
|
295 |
$installDate = strtotime( '-16 days', $installDate );
|
296 |
$pluginName = sprintf( '<b>%s</b>', esc_html__( 'WooCommerce Product Feed', 'woo-feed' ) );
|
297 |
$proLink = sprintf( '<b><a href="http://bit.ly/2KIwvTt" target="_blank">%s</a></b>', esc_html__( 'Premium', 'woo-feed' ) );
|
298 |
+
$has_notice = false;
|
299 |
$review_notice = (
|
300 |
+
false === get_option( 'woo_feed_rating_notice_hidden' ) &&
|
301 |
(
|
302 |
! $options && time() >= $installDate + ( DAY_IN_SECONDS * 15 ) ||
|
303 |
(
|
314 |
);
|
315 |
// Review Notice.
|
316 |
if ( $review_notice ) {
|
317 |
+
$has_notice = true;
|
318 |
?>
|
319 |
+
<div class="woo-feed-notice notice notice-info is-dismissible" data-which="rating" data-nonce="<?php echo esc_attr( $nonce ); ?>">
|
320 |
<p><?php
|
321 |
printf(
|
322 |
/* translators: 1: plugin name,2: Slightly Smiling Face (Emoji), 3: line break 'br' tag */
|
337 |
// Pro Limit Notice
|
338 |
$limit_notice_pages = [ 'webappick-manage-feeds', 'webappick-new-feed', 'webappick-feed-settings' ];
|
339 |
if ( in_array( $plugin_page, $limit_notice_pages ) && false === get_option( 'woo_feed_product_limit_notice_hidden' ) ) {
|
340 |
+
$has_notice = true;
|
341 |
?>
|
342 |
<div class="woo-feed-notice notice notice-warning is-dismissible" data-which="product_limit">
|
343 |
<p><?php
|
354 |
}
|
355 |
// Compatibility Notices.
|
356 |
if ( class_exists( 'SitePress' ) && false === get_option( 'woo_feed_wpml_notice_hidden' ) ) {
|
357 |
+
$has_notice = true;
|
358 |
?>
|
359 |
<div class="woo-feed-notice notice notice-success is-dismissible" data-which="wpml">
|
360 |
<p><?php
|
369 |
<?php
|
370 |
}
|
371 |
if ( class_exists( 'RP_WCDPD', false ) && false === get_option( 'woo_feed_rp-wcdpd_notice_hidden' ) ) {
|
372 |
+
$has_notice = true;
|
373 |
?>
|
374 |
<div class="woo-feed-notice notice notice-success is-dismissible" data-which="rp-wcdpd">
|
375 |
<p><?php
|
384 |
</div>
|
385 |
<?php
|
386 |
}
|
387 |
+
if ( true === $has_notice ) {
|
388 |
+
$jss = <<<JSS
|
389 |
+
(function($){
|
390 |
+
"use strict";
|
391 |
+
$(document)
|
392 |
+
.on('click', '.woo-feed-notice a.button', function (e) {
|
393 |
+
e.preventDefault();
|
394 |
+
// noinspection ES6ConvertVarToLetConst
|
395 |
+
var self = $(this), notice = self.attr('data-response');
|
396 |
+
if ( 'given' === notice ) {
|
397 |
+
window.open('https://wordpress.org/support/plugin/webappick-product-feed-for-woocommerce/reviews/?rate=5#new-post', '_blank');
|
398 |
+
}
|
399 |
+
self.closest(".woo-feed-notice").slideUp( 200, 'linear' );
|
400 |
+
wp.ajax.post( 'woo_feed_save_review_notice', { _ajax_nonce: '$nonce', notice: notice } );
|
401 |
+
})
|
402 |
+
.on('click', '.woo-feed-notice .notice-dismiss', function (e) {
|
403 |
+
e.preventDefault();
|
404 |
+
// noinspection ES6ConvertVarToLetConst
|
405 |
+
var self = $(this), feed_notice = self.closest('.woo-feed-notice'), which = feed_notice.attr('data-which');
|
406 |
+
wp.ajax.post( 'woo_feed_hide_notice', { _wpnonce: '$nonce', which: which } );
|
407 |
+
});
|
408 |
+
})(jQuery);
|
409 |
+
JSS;
|
410 |
+
wp_add_inline_script( 'wp-util', $jss );
|
411 |
+
}
|
412 |
}
|
413 |
|
414 |
/**
|
415 |
* Show Review request admin notice
|
416 |
*/
|
417 |
public function woo_feed_save_review_notice() {
|
418 |
+
check_ajax_referer( 'woo_feed_pro_notice_nonce' );
|
419 |
$review_actions = [ 'later', 'never', 'given' ];
|
420 |
if ( isset( $_POST['notice'] ) && ! empty( $_POST['notice'] ) && in_array( $_POST['notice'], $review_actions ) ) {
|
421 |
$value = [
|
434 |
* Ajax Action For Hiding Compatibility Notices
|
435 |
*/
|
436 |
public function woo_feed_hide_notice() {
|
437 |
+
check_ajax_referer( 'woo_feed_pro_notice_nonce' );
|
438 |
$notices = [ 'rp-wcdpd', 'wpml', 'rating', 'product_limit' ];
|
439 |
if ( isset( $_REQUEST['which'] ) && ! empty( $_REQUEST['which'] ) && in_array( $_REQUEST['which'], $notices ) ) {
|
440 |
$which = sanitize_text_field( $_REQUEST['which'] );
|
woo-feed.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Description: This plugin generate WooCommerce product feed for Shopping Engines
|
13 |
* like Google Shopping, Facebook Product Feed, eBay, Amazon, Idealo and many more.
|
14 |
*
|
15 |
-
* Version: 3.2.
|
16 |
* Author: WebAppick
|
17 |
* Author URI: https://webappick.com/
|
18 |
* License: GPL v2
|
@@ -40,7 +40,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
|
|
40 |
* @var string
|
41 |
* @since 3.1.6
|
42 |
*/
|
43 |
-
define( 'WOO_FEED_FREE_VERSION', '3.2.
|
44 |
}
|
45 |
|
46 |
if ( ! defined( 'WOO_FEED_FREE_FILE') ) {
|
12 |
* Description: This plugin generate WooCommerce product feed for Shopping Engines
|
13 |
* like Google Shopping, Facebook Product Feed, eBay, Amazon, Idealo and many more.
|
14 |
*
|
15 |
+
* Version: 3.2.19
|
16 |
* Author: WebAppick
|
17 |
* Author URI: https://webappick.com/
|
18 |
* License: GPL v2
|
40 |
* @var string
|
41 |
* @since 3.1.6
|
42 |
*/
|
43 |
+
define( 'WOO_FEED_FREE_VERSION', '3.2.19' );
|
44 |
}
|
45 |
|
46 |
if ( ! defined( 'WOO_FEED_FREE_FILE') ) {
|