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 | 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 +1 -1
- includes/integrations/thesis.php +1 -1
- includes/json/category.php +1 -1
- includes/json/knowledge-graph.php +63 -56
- includes/json/schema-output.php +1 -1
- includes/json/search-results.php +1 -1
- includes/json/tag.php +1 -1
- readme.txt +6 -2
- schema.php +2 -2
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 = '
|
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:
|
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' => '
|
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 |
-
$
|
61 |
|
62 |
-
if (
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
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"] = "
|
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": "
|
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' => '
|
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.
|
7 |
Requires PHP: 5.4
|
8 |
-
Stable tag: 1.7.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.
|
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.
|
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
|