Schema & Structured Data for WP & AMP - Version 1.9.40

Version Description

(09 June 2020) =

  • Added: Possible Treatment, Primary prevention and Drug properties to MedicalCondition schema type #880
  • Fixed: When images are coming from CDN links those images are not getting enlarge by acqua resizer #763
  • Fixed: If the archive option is enabled in the schema setup then the thumbnail images are not showing in the blog page #1031
Download this release

Release Info

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

Code changes from version 1.9.39 to 1.9.40

admin_section/js/saswp-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(t){jQuery("#saswp-comment-rating-div").rateYo({rating:1,fullStar:!0,onSet:function(n,e){t(this).next().val(n)}})});
1
+ jQuery(document).ready(function(t){jQuery("#saswp-comment-rating-div").rateYo({rating:5,fullStar:!0,onSet:function(n,e){t(this).next().val(n)}})});
core/3rd-party/aqua_resizer.php CHANGED
@@ -308,15 +308,27 @@ if(!function_exists('saswp_aq_resize')) {
308
  }
309
  /* Jetpack Compatible*/
310
  elseif( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
311
- $args = array(
312
- 'resize' => "$width,$height"
313
- );
314
- $image = array (
315
- 0 => jetpack_photon_url( $url, $args ),
316
- 1 => $width,
317
- 2 => $height
318
- );
319
- return $image;
 
 
 
 
 
 
 
 
 
 
 
 
320
  }
321
  elseif( function_exists('fifu_activate') || is_plugin_active('fifu-premium/fifu-premium.php') ){
322
  return fifu_amp_url($url, $width, $height);
308
  }
309
  /* Jetpack Compatible*/
310
  elseif( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
311
+
312
+ $uploads_dir = wp_upload_dir();
313
+ $baseurl = $uploads_dir['baseurl'];
314
+
315
+ if($url && strpos($url, 'uploads')!== false){
316
+
317
+ $divideurl = explode('uploads', $url);
318
+ $url = $baseurl.$divideurl[1];
319
+
320
+ if(strpos($url, '?')!== false){
321
+
322
+ $url = explode('?', $url);
323
+ $url = $url[0];
324
+
325
+ }
326
+
327
+ $aq_resize = Aq_Resize::getInstance();
328
+ return $aq_resize->process( $url, $width, $height, $crop, $single, $upscale );
329
+
330
+ }
331
+
332
  }
333
  elseif( function_exists('fifu_activate') || is_plugin_active('fifu-premium/fifu-premium.php') ){
334
  return fifu_amp_url($url, $width, $height);
core/array-list/schema-properties.php CHANGED
@@ -2670,7 +2670,35 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
2670
  'id' => 'saswp_mc_schema_diagnosis_name_'.$schema_id,
2671
  'type' => 'text',
2672
 
2673
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2674
  );
2675
  break;
2676
 
2670
  'id' => 'saswp_mc_schema_diagnosis_name_'.$schema_id,
2671
  'type' => 'text',
2672
 
2673
+ ),
2674
+ array(
2675
+ 'label' => 'Drug',
2676
+ 'id' => 'saswp_mc_schema_drug_'.$schema_id,
2677
+ 'type' => 'text',
2678
+
2679
+ ),
2680
+ array(
2681
+ 'label' => 'Primary Prevention Name',
2682
+ 'id' => 'saswp_mc_schema_primary_prevention_name_'.$schema_id,
2683
+ 'type' => 'text',
2684
+
2685
+ ),
2686
+ array(
2687
+ 'label' => 'Primary Prevention Performed',
2688
+ 'id' => 'saswp_mc_schema_primary_prevention_performed_'.$schema_id,
2689
+ 'type' => 'textarea',
2690
+ ),
2691
+ array(
2692
+ 'label' => 'Possible Treatment Name',
2693
+ 'id' => 'saswp_mc_schema_possible_treatment_name_'.$schema_id,
2694
+ 'type' => 'text',
2695
+
2696
+ ),
2697
+ array(
2698
+ 'label' => 'Possible Treatment Performed',
2699
+ 'id' => 'saswp_mc_schema_possible_treatment_performed_'.$schema_id,
2700
+ 'type' => 'textarea',
2701
+ )
2702
  );
2703
  break;
2704
 
output/markup.php CHANGED
@@ -2256,6 +2256,22 @@ function saswp_medical_condition_schema_markup($schema_id, $schema_post_id, $all
2256
 
2257
  }
2258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2259
  $input1['associatedAnatomy']['@type'] = 'AnatomicalStructure';
2260
  $input1['associatedAnatomy']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_mc_schema_anatomy_name_'.$schema_id, 'saswp_array');
2261
 
2256
 
2257
  }
2258
 
2259
+ if( isset($all_post_meta['saswp_mc_schema_drug_'.$schema_id][0]) ){
2260
+ $input1['drug'] = $all_post_meta['saswp_mc_schema_drug_'.$schema_id][0];
2261
+ }
2262
+
2263
+ if( isset($all_post_meta['saswp_mc_schema_primary_prevention_name_'.$schema_id][0]) || isset($all_post_meta['saswp_mc_schema_primary_prevention_performed_'.$schema_id][0]) ){
2264
+ $input1['primaryPrevention']['@type'] = 'MedicalTherapy';
2265
+ $input1['primaryPrevention']['name'] = $all_post_meta['saswp_mc_schema_primary_prevention_name_'.$schema_id][0];
2266
+ $input1['primaryPrevention']['howPerformed'] = $all_post_meta['saswp_mc_schema_primary_prevention_performed_'.$schema_id][0];
2267
+ }
2268
+
2269
+ if( isset($all_post_meta['saswp_mc_schema_possible_treatment_name_'.$schema_id][0]) || isset($all_post_meta['saswp_mc_schema_possible_treatment_performed_'.$schema_id][0]) ){
2270
+ $input1['possibleTreatment']['@type'] = 'MedicalTherapy';
2271
+ $input1['possibleTreatment']['name'] = $all_post_meta['saswp_mc_schema_possible_treatment_name_'.$schema_id][0];
2272
+ $input1['possibleTreatment']['howPerformed'] = $all_post_meta['saswp_mc_schema_possible_treatment_performed_'.$schema_id][0];
2273
+ }
2274
+
2275
  $input1['associatedAnatomy']['@type'] = 'AnatomicalStructure';
