Schema - Version 1.7.8.9

Version Description

  • Enhancement: Cache Knowledge Graph markup, reduced 3 database queries and enhanced performance.
  • Update: Pumped tested WordPress version to 5.7 release.
Download this release

Release Info

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

Code changes from version 1.7.8.8 to 1.7.8.9

includes/extensions/author.php CHANGED
@@ -140,7 +140,7 @@ function schema_wp_get_author_array( $post_id = null ) {
140
  function schema_wp_validate_gravatar( $email ) {
141
 
142
  $hashkey = md5(strtolower(trim($email)));
143
- $uri = 'http://www.gravatar.com/avatar/' . $hashkey;
144
  $data = get_transient($hashkey);
145
 
146
  if (false === $data) {
140
  function schema_wp_validate_gravatar( $email ) {
141
 
142
  $hashkey = md5(strtolower(trim($email)));
143
+ $uri = 'https://www.gravatar.com/avatar/' . $hashkey;
144
  $data = get_transient($hashkey);
145
 
146
  if (false === $data) {
includes/integrations/thesis.php CHANGED
@@ -3,7 +3,7 @@
3
  * Thesis Theme 2.x integration
4
  *
5
  *
6
- * plugin url: http://diythemes.com/
7
  * @since 1.4
8
  */
9
 
3
  * Thesis Theme 2.x integration
4
  *
5
  *
6
+ * plugin url: https://diythemes.com/
7
  * @since 1.4
8
  */
9
 
includes/json/category.php CHANGED
@@ -110,7 +110,7 @@ function schema_wp_get_category_json() {
110
 
111
  $json = array
112
  (
113
- '@context' => 'http://schema.org/',
114
  '@type' => 'CollectionPage',
115
  'headline' => $category_headline,
116
  'description' => strip_tags(category_description()),
110
 
111
  $json = array
112
  (
113
+ '@context' => 'https://schema.org/',
114
  '@type' => 'CollectionPage',
115
  'headline' => $category_headline,
116
  'description' => strip_tags(category_description()),
includes/json/knowledge-graph.php CHANGED
@@ -57,64 +57,71 @@ function schema_wp_output_knowledge_graph() {
57
  */
58
  function schema_wp_get_knowledge_graph_json() {
59
 
60
- $organization_or_person = schema_wp_get_option( 'organization_or_person' );
61
 
62
- if ( empty($organization_or_person) ) return;
63
-
64
- switch ( $organization_or_person ) {
65
- case "organization":
66
- $type = 'Organization';
67
- break;
68
- case "person":
69
- $type = 'Person';
70
- break;
71
- }
72
-
73
- $schema = array();
74
-
75
- $name = schema_wp_get_option( 'name' );
76
- $url = esc_attr( stripslashes( schema_wp_get_option( 'url' ) ) );
77
-
78
- if ( empty($name) || empty($url) ) return;
79
-
80
- $schema['@context'] = "http://schema.org";
81
- $schema['@type'] = $type;
82
- $schema['@id'] = $url . '#' . $organization_or_person;
83
-
84
- if ( !empty($name) ) $schema['name'] = $name;
85
- if ( !empty($url) ) $schema['url'] = $url;
86
-
87
- // Add logo
88
- // @since 1.7.7
89
- // Set logo only when type = Organization
90
- if ( $type == 'Organization' ) {
91
- $logo = esc_attr( stripslashes( schema_wp_get_option( 'logo' ) ) );
92
- if ( !empty($logo) ) {
93
- $logo_attachment_id = attachment_url_to_postid( $logo );
94
- // If the above function fails, we can use the commented one below:
95
- //$logo_attachment_id = schema_wp_get_attachment_id_from_url( $logo );
96
- if ( !empty($logo_attachment_id) ) {
97
- $schema['logo'] = schema_wp_get_image_object_by_attachment_id( $logo_attachment_id );
98
- $schema['logo']['@id'] = $url . '#logo';
99
- } else {
100
- // It's external, use image url only
101
- $schema['logo'] = $logo;
 
 
 
 
 
102
  }
103
- }
104
- }
105
-
106
- // Get corporate contacts types array
107
- $corporate_contacts_types = schema_wp_get_corporate_contacts_types_array();
108
- // Add contact
109
- if ( ! empty($corporate_contacts_types) ) {
110
- $schema["contactPoint"] = $corporate_contacts_types;
111
- }
112
-
113
- // Get social links array
114
- $social = schema_wp_get_social_array();
115
- // Add sameAs
116
- if ( ! empty($social) ) {
117
- $schema["sameAs"] = $social;
 
 
118
  }
119
 
120
  return apply_filters( 'schema_wp_knowledge_graph_json', $schema );
57
  */
58
  function schema_wp_get_knowledge_graph_json() {
59
 
60
+ $schema = get_transient( 'schema_knowledge_graph' );
61
 
62
+ if ( false === $schema ) {
63
+
64
+ $organization_or_person = schema_wp_get_option( 'organization_or_person' );
65
+
66
+ if ( empty($organization_or_person) ) return;
67
+
68
+ switch ( $organization_or_person ) {
69
+ case "organization":
70
+ $type = 'Organization';
71
+ break;
72
+ case "person":
73
+ $type = 'Person';
74
+ break;
75
+ }
76
+
77
+ $schema = array();
78
+
79
+ $name = schema_wp_get_option( 'name' );
80
+ $url = esc_attr( stripslashes( schema_wp_get_option( 'url' ) ) );
81
+
82
+ if ( empty($name) || empty($url) ) return;
83
+
84
+ $schema['@context'] = 'https://schema.org';
85
+ $schema['@type'] = $type;
86
+ $schema['@id'] = $url . '#' . $organization_or_person;
87
+
88
+ if ( !empty($name) ) $schema['name'] = $name;
89
+ if ( !empty($url) ) $schema['url'] = $url;
90
+
91
+ // Add logo
92
+ // @since 1.7.7
93
+ // Set logo only when type = Organization
94
+ if ( $type == 'Organization' ) {
95
+ $logo = esc_attr( stripslashes( schema_wp_get_option( 'logo' ) ) );
96
+ if ( !empty($logo) ) {
97
+ $logo_attachment_id = attachment_url_to_postid( $logo );
98
+ // If the above function fails, we can use the commented one below:
99
+ //$logo_attachment_id = schema_wp_get_attachment_id_from_url( $logo );
100
+ if ( !empty($logo_attachment_id) ) {
101
+ $schema['logo'] = schema_wp_get_image_object_by_attachment_id( $logo_attachment_id );
102
+ $schema['logo']['@id'] = $url . '#logo';
103
+ } else {
104
+ // It's external, use image url only
105
+ $schema['logo'] = $logo;
106
+ }
107
  }
108
+ }
109
+
110
+ // Get corporate contacts types array
111
+ $corporate_contacts_types = schema_wp_get_corporate_contacts_types_array();
112
+ // Add contact
113
+ if ( ! empty($corporate_contacts_types) ) {
114
+ $schema["contactPoint"] = $corporate_contacts_types;
115
+ }
116
+
117
+ // Get social links array
118
+ $social = schema_wp_get_social_array();
119
+ // Add sameAs
120
+ if ( ! empty($social) ) {
121
+ $schema["sameAs"] = $social;
122
+ }
123
+
124
+ set_transient( 'schema_knowledge_graph', $schema, 24 * HOUR_IN_SECONDS );
125
  }
126
 
127
  return apply_filters( 'schema_wp_knowledge_graph_json', $schema );
includes/json/schema-output.php CHANGED
@@ -170,7 +170,7 @@ function schema_wp_get_schema_json( $type ) {
170
  // @since 1.4
171
 
172
  // Stuff for any page
173
- $schema["@context"] = "http://schema.org/";
174
 
175
  $schema["@type"] = $type;
176
 
170
  // @since 1.4
171
 
172
  // Stuff for any page
173
+ $schema["@context"] = "https://schema.org/";
174
 
175
  $schema["@type"] = $type;
176
 
includes/json/search-results.php CHANGED
@@ -29,7 +29,7 @@ function schema_wp_output_sitelinks_search_box() {
29
 
30
  $output .= PHP_EOL . '<script type="application/ld+json">' . PHP_EOL;
31
  $output .= '{' . PHP_EOL;
32
- $output .= ' "@context": "http://schema.org",' . PHP_EOL;
33
  $output .= ' "@type": "WebSite",' . PHP_EOL;
34
  $output .= ' "@id": "#website",' . PHP_EOL;
35
 
29
 
30
  $output .= PHP_EOL . '<script type="application/ld+json">' . PHP_EOL;
31
  $output .= '{' . PHP_EOL;
32
+ $output .= ' "@context": "https://schema.org",' . PHP_EOL;
33
  $output .= ' "@type": "WebSite",' . PHP_EOL;
34
  $output .= ' "@id": "#website",' . PHP_EOL;
35
 
includes/json/tag.php CHANGED
@@ -86,7 +86,7 @@ function schema_wp_get_tag_json() {
86
 
87
  $json = array
88
  (
89
- '@context' => 'http://schema.org/',
90
  '@type' => "CollectionPage",
91
  'headline' => $tag_headline,
92
  'description' => strip_tags(tag_description()),
86
 
87
  $json = array
88
  (
89
+ '@context' => 'https://schema.org/',
90
  '@type' => "CollectionPage",
91
  'headline' => $tag_headline,
92
  'description' => strip_tags(tag_description()),
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.6.2
7
  Requires PHP: 5.4
8
- Stable tag: 1.7.8.8
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -223,6 +223,10 @@ Yes, Schema plugin will detect AMP plugin and output a more complete and valid s
223
 
224
  == Changelog ==
225
 
 
 
 
 
226
  = 1.7.8.8 =
227
  * Update: More clean backend and plugin settings.
228
  * Update: Pumped tested WordPress version to 5.6.2 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.7
7
  Requires PHP: 5.4
8
+ Stable tag: 1.7.8.9
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
223
 
224
  == Changelog ==
225
 
226
+ = 1.7.8.9 =
227
+ * Enhancement: Cache Knowledge Graph markup, reduced 3 database queries and enhanced performance.
228
+ * Update: Pumped tested WordPress version to 5.7 release.
229
+
230
  = 1.7.8.8 =
231
  * Update: More clean backend and plugin settings.
232
  * Update: Pumped tested WordPress version to 5.6.2 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.8
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.8';
56
 
57
  /**
58
  * The settings instance variable
5
  * Description: The next generation of Structured Data.
6
  * Author: Hesham
7
  * Author URI: http://zebida.com
8
+ * Version: 1.7.8.9
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.9';
56
 
57
  /**
58
  * The settings instance variable