WP SEO Structured Data Schema - Version 2.5.5

Version Description

  • Add Site schema control
  • Fix Site schema search link

=

Download this release

Release Info

Developer kcseopro
Plugin Icon 128x128 WP SEO Structured Data Schema
Version 2.5.5
Comparing to
See all releases

Code changes from version 2.5.4 to 2.5.5

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: seo, schema, structured data, rich snippets, microdata, json-ld, search engine optimization, local seo, google, sitelinks, schema.org, microformat, serp
5
  Requires at least: 4.5
6
  Tested up to: 5.0
7
- Stable tag: 2.5.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -120,6 +120,10 @@ You'll find the [FAQ on Kcseopro.com](https://wpsemplugins.com/).
120
 
121
  == Changelog ==
122
 
 
 
 
 
123
  == 2.5.4 =
124
  * Add a Hack
125
 
4
  Tags: seo, schema, structured data, rich snippets, microdata, json-ld, search engine optimization, local seo, google, sitelinks, schema.org, microformat, serp
5
  Requires at least: 4.5
6
  Tested up to: 5.0
7
+ Stable tag: 2.5.5
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
120
 
121
  == Changelog ==
122
 
123
+ == 2.5.5 =
124
+ * Add Site schema control
125
+ * Fix Site schema search link
126
+
127
  == 2.5.4 =
128
  * Add a Hack
129
 
languages/wp-seo-structured-data-schema.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2018 WP SEO Structured Data Schema
2
  # This file is distributed under the same license as the WP SEO Structured Data Schema package.
3
  msgid ""
4
  msgstr ""
@@ -928,26 +928,34 @@ msgid "Available language"
928
  msgstr ""
929
 
930
  #: ../lib/views/schema-options.php:518
931
- msgid "Site Name in Search Results"
932
  msgstr ""
933
 
934
  #: ../lib/views/schema-options.php:521
935
- msgid "Enable Site link Search Box"
936
  msgstr ""
937
 
938
  #: ../lib/views/schema-options.php:529
 
 
 
 
 
 
 
 
939
  msgid "Site Name:"
940
  msgstr ""
941
 
942
- #: ../lib/views/schema-options.php:536
943
  msgid "Site Alternative Name:"
944
  msgstr ""
945
 
946
- #: ../lib/views/schema-options.php:543
947
  msgid "Site Url:"
948
  msgstr ""
949
 
950
- #: ../lib/views/schema-options.php:551, ../lib/views/settings.php:105
951
  msgid "Save Changes"
952
  msgstr ""
953
 
1
+ # Copyright (C) 2019 WP SEO Structured Data Schema
2
  # This file is distributed under the same license as the WP SEO Structured Data Schema package.
3
  msgid ""
4
  msgstr ""
928
  msgstr ""
929
 
930
  #: ../lib/views/schema-options.php:518
931
+ msgid "Site Schema"
932
  msgstr ""
933
 
934
  #: ../lib/views/schema-options.php:521
935
+ msgid "Disable Site Schema"
936
  msgstr ""
937
 
938
  #: ../lib/views/schema-options.php:529
939
+ msgid "Enable Site link Search Box"
940
+ msgstr ""
941
+
942
+ #: ../lib/views/schema-options.php:534
943
+ msgid "Note: Preferred Name markup may no longer be supported by Google"
944
+ msgstr ""
945
+
946
+ #: ../lib/views/schema-options.php:538
947
  msgid "Site Name:"
948
  msgstr ""
949
 
950
+ #: ../lib/views/schema-options.php:545
951
  msgid "Site Alternative Name:"
952
  msgstr ""
953
 
954
+ #: ../lib/views/schema-options.php:552
955
  msgid "Site Url:"
956
  msgstr ""
957
 
958
+ #: ../lib/views/schema-options.php:560, ../lib/views/settings.php:105
959
  msgid "Save Changes"
960
  msgstr ""
961
 
lib/classes/KcSeoOutput.php CHANGED
@@ -63,30 +63,31 @@ if (!class_exists('KcSeoOutput')):
63
  $schemaModel = new KcSeoSchemaModel;
64
  $html = null;
65
  $settings = get_option($KcSeoWPSchema->options['settings']);
66
- if (is_home() || is_front_page()) {
67
- $metaData = array();
 
68
 
69
- $metaData["@context"] = "http://schema.org/";
70
- $metaData["@type"] = "WebSite";
71
-
72
- if (!empty($settings['homeonly']) && $settings['homeonly']) {
73
  $author_url = (!empty($settings['siteurl']) ? $settings['siteurl'] : get_home_url());
74
  $to_remove = array('http://', 'https://', 'www.');
75
  foreach ($to_remove as $item) {
76
  $author_url = str_replace($item, '', $author_url); // to: www.example.com
77
  }
78
- $metaData["url"] = $KcSeoWPSchema->sanitizeOutPut($author_url, 'url');
79
- $metaData["name"] = !empty($settings['sitename']) ? $KcSeoWPSchema->sanitizeOutPut($settings['sitename']) : null;
80
- $metaData["alternateName"] = !empty($settings['siteaname']) ? $KcSeoWPSchema->sanitizeOutPut($settings['siteaname']) : null;
81
- $html .= $schemaModel->get_jsonEncode($metaData);
82
- } else {
83
- $metaData["url"] = get_home_url();
84
- $metaData["potentialAction"] = array(
85
- "@type" => "SearchAction",
86
- "target" => get_home_url() . "/?s={query}",
87
- "query-input" => "required name=query"
88
- );
89
- $html .= $schemaModel->get_jsonEncode($metaData);
 
 
90
  }
91
  }
