Version Description
(27 March 2019) =
- Bug Fixed: Warning - Missing "review" field in product schema for WooCommerce product page. #179
- Bug Fixed: Modify schema output with custom filters #178
- Bug Fixed: https://schema.org/Publisher should be https://schema.org/publisher #175
- Bug Fixed: In AMP schema markup featured image should be 4x3,16x9,1x1 #173
- Bug Fixed: Warning - number_format() expects parameter 1 to be float, string given in #172
- Bug Fixed: Set-Up wizard is not working when Polylang plugin is activated #170
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.5
- admin_section/css/main-style.css +10 -1
- admin_section/js/saswp-add-new.js +1 -0
- admin_section/js/saswp-install.js +1 -1
- output/function.php +43 -45
- output/output.php +112 -55
- output/review-output.php +2 -5
- output/service.php +35 -28
- readme.txt +11 -2
- structured-data-for-wp.php +2 -2
- view/paywall.php +1 -1
- view/review.php +3 -2
- view/schema_type.php +8 -7
admin_section/css/main-style.css
CHANGED
@@ -558,5 +558,14 @@ On/Off Buttons ends here
|
|
558 |
.option-table-class tr td {padding: 10px 10px 10px 10px ;}
|
559 |
.option-table-class tr > td{width: 30%;}
|
560 |
.option-table-class tr td:last-child{width: 60%;}
|
561 |
-
.option-table-class input[type="text"], select{width:100%;}
|
562 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
558 |
.option-table-class tr td {padding: 10px 10px 10px 10px ;}
|
559 |
.option-table-class tr > td{width: 30%;}
|
560 |
.option-table-class tr td:last-child{width: 60%;}
|
|
|
561 |
|
562 |
+
.saswp-option-table-class input[type="text"], .saswp-option-table-class select{
|
563 |
+
width:100%;
|
564 |
+
}
|
565 |
+
.saswp-paywall-table-class input[type="text"], .saswp-paywall-table-class select{
|
566 |
+
width:100%;
|
567 |
+
}
|
568 |
+
|
569 |
+
.saswp-custom-fields-table select{
|
570 |
+
width: 100%;
|
571 |
+
}
|
admin_section/js/saswp-add-new.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
|
|
|
2 |
var Merlin = (function($){
|
3 |
|
4 |
var t;
|
1 |
|
2 |
+
var ajaxurl = saswp_add_new_params.ajaxurl;
|
3 |
var Merlin = (function($){
|
4 |
|
5 |
var t;
|
admin_section/js/saswp-install.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
|
2 |
var Merlin = (function($){
|
3 |
|
4 |
var t;
|
1 |
+
var ajaxurl = saswp_install_params.ajaxurl;
|
2 |
var Merlin = (function($){
|
3 |
|
4 |
var t;
|
output/function.php
CHANGED
@@ -4,8 +4,8 @@ function saswp_remove_amp_default_structure_data($metadata){
|
|
4 |
}
|
5 |
|
6 |
add_filter( 'amp_init', 'saswp_structured_data' );
|
7 |
-
function saswp_structured_data()
|
8 |
-
|
9 |
add_action( 'amp_post_template_head' , 'saswp_data_generator' );
|
10 |
remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
|
11 |
}
|
@@ -25,9 +25,9 @@ function saswp_data_generator() {
|
|
25 |
|
26 |
$output = '';
|
27 |
$post_specific_enable = '';
|
28 |
-
$kb_website_output =
|
29 |
-
$kb_schema_output =
|
30 |
-
$site_navigation =
|
31 |
|
32 |
|
33 |
$site_navigation = saswp_site_navigation_output();
|
@@ -36,18 +36,18 @@ function saswp_data_generator() {
|
|
36 |
$author_output = saswp_author_output();
|
37 |
$archive_output = saswp_archive_output();
|
38 |
|
39 |
-
$schema_breadcrumb_output = saswp_schema_breadcrumb_output(
|
40 |
|
41 |
if(saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') != 1){
|
42 |
|
43 |
$kb_website_output = saswp_kb_website_output();
|
44 |
-
$kb_schema_output = saswp_kb_schema_output();
|
45 |
-
|
46 |
}
|
47 |
|
48 |
if(is_singular()){
|
49 |
|
50 |
-
$post_specific_enable = get_option('modify_schema_post_enable_'
|
51 |
|
52 |
}
|
53 |
|
@@ -73,63 +73,61 @@ function saswp_data_generator() {
|
|
73 |
|
74 |
if(!empty($contact_page_output)){
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
}
|
81 |
if(!empty($about_page_output)){
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
}
|
87 |
if(!empty($author_output)){
|
88 |
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
}
|
93 |
if(!empty($archive_output)){
|
94 |
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
}
|
99 |
if(!empty($kb_website_output)){
|
100 |
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
}
|
105 |
if(!empty($site_navigation)){
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
$output .= ",";
|
111 |
-
$output .= "\n\n";
|
112 |
-
|
113 |
}
|
114 |
if(!empty($schema_breadcrumb_output)){
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
}
|
120 |
-
if(!empty($schema_output)){
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
127 |
}
|
128 |
if(!empty($kb_schema_output)){
|
129 |
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
}
|
134 |
|
135 |
}
|
4 |
}
|
5 |
|
6 |
add_filter( 'amp_init', 'saswp_structured_data' );
|
7 |
+
function saswp_structured_data(){
|
8 |
+
|
9 |
add_action( 'amp_post_template_head' , 'saswp_data_generator' );
|
10 |
remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
|
11 |
}
|
25 |
|
26 |
$output = '';
|
27 |
$post_specific_enable = '';
|
28 |
+
$kb_website_output = array();
|
29 |
+
$kb_schema_output = array();
|
30 |
+
$site_navigation = array();
|
31 |
|
32 |
|
33 |
$site_navigation = saswp_site_navigation_output();
|
36 |
$author_output = saswp_author_output();
|
37 |
$archive_output = saswp_archive_output();
|
38 |
|
39 |
+
$schema_breadcrumb_output = saswp_schema_breadcrumb_output();
|
40 |
|
41 |
if(saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') != 1){
|
42 |
|
43 |
$kb_website_output = saswp_kb_website_output();
|
44 |
+
$kb_schema_output = saswp_kb_schema_output();
|
45 |
+
|
46 |
}
|
47 |
|
48 |
if(is_singular()){
|
49 |
|
50 |
+
$post_specific_enable = get_option('modify_schema_post_enable_'.esc_attr($post->ID));
|
51 |
|
52 |
}
|
53 |
|
73 |
|
74 |
if(!empty($contact_page_output)){
|
75 |
|
76 |
+
$output .= json_encode($contact_page_output);
|
77 |
+
$output .= ",";
|
78 |
+
$output .= "\n\n";
|
|
|
79 |
}
|
80 |
if(!empty($about_page_output)){
|
81 |
|
82 |
+
$output .= json_encode($about_page_output);
|
83 |
+
$output .= ",";
|
84 |
+
$output .= "\n\n";
|
85 |
}
|
86 |
if(!empty($author_output)){
|
87 |
|
88 |
+
$output .= json_encode($author_output);
|
89 |
+
$output .= ",";
|
90 |
+
$output .= "\n\n";
|
91 |
}
|
92 |
if(!empty($archive_output)){
|
93 |
|
94 |
+
$output .= json_encode($archive_output);
|
95 |
+
$output .= ",";
|
96 |
+
$output .= "\n\n";
|
97 |
}
|
98 |
if(!empty($kb_website_output)){
|
99 |
|
100 |
+
$output .= json_encode($kb_website_output);
|
101 |
+
$output .= ",";
|
102 |
+
$output .= "\n\n";
|
103 |
}
|
104 |
if(!empty($site_navigation)){
|
105 |
+
|
106 |
+
$output .= json_encode($site_navigation);
|
107 |
+
$output .= ",";
|
108 |
+
$output .= "\n\n";
|
|
|
|
|
|
|
109 |
}
|
110 |
if(!empty($schema_breadcrumb_output)){
|
111 |
|
112 |
+
$output .= json_encode($schema_breadcrumb_output);
|
113 |
+
$output .= ",";
|
114 |
+
$output .= "\n\n";
|
115 |
}
|
116 |
+
if(!empty($schema_output)){
|
117 |
+
|
118 |
+
foreach($schema_output as $schema){
|
119 |
+
|
120 |
+
$schema = json_encode($schema);
|
121 |
+
$output .= $schema;
|
122 |
+
$output .= ",";
|
123 |
+
$output .= "\n\n";
|
124 |
+
|
125 |
+
}
|
126 |
}
|
127 |
if(!empty($kb_schema_output)){
|
128 |
|
129 |
+
$output .= json_encode($kb_schema_output);
|
130 |
+
$output .= ",";
|
|
|
131 |
}
|
132 |
|
133 |
}
|
output/output.php
CHANGED
@@ -114,7 +114,7 @@ function saswp_kb_schema_output() {
|
|
114 |
|
115 |
$input = array(
|
116 |
'@context' =>'http://schema.org',
|
117 |
-
'@type' => esc_attr($sd_data['saswp_organization_type']),
|
118 |
'name' => saswp_remove_warnings($sd_data, 'sd_name', 'saswp_string'),
|
119 |
'url' => saswp_remove_warnings($sd_data, 'sd_url', 'saswp_string'),
|
120 |
'sameAs' => $platform,
|
@@ -176,7 +176,7 @@ function saswp_kb_schema_output() {
|
|
176 |
}
|
177 |
|
178 |
|
179 |
-
return
|
180 |
}
|
181 |
|
182 |
/**
|
@@ -334,13 +334,14 @@ function saswp_schema_output() {
|
|
334 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
335 |
}
|
336 |
|
|
|
337 |
}
|
338 |
|
339 |
if( 'Blogposting' === $schema_type){
|
340 |
|
341 |
$input1 = array(
|
342 |
'@context' => 'http://schema.org',
|
343 |
-
'@type' =>
|
344 |
|
345 |
'mainEntityOfPage' => get_permalink(),
|
346 |
'headline' => get_the_title(),
|
@@ -377,6 +378,7 @@ function saswp_schema_output() {
|
|
377 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
378 |
}
|
379 |
|
|
|
380 |
}
|
381 |
|
382 |
if( 'AudioObject' === $schema_type){
|
@@ -391,8 +393,8 @@ function saswp_schema_output() {
|
|
391 |
'contentUrl' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_contenturl', 'saswp_string'),
|
392 |
'duration' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_duration', 'saswp_string'),
|
393 |
'encodingFormat' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_encoding_format', 'saswp_string'),
|
394 |
-
'datePublished' => $date,
|
395 |
-
'dateModified' => $modified_date,
|
396 |
'author' => array(
|
397 |
'@type' => 'Person',
|
398 |
'name' => esc_attr($aurthor_name)
|
@@ -419,7 +421,9 @@ function saswp_schema_output() {
|
|
419 |
}
|
420 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
421 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
422 |
-
}
|
|
|
|
|
423 |
}
|
424 |
|
425 |
if( 'Event' === $schema_type){
|
@@ -502,6 +506,7 @@ function saswp_schema_output() {
|
|
502 |
|
503 |
}
|
504 |
|
|
|
505 |
|
506 |
}
|
507 |
|
@@ -521,8 +526,8 @@ function saswp_schema_output() {
|
|
521 |
'price' => saswp_remove_warnings($schema_data, 'saswp_software_schema_price', 'saswp_string'),
|
522 |
'priceCurrency' => saswp_remove_warnings($schema_data, 'saswp_software_schema_price_currency', 'saswp_string'),
|
523 |
),
|
524 |
-
'datePublished' => $date,
|
525 |
-
'dateModified' => $modified_date,
|
526 |
'author' => array(
|
527 |
'@type' => 'Person',
|
528 |
'name' => esc_attr($aurthor_name)
|
@@ -557,7 +562,9 @@ function saswp_schema_output() {
|
|
557 |
}
|
558 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
559 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
560 |
-
}
|
|
|
|
|
561 |
}
|
562 |
|
563 |
if( 'WebPage' === $schema_type){
|
@@ -581,6 +588,8 @@ function saswp_schema_output() {
|
|
581 |
if(!empty($extra_theme_review)){
|
582 |
$input1 = array_merge($input1, $extra_theme_review);
|
583 |
}
|
|
|
|
|
584 |
}
|
585 |
|
586 |
if( 'Article' === $schema_type ){
|
@@ -598,6 +607,8 @@ function saswp_schema_output() {
|
|
598 |
if(!empty($extra_theme_review)){
|
599 |
$input1 = array_merge($input1, $extra_theme_review);
|
600 |
}
|
|
|
|
|
601 |
}
|
602 |
|
603 |
if( 'TechArticle' === $schema_type ){
|
@@ -615,6 +626,8 @@ function saswp_schema_output() {
|
|
615 |
if(!empty($extra_theme_review)){
|
616 |
$input1 = array_merge($input1, $extra_theme_review);
|
617 |
}
|
|
|
|
|
618 |
}
|
619 |
|
620 |
if( 'Recipe' === $schema_type){
|
@@ -637,7 +650,7 @@ function saswp_schema_output() {
|
|
637 |
'author' => array(
|
638 |
'@type' => 'Person',
|
639 |
'name' => esc_attr($aurthor_name),
|
640 |
-
'
|
641 |
'@type' => 'ImageObject',
|
642 |
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
643 |
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
@@ -671,6 +684,8 @@ function saswp_schema_output() {
|
|
671 |
if(!empty($extra_theme_review)){
|
672 |
$input1 = array_merge($input1, $extra_theme_review);
|
673 |
}
|
|
|
|
|
674 |
}
|
675 |
|
676 |
if( 'qanda' === $schema_type){
|
@@ -682,6 +697,8 @@ function saswp_schema_output() {
|
|
682 |
$service = new saswp_output_service();
|
683 |
$input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
|
684 |
}
|
|
|
|
|
685 |
}
|
686 |
|
687 |
if( 'Product' === $schema_type){
|
@@ -700,12 +717,12 @@ function saswp_schema_output() {
|
|
700 |
'description' => saswp_remove_warnings($product_details, 'product_description', 'saswp_string'),
|
701 |
'image' => saswp_remove_warnings($product_details, 'product_image', 'saswp_string'),
|
702 |
'offers' => array(
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
),
|
710 |
|
711 |
);
|
@@ -823,6 +840,8 @@ function saswp_schema_output() {
|
|
823 |
$input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
|
824 |
|
825 |
}
|
|
|
|
|
826 |
}
|
827 |
|
828 |
if( 'NewsArticle' === $schema_type ){
|
@@ -888,6 +907,8 @@ function saswp_schema_output() {
|
|
888 |
if(!empty($extra_theme_review)){
|
889 |
$input1 = array_merge($input1, $extra_theme_review);
|
890 |
}
|
|
|
|
|
891 |
}
|
892 |
|
893 |
if( 'Service' === $schema_type ){
|
@@ -909,10 +930,10 @@ function saswp_schema_output() {
|
|
909 |
'@type' => saswp_remove_warnings($schema_data, 'saswp_service_schema_provider_type', 'saswp_string'),
|
910 |
'name' => saswp_remove_warnings($schema_data, 'saswp_service_schema_provider_name', 'saswp_string'),
|
911 |
'image' => array(
|
912 |
-
'@type' =>'ImageObject',
|
913 |
-
'url' =>isset($schema_data['saswp_service_schema_image']) ? esc_url($schema_data['saswp_service_schema_image']['url']):'' ,
|
914 |
-
'width' =>isset($schema_data['saswp_service_schema_image']) ? esc_attr($schema_data['saswp_service_schema_image']['width']):'' ,
|
915 |
-
'height' =>isset($schema_data['saswp_service_schema_image']) ? esc_attr($schema_data['saswp_service_schema_image']['height']):'' ,
|
916 |
),
|
917 |
'@id' => get_permalink(),
|
918 |
'address' => array(
|
@@ -979,6 +1000,8 @@ function saswp_schema_output() {
|
|
979 |
if(!empty($extra_theme_review)){
|
980 |
$input1 = array_merge($input1, $extra_theme_review);
|
981 |
}
|
|
|
|
|
982 |
}
|
983 |
|
984 |
if( 'Review' === $schema_type ){
|
@@ -1003,7 +1026,7 @@ function saswp_schema_output() {
|
|
1003 |
'author' => array(
|
1004 |
'@type' => 'Person',
|
1005 |
'name' => esc_attr($aurthor_name),
|
1006 |
-
'
|
1007 |
'@type' => 'ImageObject',
|
1008 |
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
1009 |
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
@@ -1245,7 +1268,8 @@ function saswp_schema_output() {
|
|
1245 |
}
|
1246 |
|
1247 |
}
|
1248 |
-
|
|
|
1249 |
}
|
1250 |
|
1251 |
if( 'VideoObject' === $schema_type){
|
@@ -1272,7 +1296,7 @@ function saswp_schema_output() {
|
|
1272 |
'author' => array(
|
1273 |
'@type' => 'Person',
|
1274 |
'name' => esc_attr($aurthor_name),
|
1275 |
-
'
|
1276 |
'@type' => 'ImageObject',
|
1277 |
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
1278 |
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
@@ -1302,6 +1326,7 @@ function saswp_schema_output() {
|
|
1302 |
$input1 = array_merge($input1, $extra_theme_review);
|
1303 |
}
|
1304 |
|
|
|
1305 |
}
|
1306 |
|
1307 |
if( 'local_business' === $schema_type){
|
@@ -1390,7 +1415,9 @@ function saswp_schema_output() {
|
|
1390 |
|
1391 |
if(isset($business_details['local_menu'])){
|
1392 |
$input1['hasMenu'] = esc_url($business_details['local_menu']);
|
1393 |
-
}
|
|
|
|
|
1394 |
}
|
1395 |
|
1396 |
|
@@ -1438,8 +1465,9 @@ function saswp_schema_output() {
|
|
1438 |
$all_schema_output[] = $input1;
|
1439 |
}
|
1440 |
//}
|
1441 |
-
}
|
1442 |
-
|
|
|
1443 |
}
|
1444 |
|
1445 |
/**
|
@@ -1694,7 +1722,7 @@ function saswp_post_specific_schema_output() {
|
|
1694 |
'@type' => 'Person',
|
1695 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_author_name_'.$schema_id, 'saswp_array')
|
1696 |
),
|
1697 |
-
'
|
1698 |
'@type' => 'Organization',
|
1699 |
'logo' => array(
|
1700 |
'@type' => 'ImageObject',
|
@@ -1804,7 +1832,7 @@ function saswp_post_specific_schema_output() {
|
|
1804 |
'author' => array(
|
1805 |
'@type' => 'Person',
|
1806 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_author_name_'.$schema_id, 'saswp_array'), ),
|
1807 |
-
'
|
1808 |
'@type' => 'Organization',
|
1809 |
'logo' => array(
|
1810 |
'@type' => 'ImageObject',
|
@@ -1852,7 +1880,7 @@ function saswp_post_specific_schema_output() {
|
|
1852 |
'@type' => 'Person',
|
1853 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_article_author_name_'.$schema_id, 'saswp_array')
|
1854 |
),
|
1855 |
-
'
|
1856 |
'@type' => 'Organization',
|
1857 |
'logo' => array(
|
1858 |
'@type' => 'ImageObject',
|
@@ -1893,7 +1921,7 @@ function saswp_post_specific_schema_output() {
|
|
1893 |
'@type' => 'Person',
|
1894 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_author_name_'.$schema_id, 'saswp_array')
|
1895 |
),
|
1896 |
-
'
|
1897 |
'@type' => 'Organization',
|
1898 |
'logo' => array(
|
1899 |
'@type' => 'ImageObject',
|
@@ -2008,7 +2036,7 @@ function saswp_post_specific_schema_output() {
|
|
2008 |
'mainEntity' => array(
|
2009 |
'@type' => 'WebPage',
|
2010 |
'@id' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_main_entity_'.$schema_id, 'saswp_array'),
|
2011 |
-
'
|
2012 |
'@type' => 'Organization',
|
2013 |
'logo' => array(
|
2014 |
'@type' => 'ImageObject',
|
@@ -2090,7 +2118,36 @@ function saswp_post_specific_schema_output() {
|
|
2090 |
}
|
2091 |
if(!empty($extra_theme_review)){
|
2092 |
$input1 = array_merge($input1, $extra_theme_review);
|
2093 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2094 |
}
|
2095 |
|
2096 |
if( 'NewsArticle' === $schema_type ){
|
@@ -2127,7 +2184,7 @@ function saswp_post_specific_schema_output() {
|
|
2127 |
'width' => saswp_remove_warnings($author_image, 'width', 'saswp_string')
|
2128 |
),
|
2129 |
),
|
2130 |
-
'
|
2131 |
'@type' => 'Organization',
|
2132 |
'logo' => array(
|
2133 |
'@type' => 'ImageObject',
|
@@ -2176,7 +2233,7 @@ function saswp_post_specific_schema_output() {
|
|
2176 |
'width' => saswp_remove_warnings($author_image, 'width', 'saswp_string')
|
2177 |
),
|
2178 |
),
|
2179 |
-
'
|
2180 |
'@type' => 'Organization',
|
2181 |
'logo' => array(
|
2182 |
'@type' => 'ImageObject',
|
@@ -2305,12 +2362,12 @@ function saswp_post_specific_schema_output() {
|
|
2305 |
|
2306 |
if($site_name && $logo && $width && $height){
|
2307 |
|
2308 |
-
$input1['
|
2309 |
-
$input1['
|
2310 |
-
$input1['
|
2311 |
-
$input1['
|
2312 |
-
$input1['
|
2313 |
-
$input1['
|
2314 |
|
2315 |
}
|
2316 |
|
@@ -2595,8 +2652,8 @@ function saswp_post_specific_schema_output() {
|
|
2595 |
}
|
2596 |
}
|
2597 |
}
|
2598 |
-
|
2599 |
-
return $all_schema_output;
|
2600 |
}
|
2601 |
|
2602 |
/**
|
@@ -2605,7 +2662,7 @@ function saswp_post_specific_schema_output() {
|
|
2605 |
* @param type $sd_data
|
2606 |
* @return type
|
2607 |
*/
|
2608 |
-
function saswp_schema_breadcrumb_output(
|
2609 |
|
2610 |
global $sd_data;
|
2611 |
|
@@ -2623,7 +2680,7 @@ function saswp_schema_breadcrumb_output($sd_data){
|
|
2623 |
'itemListElement' => $bread_crumb_list,
|
2624 |
);
|
2625 |
|
2626 |
-
return
|
2627 |
|
2628 |
}
|
2629 |
|
@@ -2653,13 +2710,13 @@ function saswp_kb_website_output(){
|
|
2653 |
'name' => $site_name,
|
2654 |
'potentialAction' => array(
|
2655 |
'@type' => 'SearchAction',
|
2656 |
-
'target' => esc_url($site_url.'/?s={search_term_string}'
|
2657 |
'query-input' => 'required name=search_term_string',
|
2658 |
)
|
2659 |
);
|
2660 |
}
|
2661 |
|
2662 |
-
return
|
2663 |
}
|
2664 |
|
2665 |
/**
|
@@ -2682,7 +2739,7 @@ function saswp_archive_output(){
|
|
2682 |
|
2683 |
if(isset($sd_data['saswp_archive_schema']) && $sd_data['saswp_archive_schema'] == 1){
|
2684 |
|
2685 |
-
$schema_type
|
2686 |
|
2687 |
$service_object = new saswp_output_service();
|
2688 |
$logo = $service_object->saswp_get_publisher(true);
|
@@ -2766,7 +2823,7 @@ function saswp_archive_output(){
|
|
2766 |
'sameAs' => '',
|
2767 |
'hasPart' => $category_posts
|
2768 |
);
|
2769 |
-
return
|
2770 |
endif;
|
2771 |
}
|
2772 |
}
|
@@ -2829,7 +2886,7 @@ function saswp_author_output(){
|
|
2829 |
if ( get_the_author_meta( 'description', $post_author->ID ) ) {
|
2830 |
$input['description'] = strip_tags( get_the_author_meta( 'description', $post_author->ID ) );
|
2831 |
}
|
2832 |
-
return
|
2833 |
}
|
2834 |
}
|
2835 |
}
|
@@ -2873,7 +2930,7 @@ function saswp_about_page_output(){
|
|
2873 |
$input = array_merge($input, $publisher);
|
2874 |
|
2875 |
}
|
2876 |
-
return
|
2877 |
}
|
2878 |
|
2879 |
}
|
@@ -2910,16 +2967,16 @@ function saswp_contact_page_output(){
|
|
2910 |
|
2911 |
if(!empty($feature_image)){
|
2912 |
|
2913 |
-
|
2914 |
|
2915 |
}
|
2916 |
|
2917 |
if(!empty($publisher)){
|
2918 |
|
2919 |
-
|
2920 |
|
2921 |
}
|
2922 |
-
return
|
2923 |
|
2924 |
}
|
2925 |
|
@@ -2949,7 +3006,7 @@ function saswp_site_navigation_output(){
|
|
2949 |
|
2950 |
if(!saswp_non_amp()){
|
2951 |
|
2952 |
-
if($type == 'amp-menu'){
|
2953 |
|
2954 |
foreach($menuItems as $items){
|
2955 |
|
@@ -2998,5 +3055,5 @@ function saswp_site_navigation_output(){
|
|
2998 |
|
2999 |
}
|
3000 |
|
3001 |
-
return $input;
|
3002 |
}
|
114 |
|
115 |
$input = array(
|
116 |
'@context' =>'http://schema.org',
|
117 |
+
'@type' => isset($sd_data['saswp_organization_type']) ? esc_attr($sd_data['saswp_organization_type']):'Organization',
|
118 |
'name' => saswp_remove_warnings($sd_data, 'sd_name', 'saswp_string'),
|
119 |
'url' => saswp_remove_warnings($sd_data, 'sd_url', 'saswp_string'),
|
120 |
'sameAs' => $platform,
|
176 |
}
|
177 |
|
178 |
|
179 |
+
return apply_filters('saswp_modify_organization_output', $input);
|
180 |
}
|
181 |
|
182 |
/**
|
334 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
335 |
}
|
336 |
|
337 |
+
$input1 = apply_filters('saswp_modify_course_schema_output', $input1 );
|
338 |
}
|
339 |
|
340 |
if( 'Blogposting' === $schema_type){
|
341 |
|
342 |
$input1 = array(
|
343 |
'@context' => 'http://schema.org',
|
344 |
+
'@type' => 'BlogPosting' ,
|
345 |
|
346 |
'mainEntityOfPage' => get_permalink(),
|
347 |
'headline' => get_the_title(),
|
378 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
379 |
}
|
380 |
|
381 |
+
$input1 = apply_filters('saswp_modify_blogposting_schema_output', $input1 );
|
382 |
}
|
383 |
|
384 |
if( 'AudioObject' === $schema_type){
|
393 |
'contentUrl' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_contenturl', 'saswp_string'),
|
394 |
'duration' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_duration', 'saswp_string'),
|
395 |
'encodingFormat' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_encoding_format', 'saswp_string'),
|
396 |
+
'datePublished' => esc_html($date),
|
397 |
+
'dateModified' => esc_html($modified_date),
|
398 |
'author' => array(
|
399 |
'@type' => 'Person',
|
400 |
'name' => esc_attr($aurthor_name)
|
421 |
}
|
422 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
423 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
424 |
+
}
|
425 |
+
|
426 |
+
$input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
|
427 |
}
|
428 |
|
429 |
if( 'Event' === $schema_type){
|
506 |
|
507 |
}
|
508 |
|
509 |
+
$input1 = apply_filters('saswp_modify_event_schema_output', $input1 );
|
510 |
|
511 |
}
|
512 |
|
526 |
'price' => saswp_remove_warnings($schema_data, 'saswp_software_schema_price', 'saswp_string'),
|
527 |
'priceCurrency' => saswp_remove_warnings($schema_data, 'saswp_software_schema_price_currency', 'saswp_string'),
|
528 |
),
|
529 |
+
'datePublished' => esc_html($date),
|
530 |
+
'dateModified' => esc_html($modified_date),
|
531 |
'author' => array(
|
532 |
'@type' => 'Person',
|
533 |
'name' => esc_attr($aurthor_name)
|
562 |
}
|
563 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
564 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
565 |
+
}
|
566 |
+
|
567 |
+
$input1 = apply_filters('saswp_modify_software_application_schema_output', $input1 );
|
568 |
}
|
569 |
|
570 |
if( 'WebPage' === $schema_type){
|
588 |
if(!empty($extra_theme_review)){
|
589 |
$input1 = array_merge($input1, $extra_theme_review);
|
590 |
}
|
591 |
+
|
592 |
+
$input1 = apply_filters('saswp_modify_webpage_schema_output', $input1 );
|
593 |
}
|
594 |
|
595 |
if( 'Article' === $schema_type ){
|
607 |
if(!empty($extra_theme_review)){
|
608 |
$input1 = array_merge($input1, $extra_theme_review);
|
609 |
}
|
610 |
+
|
611 |
+
$input1 = apply_filters('saswp_modify_article_schema_output', $input1 );
|
612 |
}
|
613 |
|
614 |
if( 'TechArticle' === $schema_type ){
|
626 |
if(!empty($extra_theme_review)){
|
627 |
$input1 = array_merge($input1, $extra_theme_review);
|
628 |
}
|
629 |
+
|
630 |
+
$input1 = apply_filters('saswp_modify_tech_article_schema_output', $input1 );
|
631 |
}
|
632 |
|
633 |
if( 'Recipe' === $schema_type){
|
650 |
'author' => array(
|
651 |
'@type' => 'Person',
|
652 |
'name' => esc_attr($aurthor_name),
|
653 |
+
'image' => array(
|
654 |
'@type' => 'ImageObject',
|
655 |
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
656 |
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
684 |
if(!empty($extra_theme_review)){
|
685 |
$input1 = array_merge($input1, $extra_theme_review);
|
686 |
}
|
687 |
+
|
688 |
+
$input1 = apply_filters('saswp_modify_recipe_schema_output', $input1 );
|
689 |
}
|
690 |
|
691 |
if( 'qanda' === $schema_type){
|
697 |
$service = new saswp_output_service();
|
698 |
$input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
|
699 |
}
|
700 |
+
|
701 |
+
$input1 = apply_filters('saswp_modify_qanda_schema_output', $input1 );
|
702 |
}
|
703 |
|
704 |
if( 'Product' === $schema_type){
|
717 |
'description' => saswp_remove_warnings($product_details, 'product_description', 'saswp_string'),
|
718 |
'image' => saswp_remove_warnings($product_details, 'product_image', 'saswp_string'),
|
719 |
'offers' => array(
|
720 |
+
'@type' => 'Offer',
|
721 |
+
'availability' => saswp_remove_warnings($product_details, 'product_availability', 'saswp_string'),
|
722 |
+
'price' => saswp_remove_warnings($product_details, 'product_price', 'saswp_string'),
|
723 |
+
'priceCurrency' => saswp_remove_warnings($product_details, 'product_currency', 'saswp_string'),
|
724 |
+
'url' => get_permalink(),
|
725 |
+
'priceValidUntil' => saswp_remove_warnings($product_details, 'product_priceValidUntil', 'saswp_string'),
|
726 |
),
|
727 |
|
728 |
);
|
840 |
$input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
|
841 |
|
842 |
}
|
843 |
+
|
844 |
+
$input1 = apply_filters('saswp_modify_product_schema_output', $input1 );
|
845 |
}
|
846 |
|
847 |
if( 'NewsArticle' === $schema_type ){
|
907 |
if(!empty($extra_theme_review)){
|
908 |
$input1 = array_merge($input1, $extra_theme_review);
|
909 |
}
|
910 |
+
|
911 |
+
$input1 = apply_filters('saswp_modify_news_article_schema_output', $input1 );
|
912 |
}
|
913 |
|
914 |
if( 'Service' === $schema_type ){
|
930 |
'@type' => saswp_remove_warnings($schema_data, 'saswp_service_schema_provider_type', 'saswp_string'),
|
931 |
'name' => saswp_remove_warnings($schema_data, 'saswp_service_schema_provider_name', 'saswp_string'),
|
932 |
'image' => array(
|
933 |
+
'@type' => 'ImageObject',
|
934 |
+
'url' => isset($schema_data['saswp_service_schema_image']) ? esc_url($schema_data['saswp_service_schema_image']['url']):'' ,
|
935 |
+
'width' => isset($schema_data['saswp_service_schema_image']) ? esc_attr($schema_data['saswp_service_schema_image']['width']):'' ,
|
936 |
+
'height' => isset($schema_data['saswp_service_schema_image']) ? esc_attr($schema_data['saswp_service_schema_image']['height']):'' ,
|
937 |
),
|
938 |
'@id' => get_permalink(),
|
939 |
'address' => array(
|
1000 |
if(!empty($extra_theme_review)){
|
1001 |
$input1 = array_merge($input1, $extra_theme_review);
|
1002 |
}
|
1003 |
+
|
1004 |
+
$input1 = apply_filters('saswp_modify_service_schema_output', $input1 );
|
1005 |
}
|
1006 |
|
1007 |
if( 'Review' === $schema_type ){
|
1026 |
'author' => array(
|
1027 |
'@type' => 'Person',
|
1028 |
'name' => esc_attr($aurthor_name),
|
1029 |
+
'image' => array(
|
1030 |
'@type' => 'ImageObject',
|
1031 |
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
1032 |
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
1268 |
}
|
1269 |
|
1270 |
}
|
1271 |
+
|
1272 |
+
$input1 = apply_filters('saswp_modify_review_schema_output', $input1 );
|
1273 |
}
|
1274 |
|
1275 |
if( 'VideoObject' === $schema_type){
|
1296 |
'author' => array(
|
1297 |
'@type' => 'Person',
|
1298 |
'name' => esc_attr($aurthor_name),
|
1299 |
+
'image' => array(
|
1300 |
'@type' => 'ImageObject',
|
1301 |
'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
|
1302 |
'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
|
1326 |
$input1 = array_merge($input1, $extra_theme_review);
|
1327 |
}
|
1328 |
|
1329 |
+
$input1 = apply_filters('saswp_modify_video_object_schema_output', $input1 );
|
1330 |
}
|
1331 |
|
1332 |
if( 'local_business' === $schema_type){
|
1415 |
|
1416 |
if(isset($business_details['local_menu'])){
|
1417 |
$input1['hasMenu'] = esc_url($business_details['local_menu']);
|
1418 |
+
}
|
1419 |
+
|
1420 |
+
$input1 = apply_filters('saswp_modify_local_business_schema_output', $input1 );
|
1421 |
}
|
1422 |
|
1423 |
|
1465 |
$all_schema_output[] = $input1;
|
1466 |
}
|
1467 |
//}
|
1468 |
+
}
|
1469 |
+
|
1470 |
+
return apply_filters('saswp_modify_schema_output', $all_schema_output);
|
1471 |
}
|
1472 |
|
1473 |
/**
|
1722 |
'@type' => 'Person',
|
1723 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_author_name_'.$schema_id, 'saswp_array')
|
1724 |
),
|
1725 |
+
'publisher' => array(
|
1726 |
'@type' => 'Organization',
|
1727 |
'logo' => array(
|
1728 |
'@type' => 'ImageObject',
|
1832 |
'author' => array(
|
1833 |
'@type' => 'Person',
|
1834 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_author_name_'.$schema_id, 'saswp_array'), ),
|
1835 |
+
'publisher' => array(
|
1836 |
'@type' => 'Organization',
|
1837 |
'logo' => array(
|
1838 |
'@type' => 'ImageObject',
|
1880 |
'@type' => 'Person',
|
1881 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_article_author_name_'.$schema_id, 'saswp_array')
|
1882 |
),
|
1883 |
+
'publisher' => array(
|
1884 |
'@type' => 'Organization',
|
1885 |
'logo' => array(
|
1886 |
'@type' => 'ImageObject',
|
1921 |
'@type' => 'Person',
|
1922 |
'name' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_author_name_'.$schema_id, 'saswp_array')
|
1923 |
),
|
1924 |
+
'publisher' => array(
|
1925 |
'@type' => 'Organization',
|
1926 |
'logo' => array(
|
1927 |
'@type' => 'ImageObject',
|
2036 |
'mainEntity' => array(
|
2037 |
'@type' => 'WebPage',
|
2038 |
'@id' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_main_entity_'.$schema_id, 'saswp_array'),
|
2039 |
+
'publisher' => array(
|
2040 |
'@type' => 'Organization',
|
2041 |
'logo' => array(
|
2042 |
'@type' => 'ImageObject',
|
2118 |
}
|
2119 |
if(!empty($extra_theme_review)){
|
2120 |
$input1 = array_merge($input1, $extra_theme_review);
|
2121 |
+
}
|
2122 |
+
|
2123 |
+
$service = new saswp_output_service();
|
2124 |
+
$product_details = $service->saswp_woocommerce_product_details(get_the_ID());
|
2125 |
+
|
2126 |
+
|
2127 |
+
if(!empty($product_details['product_reviews'])){
|
2128 |
+
|
2129 |
+
$reviews = array();
|
2130 |
+
|
2131 |
+
foreach ($product_details['product_reviews'] as $review){
|
2132 |
+
|
2133 |
+
$reviews[] = array(
|
2134 |
+
'@type' => 'Review',
|
2135 |
+
'author' => esc_attr($review['author']),
|
2136 |
+
'datePublished' => esc_html($review['datePublished']),
|
2137 |
+
'description' => $review['description'],
|
2138 |
+
'reviewRating' => array(
|
2139 |
+
'@type' => 'Rating',
|
2140 |
+
'bestRating' => '5',
|
2141 |
+
'ratingValue' => esc_attr($review['reviewRating']),
|
2142 |
+
'worstRating' => '1',
|
2143 |
+
)
|
2144 |
+
);
|
2145 |
+
|
2146 |
+
}
|
2147 |
+
$input1['review'] = $reviews;
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
|
2151 |
}
|
2152 |
|
2153 |
if( 'NewsArticle' === $schema_type ){
|
2184 |
'width' => saswp_remove_warnings($author_image, 'width', 'saswp_string')
|
2185 |
),
|
2186 |
),
|
2187 |
+
'publisher' => array(
|
2188 |
'@type' => 'Organization',
|
2189 |
'logo' => array(
|
2190 |
'@type' => 'ImageObject',
|
2233 |
'width' => saswp_remove_warnings($author_image, 'width', 'saswp_string')
|
2234 |
),
|
2235 |
),
|
2236 |
+
'publisher' => array(
|
2237 |
'@type' => 'Organization',
|
2238 |
'logo' => array(
|
2239 |
'@type' => 'ImageObject',
|
2362 |
|
2363 |
if($site_name && $logo && $width && $height){
|
2364 |
|
2365 |
+
$input1['publisher']['@type'] = 'Organization';
|
2366 |
+
$input1['publisher']['name'] = esc_attr($site_name);
|
2367 |
+
$input1['publisher']['logo']['@type'] = 'ImageObject';
|
2368 |
+
$input1['publisher']['logo']['url'] = esc_url($logo);
|
2369 |
+
$input1['publisher']['logo']['width'] = esc_attr($width);
|
2370 |
+
$input1['publisher']['logo']['height'] = esc_attr($height);
|
2371 |
|
2372 |
}
|
2373 |
|
2652 |
}
|
2653 |
}
|
2654 |
}
|
2655 |
+
|
2656 |
+
return apply_filters('saswp_modify_schema_output', $all_schema_output);
|
2657 |
}
|
2658 |
|
2659 |
/**
|
2662 |
* @param type $sd_data
|
2663 |
* @return type
|
2664 |
*/
|
2665 |
+
function saswp_schema_breadcrumb_output(){
|
2666 |
|
2667 |
global $sd_data;
|
2668 |
|
2680 |
'itemListElement' => $bread_crumb_list,
|
2681 |
);
|
2682 |
|
2683 |
+
return apply_filters('saswp_modify_breadcrumb_output', $input);
|
2684 |
|
2685 |
}
|
2686 |
|
2710 |
'name' => $site_name,
|
2711 |
'potentialAction' => array(
|
2712 |
'@type' => 'SearchAction',
|
2713 |
+
'target' => esc_url($site_url).'/?s={search_term_string}',
|
2714 |
'query-input' => 'required name=search_term_string',
|
2715 |
)
|
2716 |
);
|
2717 |
}
|
2718 |
|
2719 |
+
return apply_filters('saswp_modify_website_output', $input);
|
2720 |
}
|
2721 |
|
2722 |
/**
|
2739 |
|
2740 |
if(isset($sd_data['saswp_archive_schema']) && $sd_data['saswp_archive_schema'] == 1){
|
2741 |
|
2742 |
+
$schema_type = $sd_data['saswp_archive_schema_type'];
|
2743 |
|
2744 |
$service_object = new saswp_output_service();
|
2745 |
$logo = $service_object->saswp_get_publisher(true);
|
2823 |
'sameAs' => '',
|
2824 |
'hasPart' => $category_posts
|
2825 |
);
|
2826 |
+
return apply_filters('saswp_modify_archive_output', $input);
|
2827 |
endif;
|
2828 |
}
|
2829 |
}
|
2886 |
if ( get_the_author_meta( 'description', $post_author->ID ) ) {
|
2887 |
$input['description'] = strip_tags( get_the_author_meta( 'description', $post_author->ID ) );
|
2888 |
}
|
2889 |
+
return apply_filters('saswp_modify_author_output', $input);
|
2890 |
}
|
2891 |
}
|
2892 |
}
|
2930 |
$input = array_merge($input, $publisher);
|
2931 |
|
2932 |
}
|
2933 |
+
return apply_filters('saswp_modify_about_page_output', $input);
|
2934 |
}
|
2935 |
|
2936 |
}
|
2967 |
|
2968 |
if(!empty($feature_image)){
|
2969 |
|
2970 |
+
$input = array_merge($input, $feature_image);
|
2971 |
|
2972 |
}
|
2973 |
|
2974 |
if(!empty($publisher)){
|
2975 |
|
2976 |
+
$input = array_merge($input, $publisher);
|
2977 |
|
2978 |
}
|
2979 |
+
return apply_filters('saswp_modify_contact_page_output', $input);
|
2980 |
|
2981 |
}
|
2982 |
|
3006 |
|
3007 |
if(!saswp_non_amp()){
|
3008 |
|
3009 |
+
if($type == 'amp-menu' || $type == 'amp-footer-menu'){
|
3010 |
|
3011 |
foreach($menuItems as $items){
|
3012 |
|
3055 |
|
3056 |
}
|
3057 |
|
3058 |
+
return apply_filters('saswp_modify_sitenavigation_output', $input);
|
3059 |
}
|
output/review-output.php
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
<?php
|
2 |
Class saswp_review_output{
|
3 |
-
|
4 |
-
public function __construct() {
|
5 |
-
}
|
6 |
-
|
7 |
public function saswp_review_hooks(){
|
8 |
add_filter('the_content', array($this, 'saswp_display_review_box'));
|
9 |
|
@@ -129,7 +126,7 @@ Class saswp_review_output{
|
|
129 |
</td>
|
130 |
<td>
|
131 |
<div class="saswp-rvw-ov">
|
132 |
-
<div class="saswp-rvw-fs">'.esc_attr(number_format($saswp_over_all_rating, 2, '.', '')).'</div>';
|
133 |
|
134 |
if($saswp_over_all_rating !=''){
|
135 |
|
1 |
<?php
|
2 |
Class saswp_review_output{
|
3 |
+
|
|
|
|
|
|
|
4 |
public function saswp_review_hooks(){
|
5 |
add_filter('the_content', array($this, 'saswp_display_review_box'));
|
6 |
|
126 |
</td>
|
127 |
<td>
|
128 |
<div class="saswp-rvw-ov">
|
129 |
+
<div class="saswp-rvw-fs">'.isset($saswp_over_all_rating)? esc_attr(number_format($saswp_over_all_rating, 2, '.', '')):''.'</div>';
|
130 |
|
131 |
if($saswp_over_all_rating !=''){
|
132 |
|
output/service.php
CHANGED
@@ -1,9 +1,6 @@
|
|
1 |
<?php
|
2 |
Class saswp_output_service{
|
3 |
-
|
4 |
-
public function __construct() {
|
5 |
|
6 |
-
}
|
7 |
/**
|
8 |
* List of hooks used in current class
|
9 |
*/
|
@@ -1505,7 +1502,7 @@ Class saswp_output_service{
|
|
1505 |
'@type' => 'Person',
|
1506 |
'name' => esc_attr($aurthor_name)
|
1507 |
),
|
1508 |
-
'
|
1509 |
'@type' => 'Organization',
|
1510 |
'logo' => array(
|
1511 |
'@type' => 'ImageObject',
|
@@ -1533,7 +1530,7 @@ Class saswp_output_service{
|
|
1533 |
'@type' => 'Person',
|
1534 |
'name' => esc_attr($aurthor_name)
|
1535 |
),
|
1536 |
-
'
|
1537 |
'@type' => 'Organization',
|
1538 |
'logo' => array(
|
1539 |
'@type' => 'ImageObject',
|
@@ -1571,7 +1568,7 @@ Class saswp_output_service{
|
|
1571 |
'author' => array(
|
1572 |
'@type' => 'Person',
|
1573 |
'name' => esc_attr($aurthor_name), ),
|
1574 |
-
'
|
1575 |
'@type' => 'Organization',
|
1576 |
'logo' => array(
|
1577 |
'@type' => 'ImageObject',
|
@@ -1620,33 +1617,43 @@ Class saswp_output_service{
|
|
1620 |
$image_details = wp_get_attachment_image_src($image_id, 'full');
|
1621 |
|
1622 |
if( is_array($image_details) ){
|
1623 |
-
|
|
|
|
|
1624 |
if(isset($image_details[1]) && ($image_details[1] < 1200) && function_exists('ampforwp_aq_resize')){
|
1625 |
|
1626 |
-
$width = 1280;
|
1627 |
-
$height = 720;
|
1628 |
-
$resize_image = ampforwp_aq_resize( $image_details[0], $width, $height, true, false, true );
|
1629 |
-
$image_details[0] = $resize_image[0];
|
1630 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1631 |
}else{
|
|
|
|
|
|
|
|
|
|
|
1632 |
|
1633 |
-
$width = $image_details[1];
|
1634 |
-
$height = $image_details[2];
|
1635 |
}
|
1636 |
-
|
1637 |
-
$input2['image']['@type'] = 'ImageObject';
|
1638 |
-
$input2['image']['url'] = esc_url($image_details[0]);
|
1639 |
-
$input2['image']['width'] = esc_attr($width);
|
1640 |
-
$input2['image']['height'] = esc_attr($height);
|
1641 |
|
1642 |
}else{
|
1643 |
|
1644 |
if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] !=''){
|
1645 |
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
|
1651 |
}
|
1652 |
|
@@ -1702,12 +1709,12 @@ Class saswp_output_service{
|
|
1702 |
|
1703 |
if($logo !='' && $height !='' && $width !=''){
|
1704 |
|
1705 |
-
$publisher['
|
1706 |
-
$publisher['
|
1707 |
-
$publisher['
|
1708 |
-
$publisher['
|
1709 |
-
$publisher['
|
1710 |
-
$publisher['
|
1711 |
|
1712 |
$default_logo['url'] = esc_url($logo);
|
1713 |
$default_logo['height'] = esc_attr($height);
|
1 |
<?php
|
2 |
Class saswp_output_service{
|
|
|
|
|
3 |
|
|
|
4 |
/**
|
5 |
* List of hooks used in current class
|
6 |
*/
|
1502 |
'@type' => 'Person',
|
1503 |
'name' => esc_attr($aurthor_name)
|
1504 |
),
|
1505 |
+
'publisher' => array(
|
1506 |
'@type' => 'Organization',
|
1507 |
'logo' => array(
|
1508 |
'@type' => 'ImageObject',
|
1530 |
'@type' => 'Person',
|
1531 |
'name' => esc_attr($aurthor_name)
|
1532 |
),
|
1533 |
+
'publisher' => array(
|
1534 |
'@type' => 'Organization',
|
1535 |
'logo' => array(
|
1536 |
'@type' => 'ImageObject',
|
1568 |
'author' => array(
|
1569 |
'@type' => 'Person',
|
1570 |
'name' => esc_attr($aurthor_name), ),
|
1571 |
+
'publisher' => array(
|
1572 |
'@type' => 'Organization',
|
1573 |
'logo' => array(
|
1574 |
'@type' => 'ImageObject',
|
1617 |
$image_details = wp_get_attachment_image_src($image_id, 'full');
|
1618 |
|
1619 |
if( is_array($image_details) ){
|
1620 |
+
|
1621 |
+
|
1622 |
+
|
1623 |
if(isset($image_details[1]) && ($image_details[1] < 1200) && function_exists('ampforwp_aq_resize')){
|
1624 |
|
1625 |
+
$width = array(1280, 640, 300);
|
1626 |
+
$height = array(720, 480, 300);
|
|
|
|
|
1627 |
|
1628 |
+
for($i = 0; $i<3; $i++){
|
1629 |
+
|
1630 |
+
$resize_image = ampforwp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
1631 |
+
|
1632 |
+
$input2['image'][$i]['@type'] = 'ImageObject';
|
1633 |
+
$input2['image'][$i]['url'] = esc_url($resize_image[0]);
|
1634 |
+
$input2['image'][$i]['width'] = esc_attr($width[$i]);
|
1635 |
+
$input2['image'][$i]['height'] = esc_attr($height[$i]);
|
1636 |
+
|
1637 |
+
}
|
1638 |
+
|
1639 |
}else{
|
1640 |
+
|
1641 |
+
$input2['image']['@type'] = 'ImageObject';
|
1642 |
+
$input2['image']['url'] = esc_url($image_details[0]);
|
1643 |
+
$input2['image']['width'] = esc_attr($image_details[1]);
|
1644 |
+
$input2['image']['height'] = esc_attr($image_details[2]);
|
1645 |
|
|
|
|
|
1646 |
}
|
1647 |
+
|
|
|
|
|
|
|
|
|
1648 |
|
1649 |
}else{
|
1650 |
|
1651 |
if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] !=''){
|
1652 |
|
1653 |
+
$input2['image']['@type'] = 'ImageObject';
|
1654 |
+
$input2['image']['url'] = esc_url($sd_data['sd_default_image']['url']);
|
1655 |
+
$input2['image']['width'] = esc_attr($sd_data['sd_default_image_width']);
|
1656 |
+
$input2['image']['height'] = esc_attr($sd_data['sd_default_image_height']);
|
1657 |
|
1658 |
}
|
1659 |
|
1709 |
|
1710 |
if($logo !='' && $height !='' && $width !=''){
|
1711 |
|
1712 |
+
$publisher['publisher']['@type'] = 'Organization';
|
1713 |
+
$publisher['publisher']['logo']['@type'] = 'ImageObject';
|
1714 |
+
$publisher['publisher']['logo']['url'] = esc_url($logo);
|
1715 |
+
$publisher['publisher']['logo']['width'] = esc_attr($width);
|
1716 |
+
$publisher['publisher']['logo']['height']= esc_attr($height);
|
1717 |
+
$publisher['publisher']['name'] = esc_attr($site_name);
|
1718 |
|
1719 |
$default_logo['url'] = esc_url($logo);
|
1720 |
$default_logo['height'] = esc_attr($height);
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: magazine3
|
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.1
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -66,7 +66,16 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
66 |
== Changelog ==
|
67 |
|
68 |
|
69 |
-
= 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
* Bug Fixed: Security improvement.
|
72 |
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.1
|
6 |
+
Stable tag: 1.5
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
66 |
== Changelog ==
|
67 |
|
68 |
|
69 |
+
= 1.5 (27 March 2019) =
|
70 |
+
|
71 |
+
* Bug Fixed: Warning - Missing "review" field in product schema for WooCommerce product page. #179
|
72 |
+
* Bug Fixed: Modify schema output with custom filters #178
|
73 |
+
* Bug Fixed: https://schema.org/Publisher should be https://schema.org/publisher #175
|
74 |
+
* Bug Fixed: In AMP schema markup featured image should be 4x3,16x9,1x1 #173
|
75 |
+
* Bug Fixed: Warning - number_format() expects parameter 1 to be float, string given in #172
|
76 |
+
* Bug Fixed: Set-Up wizard is not working when Polylang plugin is activated #170
|
77 |
+
|
78 |
+
= 1.4 (26 March 2019) =
|
79 |
|
80 |
* Bug Fixed: Security improvement.
|
81 |
|
structured-data-for-wp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
-
Version: 1.
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
@@ -13,7 +13,7 @@ License: GPL2
|
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
-
define('SASWP_VERSION', '1.
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
+
Version: 1.5
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
+
define('SASWP_VERSION', '1.5');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
view/paywall.php
CHANGED
@@ -36,7 +36,7 @@
|
|
36 |
|
37 |
<div class="misc-pub-section">
|
38 |
|
39 |
-
<table class="option-table-class">
|
40 |
<tbody>
|
41 |
<tr>
|
42 |
<td><label for="notAccessibleForFree"><?php echo esc_html__( 'Paywall', 'schema-and-structured-data-for-wp' ) ?></label></td>
|
36 |
|
37 |
<div class="misc-pub-section">
|
38 |
|
39 |
+
<table class="option-table-class saswp-paywall-table-class">
|
40 |
<tbody>
|
41 |
<tr>
|
42 |
<td><label for="notAccessibleForFree"><?php echo esc_html__( 'Paywall', 'schema-and-structured-data-for-wp' ) ?></label></td>
|
view/review.php
CHANGED
@@ -1,14 +1,15 @@
|
|
1 |
<?php
|
2 |
class saswp_metaboxes_review {
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
7 |
|
8 |
add_action( 'add_meta_boxes', array( $this, 'saswp_review_add_meta_box' ) );
|
9 |
add_action( 'save_post', array( $this, 'saswp_review_save' ) );
|
10 |
|
11 |
}
|
|
|
12 |
function saswp_review_add_meta_box($post) {
|
13 |
|
14 |
global $sd_data;
|
1 |
<?php
|
2 |
class saswp_metaboxes_review {
|
3 |
|
4 |
+
private $screen = array();
|
5 |
|
6 |
+
public function __construct() {
|
7 |
|
8 |
add_action( 'add_meta_boxes', array( $this, 'saswp_review_add_meta_box' ) );
|
9 |
add_action( 'save_post', array( $this, 'saswp_review_save' ) );
|
10 |
|
11 |
}
|
12 |
+
|
13 |
function saswp_review_add_meta_box($post) {
|
14 |
|
15 |
global $sd_data;
|
view/schema_type.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
|
6 |
if($post_specific == 1 && isset($schema_id)){
|
7 |
|
8 |
-
$post_fix = '_'
|
9 |
|
10 |
}
|
11 |
|
@@ -344,6 +344,8 @@
|
|
344 |
|
345 |
}
|
346 |
|
|
|
|
|
347 |
function saswp_get_item_reviewed_fields(){
|
348 |
|
349 |
if ( ! isset( $_GET['saswp_security_nonce'] ) ){
|
@@ -354,7 +356,7 @@
|
|
354 |
}
|
355 |
|
356 |
$post_specific = '';
|
357 |
-
$output ='';
|
358 |
$item = sanitize_text_field($_GET['item']);
|
359 |
$schema_id = sanitize_text_field($_GET['schema_id']);
|
360 |
$post_id = sanitize_text_field($_GET['post_id']);
|
@@ -491,12 +493,9 @@
|
|
491 |
|
492 |
wp_die();
|
493 |
}
|
494 |
-
|
495 |
-
add_action( 'wp_ajax_saswp_get_item_reviewed_fields', 'saswp_get_item_reviewed_fields' ) ;
|
496 |
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
function saswp_schema_type_add_meta_box() {
|
501 |
|
502 |
add_meta_box(
|
@@ -1592,6 +1591,8 @@
|
|
1592 |
<?php
|
1593 |
}
|
1594 |
|
|
|
|
|
1595 |
function saswp_schema_type_add_meta_box_save( $post_id ) {
|
1596 |
|
1597 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
|
5 |
|
6 |
if($post_specific == 1 && isset($schema_id)){
|
7 |
|
8 |
+
$post_fix = '_'.esc_attr($schema_id);
|
9 |
|
10 |
}
|
11 |
|
344 |
|
345 |
}
|
346 |
|
347 |
+
add_action( 'wp_ajax_saswp_get_item_reviewed_fields', 'saswp_get_item_reviewed_fields' ) ;
|
348 |
+
|
349 |
function saswp_get_item_reviewed_fields(){
|
350 |
|
351 |
if ( ! isset( $_GET['saswp_security_nonce'] ) ){
|
356 |
}
|
357 |
|
358 |
$post_specific = '';
|
359 |
+
$output = '';
|
360 |
$item = sanitize_text_field($_GET['item']);
|
361 |
$schema_id = sanitize_text_field($_GET['schema_id']);
|
362 |
$post_id = sanitize_text_field($_GET['post_id']);
|
493 |
|
494 |
wp_die();
|
495 |
}
|
|
|
|
|
496 |
|
497 |
+
add_action( 'add_meta_boxes', 'saswp_schema_type_add_meta_box' ) ;
|
498 |
+
|
|
|
499 |
function saswp_schema_type_add_meta_box() {
|
500 |
|
501 |
add_meta_box(
|
1591 |
<?php
|
1592 |
}
|
1593 |
|
1594 |
+
add_action( 'save_post', 'saswp_schema_type_add_meta_box_save' ) ;
|
1595 |
+
|
1596 |
function saswp_schema_type_add_meta_box_save( $post_id ) {
|
1597 |
|
1598 |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
|