WP Review - Version 4.0.16

Version Description

Download this release

Release Info

Developer MyThemeShop
Plugin Icon 128x128 WP Review
Version 4.0.16
Comparing to
See all releases

Code changes from version 4.0.15 to 4.0.16

Files changed (4) hide show
  1. assets/js/admin.js +14 -0
  2. includes/functions.php +22 -24
  3. readme.txt +5 -2
  4. wp-review.php +2 -2
assets/js/admin.js CHANGED
@@ -308,4 +308,18 @@ jQuery(document).ready(function($) {
308
309
}
310
311
});
308
309
}
310
311
+ jQuery(document).on('click', '.wpreview-notice-dismiss', function(e){
312
+ e.preventDefault();
313
+ jQuery(this).parent().remove();
314
+ jQuery.ajax({
315
+ type: "POST",
316
+ url: ajaxurl,
317
+ data: {
318
+ action: 'mts_dismiss_wpreview_notice',
319
+ dismiss: jQuery(this).data('ignore')
320
+ }
321
+ });
322
+ return false;
323
+ });
324
+
325
});
includes/functions.php CHANGED
@@ -1351,35 +1351,33 @@ function wp_review_admin_notice() {
1351
/* Check that the user hasn't already clicked to ignore the message */
1352
/* Only show the notice 2 days after plugin activation */
1353
if ( ! get_user_meta($user_id, 'wp_review_ignore_notice') && time() >= (get_option( 'wp_review_activated', 0 ) + (2 * 24 * 60 * 60)) ) {
1354
- echo '<div class="updated notice-info wp-review-notice" id="wpreview-notice" style="position:relative;">';
1355
- printf(__('<p>Like WP Review plugin? You will LOVE <a target="_blank" href="https://mythemeshop.com/plugins/wp-review-pro/?utm_source=WP+Review&utm_medium=Notification+Link&utm_content=WP+Review+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Review Pro!</strong></a></p><a class="notice-dismiss" href="%1$s"></a>', 'wp-review'), '?wp_review_admin_notice_ignore=0');
1356
- echo "</div>";
1357
}
1358
1359
/* Other notice appears right after activating */
1360
/* And it gets hidden after showing 3 times */
1361
- if ( ! get_user_meta($user_id, 'wp_review_ignore_notice_2') && get_option('wp_review_notice_views', 0) < 3 ) {
1362
- $views = get_option('wp_review_notice_views', 0);
1363
- update_option( 'wp_review_notice_views', ($views + 1) );
1364
- echo '<div class="updated notice-info wp-review-notice" id="wpreview-notice2" style="position:relative;">';
1365
- echo '<p>';
1366
_e('Thank you for trying WP Review. We hope you will like it.', 'wp-review');
1367
- echo '</p><a class="notice-dismiss" href="%1$s"></a>';
1368
- echo "</div>";
1369
}
1370
}
1371
1372
- add_action('admin_init', 'wp_review_admin_notice_ignore');
1373
-
1374
- function wp_review_admin_notice_ignore() {
1375
- global $current_user;
1376
- $user_id = $current_user->ID;
1377
- /* If user clicks to ignore the notice, add that to their user meta */
1378
- if ( isset($_GET['wp_review_admin_notice_ignore']) ) {
1379
- if ( '0' == $_GET['wp_review_admin_notice_ignore'] ) {
1380
- add_user_meta($user_id, 'wp_review_ignore_notice', '1', true);
1381
- } elseif ( '1' == $_GET['wp_review_admin_notice_ignore'] ) {
1382
- add_user_meta($user_id, 'wp_review_ignore_notice_2', '1', true);
1383
- }
1384
- }
1385
- }
1351
/* Check that the user hasn't already clicked to ignore the message */
1352
/* Only show the notice 2 days after plugin activation */
1353
if ( ! get_user_meta($user_id, 'wp_review_ignore_notice') && time() >= (get_option( 'wp_review_activated', 0 ) + (2 * 24 * 60 * 60)) ) {
1354
+ echo '<div class="updated notice-info wp-review-notice" id="wpreview-notice" style="position:relative;">';
1355
+ echo __('<p>Like WP Review plugin? You will LOVE <a target="_blank" href="https://mythemeshop.com/plugins/wp-review-pro/?utm_source=WP+Review&utm_medium=Notification+Link&utm_content=WP+Review+Pro+LP&utm_campaign=WordPressOrg"><strong>WP Review Pro!</strong></a></p><a class="notice-dismiss wpreview-notice-dismiss" data-ignore="0" href="#"></a>', 'wp-review');
1356
+ echo "</div>";
1357
}
1358
1359
/* Other notice appears right after activating */
1360
/* And it gets hidden after showing 3 times */
1361
+ if ( ! get_user_meta($user_id, 'wp_review_ignore_notice_2') && get_option('wp_review_notice_views', 0) < 3 && get_option( 'wp_review_activated', 0 ) ) {
1362
+ $views = get_option('wp_review_notice_views', 0);
1363
+ update_option( 'wp_review_notice_views', ($views + 1) );
1364
+ echo '<div class="updated notice-info wp-review-notice" id="wpreview-notice2" style="position:relative;">';
1365
+ echo '<p>';
1366
_e('Thank you for trying WP Review. We hope you will like it.', 'wp-review');
1367
+ echo '</p><a class="notice-dismiss wpreview-notice-dismiss" data-ignore="1"></a>';
1368
+ echo "</div>";
1369
}
1370
}
1371
1372
+ add_action('wp_ajax_mts_dismiss_wpreview_notice', function(){
1373
+ global $current_user;
1374
+ $user_id = $current_user->ID;
1375
+ /* If user clicks to ignore the notice, add that to their user meta */
1376
+ if ( isset($_POST['dismiss']) ) {
1377
+ if ( '0' == $_POST['dismiss'] ) {
1378
+ add_user_meta($user_id, 'wp_review_ignore_notice', '1', true);
1379
+ } elseif ( '1' == $_POST['dismiss'] ) {
1380
+ add_user_meta($user_id, 'wp_review_ignore_notice_2', '1', true);
1381
+ }
1382
+ }
1383
+ });
readme.txt CHANGED
@@ -4,7 +4,7 @@ Creator's website link: http://mythemeshop.com/plugins/wp-review/
4
Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
Requires at least: 4.0
6
Tested up to: 4.9.6
7
- Stable tag: 4.0.15
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -102,7 +102,10 @@ Please disable all plugins and check if rating is working properly. Then you can
102
103
== Changelog ==
104
105
- = v4.0.15 (June 29, 2018) =
106
* Changed admin notices
107
108
= v4.0.14 (June 13, 2018) =
4
Tags: review, wp review, rating, wp rating, user rating, google rating, star rating, product review
5
Requires at least: 4.0
6
Tested up to: 4.9.6
7
+ Stable tag: 4.0.16
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
102
103
== Changelog ==
104
105
+ = v4.0.16 (June 30, 2018) =
106
+ * Updated admin notices
107
+
108
+ = v4.0.15 (June 28, 2018) =
109
* Changed admin notices
110
111
= v4.0.14 (June 13, 2018) =
wp-review.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: WP Review
4
* Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
* Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
6
- * Version: 4.0.15
7
* Author: MyThemesShop
8
* Author URI: http://mythemeshop.com/
9
* Text Domain: wp-review
@@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
21
if ( ! defined( 'MTS_WP_REVIEW_DB_TABLE' )) {
22
23
/* Plugin version */
24
- define( 'WP_REVIEW_PLUGIN_VERSION', '4.0.15' );
25
26
/* Sets the custom db table name. */
27
define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );
3
* Plugin Name: WP Review
4
* Plugin URI: http://mythemeshop.com/plugins/wp-review/
5
* Description: Create reviews! Choose from stars, percentages or points for review scores. Supports Retina Display, WPMU and Unlimited Color Schemes.
6
+ * Version: 4.0.16
7
* Author: MyThemesShop
8
* Author URI: http://mythemeshop.com/
9
* Text Domain: wp-review
21
if ( ! defined( 'MTS_WP_REVIEW_DB_TABLE' )) {
22
23
/* Plugin version */
24
+ define( 'WP_REVIEW_PLUGIN_VERSION', '4.0.16' );
25
26
/* Sets the custom db table name. */
27
define( 'MTS_WP_REVIEW_DB_TABLE', 'mts_wp_reviews' );