Schema - Version 1.7.8.4

Version Description

  • Fixed: PHP notice when calling comments markup function.
  • Fixed: BlogPosting markup was missing post id parameter.
  • Fixed: Corrected admin notices CSS classes.
  • Update: Pumped tested WordPress version to 5.6 release.
  • Update: Modified readme.txt file.
Download this release

Release Info

Developer hishaman
Plugin Icon 128x128 Schema
Version 1.7.8.4
Comparing to
See all releases

Code changes from version 1.7.8.3 to 1.7.8.4

includes/admin/meta/class-meta.php CHANGED
@@ -61,7 +61,7 @@ function schema_wp_custom_meta_box_field( $field, $meta = null, $repeatable = nu
61
  break;
62
  // opening div
63
  case 'div_open':
64
- //echo '<span id="' . esc_attr( $id ) . '" class="toggle">'.__('Advanced', 'schema-wp').' <span class="dashicons dashicons-arrow-down-alt2"></span></span>';
65
  echo '</li></ul><span style="clear:both;display:block;"></span><div id="' . esc_attr( $id ) . '_wrap" class="toggle_div"><ul>';
66
  break;
67
  // closing div
61
  break;
62
  // opening div
63
  case 'div_open':
64
+ echo '<span id="' . esc_attr( $id ) . '" class="toggle">'.__('Advanced', 'schema-wp').' <span class="dashicons dashicons-arrow-down-alt2"></span></span>';
65
  echo '</li></ul><span style="clear:both;display:block;"></span><div id="' . esc_attr( $id ) . '_wrap" class="toggle_div"><ul>';
66
  break;
67
  // closing div
includes/extensions/comment.php CHANGED
@@ -10,34 +10,6 @@
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
 
13
-
14
- add_filter( 'schema_output', 'schema_wp_do_comments_number' );
15
- /**
16
- * Add comments number for Article types via schema_output filter
17
- *
18
- * @since 1.5.3
19
- * @return array
20
- */
21
- function schema_wp_do_comments_number( $schema ) {
22
-
23
- $comments_enable = schema_wp_get_option( 'comments_enable' );
24
-
25
- if ( $comments_enable != true )
26
- return $schema;
27
-
28
- global $post;
29
-
30
- $schema_type = $schema["@type"];
31
-
32
- $support_article_types = schema_wp_get_support_article_types();
33
-
34
- if ( in_array( $schema_type, $support_article_types, false) )
35
- $schema["commentCount"] = get_comments_number($post->ID);
36
-
37
- return $schema;
38
- }
39
-
40
-
41
  add_filter( 'schema_output', 'schema_wp_do_comment' );
42
  /**
43
  * Add Schema Comment for Article types via schema_output filter
@@ -47,6 +19,9 @@ add_filter( 'schema_output', 'schema_wp_do_comment' );
47
  */
48
  function schema_wp_do_comment( $schema ) {
49
 
 
 
 
50
  $comments_enable = schema_wp_get_option( 'comments_enable' );
51
 
52
  if ( $comments_enable != true )
@@ -58,11 +33,18 @@ function schema_wp_do_comment( $schema ) {
58
  $support_article_types = schema_wp_get_support_article_types();
59
  $number = apply_filters( 'schema_wp_do_comment_number', '10'); // default = 10
60
 
61
- if ( in_array( $schema_type, $support_article_types, true) ) {
 
 
62
  $Comments = schema_wp_get_comments();
63
- if ( !empty($Comments) )
64
  $schema["comment"] = $Comments;
65
  }
 
 
 
 
 
66
 
67
  return $schema;
68
  }
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  add_filter( 'schema_output', 'schema_wp_do_comment' );
14
  /**
15
  * Add Schema Comment for Article types via schema_output filter
19
  */
20
  function schema_wp_do_comment( $schema ) {
21
 
22
+ if ( empty($schema) )
23
+ return;
24
+
25
  $comments_enable = schema_wp_get_option( 'comments_enable' );
26
 
27
  if ( $comments_enable != true )
33
  $support_article_types = schema_wp_get_support_article_types();
34
  $number = apply_filters( 'schema_wp_do_comment_number', '10'); // default = 10
35
 
36
+ // Add comments
37
+ //
38
+ if ( in_array( $schema_type, $support_article_types, true ) ) {
39
  $Comments = schema_wp_get_comments();
40
+ if ( ! empty($Comments) )
41
  $schema["comment"] = $Comments;
42
  }
43
+
44
+ // Add comments number
45
+ //
46
+ if ( in_array( $schema_type, $support_article_types, false ) )
47
+ $schema["commentCount"] = get_comments_number($post->ID);
48
 
49
  return $schema;
50
  }
includes/json/blog.php CHANGED
@@ -83,19 +83,19 @@ function schema_wp_get_blog_json( $type ) {
83
  $blogPost[] = apply_filters( 'schema_output_blog_post', array
84
  (
85
  '@type' => 'BlogPosting',
86
- 'headline' => wp_filter_nohtml_kses( get_the_title() ),
87
  'description' => schema_wp_get_description($schema_post->ID),
88
- 'url' => get_the_permalink(),
89
  'sameAs' => schema_wp_get_sameAs($schema_post->ID),
90
- 'datePublished' => get_the_date('c'),
91
- 'dateModified' => get_the_modified_date('c'),
92
- 'mainEntityOfPage' => get_the_permalink(),
93
  'author' => schema_wp_get_author_array(),
94
  'publisher' => schema_wp_get_publisher_array(),
95
  'image' => schema_wp_get_media($schema_post->ID),
96
  'keywords' => schema_wp_get_post_tags($schema_post->ID),
97
- 'commentCount' => get_comments_number(),
98
- 'comment' => schema_wp_get_comments(),
99
  ));
100
  }
101
  }
83
  $blogPost[] = apply_filters( 'schema_output_blog_post', array
84
  (
85
  '@type' => 'BlogPosting',
86
+ 'headline' => wp_filter_nohtml_kses( get_the_title($schema_post->ID) ),
87
  'description' => schema_wp_get_description($schema_post->ID),
88
+ 'url' => get_the_permalink($schema_post->ID),
89
  'sameAs' => schema_wp_get_sameAs($schema_post->ID),
90
+ 'datePublished' => get_the_date('c', $schema_post->ID),
91
+ 'dateModified' => get_the_modified_date('c', $schema_post->ID),
92
+ 'mainEntityOfPage' => get_the_permalink($schema_post->ID),
93
  'author' => schema_wp_get_author_array(),
94
  'publisher' => schema_wp_get_publisher_array(),
95
  'image' => schema_wp_get_media($schema_post->ID),
96
  'keywords' => schema_wp_get_post_tags($schema_post->ID),
97
+ 'commentCount' => get_comments_number($schema_post->ID),
98
+ 'comment' => schema_wp_get_comments($schema_post->ID),
99
  ));
100
  }
