Schema & Structured Data for WP & AMP - Version 1.8.8

Version Description

(22 June 2019) = * Bug Fixed: Uncaught Error: Class 'saswp_google_review' not found. #351

Download this release

Release Info

Developer magazine3
Plugin Icon 128x128 Schema & Structured Data for WP & AMP
Version 1.8.8
Comparing to
See all releases

Code changes from version 1.8.7 to 1.8.8

google_review/google_review_widget.php CHANGED
@@ -31,37 +31,31 @@ class Saswp_Google_Review_Widget extends WP_Widget {
31
  public function widget( $args, $instance ) {
32
 
33
  echo html_entity_decode(esc_attr($args['before_widget']));
34
- // if ( ! empty( $instance['title'] ) ) {
35
- // echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
36
- // }
37
-
38
- $object = new saswp_google_review();
39
- $all_ads = $object->saswp_fetch_all_google_review_post();
40
- $goolge_review_obj = new saswp_google_review();
 
 
 
 
 
 
 
 
41
 
42
- foreach($all_ads as $ad){
43
-
44
- if($ad->ID == $instance['g_review']){
45
-
46
- $ad_code = $object->saswp_google_review_front_output($instance['g_review']);
47
-
48
- $goolge_review = $goolge_review_obj->saswp_get_google_review_schema_markup($instance['g_review']);
49
-
50
- if($goolge_review){
51
-
52
- echo $ad_code.$goolge_review;
53
- }else{
54
-
55
- echo $ad_code;
56
- }
57
-
58
- }
59
-
60
  }
61
-
62
- echo html_entity_decode(esc_attr($args['after_widget']));
63
-
64
- }
65
 
66
  /**
67
  * Back-end widget form.
@@ -73,46 +67,24 @@ class Saswp_Google_Review_Widget extends WP_Widget {
73
  public function form( $instance ) {
74
 
75
  $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'Review Title', 'schema-and-structured-data-for-wp' );
76
- $ads = ! empty( $instance['g_review'] ) ? $instance['g_review'] : esc_html__( 'review list to be display', 'schema-and-structured-data-for-wp' );
77
-
78
- ?>
79
-
80
- <!-- <p>
81
- <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
82
- <?php esc_attr_e( 'Title:', 'schema-and-structured-data-for-wp' ); ?></label>
83
- <input
84
- class="widefat"
85
- id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
86
- name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
87
- type="text"
88
- value="<?php echo esc_attr( $title ); ?>">
89
- </p>-->
90
-
91
- <p>
92
- <label for="<?php echo esc_attr( $this->get_field_id( 'g_review' ) ); ?>">
93
- <?php esc_attr_e( 'Places :', 'schema-and-structured-data-for-wp' ); ?>
94
- </label>
95
-
96
- <?php
97
 
98
- $ads_select_html = '';
99
- $object = new saswp_google_review();
100
- $all_ads = $object->saswp_fetch_all_google_review_post();
101
-
102
- foreach($all_ads as $ad){
103
-
104
- $ads_select_html .= '<option '. esc_attr(selected( $ads, $ad->ID, false)).' value="'.esc_attr($ad->ID).'">'.esc_html__($ad->post_title, 'schema-and-structured-data-for-wp').'</option>';
105
-
106
- }
107
-
108
- echo '<select id="'.esc_attr( $this->get_field_id( 'g_review' )).'" name="'.esc_attr( $this->get_field_name( 'g_review' )).'">'
109
- .$ads_select_html.
110
- '</select>';
111
- ?>
112
-
113
- </p>
114
-
115
- <?php
116
  }
117
 
118
  /**
@@ -134,8 +106,7 @@ class Saswp_Google_Review_Widget extends WP_Widget {
134
 
135
  }
136
 
137
- } // class Adsforwp_Ads_Widget
138
-
139
 
140
  /**
141
  * We are registering our widget here in wordpress
31
  public function widget( $args, $instance ) {
32
 
33
  echo html_entity_decode(esc_attr($args['before_widget']));
34
+
35
+ if ( ! class_exists('saswp_google_review')) {
36
+ require_once SASWP_DIR_NAME.'/google_review/google_review.php';
37
+ }
38
+
39
+ $object = new saswp_google_review();
40
+ $all_ads = $object->saswp_fetch_all_google_review_post();
41
+ $goolge_review_obj = new saswp_google_review();
42
+
43
+ foreach($all_ads as $ad){
44
+
45
+ if($ad->ID == $instance['g_review']){
46
+
47
+ $ad_code = $object->saswp_google_review_front_output($instance['g_review']);
48
+ $goolge_review = $goolge_review_obj->saswp_get_google_review_schema_markup($instance['g_review']);
49
 
50
+ if($goolge_review){
51
+ echo $ad_code . $goolge_review;
52
+ } else {
53
+ echo $ad_code;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
+ }
56
+ }
57
+ echo html_entity_decode(esc_attr($args['after_widget']));
58
+ }
59
 
60
  /**
61
  * Back-end widget form.
67
  public function form( $instance ) {
68
 
69
  $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'Review Title', 'schema-and-structured-data-for-wp' );
70
+ $ads = ! empty( $instance['g_review'] ) ? $instance['g_review'] : esc_html__( 'review list to be display', 'schema-and-structured-data-for-wp' );?>
71
+ <p>
72
+ <label for="<?php echo esc_attr( $this->get_field_id( 'g_review' ) ); ?>">
73
+ <?php esc_attr_e( 'Places :', 'schema-and-structured-data-for-wp' ); ?></label><?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
+ $ads_select_html = '';
76
+ if ( ! class_exists('saswp_google_review')) {
77
+ require_once SASWP_DIR_NAME.'/google_review/google_review.php';
78
+ }
79
+ $object = new saswp_google_review();
80
+ $all_ads = $object->saswp_fetch_all_google_review_post();
81
+ foreach($all_ads as $ad){
82
+ $ads_select_html .= '<option '. esc_attr(selected( $ads, $ad->ID, false)).' value="'.esc_attr($ad->ID).'">'.esc_html__($ad->post_title, 'schema-and-structured-data-for-wp').'</option>';
83
+ }
84
+ echo '<select id="'.esc_attr( $this->get_field_id( 'g_review' )).'" name="'.esc_attr( $this->get_field_name( 'g_review' )).'">'
85
+ .$ads_select_html.
86
+ '</select>';?>
87
+ </p><?php
 
 
 
 
 
88
  }
89
 
90
  /**
106
 
107
  }
108
 
109
+ } // class Saswp_Google_Review_Widget
 
110
 
111
  /**
112
  * We are registering our widget here in wordpress
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: magazine3
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
- Stable tag: 1.8.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -103,6 +103,9 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
103
 
104
  == Changelog ==
105
 
 
 
 
106
  = 1.8.7 (21 June 2019) =
107
 
108
  * Bug Fixed: Fatal error ( Uncaught Error: Cannot use object of type Closure as array ) #317
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 1.8.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
103
 
104
  == Changelog ==
105
 
106
+ = 1.8.8 (22 June 2019) =
107
+ * Bug Fixed: Uncaught Error: Class 'saswp_google_review' not found. #351
108
+
109
  = 1.8.7 (21 June 2019) =
110
 
111
  * Bug Fixed: Fatal error ( Uncaught Error: Cannot use object of type Closure as array ) #317
structured-data-for-wp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
4
  Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
5
- Version: 1.8.7
6
  Text Domain: schema-and-structured-data-for-wp
7
  Domain Path: /languages
8
  Author: Magazine3
@@ -13,7 +13,7 @@ License: GPL2
13
  // Exit if accessed directly.
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
16
- define('SASWP_VERSION', '1.8.7');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
4
  Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
5
+ Version: 1.8.8
6
  Text Domain: schema-and-structured-data-for-wp
7
  Domain Path: /languages
8
  Author: Magazine3
13
  // Exit if accessed directly.
14
  if ( ! defined( 'ABSPATH' ) ) exit;
15
 
16
+ define('SASWP_VERSION', '1.8.8');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));