Version Description
- Fix post save issue
=
Download this release
Release Info
Developer | kcseopro |
Plugin | WP SEO Structured Data Schema |
Version | 2.6.17.1 |
Comparing to | |
See all releases |
Code changes from version 2.6.17 to 2.6.17.1
- README.txt +5 -2
- languages/wp-seo-structured-data-schema.pot +2 -2
- lib/classes/KcSeoMetaData.php +149 -148
- wp-seo-structured-data-schema.php +1 -1
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.7
|
7 |
-
Stable tag: 2.6.17
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -114,8 +114,11 @@ You'll find the [FAQ on WPSEMPlugins.com](https://wpsemplugins.com/wordpress-seo
|
|
114 |
|
115 |
== Changelog ==
|
116 |
|
|
|
|
|
|
|
117 |
== 2.6.17 =
|
118 |
-
* Update description issue at
|
119 |
|
120 |
== 2.6.16 =
|
121 |
* Add WordPress 5.7 compatibility
|
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.7
|
7 |
+
Stable tag: 2.6.17.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
114 |
|
115 |
== Changelog ==
|
116 |
|
117 |
+
== 2.6.17.1 =
|
118 |
+
* Fix post save issue
|
119 |
+
|
120 |
== 2.6.17 =
|
121 |
+
* Update description issue at export
|
122 |
|
123 |
== 2.6.16 =
|
124 |
* Add WordPress 5.7 compatibility
|
languages/wp-seo-structured-data-schema.pot
CHANGED
@@ -97,11 +97,11 @@ msgstr ""
|
|
97 |
msgid "Settings"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: ../lib/classes/KcSeoMetaData.php:
|
101 |
msgid "For more detailed information on how to configure this plugin, please visit:"
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: ../lib/classes/KcSeoMetaData.php:
|
105 |
msgid "Once you save these structured data schema settings, validate this page url here:"
|
106 |
msgstr ""
|
107 |
|
97 |
msgid "Settings"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: ../lib/classes/KcSeoMetaData.php:63, ../lib/views/schema-options.php:26
|
101 |
msgid "For more detailed information on how to configure this plugin, please visit:"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: ../lib/classes/KcSeoMetaData.php:64
|
105 |
msgid "Once you save these structured data schema settings, validate this page url here:"
|
106 |
msgstr ""
|
107 |
|
lib/classes/KcSeoMetaData.php
CHANGED
@@ -1,89 +1,90 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
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 |
if ($data['type'] === 'group' && !empty($data['fields'])) {
|
88 |
$groupMetaData = isset($metaData[$fieldId]) && !empty($metaData[$fieldId]) ? $metaData[$fieldId] : array(array());
|
89 |
$html_g = null;
|
@@ -112,71 +113,71 @@ if ( ! class_exists( 'KcSeoMetaData' ) ):
|
|
112 |
$html_g
|
113 |
);
|
114 |
|
115 |
-
}else {
|
116 |
$htmlCont .= $schemas->get_field($data);
|
117 |
}
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
|
182 |
endif;
|
1 |
<?php
|
2 |
|
3 |
+
if (!class_exists('KcSeoMetaData')):
|
4 |
+
|
5 |
+
class KcSeoMetaData
|
6 |
+
{
|
7 |
+
|
8 |
+
function __construct() {
|
9 |
+
add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
|
10 |
+
add_action('save_post', array($this, 'save_KcSeo_schema_data'), 10, 3);
|
11 |
+
}
|
12 |
+
|
13 |
+
function admin_enqueue_scripts() {
|
14 |
+
global $pagenow, $typenow, $KcSeoWPSchema;
|
15 |
+
// validate page
|
16 |
+
$pt = $KcSeoWPSchema->kcSeoPostTypes();
|
17 |
+
if (!in_array($pagenow, array('post.php', 'post-new.php'))) {
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
if (!in_array($typenow, $pt)) {
|
21 |
+
return;
|
22 |
+
}
|
23 |
+
|
24 |
+
// scripts
|
25 |
+
wp_enqueue_script(array(
|
26 |
+
'jquery',
|
27 |
+
'kcseo-select2-js',
|
28 |
+
'kcseo-admin-js',
|
29 |
+
));
|
30 |
+
|
31 |
+
// styles
|
32 |
+
wp_enqueue_style(array(
|
33 |
+
'kcseo-select2-css',
|
34 |
+
'kcseo-admin-css',
|
35 |
+
));
|
36 |
+
|
37 |
+
add_action('admin_head', array($this, 'admin_head'));
|
38 |
+
}
|
39 |
+
|
40 |
+
function admin_head() {
|
41 |
+
global $KcSeoWPSchema;
|
42 |
+
$pt = $KcSeoWPSchema->kcSeoPostTypes();
|
43 |
+
foreach ($pt as $postType) {
|
44 |
+
add_meta_box(
|
45 |
+
'kcseo-wordpres-seo-structured-data-schema-meta-box',
|
46 |
+
__('WP SEO Structured Data Schema by <a href="https://wpsemplugins.com/">WPSEMPlugins.com</a>', KCSEO_WP_SCHEMA_SLUG),
|
47 |
+
array($this, 'meta_box_wp_schema'),
|
48 |
+
$postType,
|
49 |
+
'normal',
|
50 |
+
'high'
|
51 |
+
);
|
52 |
+
}
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
function meta_box_wp_schema($post) {
|
57 |
+
global $KcSeoWPSchema;
|
58 |
+
wp_nonce_field($KcSeoWPSchema->nonceText(), '_kcseo_nonce');
|
59 |
+
$_kcseo_ative_tab = get_post_meta($post->ID, '_kcseo_ative_tab', true);
|
60 |
+
$schemas = new KcSeoSchemaModel();
|
61 |
+
$html = null;
|
62 |
+
$html .= "<div class='schema-tips'>";
|
63 |
+
$html .= "<p><span>Tip:</span> " . __("For more detailed information on how to configure this plugin, please visit:", "wp-seo-structured-data-schema") . " <a href='https://wpsemplugins.com/wordpress-seo-structured-data-schema-plugin/'>https://wpsemplugins.com/wordpress-seo-structured-data-schema-plugin/</a></p>";
|
64 |
+
$html .= "<p><span>Tip:</span> " . __("Once you save these structured data schema settings, validate this page url here:", "wp-seo-structured-data-schema") . " <a href='https://developers.google.com/structured-data/testing-tool/'>https://developers.google.com/structured-data/testing-tool/</a></p>";
|
65 |
+
$html .= "</div>";
|
66 |
+
$html .= "<div class='schema-holder'>";
|
67 |
+
$html .= '<div id="meta-tab-holder" class="rt-tab-container">';
|
68 |
+
$htmlMenu = null;
|
69 |
+
$htmlCont = null;
|
70 |
+
$htmlMenu .= "<ul class='rt-tab-nav'>";
|
71 |
+
$schemaFields = KcSeoOptions::getSchemaTypes();
|
72 |
+
$i = 0;
|
73 |
+
foreach ($schemaFields as $schemaID => $schema) {
|
74 |
+
$tabId = $KcSeoWPSchema->KcSeoPrefix . $schemaID;
|
75 |
+
$activeClass = ((!$_kcseo_ative_tab && $i === 0) || $tabId === $_kcseo_ative_tab) ? ' active' : null;
|
76 |
+
$i++;
|
77 |
+
$htmlMenu .= '<li data-id="' . $tabId . '" class="' . $activeClass . '"><a href="#' . $tabId . '">' . $schema['title'] . '</a></li>';
|
78 |
+
$htmlCont .= "<div id='{$tabId}' class='rt-tab-content{$activeClass}'>";
|
79 |
+
$htmlCont .= "<div class='kc-top-toolbar'><span class='disabled button button-primary'>" . __("Auto Fill", "wp-seo-structured-data-schema-pro") . "</span><span class='kcseo-pro-label'>" . __("PRO", "wp-seo-structured-data-schema-pro") . "</span></div>";
|
80 |
+
$metaData = get_post_meta($post->ID, $tabId, true);
|
81 |
+
$metaData = (is_array($metaData) ? $metaData : array());
|
82 |
+
if (!empty($schema['fields'])) {
|
83 |
+
foreach ($schema['fields'] as $fieldId => $data) {
|
84 |
+
$data['fieldId'] = $fieldId;
|
85 |
+
$data['id'] = $tabId . "_" . $fieldId;
|
86 |
+
$data['name'] = $tabId . "[{$fieldId}]";
|
87 |
+
$data['value'] = (!empty($metaData[$fieldId]) ? $metaData[$fieldId] : null);
|
88 |
if ($data['type'] === 'group' && !empty($data['fields'])) {
|
89 |
$groupMetaData = isset($metaData[$fieldId]) && !empty($metaData[$fieldId]) ? $metaData[$fieldId] : array(array());
|
90 |
$html_g = null;
|
113 |
$html_g
|
114 |
);
|
115 |
|
116 |
+
} else {
|
117 |
$htmlCont .= $schemas->get_field($data);
|
118 |
}
|
119 |
+
}
|
120 |
+
}
|
121 |
+
if (!empty($schema['pro']) && $schema['pro']) {
|
122 |
+
$htmlCont .= "<div class='kcseo-pro-feature'>" . __("This is a Pro version feature.", "wp-seo-structured-data-schema-pro") . "<a href='https://wpsemplugins.com/downloads/wordpress-schema-plugin/' target='_blank'>(more info)</a></div>";
|
123 |
+
}
|
124 |
+
$htmlCont .= "</div>";
|
125 |
+
}
|
126 |
+
$htmlMenu .= "</ul>";
|
127 |
+
$html .= $htmlMenu . $htmlCont;
|
128 |
+
$html .= '<input type="hidden" id="_kcseo_ative_tab" name="_kcseo_ative_tab" value="' . $_kcseo_ative_tab . '" />';
|
129 |
+
$html .= "</div>";
|
130 |
+
$html .= "</div>";
|
131 |
+
echo $html;
|
132 |
+
}
|
133 |
+
|
134 |
+
function save_KcSeo_schema_data($post_id, $post, $update) {
|
135 |
+
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
|
136 |
+
return $post_id;
|
137 |
+
}
|
138 |
+
global $KcSeoWPSchema;
|
139 |
+
$nonce = !empty($_REQUEST['_kcseo_nonce']) ? $_REQUEST['_kcseo_nonce'] : null;
|
140 |
+
if (!wp_verify_nonce($nonce, $KcSeoWPSchema->nonceText())) {
|
141 |
+
return $post_id;
|
142 |
+
}
|
143 |
+
|
144 |
+
// Check permissions
|
145 |
+
if (!empty($_GET['post_type'])) {
|
146 |
+
if (!current_user_can('edit_' . $_GET['post_type'], $post_id)) {
|
147 |
+
return $post_id;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
$pt = $KcSeoWPSchema->kcSeoPostTypes();
|
151 |
+
if (!in_array($post->post_type, $pt)) {
|
152 |
+
return $post_id;
|
153 |
+
}
|
154 |
+
|
155 |
+
$meta = array();
|
156 |
+
$schemaModel = new KcSeoSchemaModel;
|
157 |
+
$schemaFields = KcSeoOptions::getSchemaTypes();
|
158 |
+
foreach ($schemaFields as $schemaID => $schema) {
|
159 |
+
$schemaMetaId = $KcSeoWPSchema->KcSeoPrefix . $schemaID;
|
160 |
+
$data = array();
|
161 |
+
if (!empty($schema['fields'])) {
|
162 |
+
foreach ($schema['fields'] as $fieldId => $fieldData) {
|
163 |
+
$value = (!empty($_REQUEST[$schemaMetaId][$fieldId]) ? $_REQUEST[$schemaMetaId][$fieldId] : null);
|
164 |
+
$value = $KcSeoWPSchema->sanitize($fieldId, $fieldData, $value);
|
165 |
+
$data[$fieldId] = $value;
|
166 |
+
}
|
167 |
+
}
|
168 |
+
$meta[$schemaMetaId] = $data;
|
169 |
+
}
|
170 |
+
/* _kcseo_ative_tab */
|
171 |
+
if (isset($_POST['_kcseo_ative_tab'])) {
|
172 |
+
$meta['_kcseo_ative_tab'] = sanitize_text_field($_POST['_kcseo_ative_tab']);
|
173 |
+
}
|
174 |
+
if (count($meta) > 0) {
|
175 |
+
foreach ($meta as $mKey => $mValue) {
|
176 |
+
update_post_meta($post_id, $mKey, $mValue);
|
177 |
+
}
|
178 |
+
}
|
179 |
+
}
|
180 |
+
|
181 |
+
}
|
182 |
|
183 |
endif;
|
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.6.17
|
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.6.17.1
|
7 |
* Author: WPSEMPlugins
|
8 |
* Author URI: https://wpsemplugins.com/
|
9 |
* Text Domain: wp-seo-structured-data-schema
|