2276
  $input1['associatedAnatomy']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_mc_schema_anatomy_name_'.$schema_id, 'saswp_array');
2277
 
output/output.php CHANGED
@@ -2143,7 +2143,7 @@ function saswp_woocommerce_shop_page(){
2143
  */
2144
  function saswp_archive_output(){
2145
 
2146
- global $query_string, $sd_data;
2147
 
2148
  $output = array();
2149
  $category_posts = array();
@@ -2221,9 +2221,21 @@ function saswp_archive_output(){
2221
 
2222
  if( $homepage ){
2223
 
 
 
 
 
 
 
 
 
 
 
 
 
2224
  $i = 1;
2225
- if ( have_posts() ):
2226
- while( have_posts() ): the_post();
2227
 
2228
  $result = saswp_get_loop_markup($i);
2229
  $category_posts[] = $result['schema_properties'];
@@ -2231,7 +2243,7 @@ function saswp_archive_output(){
2231
 
2232
  $i++;
2233
  endwhile;
2234
- endif;
2235
  wp_reset_postdata();
2236
 
2237
  if($category_posts){
2143
  */
2144
  function saswp_archive_output(){
2145
 
2146
+ global $query_string, $sd_data, $wp_query;
2147
 
2148
  $output = array();
2149
  $category_posts = array();
2221
 
2222
  if( $homepage ){
2223
 
2224
+ $home_query_string = array(
2225
+ 'posts_per_page' => 10
2226
+ );
2227
+
2228
+ if($wp_query->query_vars['posts_per_page']){
2229
+ $home_query_string = array(
2230
+ 'posts_per_page' => $wp_query->query_vars['posts_per_page']
2231
+ );
2232
+ }
2233
+
2234
+ $homepage_loop = new WP_Query( $home_query_string );
2235
+
2236
  $i = 1;
2237
+ if ( $homepage_loop->have_posts() ):
2238
+ while( $homepage_loop->have_posts() ): $homepage_loop->the_post();
2239
 
2240
  $result = saswp_get_loop_markup($i);
2241
  $category_posts[] = $result['schema_properties'];
2243
 
2244
  $i++;
2245
  endwhile;
2246
+ endif;
2247
  wp_reset_postdata();
2248
 
2249
  if($category_posts){
output/service.php CHANGED
@@ -2665,6 +2665,17 @@ Class saswp_output_service{
2665
  }
2666
  if(isset($custom_fields['saswp_mc_schema_coding_system'])){
2667
  $input1['code']['codingSystem'] = $custom_fields['saswp_mc_schema_coding_system'];
 
 
 
 
 
 
 
 
 
 
 
2668
  }
2669
 
2670
  break;
2665
  }
2666
  if(isset($custom_fields['saswp_mc_schema_coding_system'])){
2667
  $input1['code']['codingSystem'] = $custom_fields['saswp_mc_schema_coding_system'];
2668
+ }
2669
+ if(isset($custom_fields['saswp_mc_schema_drug'])){
2670
+ $input1['drug'] = $custom_fields['saswp_mc_schema_drug'];
2671
+ }
2672
+ if( isset($custom_fields['saswp_mc_schema_possible_treatment_name']) || isset($custom_fields['saswp_mc_schema_possible_treatment_performed']) ){
2673
+ $input1['possibleTreatment']['name'] = $custom_fields['saswp_mc_schema_possible_treatment_name'];
2674
+ $input1['possibleTreatment']['howPerformed'] = $custom_fields['saswp_mc_schema_possible_treatment_performed'];
2675
+ }
2676
+ if( isset($custom_fields['saswp_mc_schema_primary_prevention_name']) || isset($custom_fields['saswp_mc_schema_primary_prevention_performed']) ){
2677
+ $input1['primaryPrevention']['name'] = $custom_fields['saswp_mc_schema_primary_prevention_name'];
2678
+ $input1['primaryPrevention']['howPerformed'] = $custom_fields['saswp_mc_schema_primary_prevention_performed'];
2679
  }
2680
 
2681
  break;
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.4
6
- Stable tag: 1.9.39
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -120,6 +120,12 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
120
 
121
  == Changelog ==
122
 
 
 
 
 
 
 
123
  = 1.9.39 (04 June 2020) =
124
 
125
  * Fixed: Placement: Post type equal to page should not apply to custom front page #1038
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.4
6
+ Stable tag: 1.9.40
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
120
 
121
  == Changelog ==
122
 
123
+ = 1.9.40 (09 June 2020) =
124
+
125
+ * Added: Possible Treatment, Primary prevention and Drug properties to MedicalCondition schema type #880
126
+ * Fixed: When images are coming from CDN links those images are not getting enlarge by acqua resizer #763
127
+ * Fixed: If the archive option is enabled in the schema setup then the thumbnail images are not showing in the blog page #1031
128
+
129
  = 1.9.39 (04 June 2020) =
130
 
131
  * Fixed: Placement: Post type equal to page should not apply to custom front page #1038
structured-data-for-wp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Schema & Structured Data for WP & AMP
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.9.39
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.9.39');
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 & AMP
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.9.40
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.9.40');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));