Schema & Structured Data for WP & AMP - Version 1.9.102.1

Version Description

(14 Oct 2022) =

  • Fixed: Video object schema is automatically adding without even have videos in them #1754
Download this release

Release Info

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

Code changes from version 1.9.102 to 1.9.102.1

Files changed (3) hide show
  1. output/function.php +83 -82
  2. readme.txt +5 -2
  3. structured-data-for-wp.php +2 -2
output/function.php CHANGED
@@ -3384,99 +3384,100 @@ function saswp_render_breadcrumbs_html($atts){
3384
  function saswp_default_video_object_scjhema(){
3385
 
3386
  $input1 = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3387
 
3388
- $Conditionals = saswp_get_all_schema_posts();
3389
- $countVideoObjSchema = [];
3390
- if(!empty($Conditionals)){
3391
- foreach($Conditionals as $schemaConditionals){
3392
- if($schemaConditionals['schema_type'] == 'VideoObject'){
3393
- $countVideoObjSchema[] = $schemaConditionals['schema_type'];
3394
- }
3395
- }
3396
- if(count( $countVideoObjSchema) > 0){
3397
- return $input1;
3398
- }
3399
- }
3400
-
3401
- $video_links = saswp_get_video_metadata();
3402
- $input1['@context'] = saswp_context_url();
3403
- $description = saswp_get_the_excerpt();
 
 
 
 
 
 
 
 
 
 
 
 
3404
 
3405
- if(!$description){
3406
- $description = get_bloginfo('description');
3407
- }
3408
- $date = get_the_date("c");
3409
- $modified_date = get_the_modified_date("c");
3410
-
3411
- if(count($video_links) > 1){
3412
- $input1['@type'] = "ItemList";
3413
 
3414
- foreach($video_links as $vkey => $v_val){
3415
- $vnewarr = array(
3416
- '@type' => 'VideoObject',
3417
- "position" => $vkey+1,
3418
- 'name' => isset($v_val['title'])? $v_val['title'] : saswp_get_the_title(),
3419
- 'datePublished' => esc_html($date),
3420
- 'dateModified' => esc_html($modified_date),
3421
- 'url' => trailingslashit(saswp_get_permalink()),
3422
- 'interactionStatistic' => array(
3423
- "@type" => "InteractionCounter",
3424
- "interactionType" => array("@type" => "WatchAction" ),
3425
- "userInteractionCount" => isset($v_val['viewCount'])? $v_val['viewCount'] : '0',
3426
- ),
3427
- 'thumbnailUrl' => isset($v_val['thumbnail_url'])? $v_val['thumbnail_url'] : saswp_get_thumbnail(),
3428
- 'author' => saswp_get_author_details(),
3429
- );
3430
 
3431
- if(isset($v_val['uploadDate'])){
3432
- $vnewarr['uploadDate'] = $v_val['uploadDate'];
3433
- }
3434
 
3435
- if(isset($v_val['duration'])){
3436
- $vnewarr['duration'] = $v_val['duration'];
3437
- }
3438
 
3439
- if(isset($v_val['video_url'])){
3440
- $vnewarr['contentUrl'] = saswp_validate_url($v_val['video_url']);
 
 
 
3441
  }
3442
-
3443
- if(isset($v_val['video_url'])){
3444
- $vnewarr['embedUrl'] = saswp_validate_url($v_val['video_url']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3445
  }
3446
-
3447
- if(isset($v_val['description'])){
3448
- $vnewarr['description'] = $v_val['description'];
 
 
3449
  }
3450
-
3451
- $input1['itemListElement'][] = $vnewarr;
3452
- }
3453
- }else{
3454
- $input1 = array(
3455
- '@context' => saswp_context_url(),
3456
- '@type' => 'VideoObject',
3457
- '@id' => trailingslashit(saswp_get_permalink()).'#videoobject',
3458
- 'url' => trailingslashit(saswp_get_permalink()),
3459
- 'headline' => saswp_get_the_title(),
3460
- 'datePublished' => esc_html($date),
3461
- 'dateModified' => esc_html($modified_date),
3462
- 'description' => $description,
3463
- 'transcript' => saswp_get_the_content(),
3464
- 'name' => saswp_get_the_title(),
3465
- 'uploadDate' => esc_html($date),
3466
- 'thumbnailUrl' => isset($video_links[0]['thumbnail_url'])? $video_links[0]['thumbnail_url'] : saswp_get_thumbnail(),
3467
- 'author' => saswp_get_author_details()
3468
- );
3469
 
3470
- if(isset($video_links[0]['duration'])){
3471
- $input1['duration'] = $video_links[0]['duration'];
3472
  }
3473
- if(isset($video_links[0]['video_url'])){
3474
-
3475
- $input1['contentUrl'] = saswp_validate_url($video_links[0]['video_url']);
3476
- $input1['embedUrl'] = saswp_validate_url($video_links[0]['video_url']);
3477
-
3478
- }
3479
-
3480
  }
3481
  return $input1;
3482
  }
3384
  function saswp_default_video_object_scjhema(){
3385
 
3386
  $input1 = array();
3387
+ $video_links = saswp_get_video_metadata();
3388
+ if(!empty($video_links)){
3389
+ $Conditionals = saswp_get_all_schema_posts();
3390
+ $countVideoObjSchema = [];
3391
+ if(!empty($Conditionals)){
3392
+ foreach($Conditionals as $schemaConditionals){
3393
+ if($schemaConditionals['schema_type'] == 'VideoObject'){
3394
+ $countVideoObjSchema[] = $schemaConditionals['schema_type'];
3395
+ }
3396
+ }
3397
+ if(count( $countVideoObjSchema) > 0){
3398
+ return $input1;
3399
+ }
3400
+ }
3401
 
3402
+ $input1['@context'] = saswp_context_url();
3403
+ $description = saswp_get_the_excerpt();
3404
+
3405
+ if(!$description){
3406
+ $description = get_bloginfo('description');
3407
+ }
3408
+ $date = get_the_date("c");
3409
+ $modified_date = get_the_modified_date("c");
3410
+
3411
+ if(count($video_links) > 1){
3412
+ $input1['@type'] = "ItemList";
3413
+
3414
+ foreach($video_links as $vkey => $v_val){
3415
+ $vnewarr = array(
3416
+ '@type' => 'VideoObject',
3417
+ "position" => $vkey+1,
3418
+ 'name' => isset($v_val['title'])? $v_val['title'] : saswp_get_the_title(),
3419
+ 'datePublished' => esc_html($date),
3420
+ 'dateModified' => esc_html($modified_date),
3421
+ 'url' => trailingslashit(saswp_get_permalink()),
3422
+ 'interactionStatistic' => array(
3423
+ "@type" => "InteractionCounter",
3424
+ "interactionType" => array("@type" => "WatchAction" ),
3425
+ "userInteractionCount" => isset($v_val['viewCount'])? $v_val['viewCount'] : '0',
3426
+ ),
3427
+ 'thumbnailUrl' => isset($v_val['thumbnail_url'])? $v_val['thumbnail_url'] : saswp_get_thumbnail(),
3428
+ 'author' => saswp_get_author_details(),
3429
+ );
3430
 
3431
+ if(isset($v_val['uploadDate'])){
3432
+ $vnewarr['uploadDate'] = $v_val['uploadDate'];
3433
+ }
 
 
 
 
 
3434
 
3435
+ if(isset($v_val['duration'])){
3436
+ $vnewarr['duration'] = $v_val['duration'];
3437
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
3438
 
3439
+ if(isset($v_val['video_url'])){
3440
+ $vnewarr['contentUrl'] = saswp_validate_url($v_val['video_url']);
3441
+ }
3442
 
3443
+ if(isset($v_val['video_url'])){
3444
+ $vnewarr['embedUrl'] = saswp_validate_url($v_val['video_url']);
3445
+ }
3446
 
3447
+ if(isset($v_val['description'])){
3448
+ $vnewarr['description'] = $v_val['description'];
3449
+ }
3450
+
3451
+ $input1['itemListElement'][] = $vnewarr;
3452
  }
3453
+ }else{
3454
+ $input1 = array(
3455
+ '@context' => saswp_context_url(),
3456
+ '@type' => 'VideoObject',
3457
+ '@id' => trailingslashit(saswp_get_permalink()).'#videoobject',
3458
+ 'url' => trailingslashit(saswp_get_permalink()),
3459
+ 'headline' => saswp_get_the_title(),
3460
+ 'datePublished' => esc_html($date),
3461
+ 'dateModified' => esc_html($modified_date),
3462
+ 'description' => $description,
3463
+ 'transcript' => saswp_get_the_content(),
3464
+ 'name' => saswp_get_the_title(),
3465
+ 'uploadDate' => esc_html($date),
3466
+ 'thumbnailUrl' => isset($video_links[0]['thumbnail_url'])? $video_links[0]['thumbnail_url'] : saswp_get_thumbnail(),
3467
+ 'author' => saswp_get_author_details()
3468
+ );
3469
+
3470
+ if(isset($video_links[0]['duration'])){
3471
+ $input1['duration'] = $video_links[0]['duration'];
3472
  }
3473
+ if(isset($video_links[0]['video_url'])){
3474
+
3475
+ $input1['contentUrl'] = saswp_validate_url($video_links[0]['video_url']);
3476
+ $input1['embedUrl'] = saswp_validate_url($video_links[0]['video_url']);
3477
+
3478
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3479
 
 
 
3480
  }
 
 
 
 
 
 
 
3481
  }
3482
  return $input1;
3483
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO,
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6.20
7
- Stable tag: 1.9.102
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -121,9 +121,12 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
121
 
122
  == Changelog ==
123
 
 
 
 
 
124
  = 1.9.102 (13 Oct 2022) =
125
 
126
- * Fixed: Video object schema issues in GSC after the update #1750
127
  * Fixed: While activating the Schema plugin, there is a fatal error #1751
128
  * Fixed: load more shouldn't be there in zero null condition #1736
129
  * Added: Need to change the word Json-LD from Video Object Schema. #1741
4
  Requires at least: 3.0
5
  Tested up to: 6.0
6
  Requires PHP: 5.6.20
7
+ Stable tag: 1.9.102.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
121
 
122
  == Changelog ==
123
 
124
+ = 1.9.102.1 (14 Oct 2022) =
125
+
126
+ * Fixed: Video object schema is automatically adding without even have videos in them #1754
127
+
128
  = 1.9.102 (13 Oct 2022) =
129
 
 
130
  * Fixed: While activating the Schema plugin, there is a fatal error #1751
131
  * Fixed: load more shouldn't be there in zero null condition #1736
132
  * Added: Need to change the word Json-LD from Video Object Schema. #1741
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.102
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.102');
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.102.1
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.102.1');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));