Version Description
(02 March 2021) =
- Fixed: The script tag contains invalid JSON that cannot be parsed. #1328
- Fixed: Service schema type's Image field is missing. #1329
- Added: Vehicle schema type #629
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.9.65 |
Comparing to | |
See all releases |
Code changes from version 1.9.64 to 1.9.65
- core/array-list/schema-properties.php +138 -0
- core/array-list/schemas.php +2 -1
- core/global.php +1 -0
- output/function.php +4 -1
- output/markup.php +165 -0
- output/output.php +29 -2
- output/service.php +82 -1
- readme.txt +6 -1
- structured-data-for-wp.php +2 -2
core/array-list/schema-properties.php
CHANGED
@@ -5120,6 +5120,144 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
5120 |
);
|
5121 |
|
5122 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5123 |
case 'CreativeWorkSeries':
|
5124 |
|
5125 |
$meta_field = array(
|
5120 |
);
|
5121 |
|
5122 |
break;
|
5123 |
+
|
5124 |
+
case 'Vehicle':
|
5125 |
+
|
5126 |
+
$meta_field = array(
|
5127 |
+
array(
|
5128 |
+
'label' => 'Name',
|
5129 |
+
'id' => 'saswp_vehicle_schema_name_'.$schema_id,
|
5130 |
+
'type' => 'text',
|
5131 |
+
),
|
5132 |
+
array(
|
5133 |
+
'label' => 'Description',
|
5134 |
+
'id' => 'saswp_vehicle_schema_description_'.$schema_id,
|
5135 |
+
'type' => 'textarea',
|
5136 |
+
),
|
5137 |
+
array(
|
5138 |
+
'label' => 'URL',
|
5139 |
+
'id' => 'saswp_vehicle_schema_url_'.$schema_id,
|
5140 |
+
'type' => 'text',
|
5141 |
+
),
|
5142 |
+
array(
|
5143 |
+
'label' => 'Model',
|
5144 |
+
'id' => 'saswp_vehicle_schema_model_'.$schema_id,
|
5145 |
+
'type' => 'text',
|
5146 |
+
),
|
5147 |
+
array(
|
5148 |
+
'label' => 'Image',
|
5149 |
+
'id' => 'saswp_vehicle_schema_image_'.$schema_id,
|
5150 |
+
'type' => 'text',
|
5151 |
+
),
|
5152 |
+
array(
|
5153 |
+
'label' => 'Body Type',
|
5154 |
+
'id' => 'saswp_vehicle_schema_body_type_'.$schema_id,
|
5155 |
+
'type' => 'text',
|
5156 |
+
),
|
5157 |
+
array(
|
5158 |
+
'label' => 'Fuel Type',
|
5159 |
+
'id' => 'saswp_vehicle_schema_fuel_type_'.$schema_id,
|
5160 |
+
'type' => 'text',
|
5161 |
+
),
|
5162 |
+
array(
|
5163 |
+
'label' => 'Fuel Efficiency',
|
5164 |
+
'id' => 'saswp_vehicle_schema_fuel_efficiency_'.$schema_id,
|
5165 |
+
'type' => 'text',
|
5166 |
+
),
|
5167 |
+
array(
|
5168 |
+
'label' => 'Seating Capacity',
|
5169 |
+
'id' => 'saswp_vehicle_schema_seating_capacity_'.$schema_id,
|
5170 |
+
'type' => 'text',
|
5171 |
+
),
|
5172 |
+
array(
|
5173 |
+
'label' => 'Number Of Doors',
|
5174 |
+
'id' => 'saswp_vehicle_schema_number_of_doors_'.$schema_id,
|
5175 |
+
'type' => 'text',
|
5176 |
+
),
|
5177 |
+
array(
|
5178 |
+
'label' => 'Weight',
|
5179 |
+
'id' => 'saswp_vehicle_schema_weight_'.$schema_id,
|
5180 |
+
'type' => 'text',
|
5181 |
+
),
|
5182 |
+
array(
|
5183 |
+
'label' => 'Width',
|
5184 |
+
'id' => 'saswp_vehicle_schema_width_'.$schema_id,
|
5185 |
+
'type' => 'text',
|
5186 |
+
),
|
5187 |
+
array(
|
5188 |
+
'label' => 'Height',
|
5189 |
+
'id' => 'saswp_vehicle_schema_height_'.$schema_id,
|
5190 |
+
'type' => 'text',
|
5191 |
+
),
|
5192 |
+
array(
|
5193 |
+
'label' => 'SKU',
|
5194 |
+
'id' => 'saswp_vehicle_schema_sku_'.$schema_id,
|
5195 |
+
'type' => 'text',
|
5196 |
+
),
|
5197 |
+
array(
|
5198 |
+
'label' => 'MPN',
|
5199 |
+
'id' => 'saswp_vehicle_schema_mpn_'.$schema_id,
|
5200 |
+
'type' => 'text',
|
5201 |
+
),
|
5202 |
+
array(
|
5203 |
+
'label' => 'Brand',
|
5204 |
+
'id' => 'saswp_vehicle_schema_brand_name'.$schema_id,
|
5205 |
+
'type' => 'text',
|
5206 |
+
),
|
5207 |
+
array(
|
5208 |
+
'label' => 'Manufacturer',
|
5209 |
+
'id' => 'saswp_vehicle_schema_manufacturer_'.$schema_id,
|
5210 |
+
'type' => 'text',
|
5211 |
+
),
|
5212 |
+
array(
|
5213 |
+
'label' => 'Price',
|
5214 |
+
'id' => 'saswp_vehicle_schema_price_'.$schema_id,
|
5215 |
+
'type' => 'text',
|
5216 |
+
),
|
5217 |
+
array(
|
5218 |
+
'label' => 'High Price',
|
5219 |
+
'id' => 'saswp_vehicle_schema_high_price_'.$schema_id,
|
5220 |
+
'type' => 'text'
|
5221 |
+
),
|
5222 |
+
array(
|
5223 |
+
'label' => 'Low Price',
|
5224 |
+
'id' => 'saswp_vehicle_schema_low_price_'.$schema_id,
|
5225 |
+
'type' => 'text'
|
5226 |
+
),
|
5227 |
+
array(
|
5228 |
+
'label' => 'Offer Count',
|
5229 |
+
'id' => 'saswp_vehicle_schema_offer_count_'.$schema_id,
|
5230 |
+
'type' => 'text'
|
5231 |
+
),
|
5232 |
+
array(
|
5233 |
+
'label' => 'Price Valid Until',
|
5234 |
+
'id' => 'saswp_vehicle_schema_priceValidUntil_'.$schema_id,
|
5235 |
+
'type' => 'text'
|
5236 |
+
),
|
5237 |
+
array(
|
5238 |
+
'label' => 'Currency',
|
5239 |
+
'id' => 'saswp_vehicle_schema_currency_'.$schema_id,
|
5240 |
+
'type' => 'text'
|
5241 |
+
),
|
5242 |
+
array(
|
5243 |
+
'label' => 'Aggregate Rating',
|
5244 |
+
'id' => 'saswp_vehicle_schema_enable_rating_'.$schema_id,
|
5245 |
+
'type' => 'checkbox',
|
5246 |
+
),
|
5247 |
+
array(
|
5248 |
+
'label' => 'Rating',
|
5249 |
+
'id' => 'saswp_vehicle_schema_rating_value_'.$schema_id,
|
5250 |
+
'type' => 'text',
|
5251 |
+
),
|
5252 |
+
array(
|
5253 |
+
'label' => 'Rating Count',
|
5254 |
+
'id' => 'saswp_vehicle_schema_rating_count_'.$schema_id,
|
5255 |
+
'type' => 'text',
|
5256 |
+
)
|
5257 |
+
);
|
5258 |
+
|
5259 |
+
break;
|
5260 |
+
|
5261 |
case 'CreativeWorkSeries':
|
5262 |
|
5263 |
$meta_field = array(
|
core/array-list/schemas.php
CHANGED
@@ -63,7 +63,8 @@ return array(
|
|
63 |
),
|
64 |
'Product' => array(
|
65 |
'Product' => 'Product',
|
66 |
-
'Car' => 'Car'
|
|
|
67 |
),
|
68 |
'Place' => array(
|
69 |
'TouristAttraction' => 'TouristAttraction',
|
63 |
),
|
64 |
'Product' => array(
|
65 |
'Product' => 'Product',
|
66 |
+
'Car' => 'Car',
|
67 |
+
'Vehicle' => 'Vehicle'
|
68 |
),
|
69 |
'Place' => array(
|
70 |
'TouristAttraction' => 'TouristAttraction',
|
core/global.php
CHANGED
@@ -6,6 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
6 |
$saswp_divi_faq = array();
|
7 |
$with_aggregate = array(
|
8 |
'Car',
|
|
|
9 |
'Book',
|
10 |
'Course',
|
11 |
'HowTo',
|
6 |
$saswp_divi_faq = array();
|
7 |
$with_aggregate = array(
|
8 |
'Car',
|
9 |
+
'Vehicle',
|
10 |
'Book',
|
11 |
'Course',
|
12 |
'HowTo',
|
output/function.php
CHANGED
@@ -498,7 +498,7 @@ function saswp_get_all_schema_markup_output() {
|
|
498 |
$final_output['@context'] = saswp_context_url();
|
499 |
|
500 |
$final_output['@graph'][] = $kb_schema_output;
|
501 |
-
$final_output['@graph'][] = $kb_website_output;
|
502 |
|
503 |
$final_output['@graph'][] = $webpage;
|
504 |
|
@@ -507,6 +507,9 @@ function saswp_get_all_schema_markup_output() {
|
|
507 |
}
|
508 |
|
509 |
$final_output['@graph'][] = $soutput;
|
|
|
|
|
|
|
510 |
|
511 |
$schema = saswp_json_print_format($final_output);
|
512 |
$output .= $schema;
|
498 |
$final_output['@context'] = saswp_context_url();
|
499 |
|
500 |
$final_output['@graph'][] = $kb_schema_output;
|
501 |
+
$final_output['@graph'][] = $kb_website_output;
|
502 |
|
503 |
$final_output['@graph'][] = $webpage;
|
504 |
|
507 |
}
|
508 |
|
509 |
$final_output['@graph'][] = $soutput;
|
510 |
+
|
511 |
+
$final_output['@graph'] = array_filter($final_output['@graph']);
|
512 |
+
$final_output['@graph'] = array_values($final_output['@graph']);
|
513 |
|
514 |
$schema = saswp_json_print_format($final_output);
|
515 |
$output .= $schema;
|
output/markup.php
CHANGED
@@ -3006,7 +3006,172 @@ function saswp_blogposting_schema_markup($schema_id, $schema_post_id, $all_post_
|
|
3006 |
return $input1;
|
3007 |
|
3008 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3009 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3010 |
function saswp_car_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
3011 |
|
3012 |
$input1 = array();
|
3006 |
return $input1;
|
3007 |
|
3008 |
}
|
3009 |
+
function saswp_vehicle_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
3010 |
+
|
3011 |
+
$input1 = array();
|
3012 |
+
|
3013 |
+
$car_image = get_post_meta( get_the_ID(), 'saswp_vehicle_schema_image_'.$schema_id.'_detail',true);
|
3014 |
+
|
3015 |
+
$input1 = array(
|
3016 |
+
'@context' => saswp_context_url(),
|
3017 |
+
'@type' => ['Product','Vehicle'],
|
3018 |
+
'url' => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_url_'.$schema_id, 'saswp_array'),
|
3019 |
+
'name' => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_name_'.$schema_id, 'saswp_array'),
|
3020 |
+
'sku' => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_sku_'.$schema_id, 'saswp_array'),
|
3021 |
+
'description' => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_description_'.$schema_id, 'saswp_array'),
|
3022 |
+
'brand' => array('@type' => 'Thing',
|
3023 |
+
'name' => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_brand_name_'.$schema_id, 'saswp_array'),
|
3024 |
+
)
|
3025 |
+
);
|
3026 |
+
|
3027 |
+
if(isset($car_image['thumbnail']) && $car_image['thumbnail']){
|
3028 |
+
|
3029 |
+
$input1['image']['@type'] = 'ImageObject';
|
3030 |
+
$input1['image']['url'] = $car_image['thumbnail'];
|
3031 |
+
$input1['image']['width'] = $car_image['width'];
|
3032 |
+
$input1['image']['height'] = $car_image['height'];
|
3033 |
+
|
3034 |
+
}
|
3035 |
+
|
3036 |
+
if( (isset($all_post_meta['saswp_vehicle_schema_price_'.$schema_id][0]) && $all_post_meta['saswp_vehicle_schema_price_'.$schema_id][0]) || (isset($all_post_meta['saswp_vehicle_schema_high_price_'.$schema_id][0]) && isset($all_post_meta['saswp_vehicle_schema_low_price_'.$schema_id][0]) ) ){
|
3037 |
+
|
3038 |
+
$input1['offers']['@type'] = 'Offer';
|
3039 |
+
$input1['offers']['availability'] = saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_availability_'.$schema_id, 'saswp_array');
|
3040 |
+
$input1['offers']['itemCondition'] = saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_condition_'.$schema_id, 'saswp_array');
|
3041 |
+
$input1['offers']['price'] = saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_price_'.$schema_id, 'saswp_array');
|
3042 |
+
$input1['offers']['priceCurrency'] = saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_currency_'.$schema_id, 'saswp_array');
|
3043 |
+
$input1['offers']['url'] = trailingslashit(saswp_get_permalink());
|
3044 |
+
$input1['offers']['priceValidUntil'] = isset($all_post_meta['saswp_vehicle_schema_priceValidUntil_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_vehicle_schema_priceValidUntil_'.$schema_id][0])):'';
|
3045 |
+
|
3046 |
+
if( isset($all_post_meta['saswp_vehicle_schema_high_price_'.$schema_id][0]) && isset($all_post_meta['saswp_vehicle_schema_low_price_'.$schema_id][0]) ){
|
3047 |
+
$input1['offers']['@type'] = 'AggregateOffer';
|
3048 |
+
$input1['offers']['highPrice'] = $all_post_meta['saswp_vehicle_schema_high_price_'.$schema_id][0];
|
3049 |
+
$input1['offers']['lowPrice'] = $all_post_meta['saswp_vehicle_schema_low_price_'.$schema_id][0];
|
3050 |
+
|
3051 |
+
if( isset($all_post_meta['saswp_vehicle_schema_offer_count_'.$schema_id][0]) ){
|
3052 |
+
$input1['offers']['offerCount'] = $all_post_meta['saswp_vehicle_schema_offer_count_'.$schema_id][0];
|
3053 |
+
}
|
3054 |
+
|
3055 |
+
}
|
3056 |
+
|
3057 |
+
}
|
3058 |
+
|
3059 |
+
if(isset($all_post_meta['saswp_vehicle_schema_model_'.$schema_id])){
|
3060 |
+
$input1['model'] = esc_attr($all_post_meta['saswp_vehicle_schema_model_'.$schema_id][0]);
|
3061 |
+
}
|
3062 |
+
if(isset($all_post_meta['saswp_vehicle_schema_body_type_'.$schema_id])){
|
3063 |
+
$input1['bodyType'] = esc_attr($all_post_meta['saswp_vehicle_schema_body_type_'.$schema_id][0]);
|
3064 |
+
}
|
3065 |
+
if(isset($all_post_meta['saswp_vehicle_schema_fuel_type_'.$schema_id])){
|
3066 |
+
$input1['fuelType'] = esc_attr($all_post_meta['saswp_vehicle_schema_fuel_type_'.$schema_id][0]);
|
3067 |
+
}
|
3068 |
+
|
3069 |
+
if(isset($all_post_meta['saswp_vehicle_schema_fuel_efficiency_'.$schema_id])){
|
3070 |
+
$input1['fuelEfficiency'] = esc_attr($all_post_meta['saswp_vehicle_schema_fuel_efficiency_'.$schema_id][0]);
|
3071 |
+
}
|
3072 |
+
if(isset($all_post_meta['saswp_vehicle_schema_seating_capacity_'.$schema_id])){
|
3073 |
+
$input1['seatingCapacity'] = esc_attr($all_post_meta['saswp_vehicle_schema_seating_capacity_'.$schema_id][0]);
|
3074 |
+
}
|
3075 |
+
if(isset($all_post_meta['saswp_vehicle_schema_number_of_doors_'.$schema_id])){
|
3076 |
+
$input1['numberOfdoors'] = esc_attr($all_post_meta['saswp_vehicle_schema_number_of_doors_'.$schema_id][0]);
|
3077 |
+
}
|
3078 |
+
|
3079 |
+
if(isset($all_post_meta['saswp_vehicle_schema_weight_'.$schema_id])){
|
3080 |
+
$input1['weight'] = esc_attr($all_post_meta['saswp_vehicle_schema_weight_'.$schema_id][0]);
|
3081 |
+
}
|
3082 |
+
if(isset($all_post_meta['saswp_vehicle_schema_width_'.$schema_id])){
|
3083 |
+
$input1['width'] = esc_attr($all_post_meta['saswp_vehicle_schema_width_'.$schema_id][0]);
|
3084 |
+
}
|
3085 |
+
if(isset($all_post_meta['saswp_vehicle_schema_height_'.$schema_id])){
|
3086 |
+
$input1['height'] = esc_attr($all_post_meta['saswp_vehicle_schema_height_'.$schema_id][0]);
|
3087 |
+
}
|
3088 |
+
|
3089 |
+
if(isset($all_post_meta['saswp_vehicle_schema_manufacturer_'.$schema_id])){
|
3090 |
+
$input1['manufacturer'] = esc_attr($all_post_meta['saswp_vehicle_schema_manufacturer_'.$schema_id][0]);
|
3091 |
+
}
|
3092 |
+
|
3093 |
+
if(isset($all_post_meta['saswp_vehicle_schema_mpn_'.$schema_id])){
|
3094 |
+
$input1['mpn'] = esc_attr($all_post_meta['saswp_vehicle_schema_mpn_'.$schema_id][0]);
|
3095 |
+
}
|
3096 |
+
|
3097 |
+
if(saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_rating_value_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_rating_count_'.$schema_id, 'saswp_array')){
|
3098 |
+
|
3099 |
+
$input1['aggregateRating'] = array(
|
3100 |
+
"@type" => "AggregateRating",
|
3101 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_rating_value_'.$schema_id, 'saswp_array'),
|
3102 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_vehicle_schema_rating_count_'.$schema_id, 'saswp_array')
|
3103 |
+
);
|
3104 |
+
}
|
3105 |
+
|
3106 |
+
|
3107 |
+
$itinerary = get_post_meta($schema_post_id, 'car_reviews_'.$schema_id, true);
|
3108 |
+
|
3109 |
+
$itinerary_arr = array();
|
3110 |
|
3111 |
+
if(!empty($itinerary)){
|
3112 |
+
|
3113 |
+
foreach($itinerary as $review){
|
3114 |
+
|
3115 |
+
$review_fields = array();
|
3116 |
+
|
3117 |
+
$review_fields['@type'] = 'Review';
|
3118 |
+
$review_fields['author'] = esc_attr($review['saswp_vehicle_reviews_reviewer_name']);
|
3119 |
+
|
3120 |
+
if(isset($review['saswp_vehicle_reviews_created_date'])){
|
3121 |
+
$review_fields['datePublished'] = esc_html($review['saswp_vehicle_reviews_created_date']);
|
3122 |
+
}
|
3123 |
+
if(isset($review['saswp_vehicle_reviews_text'])){
|
3124 |
+
$review_fields['description'] = esc_textarea($review['saswp_vehicle_reviews_text']);
|
3125 |
+
}
|
3126 |
+
|
3127 |
+
if(is_int($review['saswp_vehicle_reviews_reviewer_rating'])){
|
3128 |
+
|
3129 |
+
$review_fields['reviewRating']['@type'] = 'Rating';
|
3130 |
+
$review_fields['reviewRating']['bestRating'] = '5';
|
3131 |
+
$review_fields['reviewRating']['ratingValue'] = esc_attr($review['saswp_vehicle_reviews_reviewer_rating']);
|
3132 |
+
$review_fields['reviewRating']['worstRating'] = '1';
|
3133 |
+
|
3134 |
+
}
|
3135 |
+
|
3136 |
+
$itinerary_arr[] = $review_fields;
|
3137 |
+
}
|
3138 |
+
$input1['review'] = $itinerary_arr;
|
3139 |
+
}
|
3140 |
+
|
3141 |
+
$service = new saswp_output_service();
|
3142 |
+
$car_details = $service->saswp_woocommerce_product_details(get_the_ID());
|
3143 |
+
|
3144 |
+
if(!empty($car_details['car_reviews'])){
|
3145 |
+
|
3146 |
+
$reviews = array();
|
3147 |
+
|
3148 |
+
foreach ($car_details['car_reviews'] as $review){
|
3149 |
+
|
3150 |
+
$review_fields = array();
|
3151 |
+
|
3152 |
+
$review_fields['@type'] = 'Review';
|
3153 |
+
$review_fields['author'] = esc_attr($review['author']);
|
3154 |
+
$review_fields['datePublished'] = esc_html($review['datePublished']);
|
3155 |
+
$review_fields['description'] = $review['description'];
|
3156 |
+
|
3157 |
+
if(isset($review['reviewRating']) && $review['reviewRating'] !=''){
|
3158 |
+
|
3159 |
+
$review_fields['reviewRating']['@type'] = 'Rating';
|
3160 |
+
$review_fields['reviewRating']['bestRating'] = '5';
|
3161 |
+
$review_fields['reviewRating']['ratingValue'] = esc_attr($review['reviewRating']);
|
3162 |
+
$review_fields['reviewRating']['worstRating'] = '1';
|
3163 |
+
|
3164 |
+
}
|
3165 |
+
|
3166 |
+
$reviews[] = $review_fields;
|
3167 |
+
|
3168 |
+
}
|
3169 |
+
$input1['review'] = $reviews;
|
3170 |
+
}
|
3171 |
+
|
3172 |
+
return $input1;
|
3173 |
+
|
3174 |
+
}
|
3175 |
function saswp_car_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
3176 |
|
3177 |
$input1 = array();
|
output/output.php
CHANGED
@@ -840,8 +840,7 @@ function saswp_schema_output() {
|
|
840 |
|
841 |
$input1 = array(
|
842 |
'@context' => saswp_context_url(),
|
843 |
-
'@type' => ['Product', 'Car'],
|
844 |
-
//'@type' => 'Car',
|
845 |
'url' => trailingslashit(saswp_get_current_url()),
|
846 |
'description' => saswp_get_the_excerpt(),
|
847 |
'name' => saswp_get_the_title(),
|
@@ -865,6 +864,34 @@ function saswp_schema_output() {
|
|
865 |
|
866 |
break;
|
867 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
868 |
case 'CreativeWorkSeries':
|
869 |
|
870 |
$input1 = array(
|
840 |
|
841 |
$input1 = array(
|
842 |
'@context' => saswp_context_url(),
|
843 |
+
'@type' => ['Product', 'Car'],
|
|
|
844 |
'url' => trailingslashit(saswp_get_current_url()),
|
845 |
'description' => saswp_get_the_excerpt(),
|
846 |
'name' => saswp_get_the_title(),
|
864 |
|
865 |
break;
|
866 |
|
867 |
+
case 'Vehicle':
|
868 |
+
|
869 |
+
$input1 = array(
|
870 |
+
'@context' => saswp_context_url(),
|
871 |
+
'@type' => ['Product', 'Vehicle'],
|
872 |
+
'url' => trailingslashit(saswp_get_current_url()),
|
873 |
+
'description' => saswp_get_the_excerpt(),
|
874 |
+
'name' => saswp_get_the_title(),
|
875 |
+
);
|
876 |
+
|
877 |
+
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] == 1){
|
878 |
+
$input1['comment'] = saswp_get_comments(get_the_ID());
|
879 |
+
}
|
880 |
+
|
881 |
+
$input1 = saswp_append_fetched_reviews($input1, $schema_post_id);
|
882 |
+
|
883 |
+
$input1 = apply_filters('saswp_modify_vehicle_schema_output', $input1 );
|
884 |
+
|
885 |
+
$input1 = saswp_get_modified_markup($input1, $schema_type, $schema_post_id, $schema_options);
|
886 |
+
|
887 |
+
if($modified_schema == 1){
|
888 |
+
|
889 |
+
$input1 = saswp_vehicle_schema_markup($schema_post_id, get_the_ID(), $all_post_meta);
|
890 |
+
|
891 |
+
}
|
892 |
+
|
893 |
+
break;
|
894 |
+
|
895 |
case 'CreativeWorkSeries':
|
896 |
|
897 |
$input1 = array(
|
output/service.php
CHANGED
@@ -2265,6 +2265,82 @@ Class saswp_output_service{
|
|
2265 |
|
2266 |
break;
|
2267 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2268 |
case 'RentAction':
|
2269 |
|
2270 |
if(isset($custom_fields['saswp_rent_action_agent_name'])){
|
@@ -2429,6 +2505,10 @@ Class saswp_output_service{
|
|
2429 |
if(isset($custom_fields['saswp_service_schema_provider_type']) && isset($custom_fields['saswp_service_schema_provider_name'])){
|
2430 |
$input1['provider']['@type'] = $custom_fields['saswp_service_schema_provider_type'];
|
2431 |
$input1['provider']['name'] = $custom_fields['saswp_service_schema_provider_name'];
|
|
|
|
|
|
|
|
|
2432 |
}
|
2433 |
if(isset($custom_fields['saswp_service_schema_price_range'])){
|
2434 |
$input1['provider']['priceRange'] = $custom_fields['saswp_service_schema_price_range'];
|
@@ -4339,7 +4419,8 @@ Class saswp_output_service{
|
|
4339 |
case 'SoftwareApplication':
|
4340 |
case 'MobileApplication':
|
4341 |
case 'Book':
|
4342 |
-
case 'Car':
|
|
|
4343 |
|
4344 |
$product_details = $this->saswp_woocommerce_product_details(get_the_ID());
|
4345 |
|
2265 |
|
2266 |
break;
|
2267 |
|
2268 |
+
case 'Vehicle':
|
2269 |
+
if(isset($custom_fields['saswp_vehicle_schema_model'])){
|
2270 |
+
$input1['model'] = $custom_fields['saswp_vehicle_schema_model'];
|
2271 |
+
}
|
2272 |
+
if(isset($custom_fields['saswp_vehicle_schema_body_type'])){
|
2273 |
+
$input1['bodyType'] = $custom_fields['saswp_vehicle_schema_body_type'];
|
2274 |
+
}
|
2275 |
+
if(isset($custom_fields['saswp_vehicle_schema_fuel_efficiency'])){
|
2276 |
+
$input1['fuelEfficiency'] = $custom_fields['saswp_vehicle_schema_fuel_efficiency'];
|
2277 |
+
}
|
2278 |
+
if(isset($custom_fields['saswp_vehicle_schema_seating_capacity'])){
|
2279 |
+
$input1['seatingCapacity'] = $custom_fields['saswp_vehicle_schema_seating_capacity'];
|
2280 |
+
}
|
2281 |
+
if(isset($custom_fields['saswp_vehicle_schema_number_of_doors'])){
|
2282 |
+
$input1['numberOfdoors'] = $custom_fields['saswp_vehicle_schema_number_of_doors'];
|
2283 |
+
}
|
2284 |
+
if(isset($custom_fields['saswp_vehicle_schema_weight'])){
|
2285 |
+
$input1['weight'] = $custom_fields['saswp_vehicle_schema_weight'];
|
2286 |
+
}
|
2287 |
+
if(isset($custom_fields['saswp_vehicle_schema_width'])){
|
2288 |
+
$input1['width'] = $custom_fields['saswp_vehicle_schema_width'];
|
2289 |
+
}
|
2290 |
+
if(isset($custom_fields['saswp_vehicle_schema_height'])){
|
2291 |
+
$input1['height'] = $custom_fields['saswp_vehicle_schema_height'];
|
2292 |
+
}
|
2293 |
+
if(isset($custom_fields['saswp_vehicle_schema_manufacturer'])){
|
2294 |
+
$input1['manufacturer'] = $custom_fields['saswp_vehicle_schema_manufacturer'];
|
2295 |
+
}
|
2296 |
+
if(isset($custom_fields['saswp_vehicle_schema_url'])){
|
2297 |
+
$input1['url'] = saswp_validate_url($custom_fields['saswp_vehicle_schema_url']);
|
2298 |
+
}
|
2299 |
+
if(isset($custom_fields['saswp_vehicle_schema_name'])){
|
2300 |
+
$input1['name'] = $custom_fields['saswp_vehicle_schema_name'];
|
2301 |
+
}
|
2302 |
+
if(isset($custom_fields['saswp_vehicle_schema_brand_name'])){
|
2303 |
+
$input1['brand']['name'] = $custom_fields['saswp_vehicle_schema_brand_name'];
|
2304 |
+
}
|
2305 |
+
if(isset($custom_fields['saswp_vehicle_schema_mpn'])){
|
2306 |
+
$input1['mpn'] = $custom_fields['saswp_vehicle_schema_mpn'];
|
2307 |
+
}
|
2308 |
+
if(isset($custom_fields['saswp_vehicle_schema_description'])){
|
2309 |
+
$input1['description'] = wp_strip_all_tags(strip_shortcodes( $custom_fields['saswp_vehicle_schema_description'] ));
|
2310 |
+
}
|
2311 |
+
if(isset($custom_fields['saswp_vehicle_schema_image'])){
|
2312 |
+
$input1['image'] = $custom_fields['saswp_vehicle_schema_image'];
|
2313 |
+
}
|
2314 |
+
if(isset($custom_fields['saswp_vehicle_schema_price'])){
|
2315 |
+
$input1['offers']['price'] = $custom_fields['saswp_vehicle_schema_price'];
|
2316 |
+
}
|
2317 |
+
if(isset($custom_fields['saswp_vehicle_schema_currency'])){
|
2318 |
+
$input1['offers']['priceCurrency'] = $custom_fields['saswp_vehicle_schema_currency'];
|
2319 |
+
}
|
2320 |
+
if(isset($custom_fields['saswp_vehicle_schema_priceValidUntil'])){
|
2321 |
+
$input1['offers']['priceValidUntil'] = $custom_fields['saswp_vehicle_schema_priceValidUntil'];
|
2322 |
+
}
|
2323 |
+
if(isset($custom_fields['saswp_vehicle_schema_sku'])){
|
2324 |
+
$input1['sku'] = $custom_fields['saswp_vehicle_schema_sku'];
|
2325 |
+
}
|
2326 |
+
if( isset($custom_fields['saswp_vehicle_schema_high_price']) && isset($custom_fields['saswp_vehicle_schema_low_price']) ){
|
2327 |
+
|
2328 |
+
$input1['offers']['@type'] = 'AggregateOffer';
|
2329 |
+
$input1['offers']['highPrice'] = $custom_fields['saswp_vehicle_schema_high_price'];
|
2330 |
+
$input1['offers']['lowPrice'] = $custom_fields['saswp_vehicle_schema_low_price'];
|
2331 |
+
|
2332 |
+
if(isset($custom_fields['saswp_vehicle_schema_offer_count'])){
|
2333 |
+
$input1['offers']['offerCount'] = $custom_fields['saswp_vehicle_schema_offer_count'];
|
2334 |
+
}
|
2335 |
+
}
|
2336 |
+
if(isset($custom_fields['saswp_vehicle_schema_rating']) && isset($custom_fields['saswp_vehicle_schema_rating_count'])){
|
2337 |
+
$input1['aggregateRating']['@type'] = 'aggregateRating';
|
2338 |
+
$input1['aggregateRating']['ratingValue'] = $custom_fields['saswp_vehicle_schema_rating'];
|
2339 |
+
$input1['aggregateRating']['reviewCount'] = $custom_fields['saswp_vehicle_schema_rating_count'];
|
2340 |
+
}
|
2341 |
+
|
2342 |
+
break;
|
2343 |
+
|
2344 |
case 'RentAction':
|
2345 |
|
2346 |
if(isset($custom_fields['saswp_rent_action_agent_name'])){
|
2505 |
if(isset($custom_fields['saswp_service_schema_provider_type']) && isset($custom_fields['saswp_service_schema_provider_name'])){
|
2506 |
$input1['provider']['@type'] = $custom_fields['saswp_service_schema_provider_type'];
|
2507 |
$input1['provider']['name'] = $custom_fields['saswp_service_schema_provider_name'];
|
2508 |
+
|
2509 |
+
if(isset($custom_fields['saswp_service_schema_image'])){
|
2510 |
+
$input1['provider']['image'] = $custom_fields['saswp_service_schema_image'];
|
2511 |
+
}
|
2512 |
}
|
2513 |
if(isset($custom_fields['saswp_service_schema_price_range'])){
|
2514 |
$input1['provider']['priceRange'] = $custom_fields['saswp_service_schema_price_range'];
|
4419 |
case 'SoftwareApplication':
|
4420 |
case 'MobileApplication':
|
4421 |
case 'Book':
|
4422 |
+
case 'Car':
|
4423 |
+
case 'Vehicle':
|
4424 |
|
4425 |
$product_details = $this->saswp_woocommerce_product_details(get_the_ID());
|
4426 |
|
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.6
|
6 |
-
Stable tag: 1.9.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -120,6 +120,11 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
120 |
|
121 |
== Changelog ==
|
122 |
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
= 1.9.64 (23 Feb 2021) =
|
125 |
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.6
|
6 |
+
Stable tag: 1.9.65
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
120 |
|
121 |
== Changelog ==
|
122 |
|
123 |
+
= 1.9.65 (02 March 2021) =
|
124 |
+
|
125 |
+
* Fixed: The script tag contains invalid JSON that cannot be parsed. #1328
|
126 |
+
* Fixed: Service schema type's Image field is missing. #1329
|
127 |
+
* Added: Vehicle schema type #629
|
128 |
|
129 |
= 1.9.64 (23 Feb 2021) =
|
130 |
|
structured-data-for-wp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP & AMP
|
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.9.
|
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.9.
|
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 & AMP
|
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.9.65
|
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.9.65');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|