92
  $webMeta = array();
63
  $schemaModel = new KcSeoSchemaModel;
64
  $html = null;
65
  $settings = get_option($KcSeoWPSchema->options['settings']);
66
+ if (empty($settings['disable_site_schema'])) {
67
+ if (is_home() || is_front_page()) {
68
+ $metaData = array();
69
 
70
+ $metaData["@context"] = "http://schema.org/";
71
+ $metaData["@type"] = "WebSite";
 
 
72
  $author_url = (!empty($settings['siteurl']) ? $settings['siteurl'] : get_home_url());
73
  $to_remove = array('http://', 'https://', 'www.');
74
  foreach ($to_remove as $item) {
75
  $author_url = str_replace($item, '', $author_url); // to: www.example.com
76
  }
77
+ if (!empty($settings['homeonly']) && $settings['homeonly']) {
78
+ $metaData["url"] = $author_url;
79
+ $metaData["potentialAction"] = array(
80
+ "@type" => "SearchAction",
81
+ "target" => trailingslashit(get_home_url()) . "?s={query}",
82
+ "query-input" => "required name=query"
83
+ );
84
+ $html .= $schemaModel->get_jsonEncode($metaData);
85
+ } else {
86
+ $metaData["url"] = $KcSeoWPSchema->sanitizeOutPut($author_url, 'url');
87
+ $metaData["name"] = !empty($settings['sitename']) ? $KcSeoWPSchema->sanitizeOutPut($settings['sitename']) : null;
88
+ $metaData["alternateName"] = !empty($settings['siteaname']) ? $KcSeoWPSchema->sanitizeOutPut($settings['siteaname']) : null;
89
+ $html .= $schemaModel->get_jsonEncode($metaData);
90
+ }
91
  }
92
  }
93
  $webMeta = array();
lib/views/schema-options.php CHANGED
@@ -515,14 +515,23 @@ $schemaModel = new KcSeoSchemaModel;
515
  </div>
516
  </div>
517
 
518
- <h2><?php _e("Site Name in Search Results", "wp-seo-structured-data-schema") ?></h2>
519
  <table width="100%" cellpadding="10" class="form-table">
 
 
 
 
 
 
 
 
520
  <tr class="default">
521
  <th><?php _e("Enable Site link Search Box", "wp-seo-structured-data-schema") ?></th>
522
  <td align="left" scope="row">
523
  <input type="checkbox"
524
  name="homeonly" <?php echo(!empty($settings['homeonly']) ? "checked" : null); ?>
525
  value="1"/>
 
526
  </td>
527
  </tr>
528
  <tr class="default">
515
  </div>
516
  </div>
517
 
518
+ <h2><?php _e("Site Schema", "wp-seo-structured-data-schema") ?></h2>
519
  <table width="100%" cellpadding="10" class="form-table">
520
+ <tr class="default">
521
+ <th><?php _e("Disable Site Schema", "wp-seo-structured-data-schema") ?></th>
522
+ <td align="left" scope="row">
523
+ <input type="checkbox"
524
+ name="disable_site_schema" <?php echo(!empty($settings['disable_site_schema']) ? "checked" : null); ?>
525
+ value="1"/>
526
+ </td>
527
+ </tr>
528
  <tr class="default">
529
  <th><?php _e("Enable Site link Search Box", "wp-seo-structured-data-schema") ?></th>
530
  <td align="left" scope="row">
531
  <input type="checkbox"
532
  name="homeonly" <?php echo(!empty($settings['homeonly']) ? "checked" : null); ?>
533
  value="1"/>
534
+ <p class="description"><?php _e("Note: Preferred Name markup may no longer be supported by Google", "wp-seo-structured-data-schema") ?></p>
535
  </td>
536
  </tr>
537
  <tr class="default">
wp-seo-structured-data-schema.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WP SEO Structured Data Schema
4
  * Plugin URI: https://wpsemplugins.com/
5
  * Description: Comprehensive JSON-LD based Structured Data solution for WordPress for adding schema for organizations, businesses, blog posts, ratings & more.
6
- * Version: 2.5.4
7
  * Author: WPSEMPlugins
8
  * Author URI: https://wpsemplugins.com/
9
  * Text Domain: wp-seo-structured-data-schema
3
  * Plugin Name: WP SEO Structured Data Schema
4
  * Plugin URI: https://wpsemplugins.com/
5
  * Description: Comprehensive JSON-LD based Structured Data solution for WordPress for adding schema for organizations, businesses, blog posts, ratings & more.
6
+ * Version: 2.5.5
7
  * Author: WPSEMPlugins
8
  * Author URI: https://wpsemplugins.com/
9
  * Text Domain: wp-seo-structured-data-schema