Version Description
(2019-09-23) = * Enhancement: Review Notice updates + instructions on how to disable it programmatically
Download this release
Release Info
Developer | jeffparker |
Plugin | Yet Another Related Posts Plugin (YARPP) |
Version | 5.1.1 |
Comparing to | |
See all releases |
Code changes from version 5.1.0 to 5.1.1
- classes/YARPP_Admin.php +14 -5
- readme.txt +20 -2
- yarpp.php +2 -2
classes/YARPP_Admin.php
CHANGED
@@ -6,7 +6,7 @@ class YARPP_Admin {
|
|
6 |
|
7 |
const ACTIVATE_TIMESTAMP_OPTION = 'yarpp_activate_timestamp';
|
8 |
const REVIEW_DISMISS_OPTION = 'yarpp_review_notice';
|
9 |
-
const REVIEW_FIRST_PERIOD =
|
10 |
const REVIEW_LATER_PERIOD = 5184000; // 60 days in seconds
|
11 |
const REVIEW_FOREVER_PERIOD = 63113904; // 2 years in seconds
|
12 |
|
@@ -78,7 +78,7 @@ class YARPP_Admin {
|
|
78 |
$user_id = $current_user->ID;
|
79 |
|
80 |
if (!is_admin() ||
|
81 |
-
!current_user_can('
|
82 |
!isset($_GET['_wpnonce']) ||
|
83 |
!wp_verify_nonce($_GET['_wpnonce'], 'review-nonce') ||
|
84 |
!isset($_GET['yarpp_defer_t']) ||
|
@@ -166,13 +166,22 @@ class YARPP_Admin {
|
|
166 |
}
|
167 |
}
|
168 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
<div class="notice notice-info is-dismissible yarpp-review-notice">
|
170 |
<p class="yarpp-review-notice-text">' . __('Hey there! We noticed that you have had success using ', 'yarpp') . '<a href="' . admin_url('options-general.php?page=yarpp') . '">YARPP - Related Posts</a>! ' . __('Could you please do us a BIG favor and give us a quick 5-star rating on WordPress? It will boost our motivation and spread the word. We would really appreciate it 🤗 — Team YARPP', 'yarpp') . '
|
171 |
<br />
|
172 |
<br />
|
173 |
-
<a
|
174 |
-
<a href="' . $dismiss_forlater_url . '">' . __('No,
|
175 |
-
<a href="' . $dismiss_forever_url . '">' . __('I already did', 'yarpp') . '</a>
|
|
|
176 |
</p>
|
177 |
</div>';
|
178 |
}
|
6 |
|
7 |
const ACTIVATE_TIMESTAMP_OPTION = 'yarpp_activate_timestamp';
|
8 |
const REVIEW_DISMISS_OPTION = 'yarpp_review_notice';
|
9 |
+
const REVIEW_FIRST_PERIOD = 518400; // 6 days in seconds
|
10 |
const REVIEW_LATER_PERIOD = 5184000; // 60 days in seconds
|
11 |
const REVIEW_FOREVER_PERIOD = 63113904; // 2 years in seconds
|
12 |
|
78 |
$user_id = $current_user->ID;
|
79 |
|
80 |
if (!is_admin() ||
|
81 |
+
!current_user_can('publish_posts') ||
|
82 |
!isset($_GET['_wpnonce']) ||
|
83 |
!wp_verify_nonce($_GET['_wpnonce'], 'review-nonce') ||
|
84 |
!isset($_GET['yarpp_defer_t']) ||
|
166 |
}
|
167 |
}
|
168 |
</style>
|
169 |
+
|
170 |
+
<script>
|
171 |
+
function yarpp_openWindowReload(link, reload) {
|
172 |
+
window.open(link, "_blank");
|
173 |
+
document.location.href = reload;
|
174 |
+
}
|
175 |
+
</script>
|
176 |
+
|
177 |
<div class="notice notice-info is-dismissible yarpp-review-notice">
|
178 |
<p class="yarpp-review-notice-text">' . __('Hey there! We noticed that you have had success using ', 'yarpp') . '<a href="' . admin_url('options-general.php?page=yarpp') . '">YARPP - Related Posts</a>! ' . __('Could you please do us a BIG favor and give us a quick 5-star rating on WordPress? It will boost our motivation and spread the word. We would really appreciate it 🤗 — Team YARPP', 'yarpp') . '
|
179 |
<br />
|
180 |
<br />
|
181 |
+
<a onClick="' . "yarpp_openWindowReload('https://wordpress.org/support/plugin/yet-another-related-posts-plugin/reviews/?rate=5#new-post', '$dismiss_forever_url')" . '" class="button button-primary">' . __('Ok, you deserve it', 'shareaholic') . '</a>
|
182 |
+
<a href="' . $dismiss_forlater_url . '">' . __('No, not good enough', 'yarpp') . '</a>
|
183 |
+
<a href="' . $dismiss_forever_url . '">' . __('I already did', 'yarpp') . '</a>
|
184 |
+
<a href="' . $dismiss_forever_url . '">' . __('Dismiss', 'yarpp') . '</a>
|
185 |
</p>
|
186 |
</div>';
|
187 |
}
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Requires at least: 3.7
|
|
5 |
Requires PHP: 5.2
|
6 |
License: GPLv2 or later
|
7 |
Tested up to: 5.2
|
8 |
-
Stable tag: 5.1.
|
9 |
|
10 |
Display a list of related posts on your site based on a powerful unique algorithm. Optionally, earn money by including sponsored content.
|
11 |
|
@@ -233,7 +233,25 @@ Yes. Any taxonomy, including custom taxonomies, may be specified in the `weight`
|
|
233 |
|
234 |
If you would like to choose custom taxonomies to choose in the YARPP settings UI, either to exclude certain terms or to consider them in the relatedness formula via the UI, the taxonomy must (a) have either the `show_ui` or `yarpp_support` attribute set to true and (b) must apply to either the post types `post` or `page` or both.
|
235 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
== Changelog ==
|
|
|
|
|
|
|
237 |
= 5.1.0 (2019-07-10) =
|
238 |
* [Bugfix](https://wordpress.org/support/topic/yarpp-broken-in-gutenberg-editor/): Related Posts metabox did not load within Gutenberg Editor
|
239 |
* Bugfix: Fixed 'Deactivate YARPP Pro' button, including moving functionality to proper WP AJAX functions
|
@@ -886,6 +904,6 @@ After a break of many years, the plugin is 100% supported now that the baton has
|
|
886 |
* Initial upload
|
887 |
|
888 |
== Upgrade Notice ==
|
889 |
-
= 5.1.
|
890 |
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thank you for using YARPP!
|
891 |
|
5 |
Requires PHP: 5.2
|
6 |
License: GPLv2 or later
|
7 |
Tested up to: 5.2
|
8 |
+
Stable tag: 5.1.1
|
9 |
|
10 |
Display a list of related posts on your site based on a powerful unique algorithm. Optionally, earn money by including sponsored content.
|
11 |
|
233 |
|
234 |
If you would like to choose custom taxonomies to choose in the YARPP settings UI, either to exclude certain terms or to consider them in the relatedness formula via the UI, the taxonomy must (a) have either the `show_ui` or `yarpp_support` attribute set to true and (b) must apply to either the post types `post` or `page` or both.
|
235 |
|
236 |
+
= Can I disable the Review Notice forever? =
|
237 |
+
|
238 |
+
If you want to prevent the Review Notice from appearing you can use the function below:
|
239 |
+
|
240 |
+
`
|
241 |
+
/**
|
242 |
+
* Disable YARPP Review Notice
|
243 |
+
*
|
244 |
+
*/
|
245 |
+
function yarpp_disable_review_notice() {
|
246 |
+
remove_action('admin_notices', array('YARPP_Admin', 'display_review_notice'));
|
247 |
+
}
|
248 |
+
add_action('admin_init', 'yarpp_disable_review_notice', 11);
|
249 |
+
`
|
250 |
+
|
251 |
== Changelog ==
|
252 |
+
= 5.1.1 (2019-09-23) =
|
253 |
+
* Enhancement: Review Notice updates + instructions on how to disable it programmatically
|
254 |
+
|
255 |
= 5.1.0 (2019-07-10) =
|
256 |
* [Bugfix](https://wordpress.org/support/topic/yarpp-broken-in-gutenberg-editor/): Related Posts metabox did not load within Gutenberg Editor
|
257 |
* Bugfix: Fixed 'Deactivate YARPP Pro' button, including moving functionality to proper WP AJAX functions
|
904 |
* Initial upload
|
905 |
|
906 |
== Upgrade Notice ==
|
907 |
+
= 5.1.1 =
|
908 |
We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thank you for using YARPP!
|
909 |
|
yarpp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Yet Another Related Posts Plugin
|
4 |
Description: Adds related posts to your site and in RSS feeds, based on a powerful, customizable algorithm.
|
5 |
-
Version: 5.1.
|
6 |
Author: YARPP
|
7 |
Author URI: http://www.yarpp.com/
|
8 |
Plugin URI: http://www.yarpp.com/
|
@@ -23,7 +23,7 @@ if(!defined('WP_CONTENT_DIR')){
|
|
23 |
define('WP_CONTENT_DIR', substr($tr,0,strrpos($tr,'/')));
|
24 |
}
|
25 |
|
26 |
-
define('YARPP_VERSION', '5.1.
|
27 |
define('YARPP_DIR', dirname(__FILE__));
|
28 |
define('YARPP_URL', plugins_url('',__FILE__));
|
29 |
define('YARPP_NO_RELATED', ':(');
|
2 |
/*
|
3 |
Plugin Name: Yet Another Related Posts Plugin
|
4 |
Description: Adds related posts to your site and in RSS feeds, based on a powerful, customizable algorithm.
|
5 |
+
Version: 5.1.1
|
6 |
Author: YARPP
|
7 |
Author URI: http://www.yarpp.com/
|
8 |
Plugin URI: http://www.yarpp.com/
|
23 |
define('WP_CONTENT_DIR', substr($tr,0,strrpos($tr,'/')));
|
24 |
}
|
25 |
|
26 |
+
define('YARPP_VERSION', '5.1.1');
|
27 |
define('YARPP_DIR', dirname(__FILE__));
|
28 |
define('YARPP_URL', plugins_url('',__FILE__));
|
29 |
define('YARPP_NO_RELATED', ':(');
|