Skip to content

Commit

Permalink
Merge pull request #2125 from ahmedkaludi/1.32
Browse files Browse the repository at this point in the history
1.32
  • Loading branch information
shridhamdeveloper authored Jun 1, 2024
2 parents eb75250 + a1b684e commit 3549599
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 80 deletions.
2 changes: 2 additions & 0 deletions admin_section/common-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -3527,6 +3527,8 @@ function saswp_get_field_note($pname){
'tevolution_events' => saswp_t_string('Requires').' <a target="_blank" href="https://templatic.com/wordpress-plugins/tevolution/">Tevolution Events</a>',
'publishpress_authors' => saswp_t_string('Requires').' <a target="_blank" href="https://wordpress.org/plugins/publishpress-authors"> Publish Press Authors </a>',
'jetpackrecipe' => saswp_t_string('Requires').' <a target="_blank" href="https://structured-data-for-wp.com/recipe-schema/"> Jetpack Recipe Schema </a>',
'event_prime' => saswp_t_string('Requires').' <a target="_blank" href="https://wordpress.org/plugins/eventprime-event-calendar-management/"> EventPrime – Events Calendar, Bookings and Tickets </a>',
'jolifaq' => saswp_t_string('Requires').' <a target="_blank" href="https://wordpress.org/plugins/joli-faq-seo/"> Joli FAQ SEO – WordPress FAQ Plugin </a>',

);