101
  }
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: hishaman, schemapress
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NGVUBT2QXN7YL
4
  Tags: schema, schema.org, rich snippets, structured data, json-ld, json, google, seo, markup, search engine, search, breadcrumbs, social, post, page, plugin, wordpress, content, article, news, search results, site name, knowledge graph, social, social profiles, keywords, meta-tags, metadata, tags, categories, optimize, ranking, search engine optimization, search engines, serp, sitelinks, google sitelinks, sitelinks search box, google sitelinks search box, semantic, structured, canonical, custom post types, post type, title, terms, media, images, thumb, featured, url, video, video markup, video object, VideoObject, video schema, audio object, AudioObject, audio schema, audio, sameAs, about, contact, amp, mobile, taxonomy
5
  Requires at least: 4.0
6
- Tested up to: 5.5.1
7
  Requires PHP: 5.4
8
- Stable tag: 1.7.8.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -146,7 +146,7 @@ The plugin should work fine with any well coded WordPress theme, however these t
146
 
147
  schema.press team does not always provide active support for the Schema plugin on the WordPress.org forums, as we prioritize our email support. One-on-one email support is available to people who [bought Schema Premium](https://schema.press/pricing/) only.
148
 
149
- Note that the [Schema Premium](https://schema.press/downloads/schema-premium/) also has several extra [features](https://schema.press/features/) too, including the option to enable more schema.org types, set content location target for markup, and map schema.org properties, so it is well worth your investment!
150
 
151
  ### Developers?
152
 
@@ -223,6 +223,13 @@ Yes, Schema plugin will detect AMP plugin and output a more complete and valid s
223
 
224
  == Changelog ==
225
 
 
 
 
 
 
 
 
226
  = 1.7.8.3 =
227
  * Fixed: Query warnings due to changes in WordPress 5.5
228
  * Update: Pumped tested WordPress version to 5.5.1 release.
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NGVUBT2QXN7YL
4
  Tags: schema, schema.org, rich snippets, structured data, json-ld, json, google, seo, markup, search engine, search, breadcrumbs, social, post, page, plugin, wordpress, content, article, news, search results, site name, knowledge graph, social, social profiles, keywords, meta-tags, metadata, tags, categories, optimize, ranking, search engine optimization, search engines, serp, sitelinks, google sitelinks, sitelinks search box, google sitelinks search box, semantic, structured, canonical, custom post types, post type, title, terms, media, images, thumb, featured, url, video, video markup, video object, VideoObject, video schema, audio object, AudioObject, audio schema, audio, sameAs, about, contact, amp, mobile, taxonomy
5
  Requires at least: 4.0
6
+ Tested up to: 5.6
7
  Requires PHP: 5.4
8
+ Stable tag: 1.7.8.4
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
146
 
147
  schema.press team does not always provide active support for the Schema plugin on the WordPress.org forums, as we prioritize our email support. One-on-one email support is available to people who [bought Schema Premium](https://schema.press/pricing/) only.
148
 
149
+ Note that the premium [Schema Plugin](https://schema.press/downloads/schema-premium/) also has several extra [features](https://schema.press/features/) too, including the option to enable more schema.org types, set content location target for markup, and map schema.org properties, so it is well worth your investment!
150
 
151
  ### Developers?
152
 
223
 
224
  == Changelog ==
225
 
226
+ = 1.7.8.4 =
227
+ * Fixed: PHP notice when calling comments markup function.
228
+ * Fixed: BlogPosting markup was missing post id parameter.
229
+ * Fixed: Corrected admin notices CSS classes.
230
+ * Update: Pumped tested WordPress version to 5.6 release.
231
+ * Update: Modified readme.txt file.
232
+
233
  = 1.7.8.3 =
234
  * Fixed: Query warnings due to changes in WordPress 5.5
235
  * Update: Pumped tested WordPress version to 5.5.1 release.
schema.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The next generation of Structured Data.
6
  * Author: Hesham
7
  * Author URI: http://zebida.com
8
- * Version: 1.7.8.3
9
  * Text Domain: schema-wp
10
  * Domain Path: /languages
11
  * License: GPLv2 or later
@@ -52,7 +52,7 @@ final class Schema_WP {
52
  *
53
  * @since 1.0
54
  */
55
- private $version = '1.7.8.3';
56
 
57
  /**
58
  * The settings instance variable
@@ -146,7 +146,7 @@ final class Schema_WP {
146
  * @return void
147
  */
148
  public function below_php_version_notice() {
149
- echo '<div class="error"><p>' . __( 'Your version of PHP is below the minimum version of PHP required by Schema plugin. Please contact your host and request that your version be upgraded to 5.4 or later.', 'schema-wp' ) . '</p></div>';
150
  }
151
 
152
  /**
5
  * Description: The next generation of Structured Data.
6
  * Author: Hesham
7
  * Author URI: http://zebida.com
8
+ * Version: 1.7.8.4
9
  * Text Domain: schema-wp
10
  * Domain Path: /languages
11
  * License: GPLv2 or later
52
  *
53
  * @since 1.0
54
  */
55
+ private $version = '1.7.8.4';
56
 
57
  /**
58
  * The settings instance variable
146
  * @return void
147
  */
148
  public function below_php_version_notice() {
149
+ echo '<div class="notice notice-error"><p>' . __( 'Your version of PHP is below the minimum version of PHP required by Schema plugin. Please contact your host and request that your version be upgraded to 5.4 or later.', 'schema-wp' ) . '</p></div>';
150
  }
151
 
152
  /**