Skip to content

Commit 9617e7c

Browse files
Merge pull request #2154 from ahmedkaludi/1.35
1.35
2 parents a2f3e20 + 85f09e2 commit 9617e7c

File tree

10 files changed

+113
-53
lines changed

10 files changed

+113
-53
lines changed

admin_section/settings.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,11 @@ function saswp_handle_file_upload($option){
688688
}else{
689689
if (is_array($value)) {
690690
foreach ( $value as $k => $val) {
691-
$value[sanitize_key($k)] = sanitize_text_field($val);
691+
if( is_array($val) ){
692+
$value[sanitize_key($k)] = array_map('sanitize_text_field', $val);
693+
}else {
694+
$value[sanitize_key($k)] = sanitize_text_field($val);
695+
}
692696
}
693697
$option[sanitize_key($key)] = $value;
694698
}else{
@@ -4929,6 +4933,9 @@ function saswp_enqueue_saswp_select2_js( $hook ) {
49294933
// Dequeue Widget Options plugin select2 on schema dashboard to remove conflict
49304934
wp_dequeue_script('jquery-widgetopts-select2-script');
49314935

4936+
// Dequeue ReviewX Pro plugin select2 on schema dashboard to remove conflict
4937+
wp_dequeue_script('reviewx-pro-select2-js');
4938+
49324939
if($post_type == 'saswp'){
49334940

49344941
//conflict with jupitor theme fixed starts here
File renamed without changes.

core/array-list/schema-properties.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,21 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
356356
'id' => 'local_review_count_'.$schema_id,
357357
'type' => 'text',
358358
);
359+
$meta_field[] = array(
360+
'label' => 'Check-in Time',
361+
'id' => 'local_checkin_time_'.$schema_id,
362+
'type' => 'text',
363+
);
364+
$meta_field[] = array(
365+
'label' => 'Check-out Time',
366+
'id' => 'local_checkout_time_'.$schema_id,
367+
'type' => 'text',
368+
);
369+
$meta_field[] = array(
370+
'label' => 'Identifier',
371+
'id' => 'local_identifier_pvalue_'.$schema_id,
372+
'type' => 'text',
373+
);
359374

360375
break;
361376

@@ -6235,6 +6250,8 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
62356250
'options' => array(
62366251
'' => 'Select Return Policy Fees',
62376252
'FreeReturn' => 'FreeReturn',
6253+
'ReturnFeesCustomerResponsibility' => 'ReturnFeesCustomerResponsibility',
6254+
'ReturnShippingFees' => 'ReturnShippingFees',
62386255
)
62396256
),
62406257
array(

modules/divi-builder/includes/loader.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88

99
// Load custom Divi Builder modules
1010
foreach ( (array) $module_files as $module_file ) {
11-
if ( $module_file && preg_match( "/\/modules\/\b([^\/]+)\/\\1\.php$/", $module_file ) ) {
12-
require_once $module_file;
13-
}
11+
require_once $module_file;
1412
}

output/class-saswp-output-service.php

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,7 @@ public function saswp_get_meta_list_value($key, $field, $schema_post_id, $schema
518518
break;
519519
case 'site_logo':
520520

521-
$sizes = array(
522-
'width' => 600,
523-
'height' => 60,
524-
'crop' => false,
525-
);
521+
$sizes = array ( 600, 60 );
526522

527523
$custom_logo_id = get_theme_mod( 'custom_logo' );
528524

@@ -2985,6 +2981,8 @@ public function saswp_replace_with_custom_fields_value($input1, $schema_post_id)
29852981

29862982
case 'local_business':
29872983

2984+
$business_name = get_post_meta($schema_post_id, 'saswp_business_name', true);
2985+
29882986
if ( isset( $custom_fields['local_business_id']) ) {
29892987
$input1['@id'] = get_permalink().$custom_fields['local_business_id'];
29902988
}
@@ -3015,6 +3013,9 @@ public function saswp_replace_with_custom_fields_value($input1, $schema_post_id)
30153013
if ( isset( $custom_fields['local_state']) ) {
30163014
$input1['address']['addressRegion'] = $custom_fields['local_state'];
30173015
}
3016+
if ( isset( $custom_fields['local_country']) ) {
3017+
$input1['address']['addressCountry'] = $custom_fields['local_country'];
3018+
}
30183019
if ( isset( $custom_fields['local_postal_code']) ) {
30193020
$input1['address']['postalCode'] = $custom_fields['local_postal_code'];
30203021
}
@@ -3123,6 +3124,17 @@ public function saswp_replace_with_custom_fields_value($input1, $schema_post_id)
31233124
if($sameas){
31243125
$input1['sameAs'] = $sameas;
31253126
}
3127+
if( $business_name == 'hotel' ) {
3128+
if( ! empty( $custom_fields['local_checkin_time'] ) ) {
3129+
$input1['checkinTime'] = $custom_fields['local_checkin_time'];
3130+
}
3131+
if( ! empty( $custom_fields['local_checkout_time'] ) ) {
3132+
$input1['checkoutTime'] = $custom_fields['local_checkout_time'];
3133+
}
3134+
if( ! empty( $custom_fields['local_identifier_pvalue'] ) ) {
3135+
$input1['identifier'] = $custom_fields['local_identifier_pvalue'];
3136+
}
3137+
}
31263138
break;
31273139

31283140
case 'Blogposting':
@@ -7874,7 +7886,7 @@ public function saswp_woocommerce_product_details($post_id){
78747886

78757887
if ( isset( $date_on_sale) ) {
78767888

7877-
$product_details['product_priceValidUntil'] = $date_on_sale->gmdate('Y-m-d G:i:s');
7889+
$product_details['product_priceValidUntil'] = $date_on_sale->date('Y-m-d G:i:s');
78787890

78797891
}else{
78807892

@@ -8727,20 +8739,22 @@ public function saswp_get_featured_image() {
87278739

87288740
if( ($image_details[1] > 0) && ($image_details[2] > 0) ){
87298741
$img_ratio = $image_details[1] / $image_details[2];
8730-
$targetHeight = 1200 / $img_ratio;
8742+
$targetHeight = round ( 1200 / $img_ratio );
87318743
}
87328744

87338745
if($multiple_size){
8734-
8746+
8747+
$min_val = min ( $image_details[1], $targetHeight );
8748+
87358749
if($targetHeight < 675){
87368750

8737-
$width = array(1200, 1200, 1200);
8738-
$height = array(900, 720, 675);
8751+
$width = array ( 1200, 1200, 1200, $min_val );
8752+
$height = array ( 900, 720, 675, $min_val );
87398753

87408754
}else{
87418755

8742-
$width = array(1200, 1200, 1200);
8743-
$height = array($targetHeight, 900, 675);
8756+
$width = array ( 1200, 1200, 1200, $min_val );
8757+
$height = array ( $targetHeight, 900, 675, $min_val );
87448758

87458759
}
87468760

@@ -8793,13 +8807,27 @@ public function saswp_get_featured_image() {
87938807

87948808
if ( isset( $image_details[1]) ) {
87958809

8796-
if($multiple_size){
8797-
$width = array($image_details[1], 1200, 1200);
8798-
$height = array($image_details[2], 900, 675);
8799-
}else{
8800-
$width = array($image_details[1]);
8801-
$height = array($image_details[2]);
8802-
}
8810+
if ( $multiple_size ) {
8811+
8812+
$width = array ( $image_details[1], 1200, 1200 );
8813+
$height = array ( $image_details[2], 900, 675 );
8814+
$height_array = array ( 900, 675 );
8815+
$min_val = min ( $image_details[1], $image_details[2] );
8816+
8817+
if ( $image_details[1] == 1200 && in_array ( $image_details[2], $height_array ) ) {
8818+
8819+
$width = array ( $min_val, 1200, 1200 );
8820+
$height = array ( $min_val, 900, 675 );
8821+
8822+
} else {
8823+
$width[] = $min_val;
8824+
$height[] = $min_val;
8825+
}
8826+
8827+
}else{
8828+
$width = array ( $image_details[1] );
8829+
$height = array ( $image_details[2] );
8830+
}
88038831

88048832
for($i = 0; $i < count($width); $i++){
88058833

output/markup.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1923,6 +1923,22 @@ function saswp_local_business_schema_markup($schema_id, $schema_post_id, $all_po
19231923

19241924
}
19251925

1926+
$business_name = get_post_meta($schema_post_id, 'saswp_business_name', true);
1927+
1928+
if( $business_name == 'hotel' || $business_sub_name == 'hotel' ) {
1929+
1930+
if( ! empty( $all_post_meta['local_checkin_time_'.$schema_id] ) ) {
1931+
$input1['checkinTime'] = saswp_remove_warnings($all_post_meta, 'local_checkin_time_'.$schema_id, 'saswp_array');
1932+
}
1933+
if( ! empty( $all_post_meta['local_checkout_time_'.$schema_id] ) ) {
1934+
$input1['checkoutTime'] = saswp_remove_warnings($all_post_meta, 'local_checkout_time_'.$schema_id, 'saswp_array');
1935+
}
1936+
if( ! empty( $all_post_meta['local_identifier_pvalue_'.$schema_id] ) ) {
1937+
$input1['identifier'] = saswp_remove_warnings( $all_post_meta, 'local_identifier_pvalue_'.$schema_id, 'saswp_array' );
1938+
}
1939+
1940+
}
1941+
19261942

19271943
return $input1;
19281944
}

readme.txt

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
Contributors: magazine3
33
Tags: Schema, Structured Data, Rich Snippets, SEO, AMP
44
Requires at least: 4.5
5-
Tested up to: 6.5
5+
Tested up to: 6.6
66
Requires PHP: 5.6.20
7-
Stable tag: 1.34.1
7+
Stable tag: 1.35
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO.
@@ -121,6 +121,20 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
121121

122122
== Changelog ==
123123

124+
= 1.35 (02 August 2024) =
125+
* Enhancement: Added new properties in LodgingBusiness > Hotel schema #2105
126+
* Fixed: Feature image size duplicate issue in schema markup #2140
127+
* Fixed: Issue with country field missing in the schema markup while modifying the schema output (Local Business) #2147
128+
* Fixed: A fatal error issue in the latest update of 1.34.2 #2148
129+
* Fixed: FAQ Block not working on Divi Builder #2149
130+
* Fixed: PHP warnings on schema types page #2150
131+
* Fixed: ACF fields are unclickable when the plugin is activated and an error appears in the Console #2152
132+
* Fixed: The ReturnFeesCustomerResponsibility field is missing in the product schema #2153
133+
134+
= 1.34.2 (18 July 2024) =
135+
* Fixed: Error after version 1.34.1 update #2144
136+
* Fixed: Tested with new version of wordpress i.e. 6.6v #2145
137+
124138
= 1.34.1 (16 July 2024) =
125139
* Fixed: Fatal error after recent update #2142
126140

@@ -268,27 +282,4 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
268282
* Fixed: A deprecated warning with author image in schema markup #2012
269283
* Fixed: Undefined array key "headingTag" #2013
270284

271-
272-
= 1.20 (01 Sep 2023) =
273-
274-
* Enhancement: Corrected summery page for archive schema #1980
275-
* Fixed: Resolved Organization URL issue in the knowledge graph #1989
276-
* Fixed: Added proper display message on license activation/deactivation timeout #1998
277-
* Fixed: Plugin Upgrade (v1.18) Causing Internal Page Breakage and Blank Screen #2001
278-
* Fixed: Fatal error in review collection #2004
279-
* Fixed: Breadcrumb schema showing wrong id in schema markup for custom post type #2005
280-
* Fixed: PHP Warnings for Undefined Array Keys in Course Schema URL's #2006
281-
282-
283-
= 1.19 (21 Aug 2023) =
284-
285-
* Fixed: Checking success of folder creation via HTTP #1954
286-
* Fixed: Warning shown in the schema #1979
287-
* Fixed: wp_remote_post timeout for some users while activating reviews api #1983
288-
* Feature: Added slide interval option to perform auto slide for review collection #1984
289-
* Fixed: PHP Warning in reveiw module #1986
290-
* Fixed: Markup warning #1987
291-
* Fixed: Collection reviews are not showing in schema markup #1988
292-
* Fixed: Tested with WordPress 6.3 and updated readme.txt #1996
293-
294285
All changelog available on [GitHub](https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/releases).

structured-data-for-wp.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
Plugin Name: Schema & Structured Data for WP & AMP
44
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.34.1
5+
Version: 1.35
66
Text Domain: schema-and-structured-data-for-wp
77
Domain Path: /languages
88
Author: Magazine3
@@ -13,7 +13,7 @@
1313
// Exit if accessed directly.
1414
if ( ! defined( 'ABSPATH' ) ) exit;
1515

16-
define( 'SASWP_VERSION', '1.34.1' );
16+
define( 'SASWP_VERSION', '1.35' );
1717
define( 'SASWP_DIR_NAME_FILE', __FILE__ );
1818
define( 'SASWP_DIR_NAME', dirname( __FILE__ ) );
1919
define( 'SASWP_DIR_URI', plugin_dir_url( __FILE__ ) );
@@ -73,7 +73,7 @@ function saswp_non_amp() {
7373
}
7474

7575
// Schema App end here
76-
require_once SASWP_DIR_NAME.'/admin_section/structure_admin.php';
76+
require_once SASWP_DIR_NAME.'/admin_section/structure-admin.php';
7777
require_once SASWP_DIR_NAME.'/admin_section/settings.php';
7878
require_once SASWP_DIR_NAME.'/admin_section/common-function.php';
7979
require_once SASWP_DIR_NAME.'/output/class-saswp-location-widget.php';
@@ -86,7 +86,7 @@ function saswp_non_amp() {
8686
require_once SASWP_DIR_NAME.'/view/help.php';
8787
require_once SASWP_DIR_NAME.'/view/schema-type.php';
8888
require_once SASWP_DIR_NAME.'/view/paywall.php';
89-
require_once SASWP_DIR_NAME.'/admin_section/add-schema/add_new.php';
89+
require_once SASWP_DIR_NAME.'/admin_section/add-schema/add-new.php';
9090
require_once SASWP_DIR_NAME.'/view/class-saswp-post-specific.php';
9191
require_once SASWP_DIR_NAME.'/modules/rating-box/class-saswp-rating-box-backend.php';
9292
require_once SASWP_DIR_NAME.'/modules/rating-box/class-saswp-rating-box-frontend.php';

view/class-saswp-view-common.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ public function saswp_post_specific_schema($schema_type, $saswp_meta_fields, $po
367367
$output = '';
368368

369369
foreach ( $saswp_meta_fields as $meta_field ) {
370+
371+
if( isset( $meta_field['type'] ) ) {
370372

371373
$input = '';
372374
$attributes = '';
@@ -660,7 +662,8 @@ public function saswp_post_specific_schema($schema_type, $saswp_meta_fields, $po
660662
$output .= '<tr><th>'.$label.'</th><td>'.$input.'</td></tr>';
661663
}
662664

663-
}
665+
}
666+
}
664667

665668
$tabs_fields = '';
666669

0 commit comments

Comments
 (0)