@@ -341,7 +341,7 @@ function saswp_schema_output() {
341
341
342
342
$ input1 = array (
343
343
'@context ' => 'http://schema.org ' ,
344
- '@type ' => $ schema_type ,
344
+ '@type ' => ' BlogPosting ' ,
345
345
346
346
'mainEntityOfPage ' => get_permalink (),
347
347
'headline ' => get_the_title (),
@@ -650,7 +650,7 @@ function saswp_schema_output() {
650
650
'author ' => array (
651
651
'@type ' => 'Person ' ,
652
652
'name ' => esc_attr ($ aurthor_name ),
653
- 'Image ' => array (
653
+ 'image ' => array (
654
654
'@type ' => 'ImageObject ' ,
655
655
'url ' => saswp_remove_warnings ($ author_details , 'url ' , 'saswp_string ' ),
656
656
'height ' => saswp_remove_warnings ($ author_details , 'height ' , 'saswp_string ' ),
@@ -1026,7 +1026,7 @@ function saswp_schema_output() {
1026
1026
'author ' => array (
1027
1027
'@type ' => 'Person ' ,
1028
1028
'name ' => esc_attr ($ aurthor_name ),
1029
- 'Image ' => array (
1029
+ 'image ' => array (
1030
1030
'@type ' => 'ImageObject ' ,
1031
1031
'url ' => saswp_remove_warnings ($ author_details , 'url ' , 'saswp_string ' ),
1032
1032
'height ' => saswp_remove_warnings ($ author_details , 'height ' , 'saswp_string ' ),
@@ -1296,7 +1296,7 @@ function saswp_schema_output() {
1296
1296
'author ' => array (
1297
1297
'@type ' => 'Person ' ,
1298
1298
'name ' => esc_attr ($ aurthor_name ),
1299
- 'Image ' => array (
1299
+ 'image ' => array (
1300
1300
'@type ' => 'ImageObject ' ,
1301
1301
'url ' => saswp_remove_warnings ($ author_details , 'url ' , 'saswp_string ' ),
1302
1302
'height ' => saswp_remove_warnings ($ author_details , 'height ' , 'saswp_string ' ),
@@ -1722,7 +1722,7 @@ function saswp_post_specific_schema_output() {
1722
1722
'@type ' => 'Person ' ,
1723
1723
'name ' => saswp_remove_warnings ($ all_post_meta , 'saswp_blogposting_author_name_ ' .$ schema_id , 'saswp_array ' )
1724
1724
),
1725
- 'Publisher ' => array (
1725
+ 'publisher ' => array (
1726
1726
'@type ' => 'Organization ' ,
1727
1727
'logo ' => array (
1728
1728
'@type ' => 'ImageObject ' ,
@@ -1832,7 +1832,7 @@ function saswp_post_specific_schema_output() {
1832
1832
'author ' => array (
1833
1833
'@type ' => 'Person ' ,
1834
1834
'name ' => saswp_remove_warnings ($ all_post_meta , 'saswp_webpage_author_name_ ' .$ schema_id , 'saswp_array ' ), ),
1835
- 'Publisher ' => array (
1835
+ 'publisher ' => array (
1836
1836
'@type ' => 'Organization ' ,
1837
1837
'logo ' => array (
1838
1838
'@type ' => 'ImageObject ' ,
@@ -1880,7 +1880,7 @@ function saswp_post_specific_schema_output() {
1880
1880
'@type ' => 'Person ' ,
1881
1881
'name ' => saswp_remove_warnings ($ all_post_meta , 'saswp_article_author_name_ ' .$ schema_id , 'saswp_array ' )
1882
1882
),
1883
- 'Publisher ' => array (
1883
+ 'publisher ' => array (
1884
1884
'@type ' => 'Organization ' ,
1885
1885
'logo ' => array (
1886
1886
'@type ' => 'ImageObject ' ,
@@ -1921,7 +1921,7 @@ function saswp_post_specific_schema_output() {
1921
1921
'@type ' => 'Person ' ,
1922
1922
'name ' => saswp_remove_warnings ($ all_post_meta , 'saswp_tech_article_author_name_ ' .$ schema_id , 'saswp_array ' )
1923
1923
),
1924
- 'Publisher ' => array (
1924
+ 'publisher ' => array (
1925
1925
'@type ' => 'Organization ' ,
1926
1926
'logo ' => array (
1927
1927
'@type ' => 'ImageObject ' ,
@@ -2036,7 +2036,7 @@ function saswp_post_specific_schema_output() {
2036
2036
'mainEntity ' => array (
2037
2037
'@type ' => 'WebPage ' ,
2038
2038
'@id ' => saswp_remove_warnings ($ all_post_meta , 'saswp_recipe_main_entity_ ' .$ schema_id , 'saswp_array ' ),
2039
- 'Publisher ' => array (
2039
+ 'publisher ' => array (
2040
2040
'@type ' => 'Organization ' ,
2041
2041
'logo ' => array (
2042
2042
'@type ' => 'ImageObject ' ,
@@ -2118,7 +2118,36 @@ function saswp_post_specific_schema_output() {
2118
2118
}
2119
2119
if (!empty ($ extra_theme_review )){
2120
2120
$ input1 = array_merge ($ input1 , $ extra_theme_review );
2121
- }
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
+
2122
2151
}
2123
2152
2124
2153
if ( 'NewsArticle ' === $ schema_type ){
@@ -2155,7 +2184,7 @@ function saswp_post_specific_schema_output() {
2155
2184
'width ' => saswp_remove_warnings ($ author_image , 'width ' , 'saswp_string ' )
2156
2185
),
2157
2186
),
2158
- 'Publisher ' => array (
2187
+ 'publisher ' => array (
2159
2188
'@type ' => 'Organization ' ,
2160
2189
'logo ' => array (
2161
2190
'@type ' => 'ImageObject ' ,
@@ -2204,7 +2233,7 @@ function saswp_post_specific_schema_output() {
2204
2233
'width ' => saswp_remove_warnings ($ author_image , 'width ' , 'saswp_string ' )
2205
2234
),
2206
2235
),
2207
- 'Publisher ' => array (
2236
+ 'publisher ' => array (
2208
2237
'@type ' => 'Organization ' ,
2209
2238
'logo ' => array (
2210
2239
'@type ' => 'ImageObject ' ,
@@ -2333,12 +2362,12 @@ function saswp_post_specific_schema_output() {
2333
2362
2334
2363
if ($ site_name && $ logo && $ width && $ height ){
2335
2364
2336
- $ input1 ['Publisher ' ]['@type ' ] = 'Organization ' ;
2337
- $ input1 ['Publisher ' ]['name ' ] = esc_attr ($ site_name );
2338
- $ input1 ['Publisher ' ]['logo ' ]['@type ' ] = 'ImageObject ' ;
2339
- $ input1 ['Publisher ' ]['logo ' ]['url ' ] = esc_url ($ logo );
2340
- $ input1 ['Publisher ' ]['logo ' ]['width ' ] = esc_attr ($ width );
2341
- $ input1 ['Publisher ' ]['logo ' ]['height ' ] = esc_attr ($ height );
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 );
2342
2371
2343
2372
}
2344
2373
@@ -2977,7 +3006,7 @@ function saswp_site_navigation_output(){
2977
3006
2978
3007
if (!saswp_non_amp ()){
2979
3008
2980
- if ($ type == 'amp-menu ' ){
3009
+ if ($ type == 'amp-menu ' || $ type == ' amp-footer-menu ' ){
2981
3010
2982
3011
foreach ($ menuItems as $ items ){
2983
3012
0 commit comments