Yasr – Yet Another Stars Rating - Version 2.0.7

Version Description

Download this release

Release Info

Developer Dudo
Plugin Icon 128x128 Yasr – Yet Another Stars Rating
Version 2.0.7
Comparing to
See all releases

Code changes from version 2.0.6 to 2.0.7

lib/admin/settings/yasr-settings-functions.php CHANGED
@@ -600,7 +600,9 @@ function yasr_choose_snippet_callback($option) {
600
 
601
  <?php
602
 
603
- foreach (YASR_SUPPORTED_SCHEMA_TYPES as $type) {
 
 
604
 
605
  $type = trim($type);
606
  $type_visualized = $type;
600
 
601
  <?php
602
 
603
+ $supported_schema_types = json_decode(YASR_SUPPORTED_SCHEMA_TYPES);
604
+
605
+ foreach ($supported_schema_types as $type) {
606
 
607
  $type = trim($type);
608
  $type_visualized = $type;
lib/yasr-db-functions.php CHANGED
@@ -231,7 +231,8 @@ function yasr_get_overall_rating($post_id = false, $create_transient = true) {
231
  /****** Return the snippet choosen for a post or page ******/
232
  function yasr_get_snippet_type() {
233
 
234
- $review_types = YASR_SUPPORTED_SCHEMA_TYPES;
 
235
  $post_id = get_the_ID();
236
 
237
  if (!$post_id) {
231
  /****** Return the snippet choosen for a post or page ******/
232
  function yasr_get_snippet_type() {
233
 
234
+ $review_types = json_decode(YASR_SUPPORTED_SCHEMA_TYPES);
235
+
236
  $post_id = get_the_ID();
237
 
238
  if (!$post_id) {
lib/yasr-functions.php CHANGED
@@ -564,7 +564,7 @@ function yasr_add_schema($content) {
564
 
565
  function yasr_select_itemtype() {
566
 
567
- $review_types = YASR_SUPPORTED_SCHEMA_TYPES;
568
  $review_type_choosen = yasr_get_snippet_type();
569
 
570
  ?>
564
 
565
  function yasr_select_itemtype() {
566
 
567
+ $review_types = json_decode(YASR_SUPPORTED_SCHEMA_TYPES);
568
  $review_type_choosen = yasr_get_snippet_type();
569
 
570
  ?>
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires at least: 4.3.0
5
  Contributors: Dudo
6
  Tested up to: 5.2.3
7
  Requires PHP: 5.3
8
- Stable tag: 2.0.6
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Boost the way people interact with your website, e-commerce or blog with an easy and intuitive WordPress rating system!
@@ -125,6 +125,8 @@ If doesn't, it's suggested to ask in a SEO oriented forum.
125
 
126
  The full changelog can be found in the plugin's directory. Recent entries:
127
 
 
 
128
  = 2.0.6 =
129
  * NEW FEATURE: in Gutenberg, is now possible to rate "overall Rating" in both blocks and sidebar
130
  * IMPORTANT CHANGES ON RICH SNIPPETS: due to [this google announcement] (https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html)
5
  Contributors: Dudo
6
  Tested up to: 5.2.3
7
  Requires PHP: 5.3
8
+ Stable tag: 2.0.7
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Boost the way people interact with your website, e-commerce or blog with an easy and intuitive WordPress rating system!
125
 
126
  The full changelog can be found in the plugin's directory. Recent entries:
127
 
128
+ * TWEAKED: changed a define to support php version <7
129
+
130
  = 2.0.6 =
131
  * NEW FEATURE: in Gutenberg, is now possible to rate "overall Rating" in both blocks and sidebar
132
  * IMPORTANT CHANGES ON RICH SNIPPETS: due to [this google announcement] (https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html)
yet-another-stars-rating.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Yet Another Stars Rating
5
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
  * Description: Yasr - Yet Another Stars Rating is a powerful way to add SEO-friendly user-generated reviews and testimonials to your website posts, pages and CPT, without affecting its speed.
7
- * Version: 2.0.6
8
  * Author: Dario Curvino
9
  * Author URI: https://dariocurvino.it/
10
  * Text Domain: yet-another-stars-rating
@@ -76,7 +76,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
76
  yasr_fs();
77
  // Signal that SDK was initiated.
78
  do_action( 'yasr_fs_loaded' );
79
- define( 'YASR_VERSION_NUM', '2.0.6' );
80
  //Plugin relative path
81
  define( "YASR_ABSOLUTE_PATH", dirname( __FILE__ ) );
82
  //Plugin RELATIVE PATH without slashes (just the directory's name)
@@ -209,7 +209,9 @@ if ( !function_exists( 'yasr_fs' ) ) {
209
  //Text for button in settings pages
210
  $save_settings_text = __( 'Save All Settings', 'yet-another-stars-rating' );
211
  define( "YASR_SAVE_All_SETTINGS_TEXT", $save_settings_text );
212
- $supported_schema_types = array(
 
 
213
  'Product',
214
  'Book',
215
  'Movie',
@@ -217,7 +219,7 @@ if ( !function_exists( 'yasr_fs' ) ) {
217
  'Place',
218
  'Recipe',
219
  'Other'
220
- );
221
  define( "YASR_SUPPORTED_SCHEMA_TYPES", $supported_schema_types );
222
  $yasr_version_installed = get_option( 'yasr-version' );
223
  global $yasr_version_installed ;
@@ -253,50 +255,6 @@ if ( !function_exists( 'yasr_fs' ) ) {
253
  global $wpdb ;
254
  global $yasr_version_installed ;
255
  global $yasr_stored_options ;
256
- //announce for version 2.0.6, remove end 2020
257
- $yasr_206_dismissed = false;
258
-
259
- if ( isset( $_GET['yasr-206-dismissed'] ) ) {
260
- $yasr_206_dismissed = true;
261
- set_transient( 'yasr_206_announce', 'yes', 2 * YEAR_IN_SECONDS );
262
- }
263
-
264
-
265
- if ( $yasr_version_installed && $yasr_206_dismissed === false ) {
266
- $yasr_206_dismissed_transient = get_transient( 'yasr_206_announce' );
267
-
268
- if ( $yasr_206_dismissed_transient !== 'yes' ) {
269
- add_action( 'admin_notices', 'yasr_announce_206' );
270
- function yasr_announce_206()
271
- {
272
- $settings_url = admin_url( 'options-general.php?page=yasr_settings_page' );
273
- echo '<div class="notice notice-success is-dismissible">
274
- <p>' . sprintf(
275
- __( '%sYASR 2.0.6 UPDATE:%s
276
- %s
277
- Google has implemented a new algorithm that doesn\'t show anymore stars in SERP
278
- for generic post type such BlogPosting, CreativeWork and Article: %s the announcement.
279
- %s
280
- BlogPosting is still supported by YASR, but will not show any ratings.
281
- Take a look at all new item types in the %s! Support for more types is coming soon.
282
- %s
283
- %s', 'yet-another-stars-rating' ),
284
- '<h4>',
285
- '</h4>',
286
- '<br />',
287
- '<a href="https://webmasters.googleblog.com/2019/09/making-review-rich-results-more-helpful.html">here</a>',
288
- '<br />',
289
- "<a href=\"{$settings_url}\">settings page</a>",
290
- '<br /><br />',
291
- '<a href="?yasr-206-dismissed">Dismiss</a>'
292
- ) . '</p>
293
- </div>' ;
294
- }
295
-
296
- }
297
-
298
- }
299
-
300
 
301
  if ( $yasr_version_installed && $yasr_version_installed < '2.0.4' ) {
302
  $yasr_stored_options['auto_insert_align'] = 'left';
4
  * Plugin Name: Yet Another Stars Rating
5
  * Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
6
  * Description: Yasr - Yet Another Stars Rating is a powerful way to add SEO-friendly user-generated reviews and testimonials to your website posts, pages and CPT, without affecting its speed.
7
+ * Version: 2.0.7
8
  * Author: Dario Curvino
9
  * Author URI: https://dariocurvino.it/
10
  * Text Domain: yet-another-stars-rating
76
  yasr_fs();
77
  // Signal that SDK was initiated.
78
  do_action( 'yasr_fs_loaded' );
79
+ define( 'YASR_VERSION_NUM', '2.0.7' );
80
  //Plugin relative path
81
  define( "YASR_ABSOLUTE_PATH", dirname( __FILE__ ) );
82
  //Plugin RELATIVE PATH without slashes (just the directory's name)
209
  //Text for button in settings pages
210
  $save_settings_text = __( 'Save All Settings', 'yet-another-stars-rating' );
211
  define( "YASR_SAVE_All_SETTINGS_TEXT", $save_settings_text );
212
+ //use json_decode for compatibility with php <7
213
+ //https://wordpress.org/support/topic/error-after-update-to-version-2-0-6/
214
+ $supported_schema_types = json_encode( array(
215
  'Product',
216
  'Book',
217
  'Movie',
219
  'Place',
220
  'Recipe',
221
  'Other'
222
+ ) );
223
  define( "YASR_SUPPORTED_SCHEMA_TYPES", $supported_schema_types );
224
  $yasr_version_installed = get_option( 'yasr-version' );
225
  global $yasr_version_installed ;
255
  global $wpdb ;
256
  global $yasr_version_installed ;
257
  global $yasr_stored_options ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
  if ( $yasr_version_installed && $yasr_version_installed < '2.0.4' ) {
260
  $yasr_stored_options['auto_insert_align'] = 'left';