Expand Down
19 changes: 19 additions & 0 deletions admin_section/js/main-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,15 @@ jQuery(document).ready(function($){
$("#saswp-modern-events-calendar").val(0);
}
break;

case 'saswp-event-prime-checkbox':
saswp_compatibliy_notes(current, id);
if ($(this).is(':checked')) {
$("#saswp-event-prime").val(1);
}else{
$("#saswp-event-prime").val(0);
}
break;

case 'saswp-woocommerce-booking-checkbox':
saswp_compatibliy_notes(current, id);
Expand Down Expand Up @@ -2219,6 +2228,16 @@ jQuery(document).ready(function($){
}

break;

case 'saswp-jolifaq-checkbox':
saswp_compatibliy_notes(current, id);
if ($(this).is(':checked')) {
$("#saswp-jolifaq").val(1);
}else{
$("#saswp-jolifaq").val(0);
}

break;

case 'saswp-ameliabooking-checkbox':
saswp_compatibliy_notes(current, id);
Expand Down
2 changes: 1 addition & 1 deletion admin_section/js/main-script.min.js

Large diffs are not rendered by default.

32 changes: 31 additions & 1 deletion admin_section/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -3051,6 +3051,19 @@ function saswp_compatibility_page_callback(){
'name' => 'sd_data[saswp-wpresponsivefaq]',
)
);

$jolifaq = array(
'label' => 'Joli FAQ SEO',
'id' => 'saswp-jolifaq-checkbox',
'name' => 'saswp-jolifaq-checkbox',
'type' => 'checkbox',
'class' => 'checkbox saswp-checkbox',
'note' => saswp_get_field_note('jolifaq'),
'hidden' => array(
'id' => 'saswp-jolifaq',
'name' => 'sd_data[saswp-jolifaq]',
)
);

$ameliabooking = array(
'label' => 'Amelia Booking',
Expand Down Expand Up @@ -3655,6 +3668,19 @@ function saswp_compatibility_page_callback(){
'name' => 'sd_data[saswp-modern-events-calendar]',
)
);

$event_prime = array(
'label' => 'Event Prime',
'id' => 'saswp-event-prime-checkbox',
'name' => 'saswp-event-prime-checkbox',
'type' => 'checkbox',
'class' => 'checkbox saswp-checkbox',
'note' => saswp_get_field_note('event_prime'),
'hidden' => array(
'id' => 'saswp-event-prime',
'name' => 'sd_data[saswp-event-prime]',
)
);

$seo_press = array(
'label' => 'SEOPress',
Expand Down Expand Up @@ -4303,6 +4329,7 @@ function saswp_compatibility_page_callback(){
$faqschemaforpost['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/faq-schema/">FAQ Schema Compatibility Addon</a>';
$webfaq10['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/faq-schema/">FAQ Schema Compatibility Addon</a>';
$enfold['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/faq-schema/">FAQ Schema Compatibility Addon</a>';
$jolifaq['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/faq-schema/">FAQ Schema Compatibility Addon</a>';

}
if(!is_plugin_active('reviews-for-schema/reviews-for-schema.php')){
Expand Down Expand Up @@ -4338,6 +4365,7 @@ function saswp_compatibility_page_callback(){
$events_manager['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
$event_organiser['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
$modern_events_calendar['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
$event_prime['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
$tevolution_events['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
$wp_event_aggregator['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
$stachethemes_events['note'] = saswp_t_string('This feature requires').' <a target="_blank" href="https://structured-data-for-wp.com/event-schema/">Event Schema Addon</a>';
Expand Down Expand Up @@ -4457,6 +4485,7 @@ function saswp_compatibility_page_callback(){
$events_calendar_wd,
$event_organiser,
$modern_events_calendar,
$event_prime,
$tevolution_events,
$wp_event_aggregator,
$all_in_one_event_calendar,
Expand Down Expand Up @@ -4498,7 +4527,8 @@ function saswp_compatibility_page_callback(){
$mooberrybm,
$novelist,
$flex_lmx,
$publishpress_authors
$publishpress_authors,
$jolifaq

);

Expand Down
13 changes: 13 additions & 0 deletions core/array-list/compatibility-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@
'opt_name' => 'saswp-wpresponsivefaq',
'part_in' => 'pro',
),
'jolifaq' => array(
'name' => 'Joli FAQ SEO',
'free' => 'joli-faq-seo/joli-faq-seo.php',
'pro' => 'joli-faq-seo-pro/joli-faq-seo.php',
'opt_name' => 'saswp-jolifaq',
'part_in' => 'pro',
),
'ultimatefaqs' => array(
'name' => 'Ultimate FAQs – WordPress Knowledgebase Plugin',
'free' => 'ultimate-faqs/Main.php',
Expand Down Expand Up @@ -501,6 +508,12 @@
'opt_name' => 'saswp-modern-events-calendar',
'part_in' => 'pro',
),
'event_prime' => array(
'name' => 'EventPrime – Events Calendar, Bookings and Tickets',
'free' => 'eventprime-event-calendar-management/event-prime.php',
'opt_name' => 'saswp-event-prime',
'part_in' => 'pro',
),
'wp_event_manager' => array(
'name' => 'WP Event Manager',
'free' => 'wp-event-manager/wp-event-manager.php',
Expand Down
10 changes: 5 additions & 5 deletions core/array-list/schema-properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,

if($condition !=null){

if(!empty($local_sub_business)){
if(!empty($local_sub_business) && array_key_exists($business_type, $local_sub_business)){

$sub_business_options = array(
'label' => 'Sub Business Type',
Expand Down Expand Up @@ -6202,6 +6202,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
'id' => 'saswp_product_schema_rp_category_'.$schema_id,
'type' => 'select',
'options' => array(
'' => 'Select Return Policy Category',
'MerchantReturnFiniteReturnWindow' => 'MerchantReturnFiniteReturnWindow',
'MerchantReturnNotPermitted' => 'MerchantReturnNotPermitted',
'MerchantReturnUnlimitedWindow' => 'MerchantReturnUnlimitedWindow',
Expand All @@ -6221,6 +6222,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
'id' => 'saswp_product_schema_rp_return_method_'.$schema_id,
'type' => 'select',
'options' => array(
'' => 'Select Return Policy Method',
'ReturnAtKiosk' => 'ReturnAtKiosk',
'ReturnByMail' => 'ReturnByMail',
'ReturnInStore' => 'ReturnInStore',
Expand All @@ -6231,6 +6233,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
'id' => 'saswp_product_schema_rp_return_fees_'.$schema_id,
'type' => 'select',
'options' => array(
'' => 'Select Return Policy Fees',
'FreeReturn' => 'FreeReturn',
)
),
Expand All @@ -6246,7 +6249,6 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
'label' => 'Shipping Rate Currency',
'id' => 'saswp_product_schema_sr_currency_'.$schema_id,
'type' => 'text',
'default' => 'USD',
'attributes' => array(
'placeholder' => 'USD'
),
Expand Down Expand Up @@ -6312,7 +6314,6 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
'id' => 'saswp_product_schema_sdh_unitcode_'.$schema_id,
'type' => 'text',
'note' => 'Note: Enter unit code as DAY',
'default' => 'DAY',
'attributes' => array(
'placeholder' => 'DAY'
),
Expand All @@ -6337,8 +6338,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
'label' => 'Shipping Transit Time Unit Code',
'id' => 'saswp_product_schema_sdt_unitcode_'.$schema_id,
'type' => 'text',
'note' => 'Note: Enter unit code as DAY',
'default' => 'DAY',
'note' => 'Note: Enter unit code as DAY',
'attributes' => array(
'placeholder' => 'DAY'
),
Expand Down
1 change: 1 addition & 0 deletions modules/gutenberg/includes/class-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ public static function saswp_blocks_description_allowed_tags($type = '')
$allowed_tags['s'] = array();
$allowed_tags['sub'] = array();
$allowed_tags['sup'] = array();
$allowed_tags['br'] = array();
return $allowed_tags;
}

Expand Down
6 changes: 6 additions & 0 deletions output/compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ public function event_organiser_on_activation(){
public function modern_events_calendar_on_activation(){
$this->saswp_update_option_on_compatibility_activation('saswp-modern-events-calendar');
}
public function event_prime_on_activation(){
$this->saswp_update_option_on_compatibility_activation('saswp-event-prime');
}
public function wp_event_manager_on_activation(){
$this->saswp_update_option_on_compatibility_activation('saswp-wp-event-manager');
}
Expand Down Expand Up @@ -706,6 +709,9 @@ public function saswp_update_option_on_compatibility_activation($opt_name){
update_option('sd_data', $defaults);

}
public function jolifaq_on_activation(){
$this->saswp_update_option_on_compatibility_activation('saswp-jolifaq');
}
/**
* Functions on compatiblity plugin activation ends here
*/
Expand Down
42 changes: 25 additions & 17 deletions output/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -1037,23 +1037,29 @@ function saswp_extract_wpdiscuz(){

if(isset($sd_data['saswp-wpdiscuz']) && $sd_data['saswp-wpdiscuz'] == 1 && is_plugin_active('wpdiscuz/class.WpdiscuzCore.php') ){

$rating = (float) get_post_meta($post->ID, 'wpdiscuz_post_rating', true);
$count = (int) get_post_meta($post->ID, 'wpdiscuz_post_rating_count', true);

if($rating){

$star_rating['@type'] = 'AggregateRating';
$star_rating['bestRating'] = 5;
$star_rating['worstRating'] = 1;
$star_rating['ratingCount'] = $count;
$star_rating['ratingValue'] = $rating;

return $star_rating;

if(is_object($post) && isset($post->ID)){
$rating = (float) get_post_meta($post->ID, 'wpdiscuz_post_rating', true);
$count = (int) get_post_meta($post->ID, 'wpdiscuz_post_rating_count', true);

if($rating){

$star_rating['@type'] = 'AggregateRating';
$star_rating['bestRating'] = 5;
$star_rating['worstRating'] = 1;
$star_rating['ratingCount'] = $count;
$star_rating['ratingValue'] = $rating;

return $star_rating;

}else{

return array();

}
}else{
return array();

return array();

}

}else{
Expand Down Expand Up @@ -1333,6 +1339,8 @@ function saswp_get_comments($post_id){

if ( count( $post_comments ) ) {

$permalink = get_permalink();

foreach ( $post_comments as $comment ) {

$likes = 0;
Expand All @@ -1354,7 +1362,7 @@ function saswp_get_comments($post_id){

$comments[] = array (
'@type' => 'Comment',
'id' => get_permalink().'comment-'.$comment->comment_ID,
'id' => $permalink.'#comment-'.$comment->comment_ID,
'dateCreated' => $is_bbpress ? $comment->comment_date : saswp_format_date_time($comment->comment_date),
'description' => strip_tags($comment->comment_content),
'upvoteCount' => $likes,
Expand Down
Loading

0 comments on commit 3549599

Please sign in to comment.