Schema & Structured Data for WP & AMP - Version 1.9.16

Version Description

(04 Nov 2019) =

  • Fixed: Warning: Use of undefined constant _return_emptyarray #573
  • Fixed: Rating Module & Review Module learn more goes to 404 #567
  • Fixed: On tag archive pages, there is an Unparsable and Breadcrumbs error. #574
  • Fixed: In videoObject, Content url and embed url appeared inside thumbnail propery #585
  • Fixed: Warring Product schema property seller is not recognized by Google for an object of type Product. #579
  • Fixed: Item Reviewed type property's fields is not being generated dynamically on post specific modification. #578
  • Fixed: Issue with kk Star Rating plugin #570
  • Fixed: Aggregate rating is not supported in service schema #591
  • Fixed: Real Breadcrumb list is not rendering in schema markup #563
  • Added: Time field in event schema
  • Added: areaServed property in Local Business
  • Added: An option to add all the available images on a post to schema markup in Advanced tab
  • Enhancement: Social fields has now dynamic option to add as many as user want #553
Download this release

Release Info

Developer magazine3
Plugin Icon 128x128 Schema & Structured Data for WP & AMP
Version 1.9.16
Comparing to
See all releases

Code changes from version 1.9.15 to 1.9.16

admin_section/common-function.php CHANGED
@@ -1640,7 +1640,8 @@ if ( ! defined('ABSPATH') ) exit;
1640
  'saswp_kb_contact_1' => 0,
1641
  'saswp-for-wordpress' => 1,
1642
  'sd_initial_wizard_status' => 1,
1643
- 'saswp-microdata-cleanup' => 1
 
1644
 
1645
  );
1646
 
@@ -2085,7 +2086,7 @@ if ( ! defined('ABSPATH') ) exit;
2085
  $content = wp_strip_all_tags(strip_shortcodes($content));
2086
  }
2087
 
2088
- return $content;
2089
 
2090
  }
2091
  /**
@@ -2210,7 +2211,8 @@ if ( ! defined('ABSPATH') ) exit;
2210
  }
2211
 
2212
  }
2213
- return $excerpt;
 
2214
  }
2215
  /**
2216
  * since @1.8.9
@@ -2615,4 +2617,69 @@ function saswp_get_taxonomy_term_list(){
2615
 
2616
  wp_die();
2617
  }
2618
- add_action( 'wp_ajax_saswp_get_taxonomy_term_list', 'saswp_get_taxonomy_term_list');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1640
  'saswp_kb_contact_1' => 0,
1641
  'saswp-for-wordpress' => 1,
1642
  'sd_initial_wizard_status' => 1,
1643
+ 'saswp-microdata-cleanup' => 1,
1644
+ 'saswp-other-images' => 1
1645
 
1646
  );
1647
 
2086
  $content = wp_strip_all_tags(strip_shortcodes($content));
2087
  }
2088
 
2089
+ return apply_filters('saswp_the_content' ,$content);
2090
 
2091
  }
2092
  /**
2211
  }
2212
 
2213
  }
2214
+
2215
+ return apply_filters('saswp_the_excerpt' ,$excerpt);
2216
  }
2217
  /**
2218
  * since @1.8.9
2617
 
2618
  wp_die();
2619
  }
2620
+ add_action( 'wp_ajax_saswp_get_taxonomy_term_list', 'saswp_get_taxonomy_term_list');
2621
+
2622
+ add_action('init', 'saswp_save_new_social_profile');
2623
+ function saswp_save_new_social_profile(){
2624
+ saswp_migrate_old_social_profile();
2625
+ }
2626
+ function saswp_migrate_old_social_profile(){
2627
+
2628
+ $upgrade_option = get_option('saswp_social_profile_upgrade');
2629
+
2630
+ if(!$upgrade_option){
2631
+
2632
+ $sd_data = get_option('sd_data');
2633
+
2634
+ $sd_social_profile = array();
2635
+
2636
+ if(isset($sd_data['sd_facebook']) && !empty($sd_data['sd_facebook'])){
2637
+ $sd_social_profile[] = $sd_data['sd_facebook'];
2638
+ }
2639
+ if(isset($sd_data['sd_twitter']) && !empty($sd_data['sd_twitter'])){
2640
+ $sd_social_profile[] = $sd_data['sd_twitter'];
2641
+ }
2642
+ if(isset($sd_data['sd_instagram']) && !empty($sd_data['sd_instagram'])){
2643
+ $sd_social_profile[] = $sd_data['sd_instagram'];
2644
+ }
2645
+ if(isset($sd_data['sd_youtube']) && !empty($sd_data['sd_youtube'])){
2646
+ $sd_social_profile[] = $sd_data['sd_youtube'];
2647
+ }
2648
+ if(isset($sd_data['sd_linkedin']) && !empty($sd_data['sd_linkedin'])){
2649
+ $sd_social_profile[] = $sd_data['sd_linkedin'];
2650
+ }
2651
+ if(isset($sd_data['sd_pinterest']) && !empty($sd_data['sd_pinterest'])){
2652
+ $sd_social_profile[] = $sd_data['sd_pinterest'];
2653
+ }
2654
+ if(isset($sd_data['sd_soundcloud']) && !empty($sd_data['sd_soundcloud'])){
2655
+ $sd_social_profile[] = $sd_data['sd_soundcloud'];
2656
+ }
2657
+ if(isset($sd_data['sd_tumblr']) && !empty($sd_data['sd_tumblr'])){
2658
+ $sd_social_profile[] = $sd_data['sd_tumblr'];
2659
+ }
2660
+ if(isset($sd_data['sd_yelp']) && !empty($sd_data['sd_yelp'])){
2661
+ $sd_social_profile[] = $sd_data['sd_yelp'];
2662
+ }
2663
+ if(isset($sd_data['saswp_social_links']) && !empty($sd_data['saswp_social_links'])){
2664
+ $sd_social_profile = array_merge($sd_social_profile, $sd_data['saswp_social_links']);
2665
+ }
2666
+ $sd_data['saswp_social_links'] = $sd_social_profile;
2667
+ update_option('sd_data', $sd_data);
2668
+
2669
+ update_option('saswp_social_profile_upgrade', date("Y-m-d"));
2670
+ }
2671
+
2672
+ }
2673
+
2674
+ function saswp_format_date_time($date, $time=null){
2675
+
2676
+ $formated = '';
2677
+
2678
+ if($time){
2679
+ $formated = date('c',strtotime($date.' '.$time));
2680
+ }else{
2681
+ $formated = date('c',strtotime($date));
2682
+ }
2683
+
2684
+ return $formated;
2685
+ }
admin_section/css/main-style.css CHANGED
@@ -1250,4 +1250,16 @@ a.saswp-revws-lnk{
1250
  }
1251
  .saswp-review-content-table textarea{
1252
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
1253
  }
1250
  }
1251
  .saswp-review-content-table textarea{
1252
  width: 100%;
1253
+ }
1254
+ .saswp-social-links-table{
1255
+ width: 100%;
1256
+ }
1257
+ .saswp-social-links-table input{
1258
+ width: 100%;
1259
+ }
1260
+ .saswp-add-social-links{
1261
+ margin: 3px !important;
1262
+ }
1263
+ .saswp-social-links-table td{
1264
+ padding-left: 0px !important;
1265
  }
admin_section/css/main-style.min.css CHANGED
@@ -1 +1 @@
1
- .saswp_warning{color:#ef6c00!important}.saswp_hide{display:none}.saswp-general table th{width:auto;font-weight:600;padding:0}.saswp-general table{margin-top:0}.saswp-general table td{padding:5px}.saswp-knowledge table th{width:auto;padding:0}.saswp-knowledge table{margin-top:0}.saswp-knowledge table td{padding:5px}.saswp-schema table th{width:auto;padding:0}.saswp-schema table{margin-top:0}.saswp-schema table td{padding:5px}.saswp-amp table th{width:auto;padding:0}.saswp-amp table{margin-top:0}.saswp-amp table td{padding:5px}.saswp-help table th{width:auto;padding:0}.saswp-support table th{width:auto;padding:0}.saswp-review table th{width:auto;padding:0}.saswp-help table{margin-top:0}.saswp-help table td{padding:5px}.saswp-settings-list{display:inline-block;width:100%}.saswp-settings-list li{padding-left:0}.saswp-settings-list li div label{font-weight:600}.saswp-general h2{margin-bottom:0}.saswp-knowledge h2{margin-bottom:0}.saswp-schema h2{margin-bottom:0}.saswp-help h2{margin-bottom:0}.saswp-settings-form p.submit{margin-top:0}.saswp_qanda_p{font-weight:500}.saswp-display-none{display:none!important}.saswp-placement-groups{border:1px solid #e5e5e5}.saswp-query-success{color:#060}.saswp-query-error{color:#bf3322}.saswp-tools table th{width:auto;padding:0}.saswp-tools table{margin-top:0}.saswp-tools table td{padding:5px}.saswp-tools-field-title strong{padding-right:130px}.saswp-tools .saswp-tooltip{width:230px}.saswp-tools .saswp-knowledge-label{float:left}.saswp-error{color:red!important}.saswp-tooltip{position:relative;display:inline-block}.saswp-tooltip .saswp-tooltiptext{visibility:hidden;width:200px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;bottom:100%;left:50%;margin-left:-25px}.saswp-tooltiptext::after{content:"";position:absolute;top:100%;left:10%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}.saswp-knowledge-base .saswp-knowledge-label{width:200px;float:left;clear:both}.saswp-knowledge-base .saswp-knowledge-field{width:75%;float:right}.saswp-social-fileds ul{display:grid;grid-template-columns:26.5% 1fr}.saswp-social-fileds li{display:flex}.saswp-social-fileds .saswp-knowledge-field{width:100%;margin-left:10px}.saswp-social-fileds .saswp-knowledge-field input{float:right;margin:inherit}.saswp-schema-type-fields .saswp-knowledge-label{width:200px;float:left;clear:both}.saswp-schema-type-fields .saswp-knowledge-field{width:75%;float:right}.saswp-settings-first-div{width:70%}.saswp-settings-container{display:inline-flex;width:100%}.saswp-settings-second-div{float:right;position:relative;top:20px;margin-right:30px;margin-top:37px}.saswp-feedback-panel{height:200px;width:280px;background:#fff;position:relative}.saswp-start-quck-setup{position:relative;float:inherit;top:7px;left:15px}.saswp-feedback-panel ul{list-style-type:circle;list-style:decimal;padding-left:30px;font-size:15px}.saswp-feedback-panel a{text-decoration:none}.saswp-feedback-panel h2{text-align:center;padding-top:18px}.saswp-social-sharing-buttons{text-align:center;padding-top:20px}.saswp-facebook-share{background:#3b5998;box-shadow:0 0 0 #1b95e0!important;color:#fff!important;line-height:20px!important;height:21px!important;border-radius:3px;margin-right:5px}.saswp-social-sharing-buttons a{text-align:center;padding:8px}.twitter-share-button{background:#1b95e0!important;box-shadow:0 0 0 #1b95e0!important;color:#fff!important;line-height:20px!important;height:21px!important;border-radius:3px;margin-left:5px}.saswp-placement-button{padding:3px 10px;color:#0d0d0d;font-size:14px;border:1px solid #aaa;border-radius:2px;background:linear-gradient(#ededed,#fff)}.saswp-placement-table td{padding:5px 10px!important}.saswp-archive-div .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-archive-div .saswp-knowledge-label{float:left;clear:both}.saswp-amp .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-amp .saswp-knowledge-label{float:left;clear:both}.saswp-review .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-review .saswp-knowledge-label{float:left;clear:both}.saswp-compativility-div .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-compativility-div .saswp-knowledge-label{float:left;clear:both}.saswp-compativility-div li{display:inline-flex}.saswp-seller-div .saswp-knowledge-label{float:left;clear:both}.saswp-seller-div .saswp-knowledge-field{float:left;width:70%}.saswp-post-specific-tab-wrapper{display:inline-block;width:25%;vertical-align:top;box-sizing:border-box;padding-right:10px}.saswp-post-specific-container{display:inline-block;width:calc(75% - 1px);border-left:1px solid #eee}.saswp-post-specific-wrapper{padding:10px}.saswp-tab a.selected{background-color:#ccc}.saswp-tab-links{display:block;background-color:inherit;color:#000;padding:6px 10px;outline:0;text-align:left;cursor:pointer;transition:.3s;font-size:15px;width:130px;overflow:hidden;margin-right:10px}.saswp-star-rating{cursor:pointer}.saswp-post-specific-wrapper select{width:100%}.saswp-review-tables{width:100%}.saswp-over-all-raring{float:right}.saswp-review-pros-and-cons{position:relative;clear:both}.saswp-review-pros-and-cons>div:first{padding-left:10px}.saswp-review-pros-and-cons>div{width:49%;display:inline-block}.saswp-review-pros-and-cons>div:nth-child(2){padding-left:12px}.saswp-wp-ediot-desc{margin-bottom:-23px;display:block}.saswp-review-description{margin-top:40px;padding-top:10px;border-top:1px solid #eee}.saswp-review-pros-and-cons{margin-top:40px;padding-top:10px;border-top:1px solid #eee}.saspw-review-item-list{margin-top:20px;border-top:1px solid #eee}.saswp-review-item-list-table{padding-bottom:10px}#sasw-review input[type=text]{width:180px}#sasw-review input[type=number]{width:180px}#saswp-review-item-enable{width:10px}.saswp-enable-review-on-post{padding-bottom:10px}.saswp-enable-review-on-post label{font-weight:500}.saswp-compatibility table th{width:auto;padding:0}.saswp-compatibility .saswp-knowledge-label{float:left;clear:both}.saswp-tools .saswp-knowledge-label{float:left;clear:both}.saswp-tools .saswp-knowledge-field{float:right;width:69%;padding-bottom:10px}.saswp_kg_logo,.saswp_person_fields{background-color:#fff!important}.saswp_image_thumbnail{padding-top:5px;display:inline-block}.saswp-compatibility .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-job-posting-note,.saswp-schem-type-note{color:#d2691e}.saswp-custom-fields-name{border:1px solid #aaa;border-radius:4px}.saswp-option-table-class p{margin:auto;font-style:italic;color:#666}.saswp-switch{position:relative;display:inline-block;width:40px;height:22px;border:20px}.saswp-switch input{opacity:0;width:0;height:0}.saswp-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#5a6783;transition:.4s;border-radius:20px}.saswp-slider:before{position:absolute;content:"";height:15px;width:15px;left:4px;bottom:4px;background-color:#fff;transition:.4s;border-radius:20px}input:checked+.saswp-slider{background-color:#61bd3b;border-radius:30px}input:focus+.saswp-slider{box-shadow:0 0 1px #2196f3}input:checked+.saswp-slider:before{transform:translateX(15px)}.saswp-slider.saswp-round{border-radius:34px}.saswp-slider.saswp-round:before{border-radius:50%}.saswp-tab-nav li{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;border-bottom:1px solid #eee}.saswp-tab-nav .selected{background-color:#ccc}.saswp-single-post-restore .saswp-switch{height:28px}.saswp-single-post-restore .saswp-slider:before{height:20px}.option-table-class{width:100%}.option-table-class tr td{padding:10px 10px 10px 10px}.option-table-class tr>td{width:30%}.option-table-class tr td:last-child{width:60%}.saswp-custom-fields-table{width:100%}.saswp-custom-fields-table input{width:100%}.saswp-custom-fields-table tr td{padding:10px 10px 10px 10px}.saswp-custom-fields-table td{width:30%;vertical-align:top}.saswp-option-table-class input[type=text],.saswp-option-table-class select{width:100%}.saswp-paywall-table-class input[type=text],.saswp-paywall-table-class select{width:100%}.saswp-email_schema table th{width:auto;padding:0}.saswp-email_schema .saswp-knowledge-label{float:left;clear:both}.saswp-email_schema .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-add-on-plugin label{margin-top:10px}.saswp-add-on-plugin span{width:250px;display:inline-block}.saswp-knowledge-label label[for=saswp_search_box_schema_checkbox]{padding-left:10px}.saswp-knowledge-label label[for=saswp-woocommerce-booking-checkbox]{padding-left:10px}.saswp-knowledge-label label[for=saswp-woocommerce-membership-checkbox]{padding-left:10px}.saswp-global-selected{color:#000;font-weight:500}#saswp-global-tabs a{cursor:pointer}#saswp-global-tabs{padding-left:5px}#saswp-tools-tabs a{cursor:pointer}#saswp-review-tabs a{cursor:pointer}#saswp-tools-tabs{padding-left:5px}.saswp-need-help{padding-left:60px}.saswp-heading{display:inline-flex;align-items:baseline}.saswp-heading h2{margin-bottom:0}.saswp-view-docs a{margin-right:5px!important;margin-top:10px!important;float:right}.saswp-tabs .nav-tab{margin-left:4px}.saswp-panel{padding:7px 18px;background-color:#fff;box-shadow:0 0 20px 1px #d2cccc}.saswp-g-review-header{margin-top:50px}.saswp-g-review-body{display:inline-grid;grid-template-columns:1fr 300px;grid-gap:30px;margin-top:30px}.saswp-channel-list{margin-right:15px}.saswp-input-fields{display:inline-flex;align-items:center;margin-bottom:8px;width:100%}.saswp-input-fields label{width:130px}.saswp-input-fields select{width:100%}.saswp-panel h3{font-size:20px;line-height:1.4;color:#222;text-align:center;margin:10px 0 20px 0}.saswp-input-fields a.button-primary{margin-top:10px}.saswp-glg-review-body{display:grid;grid-template-columns:100px 1fr;grid-gap:20px;background:#fff;padding:20px;box-shadow:0 0 20px 1px #d2cccc;margin-bottom:30px}.saswp-g-plus{float:right;font-size:15px}.saswp-rtng{padding-left:5px;font-size:14px}.saswp-pt-dt{font-size:12px;color:#999;font-weight:600;margin-top:5px;display:inline-block}.saswp-str{display:inline-block;width:100%;vertical-align:middle}.saswp-athr{font-size:15px;line-height:1.4;color:#000;font-weight:700;display:inline-block;vertical-align:middle}.saswp-str-rtng .saswp-rvw-str{display:inline-block;vertical-align:middle;padding-left:10px;width:auto}.saswp-rv-cnt p{font-size:16px;line-height:1.6;color:#000;margin:10px 0 0 0}.saswp-rv-img img{max-width:100px;border-radius:100%}.saswp-premium_features table th,.saswp-services table th{width:auto;padding:0}.saswp-features-blocks{display:inline-grid;grid-template-columns:1fr 1fr;grid-gap:20px}.saswp-features-blocks li{background:#fff;padding:25px;border:1px solid #d8d8d8}.saswp-features-blocks li a{text-decoration:none}.saswp-ele-ic{border-radius:256px;display:inline-block;padding:8px 10px 8px 10px;width:70px;margin-right:20px;height:70px;float:left}.saswp-ele-ic img{width:80%;left:10%;position:relative;top:9%}.saswp-ele-1{background:#96588a}.saswp-ele-2{background:#00a97e}.saswp-ele-3{background:#cacaca}.saswp-ele-4{background:#9c56cc}.saswp-ele-tlt h3{margin:0;font-size:18px;line-height:1.4}.saswp-ele-tlt p{margin-top:10px}.saswp-sts-btn{box-sizing:border-box;height:52px;margin-top:20px;padding:6px 15px;border:1px solid #e5e5e5;border-radius:3px;display:flex;align-items:center;justify-content:space-between}.saswp-d-btn{background:#d2150a;padding:6px 18px;border-radius:30px;font-size:14px;color:#fff}.form-wrap .saswp-sts-txt{font-size:16px;color:#000}.saswp-sts-txt span{color:#bebfc0;padding-left:5px}.saswp_review_platform .saswp-g-plus{float:left}.saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-g-review-header{margin-top:50px}.saswp-g-review-body{display:inline-grid;grid-template-columns:1fr 300px;grid-gap:30px;margin-top:30px;width:100%}.saswp-channel-list{margin-right:15px}.saswp-input-fields{display:inline-flex;align-items:center;margin-bottom:8px;width:100%}.saswp-input-fields label{width:130px}.saswp-panel h3{font-size:20px;line-height:1.4;color:#222;text-align:center;margin:10px 0 20px 0}.saswp-input-fields a.button-primary{margin-top:10px}.saswp-glg-review-body{display:grid;grid-template-columns:100px 1fr;grid-gap:20px;background:#fff;padding:20px;box-shadow:0 0 20px 1px #d2cccc;margin-bottom:30px}.saswp-g-plus{float:right;font-size:15px;width:20px;height:20px}.saswp-g-plus img{max-width:100%}.saswp-rtng{padding-left:5px;font-size:14px}.saswp-pt-dt{font-size:12px;color:#999;font-weight:600;margin-top:5px;display:inline-block}.saswp-athr{font-size:15px;line-height:1.4;color:#000;font-weight:700}.saswp-rv-cnt p{font-size:16px;line-height:1.6;color:#000;margin:10px 0 0 0}.saswp-rv-img img{max-width:100px}.saswp-g-review-header div{margin-top:10px}.saswp-upgrade-pro{background:#fff;padding:25px;border:1px solid #d8d8d8;display:inline-block;margin-top:10px;width:81%}.saswp-upgrade-pro h2{font-size:20px;margin:0;color:#23282d;font-weight:600;text-align:center}.saswp-upgrade-pro ul{margin:25px 0 20px 0;display:inline-block}.saswp-upgrade-pro ul li{position:relative;padding-left:30px;font-size:14px;line-height:1.4;margin-bottom:10px}.saswp-upgrade-pro ul li:before{content:"";background-image:url(../images/check.png);background-repeat:no-repeat;background-size:20px;width:20px;height:20px;position:absolute;left:2px;top:2px}.saswp-upgrade-pro a{background:#d2150a;padding:10px 0;display:block;text-align:center;color:#fff;text-decoration:none;font-size:16px;font-weight:600;letter-spacing:1px;border-radius:5px}.saswp_image_prev{max-width:200px;max-height:200px;float:left;padding-left:2px}.saswp_prev_close{position:relative;width:30px;height:30px;top:12px;font-size:20px;top:-5px;text-decoration:none}.saswp-add-custom-schema-div{margin-top:10px;border-top:1px solid #eee;padding-top:5px}.saswp-nav-menu-list label{padding-left:10px}.saswp-dynamic-properties{border:1px solid #aaa;margin-top:5px;margin-bottom:5px}.saswp-table-close{float:right;cursor:pointer}.saswp-table-create-onajax table td,.saswp-table-create-onajax table th{padding:5px}.saswp-table-create-onajax select{width:98%}.saswp-g-reviews-settings-table input{width:100%}.saswp-s-reviews-settings-table input{width:100%}.saswp_rv_module_pro_notice{border:1px solid #d8d8d8;background:#fff}.saswp-settings-list .saswp-rev-mod{width:100%;display:inline-block;margin-top:20px}.saswp-rev-mod .saswp-knowledge-label{width:100%;display:inline-block;padding:10px 16px;font-weight:600;font-size:16px;color:#333;background:#f9f9f9;border:1px solid #d8d8d8;border-bottom:none;box-sizing:border-box}.saswp-rev-mod .saswp-knowledge-field{width:100%;display:inline-block}.saswp-rev-mod .saswp_rv_module_pro_notice{padding:20px}.saswp_cmpny_lst{width:100%;display:inline-block;margin-top:30px}.saswp_rv_module_pro_notice ul{margin:15px 0 20px 0;width:100%;display:inline-grid;grid-template-columns:1fr 1fr 1fr;grid-gap:20px;border-bottom:1px solid #eee;padding-bottom:20px}.saswp_rv_module_pro_notice ul li{position:relative;font-size:15px;line-height:1.5;color:#444;margin:0}.saswp_rv_module_pro_notice ul li span{padding-left:3px}.saswp_rv_module_pro_notice h2{text-align:center;font-size:31px}.saswp_rv_module_pro_notice .saswp_desc{text-align:center;font-size:18px;font-style:normal;color:#000}.saswp_rv_module_pro_notice .saswp_desc a{font-style:italic}.saswp_rv_module_pro_notice .saswp_lst{color:grey;font-family:georgia;font-style:italic;font-style:italic;font-size:15px;font-weight:600}.saswp_rv_module_pro_notice .saswp_avlbl{color:#2a902e;font-family:georgia;font-style:italic;font-size:15px;font-weight:600}.saswp_rv_module_pro_notice ul li img{width:20px;height:20px;position:relative;top:4px}.saswp-rev-btn{width:100%;display:inline-block;margin-top:20px;text-align:center}.saswp-rev-btn span{display:block;font-size:13px;margin-bottom:15px}.saswp-rev-btn a{padding:12px 18px;display:inline-block;text-decoration:none;border-radius:5px;background:#0085ba;color:#fff;font-weight:600;font-size:18px}.select2-container{width:100%!important}.saswp-schema-modify-section{margin-top:15px;border-top:1px solid #eee;padding-top:15px}.saswp-custom-meta-list{border:1px solid #aaa;border-radius:4px}.saswp-custom-fields-table tr td:nth-child(3n+3) input{border:1px solid #aaa;border-radius:4px}.updated.notice p{display:flex;width:100%;align-items:center}.updated.notice .dashicons-thumbs-up{margin-right:10px}a.saswp-feedback-no-thanks,a.saswp-feedback-remindme{display:inline-block;cursor:pointer}.saswp-feedback-remindme:after{content:",";display:inline-block;margin-right:5px;padding-left:5px}a.saswp-revws-lnk{display:inline-block;background:#0085ba;padding:12px 20px;color:#fff;text-decoration:none;border-radius:3px;margin-left:20px;font-size:14px;line-height:.6}.saswp-update-notice-btns{display:inline-block;width:100%;margin-bottom:5px}.saswp-about-contact-page{width:75%;float:right}.saswp-about-contact-page-tooltip{float:left;clear:both}.saswp-quick-setup{float:left}.saswp_add_schema_fields_on_fly{margin-bottom:5px!important}.saswp-custom-fields-table .saswp_image_prev{max-width:62px!important}.saswp-custom-fields-table .saswp_prev_close{font-size:15px}.saswp-review-content-table td:nth-child(2){width:50%;float:left}.saswp-review-content-table input{width:100%}.saswp-review-content-table select{width:100%}.saswp-review-content-table textarea{width:100%}
1
+ .saswp_warning{color:#ef6c00!important}.saswp_hide{display:none}.saswp-general table th{width:auto;font-weight:600;padding:0}.saswp-general table{margin-top:0}.saswp-general table td{padding:5px}.saswp-knowledge table th{width:auto;padding:0}.saswp-knowledge table{margin-top:0}.saswp-knowledge table td{padding:5px}.saswp-schema table th{width:auto;padding:0}.saswp-schema table{margin-top:0}.saswp-schema table td{padding:5px}.saswp-amp table th{width:auto;padding:0}.saswp-amp table{margin-top:0}.saswp-amp table td{padding:5px}.saswp-help table th{width:auto;padding:0}.saswp-support table th{width:auto;padding:0}.saswp-review table th{width:auto;padding:0}.saswp-help table{margin-top:0}.saswp-help table td{padding:5px}.saswp-settings-list{display:inline-block;width:100%}.saswp-settings-list li{padding-left:0}.saswp-settings-list li div label{font-weight:600}.saswp-general h2{margin-bottom:0}.saswp-knowledge h2{margin-bottom:0}.saswp-schema h2{margin-bottom:0}.saswp-help h2{margin-bottom:0}.saswp-settings-form p.submit{margin-top:0}.saswp_qanda_p{font-weight:500}.saswp-display-none{display:none!important}.saswp-placement-groups{border:1px solid #e5e5e5}.saswp-query-success{color:#060}.saswp-query-error{color:#bf3322}.saswp-tools table th{width:auto;padding:0}.saswp-tools table{margin-top:0}.saswp-tools table td{padding:5px}.saswp-tools-field-title strong{padding-right:130px}.saswp-tools .saswp-tooltip{width:230px}.saswp-tools .saswp-knowledge-label{float:left}.saswp-error{color:red!important}.saswp-tooltip{position:relative;display:inline-block}.saswp-tooltip .saswp-tooltiptext{visibility:hidden;width:200px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;bottom:100%;left:50%;margin-left:-25px}.saswp-tooltiptext::after{content:"";position:absolute;top:100%;left:10%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}.saswp-knowledge-base .saswp-knowledge-label{width:200px;float:left;clear:both}.saswp-knowledge-base .saswp-knowledge-field{width:75%;float:right}.saswp-social-fileds ul{display:grid;grid-template-columns:26.5% 1fr}.saswp-social-fileds li{display:flex}.saswp-social-fileds .saswp-knowledge-field{width:100%;margin-left:10px}.saswp-social-fileds .saswp-knowledge-field input{float:right;margin:inherit}.saswp-schema-type-fields .saswp-knowledge-label{width:200px;float:left;clear:both}.saswp-schema-type-fields .saswp-knowledge-field{width:75%;float:right}.saswp-settings-first-div{width:70%}.saswp-settings-container{display:inline-flex;width:100%}.saswp-settings-second-div{float:right;position:relative;top:20px;margin-right:30px;margin-top:37px}.saswp-feedback-panel{height:200px;width:280px;background:#fff;position:relative}.saswp-start-quck-setup{position:relative;float:inherit;top:7px;left:15px}.saswp-feedback-panel ul{list-style-type:circle;list-style:decimal;padding-left:30px;font-size:15px}.saswp-feedback-panel a{text-decoration:none}.saswp-feedback-panel h2{text-align:center;padding-top:18px}.saswp-social-sharing-buttons{text-align:center;padding-top:20px}.saswp-facebook-share{background:#3b5998;box-shadow:0 0 0 #1b95e0!important;color:#fff!important;line-height:20px!important;height:21px!important;border-radius:3px;margin-right:5px}.saswp-social-sharing-buttons a{text-align:center;padding:8px}.twitter-share-button{background:#1b95e0!important;box-shadow:0 0 0 #1b95e0!important;color:#fff!important;line-height:20px!important;height:21px!important;border-radius:3px;margin-left:5px}.saswp-placement-button{padding:3px 10px;color:#0d0d0d;font-size:14px;border:1px solid #aaa;border-radius:2px;background:linear-gradient(#ededed,#fff)}.saswp-placement-table td{padding:5px 10px!important}.saswp-archive-div .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-archive-div .saswp-knowledge-label{float:left;clear:both}.saswp-amp .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-amp .saswp-knowledge-label{float:left;clear:both}.saswp-review .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-review .saswp-knowledge-label{float:left;clear:both}.saswp-compativility-div .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-compativility-div .saswp-knowledge-label{float:left;clear:both}.saswp-compativility-div li{display:inline-flex}.saswp-seller-div .saswp-knowledge-label{float:left;clear:both}.saswp-seller-div .saswp-knowledge-field{float:left;width:70%}.saswp-post-specific-tab-wrapper{display:inline-block;width:25%;vertical-align:top;box-sizing:border-box;padding-right:10px}.saswp-post-specific-container{display:inline-block;width:calc(75% - 1px);border-left:1px solid #eee}.saswp-post-specific-wrapper{padding:10px}.saswp-tab a.selected{background-color:#ccc}.saswp-tab-links{display:block;background-color:inherit;color:#000;padding:6px 10px;outline:0;text-align:left;cursor:pointer;transition:.3s;font-size:15px;width:130px;overflow:hidden;margin-right:10px}.saswp-star-rating{cursor:pointer}.saswp-post-specific-wrapper select{width:100%}.saswp-review-tables{width:100%}.saswp-over-all-raring{float:right}.saswp-review-pros-and-cons{position:relative;clear:both}.saswp-review-pros-and-cons>div:first{padding-left:10px}.saswp-review-pros-and-cons>div{width:49%;display:inline-block}.saswp-review-pros-and-cons>div:nth-child(2){padding-left:12px}.saswp-wp-ediot-desc{margin-bottom:-23px;display:block}.saswp-review-description{margin-top:40px;padding-top:10px;border-top:1px solid #eee}.saswp-review-pros-and-cons{margin-top:40px;padding-top:10px;border-top:1px solid #eee}.saspw-review-item-list{margin-top:20px;border-top:1px solid #eee}.saswp-review-item-list-table{padding-bottom:10px}#sasw-review input[type=text]{width:180px}#sasw-review input[type=number]{width:180px}#saswp-review-item-enable{width:10px}.saswp-enable-review-on-post{padding-bottom:10px}.saswp-enable-review-on-post label{font-weight:500}.saswp-compatibility table th{width:auto;padding:0}.saswp-compatibility .saswp-knowledge-label{float:left;clear:both}.saswp-tools .saswp-knowledge-label{float:left;clear:both}.saswp-tools .saswp-knowledge-field{float:right;width:69%;padding-bottom:10px}.saswp_kg_logo,.saswp_person_fields{background-color:#fff!important}.saswp_image_thumbnail{padding-top:5px;display:inline-block}.saswp-compatibility .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-job-posting-note,.saswp-schem-type-note{color:#d2691e}.saswp-custom-fields-name{border:1px solid #aaa;border-radius:4px}.saswp-option-table-class p{margin:auto;font-style:italic;color:#666}.saswp-switch{position:relative;display:inline-block;width:40px;height:22px;border:20px}.saswp-switch input{opacity:0;width:0;height:0}.saswp-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#5a6783;transition:.4s;border-radius:20px}.saswp-slider:before{position:absolute;content:"";height:15px;width:15px;left:4px;bottom:4px;background-color:#fff;transition:.4s;border-radius:20px}input:checked+.saswp-slider{background-color:#61bd3b;border-radius:30px}input:focus+.saswp-slider{box-shadow:0 0 1px #2196f3}input:checked+.saswp-slider:before{transform:translateX(15px)}.saswp-slider.saswp-round{border-radius:34px}.saswp-slider.saswp-round:before{border-radius:50%}.saswp-tab-nav li{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;border-bottom:1px solid #eee}.saswp-tab-nav .selected{background-color:#ccc}.saswp-single-post-restore .saswp-switch{height:28px}.saswp-single-post-restore .saswp-slider:before{height:20px}.option-table-class{width:100%}.option-table-class tr td{padding:10px 10px 10px 10px}.option-table-class tr>td{width:30%}.option-table-class tr td:last-child{width:60%}.saswp-custom-fields-table{width:100%}.saswp-custom-fields-table input{width:100%}.saswp-custom-fields-table tr td{padding:10px 10px 10px 10px}.saswp-custom-fields-table td{width:30%;vertical-align:top}.saswp-option-table-class input[type=text],.saswp-option-table-class select{width:100%}.saswp-paywall-table-class input[type=text],.saswp-paywall-table-class select{width:100%}.saswp-email_schema table th{width:auto;padding:0}.saswp-email_schema .saswp-knowledge-label{float:left;clear:both}.saswp-email_schema .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-add-on-plugin label{margin-top:10px}.saswp-add-on-plugin span{width:250px;display:inline-block}.saswp-knowledge-label label[for=saswp_search_box_schema_checkbox]{padding-left:10px}.saswp-knowledge-label label[for=saswp-woocommerce-booking-checkbox]{padding-left:10px}.saswp-knowledge-label label[for=saswp-woocommerce-membership-checkbox]{padding-left:10px}.saswp-global-selected{color:#000;font-weight:500}#saswp-global-tabs a{cursor:pointer}#saswp-global-tabs{padding-left:5px}#saswp-tools-tabs a{cursor:pointer}#saswp-review-tabs a{cursor:pointer}#saswp-tools-tabs{padding-left:5px}.saswp-need-help{padding-left:60px}.saswp-heading{display:inline-flex;align-items:baseline}.saswp-heading h2{margin-bottom:0}.saswp-view-docs a{margin-right:5px!important;margin-top:10px!important;float:right}.saswp-tabs .nav-tab{margin-left:4px}.saswp-panel{padding:7px 18px;background-color:#fff;box-shadow:0 0 20px 1px #d2cccc}.saswp-g-review-header{margin-top:50px}.saswp-g-review-body{display:inline-grid;grid-template-columns:1fr 300px;grid-gap:30px;margin-top:30px}.saswp-channel-list{margin-right:15px}.saswp-input-fields{display:inline-flex;align-items:center;margin-bottom:8px;width:100%}.saswp-input-fields label{width:130px}.saswp-input-fields select{width:100%}.saswp-panel h3{font-size:20px;line-height:1.4;color:#222;text-align:center;margin:10px 0 20px 0}.saswp-input-fields a.button-primary{margin-top:10px}.saswp-glg-review-body{display:grid;grid-template-columns:100px 1fr;grid-gap:20px;background:#fff;padding:20px;box-shadow:0 0 20px 1px #d2cccc;margin-bottom:30px}.saswp-g-plus{float:right;font-size:15px}.saswp-rtng{padding-left:5px;font-size:14px}.saswp-pt-dt{font-size:12px;color:#999;font-weight:600;margin-top:5px;display:inline-block}.saswp-str{display:inline-block;width:100%;vertical-align:middle}.saswp-athr{font-size:15px;line-height:1.4;color:#000;font-weight:700;display:inline-block;vertical-align:middle}.saswp-str-rtng .saswp-rvw-str{display:inline-block;vertical-align:middle;padding-left:10px;width:auto}.saswp-rv-cnt p{font-size:16px;line-height:1.6;color:#000;margin:10px 0 0 0}.saswp-rv-img img{max-width:100px;border-radius:100%}.saswp-premium_features table th,.saswp-services table th{width:auto;padding:0}.saswp-features-blocks{display:inline-grid;grid-template-columns:1fr 1fr;grid-gap:20px}.saswp-features-blocks li{background:#fff;padding:25px;border:1px solid #d8d8d8}.saswp-features-blocks li a{text-decoration:none}.saswp-ele-ic{border-radius:256px;display:inline-block;padding:8px 10px 8px 10px;width:70px;margin-right:20px;height:70px;float:left}.saswp-ele-ic img{width:80%;left:10%;position:relative;top:9%}.saswp-ele-1{background:#96588a}.saswp-ele-2{background:#00a97e}.saswp-ele-3{background:#cacaca}.saswp-ele-4{background:#9c56cc}.saswp-ele-tlt h3{margin:0;font-size:18px;line-height:1.4}.saswp-ele-tlt p{margin-top:10px}.saswp-sts-btn{box-sizing:border-box;height:52px;margin-top:20px;padding:6px 15px;border:1px solid #e5e5e5;border-radius:3px;display:flex;align-items:center;justify-content:space-between}.saswp-d-btn{background:#d2150a;padding:6px 18px;border-radius:30px;font-size:14px;color:#fff}.form-wrap .saswp-sts-txt{font-size:16px;color:#000}.saswp-sts-txt span{color:#bebfc0;padding-left:5px}.saswp_review_platform .saswp-g-plus{float:left}.saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-g-review-header{margin-top:50px}.saswp-g-review-body{display:inline-grid;grid-template-columns:1fr 300px;grid-gap:30px;margin-top:30px;width:100%}.saswp-channel-list{margin-right:15px}.saswp-input-fields{display:inline-flex;align-items:center;margin-bottom:8px;width:100%}.saswp-input-fields label{width:130px}.saswp-panel h3{font-size:20px;line-height:1.4;color:#222;text-align:center;margin:10px 0 20px 0}.saswp-input-fields a.button-primary{margin-top:10px}.saswp-glg-review-body{display:grid;grid-template-columns:100px 1fr;grid-gap:20px;background:#fff;padding:20px;box-shadow:0 0 20px 1px #d2cccc;margin-bottom:30px}.saswp-g-plus{float:right;font-size:15px;width:20px;height:20px}.saswp-g-plus img{max-width:100%}.saswp-rtng{padding-left:5px;font-size:14px}.saswp-pt-dt{font-size:12px;color:#999;font-weight:600;margin-top:5px;display:inline-block}.saswp-athr{font-size:15px;line-height:1.4;color:#000;font-weight:700}.saswp-rv-cnt p{font-size:16px;line-height:1.6;color:#000;margin:10px 0 0 0}.saswp-rv-img img{max-width:100px}.saswp-g-review-header div{margin-top:10px}.saswp-upgrade-pro{background:#fff;padding:25px;border:1px solid #d8d8d8;display:inline-block;margin-top:10px;width:81%}.saswp-upgrade-pro h2{font-size:20px;margin:0;color:#23282d;font-weight:600;text-align:center}.saswp-upgrade-pro ul{margin:25px 0 20px 0;display:inline-block}.saswp-upgrade-pro ul li{position:relative;padding-left:30px;font-size:14px;line-height:1.4;margin-bottom:10px}.saswp-upgrade-pro ul li:before{content:"";background-image:url(../images/check.png);background-repeat:no-repeat;background-size:20px;width:20px;height:20px;position:absolute;left:2px;top:2px}.saswp-upgrade-pro a{background:#d2150a;padding:10px 0;display:block;text-align:center;color:#fff;text-decoration:none;font-size:16px;font-weight:600;letter-spacing:1px;border-radius:5px}.saswp_image_prev{max-width:200px;max-height:200px;float:left;padding-left:2px}.saswp_prev_close{position:relative;width:30px;height:30px;top:12px;font-size:20px;top:-5px;text-decoration:none}.saswp-add-custom-schema-div{margin-top:10px;border-top:1px solid #eee;padding-top:5px}.saswp-nav-menu-list label{padding-left:10px}.saswp-dynamic-properties{border:1px solid #aaa;margin-top:5px;margin-bottom:5px}.saswp-table-close{float:right;cursor:pointer}.saswp-table-create-onajax table td,.saswp-table-create-onajax table th{padding:5px}.saswp-table-create-onajax select{width:98%}.saswp-g-reviews-settings-table input{width:100%}.saswp-s-reviews-settings-table input{width:100%}.saswp_rv_module_pro_notice{border:1px solid #d8d8d8;background:#fff}.saswp-settings-list .saswp-rev-mod{width:100%;display:inline-block;margin-top:20px}.saswp-rev-mod .saswp-knowledge-label{width:100%;display:inline-block;padding:10px 16px;font-weight:600;font-size:16px;color:#333;background:#f9f9f9;border:1px solid #d8d8d8;border-bottom:none;box-sizing:border-box}.saswp-rev-mod .saswp-knowledge-field{width:100%;display:inline-block}.saswp-rev-mod .saswp_rv_module_pro_notice{padding:20px}.saswp_cmpny_lst{width:100%;display:inline-block;margin-top:30px}.saswp_rv_module_pro_notice ul{margin:15px 0 20px 0;width:100%;display:inline-grid;grid-template-columns:1fr 1fr 1fr;grid-gap:20px;border-bottom:1px solid #eee;padding-bottom:20px}.saswp_rv_module_pro_notice ul li{position:relative;font-size:15px;line-height:1.5;color:#444;margin:0}.saswp_rv_module_pro_notice ul li span{padding-left:3px}.saswp_rv_module_pro_notice h2{text-align:center;font-size:31px}.saswp_rv_module_pro_notice .saswp_desc{text-align:center;font-size:18px;font-style:normal;color:#000}.saswp_rv_module_pro_notice .saswp_desc a{font-style:italic}.saswp_rv_module_pro_notice .saswp_lst{color:grey;font-family:georgia;font-style:italic;font-style:italic;font-size:15px;font-weight:600}.saswp_rv_module_pro_notice .saswp_avlbl{color:#2a902e;font-family:georgia;font-style:italic;font-size:15px;font-weight:600}.saswp_rv_module_pro_notice ul li img{width:20px;height:20px;position:relative;top:4px}.saswp-rev-btn{width:100%;display:inline-block;margin-top:20px;text-align:center}.saswp-rev-btn span{display:block;font-size:13px;margin-bottom:15px}.saswp-rev-btn a{padding:12px 18px;display:inline-block;text-decoration:none;border-radius:5px;background:#0085ba;color:#fff;font-weight:600;font-size:18px}.select2-container{width:100%!important}.saswp-schema-modify-section{margin-top:15px;border-top:1px solid #eee;padding-top:15px}.saswp-custom-meta-list{border:1px solid #aaa;border-radius:4px}.saswp-custom-fields-table tr td:nth-child(3n+3) input{border:1px solid #aaa;border-radius:4px}.updated.notice p{display:flex;width:100%;align-items:center}.updated.notice .dashicons-thumbs-up{margin-right:10px}a.saswp-feedback-no-thanks,a.saswp-feedback-remindme{display:inline-block;cursor:pointer}.saswp-feedback-remindme:after{content:",";display:inline-block;margin-right:5px;padding-left:5px}a.saswp-revws-lnk{display:inline-block;background:#0085ba;padding:12px 20px;color:#fff;text-decoration:none;border-radius:3px;margin-left:20px;font-size:14px;line-height:.6}.saswp-update-notice-btns{display:inline-block;width:100%;margin-bottom:5px}.saswp-about-contact-page{width:75%;float:right}.saswp-about-contact-page-tooltip{float:left;clear:both}.saswp-quick-setup{float:left}.saswp_add_schema_fields_on_fly{margin-bottom:5px!important}.saswp-custom-fields-table .saswp_image_prev{max-width:62px!important}.saswp-custom-fields-table .saswp_prev_close{font-size:15px}.saswp-review-content-table td:nth-child(2){width:50%;float:left}.saswp-review-content-table input{width:100%}.saswp-review-content-table select{width:100%}.saswp-review-content-table textarea{width:100%}.saswp-social-links-table{width:100%}.saswp-social-links-table input{width:100%}.saswp-add-social-links{margin:3px!important}.saswp-social-links-table td{padding-left:0!important}
admin_section/js/main-script.js CHANGED
@@ -99,8 +99,8 @@
99
 
100
  }
101
 
102
- function saswpAddTimepicker(){
103
- jQuery('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
104
  }
105
 
106
  function saswp_item_reviewed_call(){
@@ -126,9 +126,19 @@
126
  jQuery.get(ajaxurl,
127
  { action:"saswp_get_item_reviewed_fields",schema_id:schema_id, post_specific:post_specific ,item:item, post_id:post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
128
  function(response){
129
-
130
- jQuery(current).parent().parent().nextAll().remove(".saswp-review-tr");
131
- jQuery(current).parent().parent().after(response);
 
 
 
 
 
 
 
 
 
 
132
 
133
  });
134
 
@@ -175,13 +185,45 @@
175
  });
176
  re_html += '</select>';
177
 
178
- if(fields){
 
 
 
 
 
 
 
 
179
  var html = '<tr>';
180
  html += '<td>';
181
  html += '<select class="saswp-custom-fields-name">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
182
  jQuery.each(fields, function(key,value){
183
  html += '<option value="'+key+'">'+value+'</option>';
184
- });
 
 
 
 
 
185
  html += '</select>';
186
  html += '</td>';
187
  html += '<td>';
@@ -228,13 +270,13 @@
228
  jQuery.get(ajaxurl,
229
  { action:"saswp_get_schema_dynamic_fields_ajax",meta_name:meta_name, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
230
  function(response){
231
- saswp_meta_fields[fields_type] = response;
232
- console.log(saswp_meta_fields);
233
  var html = saswp_fields_html_generator(index, schema_id, fields_type, div_type, response);
234
 
235
  if(html){
236
  jQuery('.saswp-'+div_type+'-section[data-id="'+schema_id+'"]').append(html);
237
  saswp_schema_datepicker();
 
238
  current_fly.removeClass('updating-message');
239
  }
240
 
@@ -247,6 +289,7 @@
247
  if(html){
248
  jQuery('.saswp-'+div_type+'-section[data-id="'+schema_id+'"]').append(html);
249
  saswp_schema_datepicker();
 
250
  current_fly.removeClass('updating-message');
251
  }
252
 
@@ -1326,6 +1369,26 @@ jQuery(document).ready(function($){
1326
  }
1327
  break;
1328
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1329
 
1330
  default:
1331
  break;
@@ -1663,15 +1726,16 @@ jQuery(document).ready(function($){
1663
  current.remove();
1664
  $(".saswp-add-custom-schema-div").remove();
1665
  $("#post_specific .inside").append(response);
1666
- current.removeClass('updating-message');
1667
- saswpAddTimepicker();
1668
  saswp_schema_datepicker();
 
1669
  saswp_enable_rating_review();
1670
  saswp_item_reviewed_call();
1671
  });
1672
 
1673
  });
1674
- saswp_schema_datepicker();
 
1675
 
1676
  saswp_reviews_datepicker();
1677
 
@@ -1713,7 +1777,7 @@ jQuery(document).ready(function($){
1713
  $("#saswp-review-item-over-all").val(over_all_rating);
1714
  });
1715
 
1716
- $("#saswp-review-location").change(function(){
1717
  var location = $(this).val();
1718
  $(".saswp-review-shortcode").addClass('saswp_hide');
1719
  if(location == 3){
@@ -1897,8 +1961,8 @@ jQuery(document).ready(function($){
1897
  var fields_type = $(this).attr('fields_type');
1898
  var div_type = $(this).attr('div_type');
1899
 
1900
- var count = $(".saswp-"+div_type+"-table-div").length;
1901
- var index = $( ".saswp-"+div_type+"-table-div:nth-child("+count+")" ).attr('data-id');
1902
  index = ++index;
1903
 
1904
  if(!index){
@@ -2086,6 +2150,14 @@ jQuery(document).ready(function($){
2086
  });
2087
  }
2088
  });
 
 
 
 
 
 
 
 
2089
 
2090
  //google review js ends here
2091
 
99
 
100
  }
101
 
102
+ function saswp_schema_timepicker(){
103
+ jQuery('.saswp-timepicker').timepicker({ 'timeFormat': 'H:i:s'});
104
  }
105
 
106
  function saswp_item_reviewed_call(){
126
  jQuery.get(ajaxurl,
127
  { action:"saswp_get_item_reviewed_fields",schema_id:schema_id, post_specific:post_specific ,item:item, post_id:post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
128
  function(response){
129
+
130
+ jQuery("#saswp_specific_"+schema_id).find(".saswp-table-create-onajax").remove();
131
+ var onload_class = jQuery("#saswp_specific_"+schema_id).find(".saswp-table-create-onload");
132
+
133
+ jQuery.each(onload_class, function(key, val){
134
+ if(key != 0){
135
+ jQuery(this).remove();
136
+ }
137
+
138
+ });
139
+ jQuery("#saswp_specific_"+schema_id).append(response);
140
+ saswp_schema_datepicker();
141
+ saswp_schema_timepicker();
142
 
143
  });
144
 
185
  });
186
  re_html += '</select>';
187
 
188
+ if(fields){
189
+
190
+ var schema_type = $('select#schema_type option:selected').val();
191
+ var schema_subtype = '';
192
+
193
+ if(schema_type == 'Review'){
194
+ schema_subtype = $('select.saswp-item-reivewed-list option:selected').val();
195
+ }
196
+
197
  var html = '<tr>';
198
  html += '<td>';
199
  html += '<select class="saswp-custom-fields-name">';
200
+
201
+ if(schema_type == 'Review'){
202
+ html += '<optgroup label="Review">';
203
+ html += '<option value="saswp_review_name">Review Name</option>';
204
+ html += '<option value="saswp_review_description">Review Description</option>';
205
+ html += '<option value="saswp_review_author">Review Author</option>';
206
+ html += '<option value="saswp_review_author_url">Review Author Profile URL</option>';
207
+ html += '<option value="saswp_review_publisher">Review Publisher</option>';
208
+ html += '<option value="saswp_review_rating_value">Review Rating Value</option>';
209
+ html += '<option value="saswp_review_date_published">Review Published Date</option>';
210
+ html += '<option value="saswp_review_url">Review URL</option>';
211
+ html += '</optgroup>';
212
+
213
+ }
214
+
215
+ if(schema_type == 'Review'){
216
+ html += '<optgroup label="'+schema_subtype+'">';
217
+ }
218
+
219
  jQuery.each(fields, function(key,value){
220
  html += '<option value="'+key+'">'+value+'</option>';
221
+ });
222
+
223
+ if(schema_type == 'Review'){
224
+ html += '</optgroup>';
225
+ }
226
+
227
  html += '</select>';
228
  html += '</td>';
229
  html += '<td>';
270
  jQuery.get(ajaxurl,
271
  { action:"saswp_get_schema_dynamic_fields_ajax",meta_name:meta_name, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
272
  function(response){
273
+ saswp_meta_fields[fields_type] = response;
 
274
  var html = saswp_fields_html_generator(index, schema_id, fields_type, div_type, response);
275
 
276
  if(html){
277
  jQuery('.saswp-'+div_type+'-section[data-id="'+schema_id+'"]').append(html);
278
  saswp_schema_datepicker();
279
+ saswp_schema_timepicker();
280
  current_fly.removeClass('updating-message');
281
  }
282
 
289
  if(html){
290
  jQuery('.saswp-'+div_type+'-section[data-id="'+schema_id+'"]').append(html);
291
  saswp_schema_datepicker();
292
+ saswp_schema_timepicker();
293
  current_fly.removeClass('updating-message');
294
  }
295
 
1369
  }
1370
  break;
1371
 
1372
+ case 'saswp-other-images-checkbox':
1373
+
1374
+ if ($(this).is(':checked')) {
1375
+ $("#saswp-other-images").val(1);
1376
+ }else{
1377
+ $("#saswp-other-images").val(0);
1378
+ }
1379
+
1380
+ break;
1381
+
1382
+ case 'saswp-easy-testimonials-checkbox':
1383
+
1384
+ if ($(this).is(':checked')) {
1385
+ $("#saswp-easy-testimonials").val(1);
1386
+ }else{
1387
+ $("#saswp-easy-testimonials").val(0);
1388
+ }
1389
+
1390
+ break;
1391
+
1392
 
1393
  default:
1394
  break;
1726
  current.remove();
1727
  $(".saswp-add-custom-schema-div").remove();
1728
  $("#post_specific .inside").append(response);
1729
+ current.removeClass('updating-message');
 
1730
  saswp_schema_datepicker();
1731
+ saswp_schema_timepicker();
1732
  saswp_enable_rating_review();
1733
  saswp_item_reviewed_call();
1734
  });
1735
 
1736
  });
1737
+ saswp_schema_datepicker();
1738
+ saswp_schema_timepicker();
1739
 
1740
  saswp_reviews_datepicker();
1741
 
1777
  $("#saswp-review-item-over-all").val(over_all_rating);
1778
  });
1779
 
1780
+ $("#saswp-review-location").change(function(){
1781
  var location = $(this).val();
1782
  $(".saswp-review-shortcode").addClass('saswp_hide');
1783
  if(location == 3){
1961
  var fields_type = $(this).attr('fields_type');
1962
  var div_type = $(this).attr('div_type');
1963
 
1964
+ var count = $("saswp_specific_"+schema_id+" , .saswp-"+div_type+"-table-div").length;
1965
+ var index = $( "saswp_specific_"+schema_id+" , .saswp-"+div_type+"-table-div:nth-child("+count+")" ).attr('data-id');
1966
  index = ++index;
1967
 
1968
  if(!index){
2150
  });
2151
  }
2152
  });
2153
+
2154
+ $(document).on("click", ".saswp-add-social-links", function(){
2155
+
2156
+ var html = '<tr><td><input type="text" placeholder="https://www.facebook.com/profile" name="sd_data[saswp_social_links][]" value=""></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td></tr>';
2157
+
2158
+ $(".saswp-social-links-table").append(html);
2159
+
2160
+ });
2161
 
2162
  //google review js ends here
2163
 
admin_section/js/main-script.min.js CHANGED
@@ -1 +1 @@
1
- var saswp_meta_list=[],saswp_meta_fields=[],saswp_meta_list_fields=[],saswp_taxonomy_term=[];function saswp_taxonomy_term_html(e,s){var a="";return a+="<td>",a+='<select name="saswp_taxonomy_term['+s+']">',jQuery.each(e,function(e,s){a+='<option value="'+e+'">'+s+"</option>"}),a+="</select>",a+="</td>",a+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'}function saswp_enable_rating_review(){var e="";jQuery("select#schema_type option:selected").val()&&(e=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(e=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),e&&jQuery(".saswp-enable-rating-review-"+e.toLowerCase()).change(function(){jQuery(this).is(":checked")?jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).show():jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).hide()}).change()}function getParameterByName(e,s){s||(s=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(s);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}function saswpCustomSelect2(){"saswp"!=saswp_localize_data.post_type&&"saswp"!=saswp_localize_data.page_now||"saswp_page_structured_data_options"==saswp_localize_data.page_now||jQuery(".saswp-custom-fields-select2").select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(e){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:e.term,action:"saswp_get_custom_meta_fields"}},processResults:function(e){return{results:e}},cache:!0},minimumInputLength:2})}function saswp_reviews_datepicker(){jQuery(".saswp-reviews-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswp_schema_datepicker(){jQuery(".saswp-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswpAddTimepicker(){jQuery(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"})}function saswp_item_reviewed_call(){jQuery(".saswp-item-reviewed").change(function(e){e.preventDefault();var s="";if(jQuery("select#schema_type option:selected").val()&&(s=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(s=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),"Review"===s){var a=jQuery(this),t=jQuery(this).val(),i=saswp_localize_data.post_id,p=jQuery(a).attr("data-id"),o=jQuery(a).attr("post-specific");jQuery.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",schema_id:p,post_specific:o,item:t,post_id:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){jQuery(a).parent().parent().nextAll().remove(".saswp-review-tr"),jQuery(a).parent().parent().after(e)})}}).change()}function saswp_compatibliy_notes(e,s){var a=s.replace("-checkbox",""),t=jQuery("#"+a).next("p").text();e.is(":checked")&&""!==t?jQuery("#"+a).next("p").removeClass("saswp_hide"):1==jQuery("#"+a).next("p").attr("data-id")?jQuery("#"+a).next("p").text("This feature is only available in pro version"):jQuery("#"+a).next("p").addClass("saswp_hide")}function saswp_meta_list_html(e,s,a,t,i,p){var o=t;null==o&&(o=Object.keys(a)[0]);var n="";if(n+='<select class="saswp-custom-meta-list" name="saswp_meta_list_val['+o+']">',jQuery.each(s,function(e,s){n+='<optgroup label="'+s.label+'">',jQuery.each(s["meta-list"],function(e,s){n+='<option value="'+e+'">'+s+"</option>"}),n+="</optgroup>"}),n+="</select>",a){var c="<tr>";c+="<td>",c+='<select class="saswp-custom-fields-name">',jQuery.each(a,function(e,s){c+='<option value="'+e+'">'+s+"</option>"}),c+="</select>",c+="</td>",c+="<td>",c+=n,c+="</td>",c+='<td></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td>',c+="</tr>",jQuery(".saswp-custom-fields-table").append(c),null!=e&&e.removeClass("updating-message")}else jQuery(i).html(n),null!=e&&e.removeClass("updating-message")}function saswp_get_meta_list(e,s,a,t,i,p){saswp_meta_list[s]?saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,p):jQuery.get(ajaxurl,{action:"saswp_get_meta_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(o){saswp_meta_list[s]=o[s],saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,p)},"json")}function saswp_get_post_specific_schema_fields(e,s,a,t,i,p){if(saswp_meta_fields[p]){var o=saswp_fields_html_generator(s,i,p,t,saswp_meta_fields[p]);o&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(o),saswp_schema_datepicker(),e.removeClass("updating-message"))}else jQuery.get(ajaxurl,{action:"saswp_get_schema_dynamic_fields_ajax",meta_name:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){saswp_meta_fields[p]=a,console.log(saswp_meta_fields);var o=saswp_fields_html_generator(s,i,p,t,a);o&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(o),saswp_schema_datepicker(),e.removeClass("updating-message"))},"json")}function saswp_fields_html_generator(e,s,a,t,i){var p="";return p+='<div class="saswp-'+t+'-table-div saswp-dynamic-properties" data-id="'+e+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',jQuery.each(i,function(t,i){var o="";switch("saswp_tvseries_season_published_date"!=i.name&&"saswp_feed_element_date_created"!=i.name&&"saswp_product_reviews_created_date"!=i.name||(o="saswp-datepicker-picker"),i.type){case"number":case"text":p+="<tr><th>"+i.label+'</th><td><input class="'+o+'" style="width:100%" type="'+i.type+'" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']"></td></tr>';break;case"textarea":p+="<tr><th>"+i.label+'</th><td><textarea style="width: 100%" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']" rows="5"></textarea></td></tr>';break;case"select":var n="";jQuery.each(i.options,function(e,s){n+='<option value="'+e+'">'+s+"</option>"}),p+="<tr><th>"+i.label+'</th><td><select id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']">'+n+"</select></td></tr>";break;case"media":p+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+e+"_"+s+'" name="'+i.name+"_"+e+"_"+s+'"><input type="hidden" data-id="'+i.name+"_"+e+"_"+s+'_id" name="'+a+s+"["+e+"]["+i.name+'_id]" id="'+i.name+"_"+e+"_"+s+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+e+"_"+s+'_button" name="'+i.name+"_"+e+"_"+s+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+e+"_"+s+'"></div></fieldset></td></tr>'}}),p+="</table></div>"}jQuery(document).ready(function(e){if(e(document).on("click",".saswp-add-g-location-btn",function(s){var a="";a=e("#saswp_google_place_api_key").length?'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="5" step="5" placeholder="5" disabled="disabled">':'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="10" step="10" placeholder="10">',s.preventDefault();var t="";(t+='<tr><td style="width:12%;"><strong>Place Id</strong></td><td style="width:20%;"><input class="saswp-g-location-field" name="sd_data[saswp_reviews_location_name][]" type="text" value=""></td><td style="width:10%;"><strong>Reviews</strong></td><td style="width:10%;">'+a+'</td><td style="width:10%;"><a class="button button-default saswp-fetch-g-reviews">Fetch</a></td><td style="width:10%;"><a type="button" class="saswp-remove-review-item button">x</a></td><td style="width:10%;"><p class="saswp-rv-fetched-msg"></p></td></tr>')&&e(".saswp-g-reviews-settings-table").append(t)}),e(document).on("click",".saswp-fetch-g-reviews",function(){var s=e(this),a="free";s.addClass("updating-message");var t=e(this).parent().parent().find(".saswp-g-location-field").val(),i=e(this).parent().parent().find(".saswp-g-blocks-field").val(),p=e("#saswp_google_place_api_key").val(),o=e("#reviews_addon_license_key").val(),n=e("#reviews_addon_license_key_status").val();if("premium"==(a=e("#saswp_google_place_api_key").length?"free":"premium")){if(!(i>0))return alert("Blocks value is zero"),s.removeClass("updating-message"),!1;if(0!=i%10)return s.parent().parent().find(".saswp-rv-fetched-msg").text("Reviews count should be in step of 10"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b"),s.removeClass("updating-message"),!1}""!=t&&(o||p)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_fetch_google_reviews",reviews_api_status:n,reviews_api:o,location:t,blocks:i,g_api:p,premium_status:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s.parent().parent().find(".saswp-rv-fetched-msg").text("Success"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","green")):(s.parent().parent().find(".saswp-rv-fetched-msg").text(e.message),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b")),s.removeClass("updating-message")},error:function(e){console.log(e)}}):(""==t&&alert("Please enter place id"),""==p&&alert("Please enter api key"),""==o&&alert("Please enter reviews api key"),s.removeClass("updating-message"))}),saswp_localize_data.do_tour){var s,a="<h3>Thanks for using Structured Data!</h3>";a+="<p>Do you want the latest on <b>Structured Data update</b> before others and some best resources on monetization in a single email? - Free just for users of Structured Data!</p>",a+='<style type="text/css">',a+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",a+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none}\t#afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",a+="</style>",a+='<div id="afw_mc_embed_signup">',a+='<form action="//app.mailerlite.com/webforms/submit/z7t4b8" data-id="258182" data-code="z7t4b8" method="POST" target="_blank">',a+='<div id="afw_mc_embed_signup_scroll">',a+='<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',a+='<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">',a+='<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',a+='<input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+saswp_localize_data.get_home_url+'">',a+='<input type="hidden" name="ml-submit" value="1" />',a+="</div>",a+='<div id="mce-responses">',a+='<div class="response" id="mce-error-response" style="display:none"></div>',a+='<div class="response" id="mce-success-response" style="display:none"></div>',a+="</div>",a+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',a+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',a+="</div>",a+="</form>";var t={content:a+="</div>",position:{edge:"top",align:"left"}};s=function(){e(saswp_localize_data.displayID).pointer(t).pointer("open"),saswp_localize_data.button2&&(jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+saswp_localize_data.button2+"</a>"),jQuery("#pointer-primary").click(function(){saswp_localize_data.function_name}),jQuery("#pointer-close").click(function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})}))},(t=e.extend(t,{buttons:function(e,s){return button=jQuery('<a id="pointer-close" class="button-secondary">'+saswp_localize_data.button1+"</a>"),button_2=jQuery("#pointer-close.button"),button.bind("click.pointer",function(){s.element.pointer("close")}),button_2.on("click",function(){s.element.pointer("close")}),button},close:function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(e,s){s.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?e(window).bind("load.wp-pointers",s):s()}e(".saswp-tabs a").click(function(s){var a=e(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),e(this).siblings().removeClass("nav-tab-active"),e(this).addClass("nav-tab-active"),e(".form-wrap").find(".saswp-"+t).siblings().hide(),e(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),e(".saswp-schame-type-select").change(function(){e(".saswp-custom-fields-table").html("");var s=e(this).val();e(".saswp-option-table-class tr").each(function(s,a){s>0&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==s||"Article"==s||"Blogposting"==s||"NewsArticle"==s||"WebPage"==s?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"Book"==s||"Course"==s||"HowTo"==s||"MusicPlaylist"==s||"MusicAlbum"==s||"Recipe"==s||"TVSeries"==s||"SoftwareApplication"==s||"Event"==s||"VideoGame"==s||"Service"==s||"AudioObject"==s||"VideoObject"==s||"local_business"==s||"Product"==s?e(".saswp-enable-append-reviews").parent().parent().show():e(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==s&&(e(".saswp-option-table-class tr").eq(1).show(),e(".saswp-business-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),e(".select-post-type").val("show_globally").trigger("change")),"Service"==s&&(e(".saswp-service-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==s&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==s&&(e(".saswp-review-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),saswp_item_reviewed_call()),saswp_enable_rating_review()}),e("#saswp_business_type").change(function(){var s=e(this).val(),a=e(".saswp-schame-type-select").val();e(".saswp-option-table-class tr").each(function(s,a){s>1&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"Book"==a||"Course"==a||"HowTo"==a||"MusicPlaylist"==a||"MusicAlbum"==a||"Recipe"==a||"TVSeries"==a||"SoftwareApplication"==a||"Event"==a||"VideoGame"==a||"Service"==a||"AudioObject"==a||"VideoObject"==a||"local_business"==a||"Product"==a?e(".saswp-enable-append-reviews").parent().parent().show():e(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(e(".saswp-"+s+"-tr").show(),e(".saswp-business-text-field-tr").show(),e(".saswp-"+s+"-tr").find("select").attr("disabled",!1)),"Review"==a&&(e(".saswp-review-text-field-tr").show(),e(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"Event"==a&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),saswp_enable_rating_review()}).change(),e(".saswp-checkbox").change(function(){var s=e(this).attr("id"),a=e(this);switch(s){case"saswp-the-seo-framework-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-seo-framework").val(1):e("#saswp-the-seo-framework").val(0);break;case"saswp-seo-press-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-seo-press").val(1):e("#saswp-seo-press").val(0);break;case"saswp-aiosp-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-aiosp").val(1):e("#saswp-aiosp").val(0);break;case"saswp-smart-crawl-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-smart-crawl").val(1):e("#saswp-smart-crawl").val(0);break;case"saswp-squirrly-seo-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-squirrly-seo").val(1):e("#saswp-squirrly-seo").val(0);break;case"saswp-wp-recipe-maker-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-recipe-maker").val(1):e("#saswp-wp-recipe-maker").val(0);break;case"saswp-wp-ultimate-recipe-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-ultimate-recipe").val(1):e("#saswp-wp-ultimate-recipe").val(0);break;case"saswp-zip-recipes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-zip-recipes").val(1):e("#saswp-zip-recipes").val(0);break;case"saswp-mediavine-create-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-mediavine-create").val(1):e("#saswp-mediavine-create").val(0);break;case"saswp-ht-recipes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-ht-recipes").val(1):e("#saswp-ht-recipes").val(0);break;case"saswp-wpsso-core-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wpsso-core").val(1):e("#saswp-wpsso-core").val(0);break;case"saswp-for-wordpress-checkbox":e(this).is(":checked")?e("#saswp-for-wordpress").val(1):e("#saswp-for-wordpress").val(0);break;case"saswp-facebook-enable-checkbox":e(this).is(":checked")?(e("#saswp-facebook-enable").val(1),e("#sd_facebook").show()):(e("#saswp-facebook-enable").val(0),e("#sd_facebook").hide());break;case"saswp-twitter-enable-checkbox":e(this).is(":checked")?(e("#saswp-twitter-enable").val(1),e("#sd_twitter").show()):(e("#saswp-twitter-enable").val(0),e("#sd_twitter").hide());break;case"saswp-google-plus-enable-checkbox":e(this).is(":checked")?(e("#saswp-google-plus-enable").val(1),e("#sd_google_plus").show()):(e("#saswp-google-plus-enable").val(0),e("#sd_google_plus").hide());break;case"saswp-instagram-enable-checkbox":e(this).is(":checked")?(e("#saswp-instagram-enable").val(1),e("#sd_instagram").show()):(e("#saswp-instagram-enable").val(0),e("#sd_instagram").hide());break;case"saswp-youtube-enable-checkbox":e(this).is(":checked")?(e("#sd_youtube").show(),e("#saswp-youtube-enable").val(1)):(e("#saswp-youtube-enable").val(0),e("#sd_youtube").hide());break;case"saswp-linkedin-enable-checkbox":e(this).is(":checked")?(e("#saswp-linkedin-enable").val(1),e("#sd_linkedin").show()):(e("#saswp-linkedin-enable").val(0),e("#sd_linkedin").hide());break;case"saswp-pinterest-enable-checkbox":e(this).is(":checked")?(e("#saswp-pinterest-enable").val(1),e("#sd_pinterest").show()):(e("#saswp-pinterest-enable").val(0),e("#sd_pinterest").hide());break;case"saswp-soundcloud-enable-checkbox":e(this).is(":checked")?(e("#saswp-soundcloud-enable").val(1),e("#sd_soundcloud").show()):(e("#saswp-soundcloud-enable").val(0),e("#sd_soundcloud").hide());break;case"saswp-tumblr-enable-checkbox":e(this).is(":checked")?(e("#saswp-tumblr-enable").val(1),e("#sd_tumblr").show()):(e("#saswp-tumblr-enable").val(0),e("#sd_tumblr").hide());break;case"saswp-yelp-enable-checkbox":e(this).is(":checked")?(e("#saswp-yelp-enable").val(1),e("#sd_yelp").show()):(e("#saswp-yelp-enable").val(0),e("#sd_yelp").hide());break;case"saswp-for-amp-checkbox":e(this).is(":checked")?e("#saswp-for-amp").val(1):e("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":e(this).is(":checked")?(e("#saswp_kb_contact_1").val(1),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(e("#saswp_kb_contact_1").val(0),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":e(this).is(":checked")?(e("#saswp-logo-dimensions").val(1),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(e("#saswp-logo-dimensions").val(0),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":e(this).is(":checked")?(e("#saswp_archive_schema").val(1),e(".saswp_archive_schema_type_class").parent().parent().show()):(e("#saswp_archive_schema").val(0),e(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":e(this).is(":checked")?(e("#saswp_website_schema").val(1),e("#saswp_search_box_schema").parent().parent().show()):(e("#saswp_website_schema").val(0),e("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":e(this).is(":checked")?e("#saswp_search_box_schema").val(1):e("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":e(this).is(":checked")?e("#saswp_breadcrumb_schema").val(1):e("#saswp_breadcrumb_schema").val(0);break;case"saswp_comments_schema_checkbox":e(this).is(":checked")?e("#saswp_comments_schema").val(1):e("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":e(this).is(":checked")?e("#saswp-review-module").val(1):e("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-kk-star-raring").val(1):e("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce").val(1):e("#saswp-woocommerce").val(0);break;case"saswp-extra-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-extra").val(1):e("#saswp-extra").val(0);break;case"saswp-dw-question-answer-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-dw-question-answer").val(1):e("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-job-manager").val(1):e("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-yoast").val(1):e("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-rankmath").val(1):e("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-tagyeem").val(1):e("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-events-calendar").val(1):e("#saswp-the-events-calendar").val(0);break;case"saswp-homeland-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-homeland").val(1):e("#saswp-homeland").val(0);break;case"saswp-realhomes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-realhomes").val(1):e("#saswp-realhomes").val(0);break;case"saswp-learn-press-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-learn-press").val(1):e("#saswp-learn-press").val(0);break;case"saswp-learn-dash-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-learn-dash").val(1):e("#saswp-learn-dash").val(0);break;case"saswp-lifter-lms-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-lifter-lms").val(1):e("#saswp-lifter-lms").val(0);break;case"saswp-wp-event-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-event-manager").val(1):e("#saswp-wp-event-manager").val(0);break;case"saswp-events-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-events-manager").val(1):e("#saswp-events-manager").val(0);break;case"saswp-event-calendar-wd-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-event-calendar-wd").val(1):e("#saswp-event-calendar-wd").val(0);break;case"saswp-event-organiser-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-event-organiser").val(1):e("#saswp-event-organiser").val(0);break;case"saswp-modern-events-calendar-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-modern-events-calendar").val(1):e("#saswp-modern-events-calendar").val(0);break;case"saswp-woocommerce-booking-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking").val(1),e("#saswp-woocommerce-booking-main").val(1)):(e("#saswp-woocommerce-booking").val(0),e("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking-main").val(1),e("#saswp-woocommerce-booking").val(1)):(e("#saswp-woocommerce-booking-main").val(0),e("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce-membership").val(1):e("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":e(this).is(":checked")?e("#saswp-defragment").val(1):e("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-cooked").val(1):e("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-shopper-approved-review-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-shopper-approved-review").val(1),e(".saswp-s-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-shopper-approved-review").val(0),e(".saswp-s-reviews-settings-table").parent().parent().parent().hide());break;case"saswp-google-review-checkbox":e(this).is(":checked")?(e("#saswp-google-review").val(1),e("#saswp-google-rv-free-checkbox").length?(e("#saswp-google-review-free").parent().parent().show(),e("#saswp-google-rv-free-checkbox").is(":checked")?e("#saswp_google_place_api_key").parent().parent().show():e("#saswp_google_place_api_key").parent().parent().hide()):e("#saswp_google_place_api_key").parent().parent().show(),e(".saswp-g-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-google-review").val(0),e("#saswp_google_place_api_key").parent().parent().hide(),e(".saswp-g-reviews-settings-table").parent().parent().parent().hide(),e("#saswp-google-rv-free-checkbox").length&&e("#saswp-google-review-free").parent().parent().hide());break;case"saswp-google-rv-free-checkbox":e("#saswp-google-review-checkbox").is(":checked")&&e(this).is(":checked")?(e("#saswp-google-review-free").val(1),e("#saswp_google_place_api_key").parent().parent().show()):(e("#saswp-google-review-free").val(0),e("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":e(this).is(":checked")?e("#saswp-markup-footer").val(1):e("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":e(this).is(":checked")?e("#saswp-pretty-print").val(1):e("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wppostratings-raring").val(1):e("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-bbpress").val(1):e("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":e(this).is(":checked")?e("#saswp-microdata-cleanup").val(1):e("#saswp-microdata-cleanup").val(0)}}).change(),e("#saswp_kb_type").change(function(){var s=e(this).val();e(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==s&&(e(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==s&&(e(".saswp_org_fields").parent().parent().addClass("saswp_hide"),e(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),e(document).on("click","input[data-id=media]",function(s){s.preventDefault();var a=e(this),t=a.attr("id").replace("_button",""),i=wp.media({title:"Application Icon",button:{text:"Select Icon"},multiple:!1,library:{type:"image"}}).on("select",function(){var s=i.state().get("selection").first().toJSON();e("#"+t).val(s.url),e("input[data-id='"+t+"_id']").val(s.id),e("input[data-id='"+t+"_height']").val(s.height),e("input[data-id='"+t+"_width']").val(s.width),e("input[data-id='"+t+"_thumbnail']").val(s.url),"sd_default_image_button"===a.attr("id")&&(e("#sd_default_image_width").val(s.width),e("#sd_default_image_height").val(s.height));var p="";"saswp_image_div_"+t=="saswp_image_div_sd_default_image"&&s.height<1200&&(p='<p class="saswp_warning">Image size is smaller than recommended size</p>'),e(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+s.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>'+p)}).open()}),e(document).on("click",".saswp_prev_close",function(s){s.preventDefault();var a=e(this).attr("data-id");console.log(a),e(this).parent().remove(),e("#"+a).val(""),e("input[data-id='"+a+"_id']").val(""),e("input[data-id='"+a+"_height']").val(""),e("input[data-id='"+a+"_width']").val(""),e("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(e("#sd_default_image_width").val(""),e("#sd_default_image_height").val(""))}),e(document).on("change",".saswp-schema-type-toggle",function(s){var a=e(this).attr("data-schema-id"),t=e(this).attr("data-post-id");if(e(this).is(":checked"))var i=1;else i=0;e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:i,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){},error:function(e){console.log(e)}})}),e(document).on("click",".saswp-reset-data",function(s){s.preventDefault(),1==confirm("Are you sure?")&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){setTimeout(function(){location.reload()},1e3)},error:function(e){console.log(e)}})}),e(document).on("click",".saswp_license_activation",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("license-status"),i=e(this).attr("add-on"),p=e("#"+i+"_addon_license_key").val();t&&i&&p?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_license_status_check",license_key:p,license_status:t,add_on:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){e("#"+i+"_addon_license_key_status").val(s.status),"active"==s.status?(e(".saswp-"+i+"-dashicons").addClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").css("color","green"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","inactive"),e(".saswp_license_activation[add-on='"+i+"']").text("Deactivate"),e(".saswp_license_status_msg[add-on='"+i+"']").text("Activated"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","green"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)):(e(".saswp-"+i+"-dashicons").addClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").css("color","red"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","active"),e(".saswp_license_activation[add-on='"+i+"']").text("Activate"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","red"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)),a.removeClass("updating-message")},error:function(e){console.log(e)}}):(alert("Please enter value license key"),a.removeClass("updating-message"))}),e(".saswp-send-query").on("click",function(s){s.preventDefault();var a=e("#saswp_query_message").val();""!=e.trim(a)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",message:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){"t"==s.status?(e(".saswp-query-success").show(),e(".saswp-query-error").hide()):(console.log("dd"),e(".saswp-query-success").hide(),e(".saswp-query-error").show())},error:function(e){console.log(e)}}):alert("Please enter the message")}),e(".saswp-import-plugins").on("click",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id");e.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status?(e(a).parent().find(".saswp-imported-message").text(s.message),e(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(e(a).parent().find(".saswp-imported-message").addClass("saswp-error"),e(a).parent().find(".saswp-imported-message").text(s.message)),a.removeClass("updating-message")},"json")}),e(".saswp-feedback-no-thanks").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_no_thanks",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(".saswp-feedback-remindme").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_remindme",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(document).on("change",".saswp-local-business-type-select",function(s){s.preventDefault();var a=e(this),t=e(this).val();e.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){if("t"==s.status){e(".saswp-local-business-name-select").parents("tr").remove();var t=a.parents(".saswp-post-specific-wrapper").attr("data-id"),i='<tr><th><label for="saswp_business_name_'+t+'">Sub Business Type</label></th>';i+='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+t+'" name="saswp_business_name_'+t+'">',e.each(s.result,function(e,s){i+='<option value="'+e+'">'+s+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else e(".saswp-local-business-name-select").parents("tr").remove()},"json")}),saswp_item_reviewed_call(),e(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),e(document).on("click",".saswp-add-custom-schema",function(s){s.preventDefault(),e(".saswp-add-custom-schema-field").removeClass("saswp_hide"),e(this).hide()}),e(document).on("click",".saswp-delete-custom-schema",function(s){s.preventDefault(),e("#saswp_custom_schema_field").val(""),e(".saswp-add-custom-schema-field").addClass("saswp_hide"),e(".saswp-add-custom-schema").show()}),e(".saswp-modify_schema_post_enable").on("click",function(s){var a=e(this);a.addClass("updating-message"),s.preventDefault(),e.get(ajaxurl,{action:"saswp_modify_schema_post_enable",post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){a.remove(),e(".saswp-add-custom-schema-div").remove(),e("#post_specific .inside").append(s),a.removeClass("updating-message"),saswpAddTimepicker(),saswp_schema_datepicker(),saswp_enable_rating_review(),saswp_item_reviewed_call()})}),saswp_schema_datepicker(),saswp_reviews_datepicker(),e(document).on("click",".saswp-add-more-item",function(s){s.preventDefault();var a=e(".saswp-review-item-list-table tr").length;console.log(a);e(".saswp-review-item-list-table").append('<tr class="saswp-review-item-tr"><td>Review Item Feature</td><td><input type="text" name="saswp-review-item-feature[]"></td><td>Rating</td><td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td><td><a type="button" class="saswp-remove-review-item button">x</a></td></tr>')}),e(document).on("click",".saswp-remove-review-item",function(s){s.preventDefault(),e(this).parent().parent("tr").remove()}),e(document).on("focusout",".saswp-review-item-tr input[type=number]",function(s){s.preventDefault();var a=0,t=e(".saswp-review-item-tr input[type=number]").length;e(".saswp-review-item-tr input[type=number]").each(function(s,t){""==e(t).val()?a+=parseFloat(0):a+=parseFloat(e(t).val())});var i=a/t;e("#saswp-review-item-over-all").val(i)}),e("#saswp-review-location").change(function(){var s=e(this).val();e(".saswp-review-shortcode").addClass("saswp_hide"),3==s&&e(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),e("#saswp-review-item-enable").change(function(){e(this).is(":checked")?e(".saswp-review-fields").show():e(".saswp-review-fields").hide()}).change(),e(document).on("click",".saswp-restore-post-schema",function(s){s.preventDefault();var a=e(this);if(a.addClass("updating-message"),e(".saswp-post-specific-schema-ids").val())var t=JSON.parse(e(".saswp-post-specific-schema-ids").val());e.post(ajaxurl,{action:"saswp_restore_schema",schema_ids:t,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?setTimeout(function(){location.reload()},1e3):(alert(e.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),e(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(s){s.preventDefault();var a=e(this).attr("data-id");e(".saswp-post-specific-wrapper").hide(),e("#"+a).show(),e("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),e("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),e(this).addClass("selected"),e(this).parent().addClass("selected"),saswp_enable_rating_review()}),e("#saswp-global-tabs a:first").addClass("saswp-global-selected"),e(".saswp-global-container").hide(),"#saswp-default-container"==window.location.hash?e(".saswp-global-container:eq(2)").show():e(".saswp-global-container:first").show(),e("#saswp-global-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-global-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-global-container").hide(),e("#"+s).show())}),e("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e(".saswp-tools-container:first").show(),e("#saswp-tools-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-tools-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e("#"+s).show())}),e("#saswp-review-tabs a:first").addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e(".saswp-review-container:first").show(),e("#saswp-review-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-review-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e("#"+s).show())}),e("#saswp-compatibility-tabs a:first").addClass("saswp-global-selected"),e(".saswp-compatibility-container").hide(),e(".saswp-compatibility-container:first").show(),e("#saswp-compatibility-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-compatibility-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-compatibility-container").hide(),e("#"+s).show())}),e('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),e("#saswp_enable_custom_field").change(function(){e(this).is(":checked")?e(".saswp-custom-fields-div").show():e(".saswp-custom-fields-div").hide()}),e(document).on("change",".saswp-custom-fields-name",function(){var s="text",a=e(this).parent().parent("tr"),t=e(this).val();-1==t.indexOf("image")&&-1==t.indexOf("logo")||(s="image"),saswp_get_meta_list(null,s,null,e(this).parent().parent("tr").find("td:eq(1)"),t,a)}),e(document).on("click",".saswp-skip-button",function(s){s.preventDefault(),e(this).parent().parent().hide(),e.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){},"json")}),e(document).on("click",".saswp_add_schema_fields_on_fly",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id"),i=e(this).attr("fields_type"),p=e(this).attr("div_type"),o=e(".saswp-"+p+"-table-div").length,n=e(".saswp-"+p+"-table-div:nth-child("+o+")").attr("data-id");(n=++n)||(n=0),saswp_get_post_specific_schema_fields(a,n,i,p,t,i+"_")}),e(document).on("click",".saswp-table-close",function(){e(this).parent().remove()}),e(document).on("click",".saswp-rmv-modify_row",function(s){s.preventDefault(),e(this).parent().parent().remove()}),e(document).on("change",".saswp-custom-meta-list",function(){var s=e(this),a=e("select#schema_type option:selected").val(),t=e(this).val(),i=e(this).parent().parent("tr").find(".saswp-custom-fields-name").val(),p="",o=a.toLowerCase()+"_"+i,n="saswp_fixed_image["+i+"]";"manual_text"==t?(p+='<td><input type="text" name="saswp_fixed_text['+i+']"></td>',p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2()):"taxonomy_term"==t?saswp_taxonomy_term.taxonomy?(p+=saswp_taxonomy_term_html(saswp_taxonomy_term.taxonomy,i),s.parent().parent("tr").find("td:gt(1)").remove(),s.parent().parent("tr").append(p),saswpCustomSelect2()):e.get(ajaxurl,{action:"saswp_get_taxonomy_term_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){e&&(saswp_taxonomy_term.taxonomy=e,p+=saswp_taxonomy_term_html(e,i),s.parent().parent("tr").find("td:gt(1)").remove(),s.parent().parent("tr").append(p),saswpCustomSelect2())},"json"):"custom_field"==t?(p+='<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['+i+']">',p+="</select></td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2()):"fixed_image"==t?(p+="<td>",p+="<fieldset>",p+='<input data-id="media" style="width: 30%;" class="button" id="'+o+'_button" name="'+o+'_button" type="button" value="Upload" />',p+='<input type="hidden" data-id="'+o+'_height" class="upload-height" name="'+n+'[height]" id="'+o+'_height" value="">',p+='<input type="hidden" data-id="'+o+'_width" class="upload-width" name="'+n+'[width]" id="'+o+'_width" value="">',p+='<input type="hidden" data-id="'+o+'_thumbnail" class="upload-thumbnail" name="'+n+'[thumbnail]" id="'+o+'_thumbnail" value="">',p+='<div class="saswp_image_div_'+o+'">',p+="</div>",p+="</fieldset>",p+="</td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2()):(p+="<td></td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2())}),e(document).on("change",".saswp-item-reivewed-list",function(){e(".saswp-custom-fields-table").html(""),saswp_meta_list_fields=[]}),e(document).on("click",".saswp-add-custom-fields",function(){var s=e(this);s.addClass("updating-message");var a=e("select#schema_type option:selected").val(),t="";"Review"==a&&(t=e("select.saswp-item-reivewed-list option:selected").val());var i=e("#post_ID").val();""!=a&&(saswp_meta_list_fields[a]?saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null):e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:i,schema_type:a,schema_subtype:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){saswp_meta_list_fields[a]=e,saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null)},error:function(e){console.log(e)}}))}),saswpCustomSelect2(),saswp_enable_rating_review(),e('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),e(document).on("click",".saswp_coonect_google_place",function(){var s=e("#saswp_google_place_id").val(),a=e("#saswp_language_list").val(),t=e("#saswp_googel_api").val();""!=s&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:s,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){console.log(e.status)},error:function(e){console.log(e)}})}),"saswp"==saswp_localize_data.post_type&&"edit.php"==saswp_localize_data.page_now&&jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>"),"undefined"!=typeof saswp_reviews_data&&e(".saswp-rating-div").rateYo({rating:saswp_reviews_data.rating_val,halfStar:!0,readOnly:saswp_reviews_data.readonly,onSet:function(s,a){e(this).next().val(s),console.log(s)}}),e("#sd-person-phone-number, #saswp_kb_telephone").focusout(function(){var s=e(this);s.parent().find(".saswp-phone-validation").remove();var a=e(this).val();/^\+([0-9]{1,3})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})$/.test(a)?s.parent().find(".saswp-phone-validation").remove():s.after('<span style="color:red;" class="saswp-phone-validation">Invalid Phone Number</span>')})});
1
+ var saswp_meta_list=[],saswp_meta_fields=[],saswp_meta_list_fields=[],saswp_taxonomy_term=[];function saswp_taxonomy_term_html(e,s){var a="";return a+="<td>",a+='<select name="saswp_taxonomy_term['+s+']">',jQuery.each(e,function(e,s){a+='<option value="'+e+'">'+s+"</option>"}),a+="</select>",a+="</td>",a+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'}function saswp_enable_rating_review(){var e="";jQuery("select#schema_type option:selected").val()&&(e=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(e=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),e&&jQuery(".saswp-enable-rating-review-"+e.toLowerCase()).change(function(){jQuery(this).is(":checked")?jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).show():jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).hide()}).change()}function getParameterByName(e,s){s||(s=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(s);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}function saswpCustomSelect2(){"saswp"!=saswp_localize_data.post_type&&"saswp"!=saswp_localize_data.page_now||"saswp_page_structured_data_options"==saswp_localize_data.page_now||jQuery(".saswp-custom-fields-select2").select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(e){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:e.term,action:"saswp_get_custom_meta_fields"}},processResults:function(e){return{results:e}},cache:!0},minimumInputLength:2})}function saswp_reviews_datepicker(){jQuery(".saswp-reviews-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswp_schema_datepicker(){jQuery(".saswp-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswp_schema_timepicker(){jQuery(".saswp-timepicker").timepicker({timeFormat:"H:i:s"})}function saswp_item_reviewed_call(){jQuery(".saswp-item-reviewed").change(function(e){e.preventDefault();var s="";if(jQuery("select#schema_type option:selected").val()&&(s=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(s=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),"Review"===s){var a=jQuery(this),t=jQuery(this).val(),i=saswp_localize_data.post_id,p=jQuery(a).attr("data-id"),o=jQuery(a).attr("post-specific");jQuery.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",schema_id:p,post_specific:o,item:t,post_id:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){jQuery("#saswp_specific_"+p).find(".saswp-table-create-onajax").remove();var s=jQuery("#saswp_specific_"+p).find(".saswp-table-create-onload");jQuery.each(s,function(e,s){0!=e&&jQuery(this).remove()}),jQuery("#saswp_specific_"+p).append(e),saswp_schema_datepicker(),saswp_schema_timepicker()})}}).change()}function saswp_compatibliy_notes(e,s){var a=s.replace("-checkbox",""),t=jQuery("#"+a).next("p").text();e.is(":checked")&&""!==t?jQuery("#"+a).next("p").removeClass("saswp_hide"):1==jQuery("#"+a).next("p").attr("data-id")?jQuery("#"+a).next("p").text("This feature is only available in pro version"):jQuery("#"+a).next("p").addClass("saswp_hide")}function saswp_meta_list_html(e,s,a,t,i,p){var o=t;null==o&&(o=Object.keys(a)[0]);var n="";if(n+='<select class="saswp-custom-meta-list" name="saswp_meta_list_val['+o+']">',jQuery.each(s,function(e,s){n+='<optgroup label="'+s.label+'">',jQuery.each(s["meta-list"],function(e,s){n+='<option value="'+e+'">'+s+"</option>"}),n+="</optgroup>"}),n+="</select>",a){var c=$("select#schema_type option:selected").val(),l="";"Review"==c&&(l=$("select.saswp-item-reivewed-list option:selected").val());var r="<tr>";r+="<td>",r+='<select class="saswp-custom-fields-name">',"Review"==c&&(r+='<optgroup label="Review">',r+='<option value="saswp_review_name">Review Name</option>',r+='<option value="saswp_review_description">Review Description</option>',r+='<option value="saswp_review_author">Review Author</option>',r+='<option value="saswp_review_author_url">Review Author Profile URL</option>',r+='<option value="saswp_review_publisher">Review Publisher</option>',r+='<option value="saswp_review_rating_value">Review Rating Value</option>',r+='<option value="saswp_review_date_published">Review Published Date</option>',r+='<option value="saswp_review_url">Review URL</option>',r+="</optgroup>"),"Review"==c&&(r+='<optgroup label="'+l+'">'),jQuery.each(a,function(e,s){r+='<option value="'+e+'">'+s+"</option>"}),"Review"==c&&(r+="</optgroup>"),r+="</select>",r+="</td>",r+="<td>",r+=n,r+="</td>",r+='<td></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td>',r+="</tr>",jQuery(".saswp-custom-fields-table").append(r),null!=e&&e.removeClass("updating-message")}else jQuery(i).html(n),null!=e&&e.removeClass("updating-message")}function saswp_get_meta_list(e,s,a,t,i,p){saswp_meta_list[s]?saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,p):jQuery.get(ajaxurl,{action:"saswp_get_meta_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(o){saswp_meta_list[s]=o[s],saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,p)},"json")}function saswp_get_post_specific_schema_fields(e,s,a,t,i,p){if(saswp_meta_fields[p]){var o=saswp_fields_html_generator(s,i,p,t,saswp_meta_fields[p]);o&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(o),saswp_schema_datepicker(),saswp_schema_timepicker(),e.removeClass("updating-message"))}else jQuery.get(ajaxurl,{action:"saswp_get_schema_dynamic_fields_ajax",meta_name:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){saswp_meta_fields[p]=a;var o=saswp_fields_html_generator(s,i,p,t,a);o&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(o),saswp_schema_datepicker(),saswp_schema_timepicker(),e.removeClass("updating-message"))},"json")}function saswp_fields_html_generator(e,s,a,t,i){var p="";return p+='<div class="saswp-'+t+'-table-div saswp-dynamic-properties" data-id="'+e+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',jQuery.each(i,function(t,i){var o="";switch("saswp_tvseries_season_published_date"!=i.name&&"saswp_feed_element_date_created"!=i.name&&"saswp_product_reviews_created_date"!=i.name||(o="saswp-datepicker-picker"),i.type){case"number":case"text":p+="<tr><th>"+i.label+'</th><td><input class="'+o+'" style="width:100%" type="'+i.type+'" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']"></td></tr>';break;case"textarea":p+="<tr><th>"+i.label+'</th><td><textarea style="width: 100%" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']" rows="5"></textarea></td></tr>';break;case"select":var n="";jQuery.each(i.options,function(e,s){n+='<option value="'+e+'">'+s+"</option>"}),p+="<tr><th>"+i.label+'</th><td><select id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']">'+n+"</select></td></tr>";break;case"media":p+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+e+"_"+s+'" name="'+i.name+"_"+e+"_"+s+'"><input type="hidden" data-id="'+i.name+"_"+e+"_"+s+'_id" name="'+a+s+"["+e+"]["+i.name+'_id]" id="'+i.name+"_"+e+"_"+s+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+e+"_"+s+'_button" name="'+i.name+"_"+e+"_"+s+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+e+"_"+s+'"></div></fieldset></td></tr>'}}),p+="</table></div>"}jQuery(document).ready(function(e){if(e(document).on("click",".saswp-add-g-location-btn",function(s){var a="";a=e("#saswp_google_place_api_key").length?'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="5" step="5" placeholder="5" disabled="disabled">':'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="10" step="10" placeholder="10">',s.preventDefault();var t="";(t+='<tr><td style="width:12%;"><strong>Place Id</strong></td><td style="width:20%;"><input class="saswp-g-location-field" name="sd_data[saswp_reviews_location_name][]" type="text" value=""></td><td style="width:10%;"><strong>Reviews</strong></td><td style="width:10%;">'+a+'</td><td style="width:10%;"><a class="button button-default saswp-fetch-g-reviews">Fetch</a></td><td style="width:10%;"><a type="button" class="saswp-remove-review-item button">x</a></td><td style="width:10%;"><p class="saswp-rv-fetched-msg"></p></td></tr>')&&e(".saswp-g-reviews-settings-table").append(t)}),e(document).on("click",".saswp-fetch-g-reviews",function(){var s=e(this),a="free";s.addClass("updating-message");var t=e(this).parent().parent().find(".saswp-g-location-field").val(),i=e(this).parent().parent().find(".saswp-g-blocks-field").val(),p=e("#saswp_google_place_api_key").val(),o=e("#reviews_addon_license_key").val(),n=e("#reviews_addon_license_key_status").val();if("premium"==(a=e("#saswp_google_place_api_key").length?"free":"premium")){if(!(i>0))return alert("Blocks value is zero"),s.removeClass("updating-message"),!1;if(0!=i%10)return s.parent().parent().find(".saswp-rv-fetched-msg").text("Reviews count should be in step of 10"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b"),s.removeClass("updating-message"),!1}""!=t&&(o||p)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_fetch_google_reviews",reviews_api_status:n,reviews_api:o,location:t,blocks:i,g_api:p,premium_status:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s.parent().parent().find(".saswp-rv-fetched-msg").text("Success"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","green")):(s.parent().parent().find(".saswp-rv-fetched-msg").text(e.message),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b")),s.removeClass("updating-message")},error:function(e){console.log(e)}}):(""==t&&alert("Please enter place id"),""==p&&alert("Please enter api key"),""==o&&alert("Please enter reviews api key"),s.removeClass("updating-message"))}),saswp_localize_data.do_tour){var s,a="<h3>Thanks for using Structured Data!</h3>";a+="<p>Do you want the latest on <b>Structured Data update</b> before others and some best resources on monetization in a single email? - Free just for users of Structured Data!</p>",a+='<style type="text/css">',a+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",a+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none}\t#afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",a+="</style>",a+='<div id="afw_mc_embed_signup">',a+='<form action="//app.mailerlite.com/webforms/submit/z7t4b8" data-id="258182" data-code="z7t4b8" method="POST" target="_blank">',a+='<div id="afw_mc_embed_signup_scroll">',a+='<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',a+='<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">',a+='<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',a+='<input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+saswp_localize_data.get_home_url+'">',a+='<input type="hidden" name="ml-submit" value="1" />',a+="</div>",a+='<div id="mce-responses">',a+='<div class="response" id="mce-error-response" style="display:none"></div>',a+='<div class="response" id="mce-success-response" style="display:none"></div>',a+="</div>",a+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',a+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',a+="</div>",a+="</form>";var t={content:a+="</div>",position:{edge:"top",align:"left"}};s=function(){e(saswp_localize_data.displayID).pointer(t).pointer("open"),saswp_localize_data.button2&&(jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+saswp_localize_data.button2+"</a>"),jQuery("#pointer-primary").click(function(){saswp_localize_data.function_name}),jQuery("#pointer-close").click(function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})}))},(t=e.extend(t,{buttons:function(e,s){return button=jQuery('<a id="pointer-close" class="button-secondary">'+saswp_localize_data.button1+"</a>"),button_2=jQuery("#pointer-close.button"),button.bind("click.pointer",function(){s.element.pointer("close")}),button_2.on("click",function(){s.element.pointer("close")}),button},close:function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(e,s){s.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?e(window).bind("load.wp-pointers",s):s()}e(".saswp-tabs a").click(function(s){var a=e(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),e(this).siblings().removeClass("nav-tab-active"),e(this).addClass("nav-tab-active"),e(".form-wrap").find(".saswp-"+t).siblings().hide(),e(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),e(".saswp-schame-type-select").change(function(){e(".saswp-custom-fields-table").html("");var s=e(this).val();e(".saswp-option-table-class tr").each(function(s,a){s>0&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==s||"Article"==s||"Blogposting"==s||"NewsArticle"==s||"WebPage"==s?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"Book"==s||"Course"==s||"HowTo"==s||"MusicPlaylist"==s||"MusicAlbum"==s||"Recipe"==s||"TVSeries"==s||"SoftwareApplication"==s||"Event"==s||"VideoGame"==s||"Service"==s||"AudioObject"==s||"VideoObject"==s||"local_business"==s||"Product"==s?e(".saswp-enable-append-reviews").parent().parent().show():e(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==s&&(e(".saswp-option-table-class tr").eq(1).show(),e(".saswp-business-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),e(".select-post-type").val("show_globally").trigger("change")),"Service"==s&&(e(".saswp-service-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==s&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==s&&(e(".saswp-review-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),saswp_item_reviewed_call()),saswp_enable_rating_review()}),e("#saswp_business_type").change(function(){var s=e(this).val(),a=e(".saswp-schame-type-select").val();e(".saswp-option-table-class tr").each(function(s,a){s>1&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"Book"==a||"Course"==a||"HowTo"==a||"MusicPlaylist"==a||"MusicAlbum"==a||"Recipe"==a||"TVSeries"==a||"SoftwareApplication"==a||"Event"==a||"VideoGame"==a||"Service"==a||"AudioObject"==a||"VideoObject"==a||"local_business"==a||"Product"==a?e(".saswp-enable-append-reviews").parent().parent().show():e(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(e(".saswp-"+s+"-tr").show(),e(".saswp-business-text-field-tr").show(),e(".saswp-"+s+"-tr").find("select").attr("disabled",!1)),"Review"==a&&(e(".saswp-review-text-field-tr").show(),e(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"Event"==a&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),saswp_enable_rating_review()}).change(),e(".saswp-checkbox").change(function(){var s=e(this).attr("id"),a=e(this);switch(s){case"saswp-the-seo-framework-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-seo-framework").val(1):e("#saswp-the-seo-framework").val(0);break;case"saswp-seo-press-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-seo-press").val(1):e("#saswp-seo-press").val(0);break;case"saswp-aiosp-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-aiosp").val(1):e("#saswp-aiosp").val(0);break;case"saswp-smart-crawl-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-smart-crawl").val(1):e("#saswp-smart-crawl").val(0);break;case"saswp-squirrly-seo-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-squirrly-seo").val(1):e("#saswp-squirrly-seo").val(0);break;case"saswp-wp-recipe-maker-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-recipe-maker").val(1):e("#saswp-wp-recipe-maker").val(0);break;case"saswp-wp-ultimate-recipe-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-ultimate-recipe").val(1):e("#saswp-wp-ultimate-recipe").val(0);break;case"saswp-zip-recipes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-zip-recipes").val(1):e("#saswp-zip-recipes").val(0);break;case"saswp-mediavine-create-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-mediavine-create").val(1):e("#saswp-mediavine-create").val(0);break;case"saswp-ht-recipes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-ht-recipes").val(1):e("#saswp-ht-recipes").val(0);break;case"saswp-wpsso-core-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wpsso-core").val(1):e("#saswp-wpsso-core").val(0);break;case"saswp-for-wordpress-checkbox":e(this).is(":checked")?e("#saswp-for-wordpress").val(1):e("#saswp-for-wordpress").val(0);break;case"saswp-facebook-enable-checkbox":e(this).is(":checked")?(e("#saswp-facebook-enable").val(1),e("#sd_facebook").show()):(e("#saswp-facebook-enable").val(0),e("#sd_facebook").hide());break;case"saswp-twitter-enable-checkbox":e(this).is(":checked")?(e("#saswp-twitter-enable").val(1),e("#sd_twitter").show()):(e("#saswp-twitter-enable").val(0),e("#sd_twitter").hide());break;case"saswp-google-plus-enable-checkbox":e(this).is(":checked")?(e("#saswp-google-plus-enable").val(1),e("#sd_google_plus").show()):(e("#saswp-google-plus-enable").val(0),e("#sd_google_plus").hide());break;case"saswp-instagram-enable-checkbox":e(this).is(":checked")?(e("#saswp-instagram-enable").val(1),e("#sd_instagram").show()):(e("#saswp-instagram-enable").val(0),e("#sd_instagram").hide());break;case"saswp-youtube-enable-checkbox":e(this).is(":checked")?(e("#sd_youtube").show(),e("#saswp-youtube-enable").val(1)):(e("#saswp-youtube-enable").val(0),e("#sd_youtube").hide());break;case"saswp-linkedin-enable-checkbox":e(this).is(":checked")?(e("#saswp-linkedin-enable").val(1),e("#sd_linkedin").show()):(e("#saswp-linkedin-enable").val(0),e("#sd_linkedin").hide());break;case"saswp-pinterest-enable-checkbox":e(this).is(":checked")?(e("#saswp-pinterest-enable").val(1),e("#sd_pinterest").show()):(e("#saswp-pinterest-enable").val(0),e("#sd_pinterest").hide());break;case"saswp-soundcloud-enable-checkbox":e(this).is(":checked")?(e("#saswp-soundcloud-enable").val(1),e("#sd_soundcloud").show()):(e("#saswp-soundcloud-enable").val(0),e("#sd_soundcloud").hide());break;case"saswp-tumblr-enable-checkbox":e(this).is(":checked")?(e("#saswp-tumblr-enable").val(1),e("#sd_tumblr").show()):(e("#saswp-tumblr-enable").val(0),e("#sd_tumblr").hide());break;case"saswp-yelp-enable-checkbox":e(this).is(":checked")?(e("#saswp-yelp-enable").val(1),e("#sd_yelp").show()):(e("#saswp-yelp-enable").val(0),e("#sd_yelp").hide());break;case"saswp-for-amp-checkbox":e(this).is(":checked")?e("#saswp-for-amp").val(1):e("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":e(this).is(":checked")?(e("#saswp_kb_contact_1").val(1),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(e("#saswp_kb_contact_1").val(0),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":e(this).is(":checked")?(e("#saswp-logo-dimensions").val(1),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(e("#saswp-logo-dimensions").val(0),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":e(this).is(":checked")?(e("#saswp_archive_schema").val(1),e(".saswp_archive_schema_type_class").parent().parent().show()):(e("#saswp_archive_schema").val(0),e(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":e(this).is(":checked")?(e("#saswp_website_schema").val(1),e("#saswp_search_box_schema").parent().parent().show()):(e("#saswp_website_schema").val(0),e("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":e(this).is(":checked")?e("#saswp_search_box_schema").val(1):e("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":e(this).is(":checked")?e("#saswp_breadcrumb_schema").val(1):e("#saswp_breadcrumb_schema").val(0);break;case"saswp_comments_schema_checkbox":e(this).is(":checked")?e("#saswp_comments_schema").val(1):e("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":e(this).is(":checked")?e("#saswp-review-module").val(1):e("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-kk-star-raring").val(1):e("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce").val(1):e("#saswp-woocommerce").val(0);break;case"saswp-extra-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-extra").val(1):e("#saswp-extra").val(0);break;case"saswp-dw-question-answer-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-dw-question-answer").val(1):e("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-job-manager").val(1):e("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-yoast").val(1):e("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-rankmath").val(1):e("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-tagyeem").val(1):e("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-events-calendar").val(1):e("#saswp-the-events-calendar").val(0);break;case"saswp-homeland-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-homeland").val(1):e("#saswp-homeland").val(0);break;case"saswp-realhomes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-realhomes").val(1):e("#saswp-realhomes").val(0);break;case"saswp-learn-press-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-learn-press").val(1):e("#saswp-learn-press").val(0);break;case"saswp-learn-dash-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-learn-dash").val(1):e("#saswp-learn-dash").val(0);break;case"saswp-lifter-lms-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-lifter-lms").val(1):e("#saswp-lifter-lms").val(0);break;case"saswp-wp-event-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-event-manager").val(1):e("#saswp-wp-event-manager").val(0);break;case"saswp-events-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-events-manager").val(1):e("#saswp-events-manager").val(0);break;case"saswp-event-calendar-wd-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-event-calendar-wd").val(1):e("#saswp-event-calendar-wd").val(0);break;case"saswp-event-organiser-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-event-organiser").val(1):e("#saswp-event-organiser").val(0);break;case"saswp-modern-events-calendar-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-modern-events-calendar").val(1):e("#saswp-modern-events-calendar").val(0);break;case"saswp-woocommerce-booking-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking").val(1),e("#saswp-woocommerce-booking-main").val(1)):(e("#saswp-woocommerce-booking").val(0),e("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking-main").val(1),e("#saswp-woocommerce-booking").val(1)):(e("#saswp-woocommerce-booking-main").val(0),e("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce-membership").val(1):e("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":e(this).is(":checked")?e("#saswp-defragment").val(1):e("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-cooked").val(1):e("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-shopper-approved-review-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-shopper-approved-review").val(1),e(".saswp-s-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-shopper-approved-review").val(0),e(".saswp-s-reviews-settings-table").parent().parent().parent().hide());break;case"saswp-google-review-checkbox":e(this).is(":checked")?(e("#saswp-google-review").val(1),e("#saswp-google-rv-free-checkbox").length?(e("#saswp-google-review-free").parent().parent().show(),e("#saswp-google-rv-free-checkbox").is(":checked")?e("#saswp_google_place_api_key").parent().parent().show():e("#saswp_google_place_api_key").parent().parent().hide()):e("#saswp_google_place_api_key").parent().parent().show(),e(".saswp-g-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-google-review").val(0),e("#saswp_google_place_api_key").parent().parent().hide(),e(".saswp-g-reviews-settings-table").parent().parent().parent().hide(),e("#saswp-google-rv-free-checkbox").length&&e("#saswp-google-review-free").parent().parent().hide());break;case"saswp-google-rv-free-checkbox":e("#saswp-google-review-checkbox").is(":checked")&&e(this).is(":checked")?(e("#saswp-google-review-free").val(1),e("#saswp_google_place_api_key").parent().parent().show()):(e("#saswp-google-review-free").val(0),e("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":e(this).is(":checked")?e("#saswp-markup-footer").val(1):e("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":e(this).is(":checked")?e("#saswp-pretty-print").val(1):e("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wppostratings-raring").val(1):e("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-bbpress").val(1):e("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":e(this).is(":checked")?e("#saswp-microdata-cleanup").val(1):e("#saswp-microdata-cleanup").val(0);break;case"saswp-other-images-checkbox":e(this).is(":checked")?e("#saswp-other-images").val(1):e("#saswp-other-images").val(0);break;case"saswp-easy-testimonials-checkbox":e(this).is(":checked")?e("#saswp-easy-testimonials").val(1):e("#saswp-easy-testimonials").val(0)}}).change(),e("#saswp_kb_type").change(function(){var s=e(this).val();e(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==s&&(e(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==s&&(e(".saswp_org_fields").parent().parent().addClass("saswp_hide"),e(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),e(document).on("click","input[data-id=media]",function(s){s.preventDefault();var a=e(this),t=a.attr("id").replace("_button",""),i=wp.media({title:"Application Icon",button:{text:"Select Icon"},multiple:!1,library:{type:"image"}}).on("select",function(){var s=i.state().get("selection").first().toJSON();e("#"+t).val(s.url),e("input[data-id='"+t+"_id']").val(s.id),e("input[data-id='"+t+"_height']").val(s.height),e("input[data-id='"+t+"_width']").val(s.width),e("input[data-id='"+t+"_thumbnail']").val(s.url),"sd_default_image_button"===a.attr("id")&&(e("#sd_default_image_width").val(s.width),e("#sd_default_image_height").val(s.height));var p="";"saswp_image_div_"+t=="saswp_image_div_sd_default_image"&&s.height<1200&&(p='<p class="saswp_warning">Image size is smaller than recommended size</p>'),e(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+s.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>'+p)}).open()}),e(document).on("click",".saswp_prev_close",function(s){s.preventDefault();var a=e(this).attr("data-id");console.log(a),e(this).parent().remove(),e("#"+a).val(""),e("input[data-id='"+a+"_id']").val(""),e("input[data-id='"+a+"_height']").val(""),e("input[data-id='"+a+"_width']").val(""),e("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(e("#sd_default_image_width").val(""),e("#sd_default_image_height").val(""))}),e(document).on("change",".saswp-schema-type-toggle",function(s){var a=e(this).attr("data-schema-id"),t=e(this).attr("data-post-id");if(e(this).is(":checked"))var i=1;else i=0;e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:i,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){},error:function(e){console.log(e)}})}),e(document).on("click",".saswp-reset-data",function(s){s.preventDefault(),1==confirm("Are you sure?")&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){setTimeout(function(){location.reload()},1e3)},error:function(e){console.log(e)}})}),e(document).on("click",".saswp_license_activation",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("license-status"),i=e(this).attr("add-on"),p=e("#"+i+"_addon_license_key").val();t&&i&&p?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_license_status_check",license_key:p,license_status:t,add_on:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){e("#"+i+"_addon_license_key_status").val(s.status),"active"==s.status?(e(".saswp-"+i+"-dashicons").addClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").css("color","green"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","inactive"),e(".saswp_license_activation[add-on='"+i+"']").text("Deactivate"),e(".saswp_license_status_msg[add-on='"+i+"']").text("Activated"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","green"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)):(e(".saswp-"+i+"-dashicons").addClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").css("color","red"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","active"),e(".saswp_license_activation[add-on='"+i+"']").text("Activate"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","red"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)),a.removeClass("updating-message")},error:function(e){console.log(e)}}):(alert("Please enter value license key"),a.removeClass("updating-message"))}),e(".saswp-send-query").on("click",function(s){s.preventDefault();var a=e("#saswp_query_message").val();""!=e.trim(a)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",message:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){"t"==s.status?(e(".saswp-query-success").show(),e(".saswp-query-error").hide()):(console.log("dd"),e(".saswp-query-success").hide(),e(".saswp-query-error").show())},error:function(e){console.log(e)}}):alert("Please enter the message")}),e(".saswp-import-plugins").on("click",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id");e.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status?(e(a).parent().find(".saswp-imported-message").text(s.message),e(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(e(a).parent().find(".saswp-imported-message").addClass("saswp-error"),e(a).parent().find(".saswp-imported-message").text(s.message)),a.removeClass("updating-message")},"json")}),e(".saswp-feedback-no-thanks").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_no_thanks",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(".saswp-feedback-remindme").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_remindme",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(document).on("change",".saswp-local-business-type-select",function(s){s.preventDefault();var a=e(this),t=e(this).val();e.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){if("t"==s.status){e(".saswp-local-business-name-select").parents("tr").remove();var t=a.parents(".saswp-post-specific-wrapper").attr("data-id"),i='<tr><th><label for="saswp_business_name_'+t+'">Sub Business Type</label></th>';i+='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+t+'" name="saswp_business_name_'+t+'">',e.each(s.result,function(e,s){i+='<option value="'+e+'">'+s+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else e(".saswp-local-business-name-select").parents("tr").remove()},"json")}),saswp_item_reviewed_call(),e(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),e(document).on("click",".saswp-add-custom-schema",function(s){s.preventDefault(),e(".saswp-add-custom-schema-field").removeClass("saswp_hide"),e(this).hide()}),e(document).on("click",".saswp-delete-custom-schema",function(s){s.preventDefault(),e("#saswp_custom_schema_field").val(""),e(".saswp-add-custom-schema-field").addClass("saswp_hide"),e(".saswp-add-custom-schema").show()}),e(".saswp-modify_schema_post_enable").on("click",function(s){var a=e(this);a.addClass("updating-message"),s.preventDefault(),e.get(ajaxurl,{action:"saswp_modify_schema_post_enable",post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){a.remove(),e(".saswp-add-custom-schema-div").remove(),e("#post_specific .inside").append(s),a.removeClass("updating-message"),saswp_schema_datepicker(),saswp_schema_timepicker(),saswp_enable_rating_review(),saswp_item_reviewed_call()})}),saswp_schema_datepicker(),saswp_schema_timepicker(),saswp_reviews_datepicker(),e(document).on("click",".saswp-add-more-item",function(s){s.preventDefault();var a=e(".saswp-review-item-list-table tr").length;console.log(a);e(".saswp-review-item-list-table").append('<tr class="saswp-review-item-tr"><td>Review Item Feature</td><td><input type="text" name="saswp-review-item-feature[]"></td><td>Rating</td><td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td><td><a type="button" class="saswp-remove-review-item button">x</a></td></tr>')}),e(document).on("click",".saswp-remove-review-item",function(s){s.preventDefault(),e(this).parent().parent("tr").remove()}),e(document).on("focusout",".saswp-review-item-tr input[type=number]",function(s){s.preventDefault();var a=0,t=e(".saswp-review-item-tr input[type=number]").length;e(".saswp-review-item-tr input[type=number]").each(function(s,t){""==e(t).val()?a+=parseFloat(0):a+=parseFloat(e(t).val())});var i=a/t;e("#saswp-review-item-over-all").val(i)}),e("#saswp-review-location").change(function(){var s=e(this).val();e(".saswp-review-shortcode").addClass("saswp_hide"),3==s&&e(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),e("#saswp-review-item-enable").change(function(){e(this).is(":checked")?e(".saswp-review-fields").show():e(".saswp-review-fields").hide()}).change(),e(document).on("click",".saswp-restore-post-schema",function(s){s.preventDefault();var a=e(this);if(a.addClass("updating-message"),e(".saswp-post-specific-schema-ids").val())var t=JSON.parse(e(".saswp-post-specific-schema-ids").val());e.post(ajaxurl,{action:"saswp_restore_schema",schema_ids:t,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?setTimeout(function(){location.reload()},1e3):(alert(e.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),e(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(s){s.preventDefault();var a=e(this).attr("data-id");e(".saswp-post-specific-wrapper").hide(),e("#"+a).show(),e("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),e("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),e(this).addClass("selected"),e(this).parent().addClass("selected"),saswp_enable_rating_review()}),e("#saswp-global-tabs a:first").addClass("saswp-global-selected"),e(".saswp-global-container").hide(),"#saswp-default-container"==window.location.hash?e(".saswp-global-container:eq(2)").show():e(".saswp-global-container:first").show(),e("#saswp-global-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-global-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-global-container").hide(),e("#"+s).show())}),e("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e(".saswp-tools-container:first").show(),e("#saswp-tools-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-tools-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e("#"+s).show())}),e("#saswp-review-tabs a:first").addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e(".saswp-review-container:first").show(),e("#saswp-review-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-review-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e("#"+s).show())}),e("#saswp-compatibility-tabs a:first").addClass("saswp-global-selected"),e(".saswp-compatibility-container").hide(),e(".saswp-compatibility-container:first").show(),e("#saswp-compatibility-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-compatibility-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-compatibility-container").hide(),e("#"+s).show())}),e('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),e("#saswp_enable_custom_field").change(function(){e(this).is(":checked")?e(".saswp-custom-fields-div").show():e(".saswp-custom-fields-div").hide()}),e(document).on("change",".saswp-custom-fields-name",function(){var s="text",a=e(this).parent().parent("tr"),t=e(this).val();-1==t.indexOf("image")&&-1==t.indexOf("logo")||(s="image"),saswp_get_meta_list(null,s,null,e(this).parent().parent("tr").find("td:eq(1)"),t,a)}),e(document).on("click",".saswp-skip-button",function(s){s.preventDefault(),e(this).parent().parent().hide(),e.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){},"json")}),e(document).on("click",".saswp_add_schema_fields_on_fly",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id"),i=e(this).attr("fields_type"),p=e(this).attr("div_type"),o=e("saswp_specific_"+t+" , .saswp-"+p+"-table-div").length,n=e("saswp_specific_"+t+" , .saswp-"+p+"-table-div:nth-child("+o+")").attr("data-id");(n=++n)||(n=0),saswp_get_post_specific_schema_fields(a,n,i,p,t,i+"_")}),e(document).on("click",".saswp-table-close",function(){e(this).parent().remove()}),e(document).on("click",".saswp-rmv-modify_row",function(s){s.preventDefault(),e(this).parent().parent().remove()}),e(document).on("change",".saswp-custom-meta-list",function(){var s=e(this),a=e("select#schema_type option:selected").val(),t=e(this).val(),i=e(this).parent().parent("tr").find(".saswp-custom-fields-name").val(),p="",o=a.toLowerCase()+"_"+i,n="saswp_fixed_image["+i+"]";"manual_text"==t?(p+='<td><input type="text" name="saswp_fixed_text['+i+']"></td>',p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2()):"taxonomy_term"==t?saswp_taxonomy_term.taxonomy?(p+=saswp_taxonomy_term_html(saswp_taxonomy_term.taxonomy,i),s.parent().parent("tr").find("td:gt(1)").remove(),s.parent().parent("tr").append(p),saswpCustomSelect2()):e.get(ajaxurl,{action:"saswp_get_taxonomy_term_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){e&&(saswp_taxonomy_term.taxonomy=e,p+=saswp_taxonomy_term_html(e,i),s.parent().parent("tr").find("td:gt(1)").remove(),s.parent().parent("tr").append(p),saswpCustomSelect2())},"json"):"custom_field"==t?(p+='<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['+i+']">',p+="</select></td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2()):"fixed_image"==t?(p+="<td>",p+="<fieldset>",p+='<input data-id="media" style="width: 30%;" class="button" id="'+o+'_button" name="'+o+'_button" type="button" value="Upload" />',p+='<input type="hidden" data-id="'+o+'_height" class="upload-height" name="'+n+'[height]" id="'+o+'_height" value="">',p+='<input type="hidden" data-id="'+o+'_width" class="upload-width" name="'+n+'[width]" id="'+o+'_width" value="">',p+='<input type="hidden" data-id="'+o+'_thumbnail" class="upload-thumbnail" name="'+n+'[thumbnail]" id="'+o+'_thumbnail" value="">',p+='<div class="saswp_image_div_'+o+'">',p+="</div>",p+="</fieldset>",p+="</td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2()):(p+="<td></td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(p),saswpCustomSelect2())}),e(document).on("change",".saswp-item-reivewed-list",function(){e(".saswp-custom-fields-table").html(""),saswp_meta_list_fields=[]}),e(document).on("click",".saswp-add-custom-fields",function(){var s=e(this);s.addClass("updating-message");var a=e("select#schema_type option:selected").val(),t="";"Review"==a&&(t=e("select.saswp-item-reivewed-list option:selected").val());var i=e("#post_ID").val();""!=a&&(saswp_meta_list_fields[a]?saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null):e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:i,schema_type:a,schema_subtype:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){saswp_meta_list_fields[a]=e,saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null)},error:function(e){console.log(e)}}))}),saswpCustomSelect2(),saswp_enable_rating_review(),e('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),e(document).on("click",".saswp_coonect_google_place",function(){var s=e("#saswp_google_place_id").val(),a=e("#saswp_language_list").val(),t=e("#saswp_googel_api").val();""!=s&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:s,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){console.log(e.status)},error:function(e){console.log(e)}})}),e(document).on("click",".saswp-add-social-links",function(){e(".saswp-social-links-table").append('<tr><td><input type="text" placeholder="https://www.facebook.com/profile" name="sd_data[saswp_social_links][]" value=""></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td></tr>')}),"saswp"==saswp_localize_data.post_type&&"edit.php"==saswp_localize_data.page_now&&jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>"),"undefined"!=typeof saswp_reviews_data&&e(".saswp-rating-div").rateYo({rating:saswp_reviews_data.rating_val,halfStar:!0,readOnly:saswp_reviews_data.readonly,onSet:function(s,a){e(this).next().val(s),console.log(s)}}),e("#sd-person-phone-number, #saswp_kb_telephone").focusout(function(){var s=e(this);s.parent().find(".saswp-phone-validation").remove();var a=e(this).val();/^\+([0-9]{1,3})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})$/.test(a)?s.parent().find(".saswp-phone-validation").remove():s.after('<span style="color:red;" class="saswp-phone-validation">Invalid Phone Number</span>')})});
admin_section/settings.php CHANGED
@@ -482,7 +482,7 @@ function saswp_premium_features_callback(){ ?>
482
 
483
  $cooked_active_text = '';
484
 
485
- if(is_plugin_active('course-schema/course-schema.php')){
486
  $cooked_active_text = '<label class="saswp-sts-txt">Status :<span style="color:green;">Active</span></label>';
487
  }else{
488
  $cooked_active_text .='<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
@@ -561,38 +561,7 @@ function saswp_premium_features_callback(){ ?>
561
  <?php echo $cooked_active_text; ?>
562
 
563
  </div>
564
- </li>
565
- <li>
566
-
567
- <?php
568
-
569
- $cooked_active_text = '';
570
-
571
- if(is_plugin_active('cooked-compatibility-for-schema/cooked-compatibility-for-schema.php')){
572
- $cooked_active_text = '<label class="saswp-sts-txt">Status :<span style="color:green;">Active</span></label>';
573
- }else{
574
- $cooked_active_text .='<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
575
- $cooked_active_text .='<a target="_blank" href="http://structured-data-for-wp.com/extensions/cooked-compatibility-for-schema/"><span class="saswp-d-btn">Download</span></a>';
576
- }
577
-
578
- ?>
579
-
580
-
581
- <div class="saswp-features-ele">
582
- <div class="saswp-ele-ic saswp-ele-2">
583
- <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/cooked-schema-wp.png">
584
- </div>
585
- <div class="saswp-ele-tlt">
586
- <h3><?php echo esc_html__('Cooked Compatibility for Schema','schema-and-structured-data-for-wp') ?></h3>
587
- <p><?php echo esc_html__('This extension will be able to take all the proper recipe data and integrate it with the schema & structured data in AMP & non-AMP.','schema-and-structured-data-for-wp') ?></p>
588
- </div>
589
- </div>
590
- <div class="saswp-sts-btn">
591
-
592
- <?php echo $cooked_active_text; ?>
593
-
594
- </div>
595
- </li>
596
 
597
  </ul>
598
  </div>
@@ -1047,201 +1016,22 @@ function saswp_general_page_callback(){
1047
  echo '</div>';
1048
 
1049
  //social
1050
- echo '<h2>'.esc_html__( 'Social Fields', 'schema-and-structured-data-for-wp' ).'</h2>';
1051
- $social_meta_fields = array(
1052
- array(
1053
- 'label' => 'Facebook',
1054
- 'id' => 'saswp-facebook-enable-checkbox',
1055
- 'name' => 'saswp-facebook-enable-checkbox',
1056
- 'type' => 'checkbox',
1057
- 'class' => 'checkbox saswp-checkbox',
1058
- 'hidden' => array(
1059
- 'id' => 'saswp-facebook-enable',
1060
- 'name' => 'sd_data[saswp-facebook-enable]',
1061
- )
1062
- ),
1063
- array(
1064
- 'label' => '',
1065
- 'id' => 'sd_facebook',
1066
- 'name' => 'sd_data[sd_facebook]',
1067
- 'class' => 'regular-text',
1068
- 'type' => 'text',
1069
- 'attributes' => array(
1070
- 'placeholder' => 'https://facebook.com'
1071
- )
1072
- ),
1073
- array(
1074
- 'label' => 'Twitter',
1075
- 'id' => 'saswp-twitter-enable-checkbox',
1076
- 'name' => 'saswp-twitter-enable-checkbox',
1077
- 'type' => 'checkbox',
1078
- 'class' => 'checkbox saswp-checkbox',
1079
- 'hidden' => array(
1080
- 'id' => 'saswp-twitter-enable',
1081
- 'name' => 'sd_data[saswp-twitter-enable]',
1082
- )
1083
- ),
1084
- array(
1085
- 'label' => '',
1086
- 'id' => 'sd_twitter',
1087
- 'name' => 'sd_data[sd_twitter]',
1088
- 'class' => 'regular-text',
1089
- 'type' => 'text',
1090
- 'attributes' => array(
1091
- 'placeholder' => 'https://twitter.com'
1092
- )
1093
- ),
1094
- array(
1095
- 'label' => 'Instagram',
1096
- 'id' => 'saswp-instagram-enable-checkbox',
1097
- 'name' => 'saswp-instagram-enable-checkbox',
1098
- 'type' => 'checkbox',
1099
- 'class' => 'checkbox saswp-checkbox',
1100
- 'hidden' => array(
1101
- 'id' => 'saswp-instagram-enable',
1102
- 'name' => 'sd_data[saswp-instagram-enable]',
1103
- )
1104
- ),
1105
- array(
1106
- 'label' => '',
1107
- 'id' => 'sd_instagram',
1108
- 'name' => 'sd_data[sd_instagram]',
1109
- 'class' => 'regular-text',
1110
- 'type' => 'text',
1111
- 'attributes' => array(
1112
- 'placeholder' => 'https://instagram.com'
1113
- )
1114
- ),
1115
- array(
1116
- 'label' => 'Youtube',
1117
- 'id' => 'saswp-youtube-enable-checkbox',
1118
- 'name' => 'saswp-youtube-enable-checkbox',
1119
- 'type' => 'checkbox',
1120
- 'class' => 'checkbox saswp-checkbox',
1121
- 'hidden' => array(
1122
- 'id' => 'saswp-youtube-enable',
1123
- 'name' => 'sd_data[saswp-youtube-enable]',
1124
- )
1125
- ),
1126
- array(
1127
- 'label' => '',
1128
- 'id' => 'sd_youtube',
1129
- 'name' => 'sd_data[sd_youtube]',
1130
- 'class' => 'regular-text',
1131
- 'type' => 'text',
1132
- 'attributes' => array(
1133
- 'placeholder' => 'https://youtube.com'
1134
- )
1135
- ),
1136
- array(
1137
- 'label' => 'LinkedIn',
1138
- 'id' => 'saswp-linkedin-enable-checkbox',
1139
- 'name' => 'saswp-linkedin-enable-checkbox',
1140
- 'type' => 'checkbox',
1141
- 'class' => 'checkbox saswp-checkbox',
1142
- 'hidden' => array(
1143
- 'id' => 'saswp-linkedin-enable',
1144
- 'name' => 'sd_data[saswp-linkedin-enable]',
1145
- )
1146
- ),
1147
- array(
1148
- 'label' => '',
1149
- 'id' => 'sd_linkedin',
1150
- 'name' => 'sd_data[sd_linkedin]',
1151
- 'class' => 'regular-text',
1152
- 'type' => 'text',
1153
- 'attributes' => array(
1154
- 'placeholder' => 'https://linkedin.com'
1155
- )
1156
- ),
1157
- array(
1158
- 'label' => 'Pinterest',
1159
- 'id' => 'saswp-pinterest-enable-checkbox',
1160
- 'name' => 'saswp-pinterest-enable-checkbox',
1161
- 'type' => 'checkbox',
1162
- 'class' => 'checkbox saswp-checkbox',
1163
- 'hidden' => array(
1164
- 'id' => 'saswp-pinterest-enable',
1165
- 'name' => 'sd_data[saswp-pinterest-enable]',
1166
- )
1167
- ),
1168
- array(
1169
- 'label' => '',
1170
- 'id' => 'sd_pinterest',
1171
- 'name' => 'sd_data[sd_pinterest]',
1172
- 'class' => 'regular-text',
1173
- 'type' => 'text',
1174
- 'attributes' => array(
1175
- 'placeholder' => 'https://pinterest.com'
1176
- )
1177
- ),
1178
- array(
1179
- 'label' => 'SoundCloud',
1180
- 'id' => 'saswp-soundcloud-enable-checkbox',
1181
- 'name' => 'saswp-soundcloud-enable-checkbox',
1182
- 'type' => 'checkbox',
1183
- 'class' => 'checkbox saswp-checkbox',
1184
- 'hidden' => array(
1185
- 'id' => 'saswp-soundcloud-enable',
1186
- 'name' => 'sd_data[saswp-soundcloud-enable]',
1187
- )
1188
- ),
1189
- array(
1190
- 'label' => '',
1191
- 'id' => 'sd_soundcloud',
1192
- 'name' => 'sd_data[sd_soundcloud]',
1193
- 'class' => 'regular-text',
1194
- 'type' => 'text',
1195
- 'attributes' => array(
1196
- 'placeholder' => 'https://soundcloud.com'
1197
- )
1198
- ),
1199
- array(
1200
- 'label' => 'Tumblr',
1201
- 'id' => 'saswp-tumblr-enable-checkbox',
1202
- 'name' => 'saswp-tumblr-enable-checkbox',
1203
- 'type' => 'checkbox',
1204
- 'class' => 'checkbox saswp-checkbox',
1205
- 'hidden' => array(
1206
- 'id' => 'saswp-tumblr-enable',
1207
- 'name' => 'sd_data[saswp-tumblr-enable]',
1208
- )
1209
- ),
1210
- array(
1211
- 'label' => '',
1212
- 'id' => 'sd_tumblr',
1213
- 'name' => 'sd_data[sd_tumblr]',
1214
- 'class' => 'regular-text',
1215
- 'type' => 'text',
1216
- 'attributes' => array(
1217
- 'placeholder' => 'https://tumblr.com'
1218
- )
1219
- ),
1220
- array(
1221
- 'label' => 'Yelp',
1222
- 'id' => 'saswp-yelp-enable-checkbox',
1223
- 'name' => 'saswp-yelp-enable-checkbox',
1224
- 'type' => 'checkbox',
1225
- 'class' => 'checkbox saswp-checkbox',
1226
- 'hidden' => array(
1227
- 'id' => 'saswp-yelp-enable',
1228
- 'name' => 'sd_data[saswp-yelp-enable]',
1229
- )
1230
- ),
1231
- array(
1232
- 'label' => '',
1233
- 'id' => 'sd_yelp',
1234
- 'name' => 'sd_data[sd_yelp]',
1235
- 'class' => 'regular-text',
1236
- 'type' => 'text',
1237
- 'attributes' => array(
1238
- 'placeholder' => 'https://yelp.com'
1239
- )
1240
- )
1241
- );
1242
- echo '<div class="saswp-social-fileds">';
1243
- $field_objs->saswp_field_generator($social_meta_fields, $settings);
1244
- echo '</div>';
1245
 
1246
  ?>
1247
 
@@ -1359,6 +1149,18 @@ function saswp_import_callback(){
1359
  'name' => 'sd_data[saswp-microdata-cleanup]',
1360
  )
1361
  ),
 
 
 
 
 
 
 
 
 
 
 
 
1362
 
1363
  );
1364
 
@@ -1513,7 +1315,7 @@ function saswp_import_callback(){
1513
  $add_on[] = 'Res';
1514
 
1515
  }
1516
- if(is_plugin_active('course-schema/course-schema.php')){
1517
 
1518
  $add_on[] = 'Cs';
1519
 
@@ -1713,7 +1515,7 @@ function saswp_review_page_callback(){
1713
  'name' => 'saswp-google-review-checkbox',
1714
  'type' => 'checkbox',
1715
  'class' => 'checkbox saswp-checkbox',
1716
- 'note' => 'This option enables the google review section. <a target="_blank" href="https://structured-data-for-wp.com/docs/article/how-to-display-google-review/">Learn More</a>',
1717
  'hidden' => array(
1718
  'id' => 'saswp-google-review',
1719
  'name' => 'sd_data[saswp-google-review]',
@@ -1781,7 +1583,7 @@ function saswp_review_page_callback(){
1781
  'name' => 'saswp-review-module-checkbox',
1782
  'type' => 'checkbox',
1783
  'class' => 'checkbox saswp-checkbox',
1784
- 'note' => 'This option enables the review metabox on every post/page. <a target="_blank" href="http://structured-data-for-wp.com/docs/article/how-to-use-review-in-schema-and-structure-data/">Learn More</a>',
1785
  'hidden' => array(
1786
  'id' => 'saswp-review-module',
1787
  'name' => 'sd_data[saswp-review-module]',
@@ -2253,6 +2055,19 @@ function saswp_compatibility_page_callback(){
2253
  )
2254
  );
2255
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2256
  $flex_lmx = array(
2257
  'label' => 'FlexMLS IDX Plugin',
2258
  'id' => 'saswp-flexmlx-compativility-checkbox',
@@ -2285,7 +2100,7 @@ function saswp_compatibility_page_callback(){
2285
 
2286
  }
2287
 
2288
- if(!is_plugin_active('course-schema/course-schema.php')){
2289
 
2290
  $learn_press['note'] = esc_html__('This feature requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://structured-data-for-wp.com/course-schema/">Course Schema Addon</a>';
2291
  $learn_dash['note'] = esc_html__('This feature requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://structured-data-for-wp.com/course-schema/">Course Schema Addon</a>';
@@ -2349,6 +2164,7 @@ function saswp_compatibility_page_callback(){
2349
  $events_calendar_wd,
2350
  $event_organiser,
2351
  $modern_events_calendar,
 
2352
  $flex_lmx
2353
 
2354
  );
@@ -2613,7 +2429,8 @@ function saswp_get_field_note($pname){
2613
  'jannah' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://codecanyon.net/item/taqyeem-wordpress-review-plugin/4558799">Taqyeem</a>',
2614
  'zip_recipes' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/zip-recipes/">Zip Recipes</a>',
2615
  'mediavine_create' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/mediavine-create/">Create by Mediavine</a>',
2616
- 'ht_recipes' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://themeforest.net/item/culinier-food-recipe-wordpress-theme/11088564/">HT-Recipes</a>'
 
2617
  );
2618
 
2619
  $active = saswp_compatible_active_list();
482
 
483
  $cooked_active_text = '';
484
 
485
+ if(is_plugin_active('course-schema-for-saswp/course-schema-for-saswp.php')){
486
  $cooked_active_text = '<label class="saswp-sts-txt">Status :<span style="color:green;">Active</span></label>';
487
  }else{
488
  $cooked_active_text .='<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
561
  <?php echo $cooked_active_text; ?>
562
 
563
  </div>
564
+ </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
 
566
  </ul>
567
  </div>
1016
  echo '</div>';
1017
 
1018
  //social
1019
+ echo '<h2>'.esc_html__( 'Social Profile', 'schema-and-structured-data-for-wp' ).'</h2>';
1020
+ echo '<div class="saswp-social-fileds">';
1021
+ echo '<p>'.esc_html__('Add your social profile, Google will automatically crawl it in Knowledge Graph','schema-and-structured-data-for-wp').' <a target="_blank" href="https://structured-data-for-wp.com/docs/">'.esc_html__('Learn More','schema-and-structured-data-for-wp').'</a></p>';
1022
+ echo '<div class="saswp-social-links">';
1023
+ echo '<table class="saswp-social-links-table">';
1024
+ if(isset($settings['saswp_social_links']) && !empty($settings['saswp_social_links'])){
1025
+
1026
+ foreach($settings['saswp_social_links'] as $link){
1027
+ echo '<tr><td><input type="text" placeholder="https://www.facebook.com/profile" name="sd_data[saswp_social_links][]" value="'.esc_url($link).'"></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td></tr>';
1028
+ }
1029
+
1030
+ }
1031
+ echo '</table>';
1032
+ echo '</div>';
1033
+ echo '<a class="button button-default saswp-add-social-links">Add New Social Profile</a>';
1034
+ echo '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1035
 
1036
  ?>
1037
 
1149
  'name' => 'sd_data[saswp-microdata-cleanup]',
1150
  )
1151
  ),
1152
+ array(
1153
+ 'label' => 'Add All Available Images On Post',
1154
+ 'id' => 'saswp-other-images-checkbox',
1155
+ 'name' => 'saswp-other-images-checkbox',
1156
+ 'type' => 'checkbox',
1157
+ 'class' => 'checkbox saswp-checkbox',
1158
+ 'note' => 'It adds all the available images on a post to schema markup',
1159
+ 'hidden' => array(
1160
+ 'id' => 'saswp-other-images',
1161
+ 'name' => 'sd_data[saswp-other-images]',
1162
+ )
1163
+ ),
1164
 
1165
  );
1166
 
1315
  $add_on[] = 'Res';
1316
 
1317
  }
1318
+ if(is_plugin_active('course-schema-for-saswp/course-schema-for-saswp.php')){
1319
 
1320
  $add_on[] = 'Cs';
1321
 
1515
  'name' => 'saswp-google-review-checkbox',
1516
  'type' => 'checkbox',
1517
  'class' => 'checkbox saswp-checkbox',
1518
+ 'note' => 'This option enables the google review section. <a target="_blank" href="https://structured-data-for-wp.com/docs/article/how-to-fetch-google-reviewfree-version/">Learn More</a>',
1519
  'hidden' => array(
1520
  'id' => 'saswp-google-review',
1521
  'name' => 'sd_data[saswp-google-review]',
1583
  'name' => 'saswp-review-module-checkbox',
1584
  'type' => 'checkbox',
1585
  'class' => 'checkbox saswp-checkbox',
1586
+ 'note' => 'This option enables the review metabox on every post/page. <a target="_blank" href="https://structured-data-for-wp.com/docs/article/how-to-use-rating-module-in-schema-and-structured-data/">Learn More</a>',
1587
  'hidden' => array(
1588
  'id' => 'saswp-review-module',
1589
  'name' => 'sd_data[saswp-review-module]',
2055
  )
2056
  );
2057
 
2058
+ $easy_testimonials = array(
2059
+ 'label' => 'Easy Testimonials',
2060
+ 'id' => 'saswp-easy-testimonials-checkbox',
2061
+ 'name' => 'saswp-easy-testimonials-checkbox',
2062
+ 'type' => 'checkbox',
2063
+ 'class' => 'checkbox saswp-checkbox',
2064
+ 'note' => saswp_get_field_note('easy_testimonials'),
2065
+ 'hidden' => array(
2066
+ 'id' => 'saswp-easy-testimonials',
2067
+ 'name' => 'sd_data[saswp-easy-testimonials]',
2068
+ )
2069
+ );
2070
+
2071
  $flex_lmx = array(
2072
  'label' => 'FlexMLS IDX Plugin',
2073
  'id' => 'saswp-flexmlx-compativility-checkbox',
2100
 
2101
  }
2102
 
2103
+ if(!is_plugin_active('course-schema-for-saswp/course-schema-for-saswp.php')){
2104
 
2105
  $learn_press['note'] = esc_html__('This feature requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://structured-data-for-wp.com/course-schema/">Course Schema Addon</a>';
2106
  $learn_dash['note'] = esc_html__('This feature requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://structured-data-for-wp.com/course-schema/">Course Schema Addon</a>';
2164
  $events_calendar_wd,
2165
  $event_organiser,
2166
  $modern_events_calendar,
2167
+ $easy_testimonials,
2168
  $flex_lmx
2169
 
2170
  );
2429
  'jannah' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://codecanyon.net/item/taqyeem-wordpress-review-plugin/4558799">Taqyeem</a>',
2430
  'zip_recipes' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/zip-recipes/">Zip Recipes</a>',
2431
  'mediavine_create' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/mediavine-create/">Create by Mediavine</a>',
2432
+ 'ht_recipes' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://themeforest.net/item/culinier-food-recipe-wordpress-theme/11088564/">HT-Recipes</a>',
2433
+ 'easy_testimonials' => esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/easy-testimonials">Easy Testimonials</a>'
2434
  );
2435
 
2436
  $active = saswp_compatible_active_list();
admin_section/structure_admin.php CHANGED
@@ -958,8 +958,9 @@ function saswp_custom_breadcrumbs() {
958
  $archive_title = post_type_archive_title($prefix, false);
959
  $variables1_titles[] = $archive_title;
960
 
961
-
962
  } else if ( is_author() ) {
 
963
  global $author;
964
 
965
  $userdata = get_userdata( $author );
@@ -1000,13 +1001,18 @@ function saswp_custom_breadcrumbs() {
1000
 
1001
  }
1002
 
1003
- $custom_tax_name = get_queried_object()->name;
1004
- $variables1_titles[] = $custom_tax_name;
1005
-
 
 
 
 
 
1006
  } else if ( is_single() ) {
1007
 
1008
  // If post is a custom post type
1009
- $post_type = get_post_type();
1010
 
1011
  // If it is a custom post type display name and link
1012
  if($post_type != 'post') {
@@ -1024,7 +1030,7 @@ function saswp_custom_breadcrumbs() {
1024
 
1025
  // Get post category info
1026
  $category = get_the_category();
1027
-
1028
  if(!empty($category)) {
1029
 
1030
  $category_values = array_values( $category );
@@ -1037,7 +1043,7 @@ function saswp_custom_breadcrumbs() {
1037
  $variables2_links[] = get_category_link( $category_value );
1038
 
1039
  }
1040
-
1041
  // Get last category post is in
1042
  $last_category = end(($category));
1043
  $category_name = get_category($last_category);
@@ -1079,17 +1085,11 @@ function saswp_custom_breadcrumbs() {
1079
  $variables1_titles[] = $cat_name;
1080
  $variables2_links[] = $cat_link;
1081
 
1082
- } else {
1083
-
1084
- if($post_type == 'post') {
1085
-
1086
- $variables1_titles[] = saswp_get_the_title();
1087
- $variables2_links[] = get_permalink();
1088
-
1089
- }
1090
-
1091
- }
1092
-
1093
  } else if ( is_category() ) {
1094
 
1095
  $category = get_the_category();
@@ -1139,21 +1139,20 @@ function saswp_custom_breadcrumbs() {
1139
  $variables2_links[] = get_permalink();
1140
  }
1141
 
1142
- } else if ( is_tag() ) {
 
1143
  // Tag page
1144
  // Get tag information
1145
- $term_id = get_query_var('tag_id');
1146
- $taxonomy = 'post_tag';
1147
- $args = 'include=' . $term_id;
1148
- $terms = get_terms( $taxonomy, $args );
1149
- $get_term_id = $terms[0]->term_id;
1150
- $get_term_name = $terms[0]->name;
1151
- $term_link = get_term_link($get_term_id );
1152
-
1153
- // Tag name and link
1154
-
1155
- $variables1_titles[] = $get_term_name;
1156
- $variables2_links[] = $term_link;
1157
  }
1158
 
1159
  $sd_data['titles'] = $variables1_titles;
@@ -1610,9 +1609,10 @@ function saswp_upgrade_function( $upgrader_object, $options ) {
1610
 
1611
  foreach($options['plugins'] as $each_plugin){
1612
 
1613
- if ($each_plugin==$current_plugin_path_name){
1614
 
1615
  saswp_review_module_upgradation();
 
1616
 
1617
  }
1618
  }
958
  $archive_title = post_type_archive_title($prefix, false);
959
  $variables1_titles[] = $archive_title;
960
 
961
+
962
  } else if ( is_author() ) {
963
+
964
  global $author;
965
 
966
  $userdata = get_userdata( $author );
1001
 
1002
  }
1003
 
1004
+ $queried_obj = get_queried_object();
1005
+
1006
+ if(is_object($queried_obj)){
1007
+ $variables1_titles[] = get_queried_object()->name;
1008
+ $variables2_links[] = get_term_link($queried_obj->term_id);
1009
+
1010
+ }
1011
+
1012
  } else if ( is_single() ) {
1013
 
1014
  // If post is a custom post type
1015
+ $post_type = get_post_type();
1016
 
1017
  // If it is a custom post type display name and link
1018
  if($post_type != 'post') {
1030
 
1031
  // Get post category info
1032
  $category = get_the_category();
1033
+
1034
  if(!empty($category)) {
1035
 
1036
  $category_values = array_values( $category );
1043
  $variables2_links[] = get_category_link( $category_value );
1044
 
1045
  }
1046
+
1047
  // Get last category post is in
1048
  $last_category = end(($category));
1049
  $category_name = get_category($last_category);
1085
  $variables1_titles[] = $cat_name;
1086
  $variables2_links[] = $cat_link;
1087
 
1088
+ }
1089
+
1090
+ $variables1_titles[] = saswp_get_the_title();
1091
+ $variables2_links[] = get_permalink();
1092
+
 
 
 
 
 
 
1093
  } else if ( is_category() ) {
1094
 
1095
  $category = get_the_category();
1139
  $variables2_links[] = get_permalink();
1140
  }
1141
 
1142
+ } else if ( is_tag() ) {
1143
+
1144
  // Tag page
1145
  // Get tag information
1146
+ $term_id = get_query_var('tag_id');
1147
+ $get_term = get_term($term_id);
1148
+
1149
+ if(is_object($get_term)){
1150
+
1151
+ $variables1_titles[] = $get_term->name;
1152
+ $variables2_links[] = get_term_link($term_id);
1153
+
1154
+ }
1155
+ // Tag name and link
 
 
1156
  }
1157
 
1158
  $sd_data['titles'] = $variables1_titles;
1609
 
1610
  foreach($options['plugins'] as $each_plugin){
1611
 
1612
+ if ($each_plugin == $current_plugin_path_name){
1613
 
1614
  saswp_review_module_upgradation();
1615
+ saswp_migrate_old_social_profile();
1616
 
1617
  }
1618
  }
core/array-list/compatibility-list.php CHANGED
@@ -16,6 +16,12 @@ return array(
16
  'opt_name' => 'saswp-kk-star-raring',
17
  'part_in' => 'free',
18
  ),
 
 
 
 
 
 
19
  'learn_press' => array(
20
  'name' => 'Learn Press',
21
  'free' => 'learnpress/learnpress.php',
16
  'opt_name' => 'saswp-kk-star-raring',
17
  'part_in' => 'free',
18
  ),
19
+ 'easy_testimonials' => array(
20
+ 'name' => 'Easy Testimonials',
21
+ 'free' => 'easy-testimonials/easy-testimonials.php',
22
+ 'opt_name' => 'saswp-easy-testimonials',
23
+ 'part_in' => 'free',
24
+ ),
25
  'learn_press' => array(
26
  'name' => 'Learn Press',
27
  'free' => 'learnpress/learnpress.php',
core/array-list/pro_extensions.php CHANGED
@@ -27,7 +27,7 @@ return array(
27
  array(
28
  'key' => 'course_schema',
29
  'name' => 'Course Schema',
30
- 'path' => 'course-schema/course-schema.php',
31
  ),
32
  array(
33
  'key' => 'event_schema',
27
  array(
28
  'key' => 'course_schema',
29
  'name' => 'Course Schema',
30
+ 'path' => 'course-schema-for-saswp/course-schema-for-saswp.php',
31
  ),
32
  array(
33
  'key' => 'event_schema',
output/compatibility.php CHANGED
@@ -32,7 +32,7 @@ class saswp_output_compatibility{
32
 
33
  public function saswp_exclude_wpsso_schema_graph( $prop_data, $mod, $mt_og, $page_type_id, $is_main ) {
34
 
35
- return __return_empty_array;
36
 
37
  }
38
 
@@ -64,6 +64,17 @@ class saswp_output_compatibility{
64
 
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
67
  public function saswp_wp_event_manager_override(){
68
 
69
  if(class_exists('WP_Event_Manager_Post_Types')){
@@ -79,7 +90,7 @@ class saswp_output_compatibility{
79
  }
80
  public function saswp_remove_the_events_calendar_markup( $data, $args ){
81
 
82
- return __return_empty_array;
83
  }
84
 
85
 
32
 
33
  public function saswp_exclude_wpsso_schema_graph( $prop_data, $mod, $mt_og, $page_type_id, $is_main ) {
34
 
35
+ return array();
36
 
37
  }
38
 
64
 
65
  }
66
 
67
+ public function saswp_easy_testimonials_override(){
68
+
69
+ add_filter('easy_testimonials_json_ld', '__return_false');
70
+
71
+ }
72
+ public function saswp_kk_star_ratings_override(){
73
+
74
+ remove_action('wp_head', 'Bhittani\StarRating\structured_data');
75
+
76
+ }
77
+
78
  public function saswp_wp_event_manager_override(){
79
 
80
  if(class_exists('WP_Event_Manager_Post_Types')){
90
  }
91
  public function saswp_remove_the_events_calendar_markup( $data, $args ){
92
 
93
+ return array();
94
  }
95
 
96
 
output/function.php CHANGED
@@ -41,6 +41,7 @@ function saswp_schema_markup_hook_on_init() {
41
  remove_action( 'wp_head', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'global_schemas_markup' ),10);
42
  remove_action( 'wp_footer', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'schema_markup' ),10);
43
  remove_action( 'wp_footer', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'global_schemas_markup' ),10);
 
44
  }
45
 
46
  if(isset($sd_data['saswp-wp-recipe-maker']) && $sd_data['saswp-wp-recipe-maker'] == 1){
@@ -85,7 +86,7 @@ function saswp_schema_markup_output() {
85
  if($archive_output){
86
 
87
  if(empty($woo_cat_schema)){
88
- $item_list = $archive_output[0];
89
  }
90
 
91
  $collection_page = $archive_output[1];
@@ -1048,4 +1049,849 @@ function saswp_append_fetched_reviews($input1){
1048
 
1049
  }
1050
  return $input1;
1051
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  remove_action( 'wp_head', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'global_schemas_markup' ),10);
42
  remove_action( 'wp_footer', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'schema_markup' ),10);
43
  remove_action( 'wp_footer', array( BSF_AIOSRS_Pro_Markup::get_instance(), 'global_schemas_markup' ),10);
44
+
45
  }
46
 
47
  if(isset($sd_data['saswp-wp-recipe-maker']) && $sd_data['saswp-wp-recipe-maker'] == 1){
86
  if($archive_output){
87
 
88
  if(empty($woo_cat_schema)){
89
+ $item_list = $archive_output[0];
90
  }
91
 
92
  $collection_page = $archive_output[1];
1049
 
1050
  }
1051
  return $input1;
1052
+ }
1053
+
1054
+ function saswp_book_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1055
+
1056
+ $input1 = array();
1057
+
1058
+ $howto_image = get_post_meta( get_the_ID(), 'saswp_book_image_'.$schema_id.'_detail',true);
1059
+
1060
+ $input1['@context'] = saswp_context_url();
1061
+ $input1['@type'] = 'Book';
1062
+ $input1['@id'] = trailingslashit(get_permalink()).'#Book';
1063
+ $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_book_url_'.$schema_id, 'saswp_array');
1064
+ $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_book_name_'.$schema_id, 'saswp_array');
1065
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_book_description_'.$schema_id, 'saswp_array');
1066
+
1067
+ if(!(empty($howto_image))){
1068
+
1069
+ $input1['image']['@type'] = 'ImageObject';
1070
+ $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
1071
+ $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
1072
+ $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
1073
+
1074
+ }
1075
+
1076
+ if($all_post_meta['saswp_book_author_'.$schema_id][0]){
1077
+ $input1['author']['@type'] = 'Person';
1078
+ $input1['author']['name'] = $all_post_meta['saswp_book_author_'.$schema_id][0];
1079
+
1080
+ if($all_post_meta['saswp_book_author_url_'.$schema_id][0]){
1081
+ $input1['author']['sameAs'] = $all_post_meta['saswp_book_author_url_'.$schema_id][0];
1082
+ }
1083
+
1084
+ }
1085
+
1086
+ $input1['datePublished'] = isset($all_post_meta['saswp_book_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_book_date_published_'.$schema_id][0])):'';
1087
+ $input1['isbn'] = saswp_remove_warnings($all_post_meta, 'saswp_book_isbn_'.$schema_id, 'saswp_array');
1088
+ $input1['numberOfPages'] = saswp_remove_warnings($all_post_meta, 'saswp_book_no_of_page_'.$schema_id, 'saswp_array');
1089
+ $input1['publisher'] = saswp_remove_warnings($all_post_meta, 'saswp_book_publisher_'.$schema_id, 'saswp_array');
1090
+
1091
+ if(isset($all_post_meta['saswp_book_price_'.$schema_id]) && isset($all_post_meta['saswp_book_price_currency_'.$schema_id])){
1092
+ $input1['offers']['@type'] = 'Offer';
1093
+ $input1['offers']['availability'] = saswp_remove_warnings($all_post_meta, 'saswp_book_availability_'.$schema_id, 'saswp_array');
1094
+ $input1['offers']['price'] = $all_post_meta['saswp_book_price_'.$schema_id];
1095
+ $input1['offers']['priceCurrency'] = $all_post_meta['saswp_book_price_currency_'.$schema_id];
1096
+ }
1097
+
1098
+ if(isset($all_post_meta['saswp_book_enable_rating_'.$schema_id]) && isset($all_post_meta['saswp_book_rating_value_'.$schema_id]) && isset($all_post_meta['saswp_book_rating_count_'.$schema_id])){
1099
+ $input1['aggregateRating']['@type'] = 'aggregateRating';
1100
+ $input1['aggregateRating']['ratingValue'] = $all_post_meta['saswp_book_rating_value_'.$schema_id];
1101
+ $input1['aggregateRating']['ratingCount'] = $all_post_meta['saswp_book_rating_count_'.$schema_id];
1102
+ }
1103
+
1104
+ return $input1;
1105
+ }
1106
+
1107
+ function saswp_howto_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1108
+
1109
+ $input1 = array();
1110
+ $howto_image = get_post_meta( get_the_ID(), 'saswp_howto_schema_image_'.$schema_id.'_detail',true);
1111
+
1112
+ $tool = get_post_meta($schema_post_id, 'howto_tool_'.$schema_id, true);
1113
+ $step = get_post_meta($schema_post_id, 'howto_step_'.$schema_id, true);
1114
+ $supply = get_post_meta($schema_post_id, 'howto_supply_'.$schema_id, true);
1115
+
1116
+ $input1['@context'] = saswp_context_url();
1117
+ $input1['@type'] = 'HowTo';
1118
+ $input1['@id'] = trailingslashit(get_permalink()).'#HowTo';
1119
+ $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_name_'.$schema_id, 'saswp_array');
1120
+ $input1['datePublished'] = isset($all_post_meta['saswp_howto_ec_schema_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_howto_ec_schema_date_published_'.$schema_id][0])):'';
1121
+ $input1['dateModified'] = isset($all_post_meta['saswp_howto_ec_schema_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_howto_ec_schema_date_modified_'.$schema_id][0])):'';
1122
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_description_'.$schema_id, 'saswp_array');
1123
+
1124
+ if(!(empty($howto_image))){
1125
+
1126
+ $input1['image']['@type'] = 'ImageObject';
1127
+ $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
1128
+ $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
1129
+ $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
1130
+
1131
+ }
1132
+
1133
+ if(saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_currency_'.$schema_id, 'saswp_array') !='' && saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_value_'.$schema_id, 'saswp_array') !='')
1134
+ {
1135
+ $input1['estimatedCost']['@type'] = 'MonetaryAmount';
1136
+ $input1['estimatedCost']['currency']= saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_currency_'.$schema_id, 'saswp_array');
1137
+ $input1['estimatedCost']['value'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_value_'.$schema_id, 'saswp_array');
1138
+ }
1139
+
1140
+
1141
+ $supply_arr = array();
1142
+ if(!empty($supply)){
1143
+
1144
+ foreach($supply as $val){
1145
+
1146
+ $supply_data = array();
1147
+
1148
+ if($val['saswp_howto_supply_name'] || $val['saswp_howto_supply_url']){
1149
+ $supply_data['@type'] = 'HowToSupply';
1150
+ $supply_data['name'] = $val['saswp_howto_supply_name'];
1151
+ $supply_data['url'] = $val['saswp_howto_supply_url'];
1152
+ }
1153
+
1154
+
1155
+
1156
+ if(isset($val['saswp_howto_supply_image_id']) && $val['saswp_howto_supply_image_id'] !=''){
1157
+
1158
+ $image_details = wp_get_attachment_image_src($val['saswp_howto_supply_image_id']);
1159
+
1160
+ $supply_data['image']['@type'] = 'ImageObject';
1161
+ $supply_data['image']['url'] = esc_url($image_details[0]);
1162
+ $supply_data['image']['width'] = esc_attr($image_details[1]);
1163
+ $supply_data['image']['height'] = esc_attr($image_details[2]);
1164
+
1165
+
1166
+
1167
+ }
1168
+ $supply_arr[] = $supply_data;
1169
+ }
1170
+ $input1['supply'] = $supply_arr;
1171
+ }
1172
+
1173
+ $tool_arr = array();
1174
+ if(!empty($tool)){
1175
+
1176
+ foreach($tool as $val){
1177
+
1178
+ $supply_data = array();
1179
+
1180
+ if($val['saswp_howto_tool_name'] || $val['saswp_howto_tool_url']){
1181
+ $supply_data['@type'] = 'HowToTool';
1182
+ $supply_data['name'] = $val['saswp_howto_tool_name'];
1183
+ $supply_data['url'] = $val['saswp_howto_tool_url'];
1184
+ }
1185
+
1186
+ if(isset($val['saswp_howto_tool_image_id']) && $val['saswp_howto_tool_image_id'] !=''){
1187
+
1188
+ $image_details = wp_get_attachment_image_src($val['saswp_howto_tool_image_id']);
1189
+
1190
+ $supply_data['image']['@type'] = 'ImageObject';
1191
+ $supply_data['image']['url'] = esc_url($image_details[0]);
1192
+ $supply_data['image']['width'] = esc_attr($image_details[1]);
1193
+ $supply_data['image']['height'] = esc_attr($image_details[2]);
1194
+
1195
+
1196
+
1197
+ }
1198
+ $tool_arr[] = $supply_data;
1199
+ }
1200
+ $input1['tool'] = $tool_arr;
1201
+ }
1202
+
1203
+ //step
1204
+
1205
+ $step_arr = array();
1206
+ if(!empty($step)){
1207
+
1208
+ foreach($step as $key => $val){
1209
+
1210
+ $supply_data = array();
1211
+ $direction = array();
1212
+ $tip = array();
1213
+
1214
+ if($val['saswp_howto_direction_text']){
1215
+ $direction['@type'] = 'HowToDirection';
1216
+ $direction['text'] = $val['saswp_howto_direction_text'];
1217
+ }
1218
+
1219
+ if($val['saswp_howto_tip_text']){
1220
+
1221
+ $tip['@type'] = 'HowToTip';
1222
+ $tip['text'] = $val['saswp_howto_tip_text'];
1223
+
1224
+ }
1225
+
1226
+ $supply_data['@type'] = 'HowToStep';
1227
+ $supply_data['url'] = trailingslashit(get_permalink()).'#step'.++$key;
1228
+ $supply_data['name'] = $val['saswp_howto_step_name'];
1229
+
1230
+ if($direction['text'] || $tip['text']){
1231
+ $supply_data['itemListElement'] = array($direction, $tip);
1232
+ }
1233
+
1234
+ if(isset($val['saswp_howto_step_image_id']) && $val['saswp_howto_step_image_id'] !=''){
1235
+
1236
+ $image_details = wp_get_attachment_image_src($val['saswp_howto_step_image_id']);
1237
+ $supply_data['image']['@type'] = 'ImageObject';
1238
+ $supply_data['image']['url'] = esc_url($image_details[0]);
1239
+ $supply_data['image']['width'] = esc_attr($image_details[1]);
1240
+ $supply_data['image']['height'] = esc_attr($image_details[2]);
1241
+
1242
+ }
1243
+
1244
+ $step_arr[] = $supply_data;
1245
+
1246
+ }
1247
+
1248
+ $input1['step'] = $step_arr;
1249
+
1250
+ }
1251
+
1252
+ $input1['totalTime'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_totaltime_'.$schema_id, 'saswp_array');
1253
+
1254
+ return $input1;
1255
+ }
1256
+
1257
+ function saswp_event_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1258
+
1259
+ $input1 = array();
1260
+
1261
+ $event_image = get_post_meta( get_the_ID(), 'saswp_event_schema_image_'.$schema_id.'_detail',true);
1262
+
1263
+ $input1 = array(
1264
+ '@context' => saswp_context_url(),
1265
+ '@type' => (isset($all_post_meta['saswp_event_schema_type_'.$schema_id][0]) && $all_post_meta['saswp_event_schema_type_'.$schema_id][0] !='') ? $all_post_meta['saswp_event_schema_type_'.$schema_id][0] : 'Event' ,
1266
+ '@id' => trailingslashit(get_permalink()).'#event',
1267
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_name_'.$schema_id, 'saswp_array'),
1268
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_description_'.$schema_id, 'saswp_array'),
1269
+ 'image' => array(
1270
+ '@type' =>'ImageObject',
1271
+ 'url' => isset($event_image['thumbnail']) ? esc_url($event_image['thumbnail']):'' ,
1272
+ 'width' => isset($event_image['width']) ? esc_attr($event_image['width']) :'' ,
1273
+ 'height' => isset($event_image['height']) ? esc_attr($event_image['height']) :'' ,
1274
+ ),
1275
+ 'location' => array(
1276
+ '@type' => 'Place',
1277
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_name_'.$schema_id, 'saswp_array'),
1278
+ 'address' => array(
1279
+ '@type' => 'PostalAddress',
1280
+ 'streetAddress' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_streetaddress_'.$schema_id, 'saswp_array'),
1281
+ 'addressLocality' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_locality_'.$schema_id, 'saswp_array'),
1282
+ 'postalCode' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_postalcode_'.$schema_id, 'saswp_array'),
1283
+ 'addressRegion' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_region_'.$schema_id, 'saswp_array'),
1284
+ )
1285
+ ),
1286
+ 'offers' => array(
1287
+ '@type' => 'Offer',
1288
+ 'url' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_url_'.$schema_id, 'saswp_array'),
1289
+ 'price' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_price_'.$schema_id, 'saswp_array'),
1290
+ 'priceCurrency' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_price_currency_'.$schema_id, 'saswp_array'),
1291
+ 'availability' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_availability_'.$schema_id, 'saswp_array'),
1292
+ 'validFrom' => isset($all_post_meta['saswp_event_schema_validfrom_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_event_schema_validfrom_'.$schema_id][0])):'',
1293
+ )
1294
+ );
1295
+
1296
+
1297
+ if(isset($all_post_meta['saswp_event_schema_start_date_'.$schema_id][0])){
1298
+
1299
+ $date = $time = '';
1300
+
1301
+ $date = $all_post_meta['saswp_event_schema_start_date_'.$schema_id][0];
1302
+
1303
+ if(isset($all_post_meta['saswp_event_schema_start_time_'.$schema_id][0])){
1304
+ $time = $all_post_meta['saswp_event_schema_start_time_'.$schema_id][0];
1305
+ }
1306
+
1307
+ $input1['startDate'] = saswp_format_date_time($date, $time);
1308
+
1309
+ }
1310
+
1311
+ if(isset($all_post_meta['saswp_event_schema_end_date_'.$schema_id][0])){
1312
+
1313
+ $date = $time = '';
1314
+
1315
+ $date = $all_post_meta['saswp_event_schema_end_date_'.$schema_id][0];
1316
+
1317
+ if(isset($all_post_meta['saswp_event_schema_end_time_'.$schema_id][0])){
1318
+ $time = $all_post_meta['saswp_event_schema_end_time_'.$schema_id][0];
1319
+ }
1320
+
1321
+ $input1['endDate'] = saswp_format_date_time($date, $time);
1322
+
1323
+ }
1324
+
1325
+
1326
+ $performer = get_post_meta($schema_post_id, 'performer_'.$schema_id, true);
1327
+
1328
+ $performer_arr = array();
1329
+
1330
+ if(!empty($performer)){
1331
+
1332
+ foreach($performer as $val){
1333
+
1334
+ $supply_data = array();
1335
+ $supply_data['@type'] = $val['saswp_event_performer_type'];
1336
+ $supply_data['name'] = $val['saswp_event_performer_name'];
1337
+ $supply_data['url'] = $val['saswp_event_performer_url'];
1338
+
1339
+ $performer_arr[] = $supply_data;
1340
+ }
1341
+
1342
+ $input1['performer'] = $performer_arr;
1343
+
1344
+ }
1345
+
1346
+
1347
+ return $input1;
1348
+
1349
+
1350
+ }
1351
+
1352
+ function saswp_course_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1353
+
1354
+ $input1 = array();
1355
+
1356
+ $input1 = array(
1357
+ '@context' => saswp_context_url(),
1358
+ '@type' => 'Course' ,
1359
+ '@id' => trailingslashit(get_permalink()).'#course',
1360
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_course_name_'.$schema_id, 'saswp_array'),
1361
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_course_description_'.$schema_id, 'saswp_array'),
1362
+ 'url' => saswp_remove_warnings($all_post_meta, 'saswp_course_url_'.$schema_id, 'saswp_array'),
1363
+ 'datePublished' => isset($all_post_meta['saswp_course_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_course_date_published_'.$schema_id][0])):'',
1364
+ 'dateModified' => isset($all_post_meta['saswp_course_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_course_date_modified_'.$schema_id][0])):'',
1365
+ 'provider' => array(
1366
+ '@type' => 'Organization',
1367
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_course_provider_name_'.$schema_id, 'saswp_array'),
1368
+ 'sameAs' => saswp_remove_warnings($all_post_meta, 'saswp_course_sameas_'.$schema_id, 'saswp_array')
1369
+ )
1370
+ );
1371
+
1372
+ return $input1;
1373
+
1374
+ }
1375
+
1376
+ function saswp_software_app_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1377
+
1378
+ $input1 = array();
1379
+
1380
+
1381
+ $input1 = array(
1382
+ '@context' => saswp_context_url(),
1383
+ '@type' => 'SoftwareApplication',
1384
+ '@id' => trailingslashit(get_permalink()).'#softwareapplication',
1385
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_name_'.$schema_id, 'saswp_array'),
1386
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_description_'.$schema_id, 'saswp_array'),
1387
+ 'operatingSystem' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_operating_system_'.$schema_id, 'saswp_array'),
1388
+ 'applicationCategory' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_application_category_'.$schema_id, 'saswp_array'),
1389
+ 'offers' => array(
1390
+ '@type' => 'Offer',
1391
+ 'price' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_price_'.$schema_id, 'saswp_array'),
1392
+ 'priceCurrency' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_price_currency_'.$schema_id, 'saswp_array'),
1393
+ ),
1394
+ 'datePublished' => isset($all_post_meta['saswp_software_schema_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_software_schema_date_published_'.$schema_id][0])):'',
1395
+ 'dateModified' => isset($all_post_meta['saswp_software_schema_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_software_schema_date_modified_'.$schema_id][0])):'',
1396
+
1397
+ );
1398
+
1399
+ $soft_image = get_post_meta( get_the_ID(), 'saswp_software_schema_image_'.$schema_id.'_detail',true);
1400
+
1401
+ if(!(empty($soft_image))){
1402
+
1403
+ $input1['image']['@type'] = 'ImageObject';
1404
+ $input1['image']['url'] = isset($soft_image['thumbnail']) ? esc_url($soft_image['thumbnail']):'';
1405
+ $input1['image']['height'] = isset($soft_image['width']) ? esc_attr($soft_image['width']) :'';
1406
+ $input1['image']['width'] = isset($soft_image['height']) ? esc_attr($soft_image['height']) :'';
1407
+
1408
+ }
1409
+
1410
+ if(saswp_remove_warnings($all_post_meta, 'saswp_software_schema_enable_rating_'.$schema_id, 'saswp_array') == 1){
1411
+
1412
+ $input1['aggregateRating'] = array(
1413
+ "@type" => "AggregateRating",
1414
+ "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_rating_'.$schema_id, 'saswp_array'),
1415
+ "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_rating_count_'.$schema_id, 'saswp_array')
1416
+ );
1417
+ }
1418
+
1419
+
1420
+ return $input1;
1421
+
1422
+ }
1423
+
1424
+ function saswp_recipe_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1425
+
1426
+ $input1 = array();
1427
+
1428
+ $recipe_logo = get_post_meta( get_the_ID(), 'saswp_recipe_organization_logo_'.$schema_id.'_detail',true);
1429
+ $recipe_image = get_post_meta( get_the_ID(), 'saswp_recipe_image_'.$schema_id.'_detail',true);
1430
+ $recipe_author_image = get_post_meta( get_the_ID(), 'saswp_recipe_author_image_'.$schema_id.'_detail',true);
1431
+
1432
+ $ingredient = array();
1433
+ $instruction = array();
1434
+
1435
+ if(isset($all_post_meta['saswp_recipe_ingredient_'.$schema_id])){
1436
+
1437
+ $explod = explode(';', $all_post_meta['saswp_recipe_ingredient_'.$schema_id][0]);
1438
+
1439
+ if($explod){
1440
+
1441
+ foreach ($explod as $val){
1442
+
1443
+ $ingredient[] = $val;
1444
+
1445
+ }
1446
+
1447
+ }
1448
+
1449
+
1450
+
1451
+ }
1452
+
1453
+ if(isset($all_post_meta['saswp_recipe_instructions_'.$schema_id])){
1454
+
1455
+ $explod = explode(';', $all_post_meta['saswp_recipe_instructions_'.$schema_id][0]);
1456
+
1457
+ if($explod){
1458
+
1459
+ foreach ($explod as $val){
1460
+
1461
+ $instruction[] = array(
1462
+ '@type' => "HowToStep",
1463
+ 'text' => $val,
1464
+ );
1465
+
1466
+ }
1467
+
1468
+ }
1469
+
1470
+ }
1471
+
1472
+ $input1 = array(
1473
+ '@context' => saswp_context_url(),
1474
+ '@type' => 'Recipe' ,
1475
+ '@id' => trailingslashit(get_permalink()).'#recipe',
1476
+ 'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_url_'.$schema_id, 'saswp_array'),
1477
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_name_'.$schema_id, 'saswp_array'),
1478
+ 'image' =>array(
1479
+ '@type' => 'ImageObject',
1480
+ 'url' => saswp_remove_warnings( $recipe_image, 'thumbnail', 'saswp_string'),
1481
+ 'width' => saswp_remove_warnings( $recipe_image, 'width', 'saswp_string'),
1482
+ 'height' => saswp_remove_warnings( $recipe_image , 'height', 'saswp_string'),
1483
+ ),
1484
+ 'author' => array(
1485
+ '@type' => 'Person',
1486
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_name_'.$schema_id, 'saswp_array'),
1487
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_description_'.$schema_id, 'saswp_array'),
1488
+ 'Image' => array(
1489
+ '@type' => 'ImageObject',
1490
+ 'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_image_'.$schema_id, 'saswp_array'),
1491
+ 'height' => saswp_remove_warnings($recipe_author_image, 'height', 'saswp_string'),
1492
+ 'width' => saswp_remove_warnings($recipe_author_image, 'width', 'saswp_string')
1493
+ ),
1494
+ ),
1495
+
1496
+
1497
+ 'prepTime' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_preptime_'.$schema_id, 'saswp_array'),
1498
+ 'cookTime' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_cooktime_'.$schema_id, 'saswp_array'),
1499
+ 'totalTime' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_totaltime_'.$schema_id, 'saswp_array'),
1500
+ 'keywords' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_keywords_'.$schema_id, 'saswp_array'),
1501
+ 'recipeYield' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_recipeyield_'.$schema_id, 'saswp_array'),
1502
+ 'recipeCategory' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_category_'.$schema_id, 'saswp_array'),
1503
+ 'recipeCuisine' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_cuisine_'.$schema_id, 'saswp_array'),
1504
+ 'nutrition' => array(
1505
+ '@type' => "NutritionInformation",
1506
+ 'calories' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_nutrition_'.$schema_id, 'saswp_array'),
1507
+ ),
1508
+ 'recipeIngredient' => $ingredient,
1509
+ 'recipeInstructions' => $instruction,
1510
+ 'datePublished' => isset($all_post_meta['saswp_recipe_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_recipe_date_published_'.$schema_id][0])):'',
1511
+ 'dateModified' => isset($all_post_meta['saswp_recipe_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_recipe_date_modified_'.$schema_id][0])):'',
1512
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_description_'.$schema_id, 'saswp_array'),
1513
+ 'mainEntity' => array(
1514
+ '@type' => 'WebPage',
1515
+ '@id' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_main_entity_'.$schema_id, 'saswp_array'),
1516
+ 'publisher' => array(
1517
+ '@type' => 'Organization',
1518
+ 'logo' => array(
1519
+ '@type' => 'ImageObject',
1520
+ 'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_organization_logo_'.$schema_id, 'saswp_array'),
1521
+ 'width' => saswp_remove_warnings($recipe_logo, 'width', 'saswp_string'),
1522
+ 'height' => saswp_remove_warnings($recipe_logo, 'height', 'saswp_string'),
1523
+ ),
1524
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_organization_name_'.$schema_id, 'saswp_array'),
1525
+ ),
1526
+ ),
1527
+
1528
+
1529
+ );
1530
+
1531
+ if(saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_name_'.$schema_id, 'saswp_array') !='' && saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_thumbnailurl_'.$schema_id, 'saswp_array') !='' && saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_description_'.$schema_id, 'saswp_array') !=''){
1532
+
1533
+ $input1['video']['@type'] = 'VideoObject';
1534
+ $input1['video']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_name_'.$schema_id, 'saswp_array');
1535
+ $input1['video']['description'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_description_'.$schema_id, 'saswp_array');
1536
+ $input1['video']['thumbnailUrl'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_thumbnailurl_'.$schema_id, 'saswp_array');
1537
+ $input1['video']['contentUrl'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_contenturl_'.$schema_id, 'saswp_array');
1538
+ $input1['video']['embedUrl'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_embedurl_'.$schema_id, 'saswp_array');
1539
+ $input1['video']['uploadDate'] = isset($all_post_meta['saswp_recipe_video_upload_date_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_recipe_video_upload_date_'.$schema_id][0])):'';
1540
+ $input1['video']['duration'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_duration_'.$schema_id, 'saswp_array');
1541
+ }
1542
+
1543
+ if(saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_review_count_'.$schema_id, 'saswp_array')){
1544
+
1545
+ $input1['aggregateRating'] = array(
1546
+ "@type" => "AggregateRating",
1547
+ "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_rating_'.$schema_id, 'saswp_array'),
1548
+ "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_review_count_'.$schema_id, 'saswp_array')
1549
+ );
1550
+ }
1551
+
1552
+ return $input1;
1553
+
1554
+ }
1555
+
1556
+ function saswp_product_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1557
+
1558
+ $input1 = array();
1559
+
1560
+ $product_image = get_post_meta( get_the_ID(), 'saswp_product_schema_image_'.$schema_id.'_detail',true);
1561
+ $input1 = array(
1562
+ '@context' => saswp_context_url(),
1563
+ '@type' => 'Product',
1564
+ '@id' => trailingslashit(get_permalink()).'#product',
1565
+ 'url' => trailingslashit(get_permalink()),
1566
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_name_'.$schema_id, 'saswp_array'),
1567
+ 'sku' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_sku_'.$schema_id, 'saswp_array'),
1568
+ 'description' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_description_'.$schema_id, 'saswp_array'),
1569
+ 'image' =>array(
1570
+ '@type' => 'ImageObject',
1571
+ 'url' => saswp_remove_warnings($product_image, 'thumbnail', 'saswp_string'),
1572
+ 'width' => saswp_remove_warnings($product_image, 'width', 'saswp_string'),
1573
+ 'height' => saswp_remove_warnings($product_image, 'height', 'saswp_string'),
1574
+ ),
1575
+ 'offers' => array(
1576
+ '@type' => 'Offer',
1577
+ 'availability' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_availability_'.$schema_id, 'saswp_array'),
1578
+ 'itemCondition' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_condition_'.$schema_id, 'saswp_array'),
1579
+ 'price' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_price_'.$schema_id, 'saswp_array'),
1580
+ 'priceCurrency' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_currency_'.$schema_id, 'saswp_array'),
1581
+ 'url' => trailingslashit(get_permalink()),
1582
+ 'priceValidUntil' => isset($all_post_meta['saswp_product_schema_priceValidUntil_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_product_schema_priceValidUntil_'.$schema_id][0])):'',
1583
+ ),
1584
+ 'brand' => array('@type' => 'Thing',
1585
+ 'name' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_brand_name_'.$schema_id, 'saswp_array'),
1586
+ )
1587
+ );
1588
+
1589
+ if(isset($all_post_meta['saswp_product_schema_seller_'.$schema_id])){
1590
+ $input1['offers']['seller']['@type'] = 'Organization';
1591
+ $input1['offers']['seller']['name'] = esc_attr($all_post_meta['saswp_product_schema_seller_'.$schema_id][0]);
1592
+ }
1593
+ if(isset($all_post_meta['saswp_product_schema_gtin8_'.$schema_id])){
1594
+ $input1['gtin8'] = esc_attr($all_post_meta['saswp_product_schema_gtin8_'.$schema_id][0]);
1595
+ }
1596
+ if(isset($all_post_meta['saswp_product_schema_mpn_'.$schema_id])){
1597
+ $input1['mpn'] = esc_attr($all_post_meta['saswp_product_schema_mpn_'.$schema_id][0]);
1598
+ }
1599
+
1600
+ if(saswp_remove_warnings($all_post_meta, 'saswp_product_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_product_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_product_schema_review_count_'.$schema_id, 'saswp_array')){
1601
+
1602
+ $input1['aggregateRating'] = array(
1603
+ "@type" => "AggregateRating",
1604
+ "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_rating_'.$schema_id, 'saswp_array'),
1605
+ "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_review_count_'.$schema_id, 'saswp_array')
1606
+ );
1607
+ }
1608
+
1609
+
1610
+ $itinerary = get_post_meta($schema_post_id, 'product_reviews_'.$schema_id, true);
1611
+
1612
+ $itinerary_arr = array();
1613
+
1614
+ if(!empty($itinerary)){
1615
+
1616
+ foreach($itinerary as $review){
1617
+
1618
+ $review_fields = array();
1619
+
1620
+ $review_fields['@type'] = 'Review';
1621
+ $review_fields['author'] = esc_attr($review['saswp_product_reviews_reviewer_name']);
1622
+ $review_fields['datePublished'] = esc_html($review['saswp_product_reviews_created_date']);
1623
+ $review_fields['description'] = esc_textarea($review['saswp_product_reviews_text']);
1624
+
1625
+ if(is_int($review['saswp_product_reviews_reviewer_rating'])){
1626
+
1627
+ $review_fields['reviewRating']['@type'] = 'Rating';
1628
+ $review_fields['reviewRating']['bestRating'] = '5';
1629
+ $review_fields['reviewRating']['ratingValue'] = esc_attr($review['saswp_product_reviews_reviewer_rating']);
1630
+ $review_fields['reviewRating']['worstRating'] = '1';
1631
+
1632
+ }
1633
+
1634
+ $itinerary_arr[] = $review_fields;
1635
+ }
1636
+ $input1['review'] = $itinerary_arr;
1637
+ }
1638
+
1639
+ $service = new saswp_output_service();
1640
+ $product_details = $service->saswp_woocommerce_product_details(get_the_ID());
1641
+
1642
+
1643
+ if(!empty($product_details['product_reviews'])){
1644
+
1645
+ $reviews = array();
1646
+
1647
+ foreach ($product_details['product_reviews'] as $review){
1648
+
1649
+ $review_fields = array();
1650
+
1651
+ $review_fields['@type'] = 'Review';
1652
+ $review_fields['author'] = esc_attr($review['author']);
1653
+ $review_fields['datePublished'] = esc_html($review['datePublished']);
1654
+ $review_fields['description'] = $review['description'];
1655
+
1656
+ if(isset($review['reviewRating']) && $review['reviewRating'] !=''){
1657
+
1658
+ $review_fields['reviewRating']['@type'] = 'Rating';
1659
+ $review_fields['reviewRating']['bestRating'] = '5';
1660
+ $review_fields['reviewRating']['ratingValue'] = esc_attr($review['reviewRating']);
1661
+ $review_fields['reviewRating']['worstRating'] = '1';
1662
+
1663
+ }
1664
+
1665
+ $reviews[] = $review_fields;
1666
+
1667
+ }
1668
+ $input1['review'] = $reviews;
1669
+ }
1670
+
1671
+ return $input1;
1672
+
1673
+ }
1674
+
1675
+ function saswp_local_business_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1676
+
1677
+ $input1 = array();
1678
+
1679
+ $operation_days = explode( "rn", esc_html( stripslashes(saswp_remove_warnings($all_post_meta, 'saswp_dayofweek_'.$schema_id, 'saswp_array'))) );;
1680
+ $business_sub_name = '';
1681
+ $business_type = saswp_remove_warnings($all_post_meta, 'saswp_business_type_'.$schema_id, 'saswp_array');
1682
+ $post_specific_obj = new saswp_post_specific();
1683
+
1684
+ if(array_key_exists($business_type, $post_specific_obj->_local_sub_business)){
1685
+
1686
+ $check_business_type = $post_specific_obj->_local_sub_business[$business_type];
1687
+
1688
+ if(!empty($check_business_type)){
1689
+
1690
+ $business_sub_name = saswp_remove_warnings($all_post_meta, 'saswp_business_name_'.$schema_id, 'saswp_array');
1691
+
1692
+ }
1693
+
1694
+ }
1695
+
1696
+ if($business_sub_name){
1697
+
1698
+ $local_business = $business_sub_name;
1699
+
1700
+ }else if($business_type){
1701
+
1702
+ $local_business = $business_type;
1703
+
1704
+ }else{
1705
+
1706
+ $local_business = 'LocalBusiness';
1707
+
1708
+ }
1709
+
1710
+ $local_image = get_post_meta( get_the_ID(), 'local_business_logo_'.$schema_id.'_detail',true);
1711
+
1712
+ $input1 = array(
1713
+ '@context' => saswp_context_url(),
1714
+ '@type' => $local_business ,
1715
+ '@id' => ((isset($all_post_meta['saswp_business_id_'.$schema_id][0]) && $all_post_meta['saswp_business_id_'.$schema_id][0] !='') ? $all_post_meta['saswp_business_id_'.$schema_id][0] : trailingslashit(get_permalink()).'#'.strtolower($local_business)),
1716
+ 'name' => saswp_remove_warnings($all_post_meta, 'local_business_name_'.$schema_id, 'saswp_array'),
1717
+ 'url' => saswp_remove_warnings($all_post_meta, 'local_business_name_url_'.$schema_id, 'saswp_array'),
1718
+ 'description' => saswp_remove_warnings($all_post_meta, 'local_business_description_'.$schema_id, 'saswp_array'),
1719
+ 'image' => array(
1720
+ '@type' => 'ImageObject',
1721
+ 'url' => saswp_remove_warnings($local_image, 'thumbnail', 'saswp_string'),
1722
+ 'width' => saswp_remove_warnings($local_image, 'width', 'saswp_string'),
1723
+ 'height' => saswp_remove_warnings($local_image, 'height', 'saswp_string'),
1724
+ ),
1725
+ 'address' => array(
1726
+ "@type" => "PostalAddress",
1727
+ "streetAddress" => saswp_remove_warnings($all_post_meta, 'local_street_address_'.$schema_id, 'saswp_array'),
1728
+ "addressLocality" => saswp_remove_warnings($all_post_meta, 'local_city_'.$schema_id, 'saswp_array'),
1729
+ "addressRegion" => saswp_remove_warnings($all_post_meta, 'local_state_'.$schema_id, 'saswp_array'),
1730
+ "postalCode" => saswp_remove_warnings($all_post_meta, 'local_postal_code_'.$schema_id, 'saswp_array'),
1731
+ ),
1732
+ 'telephone' => saswp_remove_warnings($all_post_meta, 'local_phone_'.$schema_id, 'saswp_array'),
1733
+ 'openingHours' => $operation_days,
1734
+ );
1735
+
1736
+ if(isset($all_post_meta['local_price_range_'.$schema_id][0])){
1737
+ $input1['priceRange'] = esc_attr($all_post_meta['local_price_range_'.$schema_id][0]);
1738
+ }
1739
+
1740
+ if(isset($all_post_meta['local_accepts_reservations_'.$schema_id][0])){
1741
+ $input1['acceptsReservations'] = esc_attr($all_post_meta['local_price_accepts_reservations_'.$schema_id][0]);
1742
+ }
1743
+
1744
+ if(isset($all_post_meta['local_serves_cuisine_'.$schema_id][0])){
1745
+ $input1['servesCuisine'] = esc_attr($all_post_meta['local_serves_cuisine_'.$schema_id][0]);
1746
+ }
1747
+
1748
+ if(isset($all_post_meta['local_area_served_'.$schema_id][0])){
1749
+
1750
+ $area_served = explode(',', $all_post_meta['local_area_served_'.$schema_id][0]);
1751
+
1752
+ $input1['areaServed'] = $area_served;
1753
+
1754
+ }
1755
+
1756
+ //social fields starts here
1757
+
1758
+ $local_social = array();
1759
+
1760
+ if(isset($all_post_meta['local_facebook_'.$schema_id][0]) && $all_post_meta['local_facebook_'.$schema_id][0] !=''){
1761
+ $local_social[] = esc_url($all_post_meta['local_facebook_'.$schema_id][0]);
1762
+ }
1763
+ if(isset($all_post_meta['local_twitter_'.$schema_id][0]) && $all_post_meta['local_twitter_'.$schema_id][0] !=''){
1764
+ $local_social[] = esc_url($all_post_meta['local_twitter_'.$schema_id][0]);
1765
+ }
1766
+ if(isset($all_post_meta['local_instagram_'.$schema_id][0]) && $all_post_meta['local_instagram_'.$schema_id][0] !=''){
1767
+ $local_social[] = esc_url($all_post_meta['local_instagram_'.$schema_id][0]);
1768
+ }
1769
+ if(isset($all_post_meta['local_pinterest_'.$schema_id][0]) && $all_post_meta['local_pinterest_'.$schema_id][0] !=''){
1770
+ $local_social[] = esc_url($all_post_meta['local_pinterest_'.$schema_id][0]);
1771
+ }
1772
+ if(isset($all_post_meta['local_linkedin_'.$schema_id][0]) && $all_post_meta['local_linkedin_'.$schema_id][0] !=''){
1773
+ $local_social[] = esc_url($all_post_meta['local_linkedin_'.$schema_id][0]);
1774
+ }
1775
+ if(isset($all_post_meta['local_soundcloud_'.$schema_id][0]) && $all_post_meta['local_soundcloud_'.$schema_id][0] !=''){
1776
+ $local_social[] = esc_url($all_post_meta['local_soundcloud_'.$schema_id][0]);
1777
+ }
1778
+ if(isset($all_post_meta['local_tumblr_'.$schema_id][0]) && $all_post_meta['local_tumblr_'.$schema_id][0] !=''){
1779
+ $local_social[] = esc_url($all_post_meta['local_tumblr_'.$schema_id][0]);
1780
+ }
1781
+ if(isset($all_post_meta['local_youtube_'.$schema_id][0]) && $all_post_meta['local_youtube_'.$schema_id][0] !=''){
1782
+ $local_social[] = esc_url($all_post_meta['local_youtube_'.$schema_id][0]);
1783
+ }
1784
+
1785
+ if(!empty($local_social)){
1786
+ $input1['sameAs'] = $local_social;
1787
+ }
1788
+ //social fields ends here
1789
+
1790
+ if(isset($all_post_meta['local_menu_'.$schema_id][0])){
1791
+ $input1['hasMenu'] = esc_url($all_post_meta['local_menu_'.$schema_id][0]);
1792
+ }
1793
+
1794
+ if(isset($all_post_meta['local_hasmap_'.$schema_id][0])){
1795
+ $input1['hasMap'] = esc_url($all_post_meta['local_hasmap_'.$schema_id][0]);
1796
+ }
1797
+
1798
+ if(isset($all_post_meta['local_latitude_'.$schema_id][0]) && isset($all_post_meta['local_longitude_'.$schema_id][0])){
1799
+
1800
+ $input1['geo']['@type'] = 'GeoCoordinates';
1801
+ $input1['geo']['latitude'] = $all_post_meta['local_latitude_'.$schema_id][0];
1802
+ $input1['geo']['longitude'] = $all_post_meta['local_longitude_'.$schema_id][0];
1803
+
1804
+ }
1805
+
1806
+ return $input1;
1807
+ }
1808
+
1809
+ function saswp_video_game_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1810
+
1811
+ $input1 = array();
1812
+
1813
+ $howto_image = get_post_meta( get_the_ID(), 'saswp_vg_schema_image_'.$schema_id.'_detail',true);
1814
+
1815
+ $input1['@context'] = saswp_context_url();
1816
+ $input1['@type'] = 'VideoGame';
1817
+ $input1['@id'] = trailingslashit(get_permalink()).'#VideoGame';
1818
+ $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_name_'.$schema_id, 'saswp_array');
1819
+ $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_url_'.$schema_id, 'saswp_array');
1820
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_description_'.$schema_id, 'saswp_array');
1821
+
1822
+ if(!(empty($howto_image))){
1823
+
1824
+ $input1['image']['@type'] = 'ImageObject';
1825
+ $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
1826
+ $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
1827
+ $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
1828
+
1829
+ }
1830
+
1831
+ $input1['operatingSystem'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_operating_system_'.$schema_id, 'saswp_array');
1832
+ $input1['applicationCategory'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_application_category_'.$schema_id, 'saswp_array');
1833
+
1834
+ $input1['author']['@type'] = 'Organization';
1835
+ $input1['author']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_author_name_'.$schema_id, 'saswp_array');
1836
+
1837
+ $input1['offers']['@type'] = 'Offer';
1838
+ $input1['offers']['price'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_price_'.$schema_id, 'saswp_array');
1839
+ $input1['offers']['priceCurrency'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_price_currency_'.$schema_id, 'saswp_array');
1840
+ $input1['offers']['availability'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_price_availability_'.$schema_id, 'saswp_array');
1841
+
1842
+
1843
+ $input1['publisher'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_publisher_'.$schema_id, 'saswp_array');
1844
+ $input1['genre'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_genre_'.$schema_id, 'saswp_array');
1845
+ $input1['processorRequirements'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_processor_requirements_'.$schema_id, 'saswp_array');
1846
+ $input1['memoryRequirements'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_memory_requirements_'.$schema_id, 'saswp_array');
1847
+ $input1['storageRequirements'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_storage_requirements_'.$schema_id, 'saswp_array');
1848
+ $input1['gamePlatform'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_game_platform_'.$schema_id, 'saswp_array');
1849
+ $input1['cheatCode'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_cheat_code_'.$schema_id, 'saswp_array');
1850
+
1851
+ if( saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_review_count_'.$schema_id, 'saswp_array')){
1852
+
1853
+ $input1['aggregateRating']['@type'] = 'AggregateRating';
1854
+ $input1['aggregateRating']['ratingValue'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_rating_'.$schema_id, 'saswp_array');
1855
+ $input1['aggregateRating']['ratingCount'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_review_count_'.$schema_id, 'saswp_array');
1856
+
1857
+ }
1858
+
1859
+ return $input1;
1860
+ }
1861
+
1862
+ function saswp_music_playlist_schema_markup($schema_id, $schema_post_id, $all_post_meta){
1863
+
1864
+ $input1 = array();
1865
+
1866
+ $input1['@context'] = saswp_context_url();
1867
+ $input1['@type'] = 'MusicPlaylist';
1868
+ $input1['@id'] = trailingslashit(get_permalink()).'#MusicPlaylist';
1869
+ $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_music_playlist_url_'.$schema_id, 'saswp_array');
1870
+ $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_music_playlist_name_'.$schema_id, 'saswp_array');
1871
+ $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_music_playlist_description_'.$schema_id, 'saswp_array');
1872
+
1873
+ $faq_question = get_post_meta($schema_post_id, 'music_playlist_track_'.$schema_id, true);
1874
+
1875
+ $faq_question_arr = array();
1876
+
1877
+ if(!empty($faq_question)){
1878
+
1879
+ $input1['numTracks'] = count($faq_question);
1880
+
1881
+ foreach($faq_question as $val){
1882
+
1883
+ $supply_data = array();
1884
+ $supply_data['@type'] = 'MusicRecording';
1885
+ $supply_data['byArtist'] = $val['saswp_music_playlist_track_artist'];
1886
+ $supply_data['duration'] = $val['saswp_music_playlist_track_duration'];
1887
+ $supply_data['inAlbum'] = $val['saswp_music_playlist_track_inalbum'];
1888
+ $supply_data['name'] = $val['saswp_music_playlist_track_name'];
1889
+ $supply_data['url'] = $val['saswp_music_playlist_track_url'];
1890
+
1891
+ $faq_question_arr[] = $supply_data;
1892
+ }
1893
+ $input1['track'] = $faq_question_arr;
1894
+ }
1895
+
1896
+ return $input1;
1897
+ }
output/output.php CHANGED
@@ -23,8 +23,7 @@ $without_aggregate = array(
23
  'DataFeed',
24
  'FAQ',
25
  'NewsArticle',
26
- 'qanda',
27
- 'Review',
28
  'TechArticle',
29
  'WebPage',
30
  'JobPosting',
@@ -50,68 +49,6 @@ function saswp_kb_schema_output() {
50
  global $sd_data;
51
  $input = array();
52
  $site_url = get_home_url();
53
- // Social profile
54
- $sd_social_profile = array();
55
-
56
- $sd_facebook = array();
57
-
58
- if(isset($sd_data['sd_facebook']) && !empty($sd_data['sd_facebook']) && isset($sd_data['saswp-facebook-enable']) && $sd_data['saswp-facebook-enable'] ==1){
59
- $sd_facebook[] = $sd_data['sd_facebook'];
60
- $sd_social_profile[] = $sd_facebook;
61
- }
62
- $sd_twitter = array();
63
- if(isset($sd_data['sd_twitter']) && !empty($sd_data['sd_twitter']) && isset($sd_data['saswp-twitter-enable']) && $sd_data['saswp-twitter-enable'] ==1 ){
64
- $sd_twitter[] = $sd_data['sd_twitter'];
65
- $sd_social_profile[] = $sd_twitter;
66
- }
67
-
68
- $sd_instagram = array();
69
- if(isset($sd_data['sd_instagram']) && !empty($sd_data['sd_instagram']) && isset($sd_data['saswp-instagram-enable']) && $sd_data['saswp-instagram-enable'] ==1 ){
70
- $sd_instagram[] = $sd_data['sd_instagram'];
71
- $sd_social_profile[] = $sd_instagram;
72
- }
73
-
74
- $sd_youtube = array();
75
- if(isset($sd_data['sd_youtube']) && !empty($sd_data['sd_youtube']) && isset($sd_data['saswp-youtube-enable']) && $sd_data['saswp-youtube-enable'] ==1){
76
- $sd_youtube[] = $sd_data['sd_youtube'];
77
- $sd_social_profile[] = $sd_youtube;
78
- }
79
-
80
- $sd_linkedin = array();
81
- if(isset($sd_data['sd_linkedin']) && !empty($sd_data['sd_linkedin']) && isset($sd_data['saswp-linkedin-enable']) && $sd_data['saswp-linkedin-enable'] ==1 ){
82
- $sd_linkedin[] = $sd_data['sd_linkedin'];
83
- $sd_social_profile[] = $sd_linkedin;
84
- }
85
-
86
- $sd_pinterest = array();
87
- if(isset($sd_data['sd_pinterest']) && !empty($sd_data['sd_pinterest']) && isset($sd_data['saswp-pinterest-enable']) && $sd_data['saswp-pinterest-enable'] ==1){
88
- $sd_pinterest[] = $sd_data['sd_pinterest'];
89
- $sd_social_profile[] = $sd_pinterest;
90
- }
91
-
92
- $sd_soundcloud = array();
93
- if(isset($sd_data['sd_soundcloud']) && !empty($sd_data['sd_soundcloud']) && isset($sd_data['saswp-soundcloud-enable']) && $sd_data['saswp-soundcloud-enable'] ==1){
94
- $sd_soundcloud[] = $sd_data['sd_soundcloud'];
95
- $sd_social_profile[] = $sd_soundcloud;
96
- }
97
-
98
- $sd_tumblr = array();
99
- if(isset($sd_data['sd_tumblr']) && !empty($sd_data['sd_tumblr']) && isset($sd_data['saswp-tumblr-enable']) && $sd_data['saswp-tumblr-enable'] ==1){
100
- $sd_tumblr[] = $sd_data['sd_tumblr'];
101
- $sd_social_profile[] = $sd_tumblr;
102
- }
103
-
104
- $sd_yelp = array();
105
- if(isset($sd_data['sd_yelp']) && !empty($sd_data['sd_yelp']) && isset($sd_data['saswp-yelp-enable']) && $sd_data['saswp-yelp-enable'] ==1){
106
- $sd_yelp[] = $sd_data['sd_yelp'];
107
- $sd_social_profile[] = $sd_yelp;
108
- }
109
-
110
- $platform = array();
111
-
112
- foreach ($sd_social_profile as $key => $value) {
113
- $platform[] = $value;
114
- }
115
 
116
  // Organization Schema
117
 
@@ -161,7 +98,7 @@ function saswp_kb_schema_output() {
161
  '@id' => $site_url.'#Organization',
162
  'name' => saswp_remove_warnings($sd_data, 'sd_name', 'saswp_string'),
163
  'url' => saswp_remove_warnings($sd_data, 'sd_url', 'saswp_string'),
164
- 'sameAs' => $platform,
165
  );
166
 
167
  if($logo !='' && $width !='' && $height !=''){
@@ -335,12 +272,16 @@ function saswp_schema_output() {
335
  $input1['dateModified'] = esc_html($modified_date);
336
  $input1['dateCreated'] = esc_html($date);
337
  $input1['author'] = saswp_get_author_details();
338
-
 
 
 
339
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
340
  $service = new saswp_output_service();
341
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
342
  }
343
-
 
344
  }
345
 
346
  if( 'VideoGame' === $schema_type){
@@ -353,6 +294,8 @@ function saswp_schema_output() {
353
 
354
  $input1 = saswp_append_fetched_reviews($input1);
355
 
 
 
356
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
357
  $service = new saswp_output_service();
358
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -368,6 +311,8 @@ function saswp_schema_output() {
368
  $input1['associatedAnatomy']['@type'] = 'AnatomicalStructure';
369
  $input1['code']['@type'] = 'MedicalCode';
370
 
 
 
371
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
372
  $service = new saswp_output_service();
373
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -384,6 +329,8 @@ function saswp_schema_output() {
384
 
385
  $input1 = saswp_append_fetched_reviews($input1);
386
 
 
 
387
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
388
  $service = new saswp_output_service();
389
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -400,6 +347,8 @@ function saswp_schema_output() {
400
 
401
  $input1 = saswp_append_fetched_reviews($input1);
402
 
 
 
403
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
404
  $service = new saswp_output_service();
405
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -413,6 +362,8 @@ function saswp_schema_output() {
413
  $input1['@type'] = 'Trip';
414
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Trip';
415
 
 
 
416
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
417
  $service = new saswp_output_service();
418
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -426,12 +377,13 @@ function saswp_schema_output() {
426
  $input1['@type'] = 'SingleFamilyResidence';
427
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#SingleFamilyResidence';
428
  $input1['address']['@type'] = 'PostalAddress';
 
 
429
 
430
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
431
  $service = new saswp_output_service();
432
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
433
  }
434
- $input1 = apply_filters('saswp_modify_apartment_schema_sfr', $input1 );
435
 
436
  }
437
 
@@ -442,12 +394,13 @@ function saswp_schema_output() {
442
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#House';
443
  $input1['address']['@type'] = 'PostalAddress';
444
 
 
 
445
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
446
  $service = new saswp_output_service();
447
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
448
  }
449
-
450
- $input1 = apply_filters('saswp_modify_apartment_schema_house', $input1 );
451
 
452
  }
453
 
@@ -458,12 +411,13 @@ function saswp_schema_output() {
458
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Apartment';
459
  $input1['address']['@type'] = 'PostalAddress';
460
 
 
 
461
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
462
  $service = new saswp_output_service();
463
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
464
  }
465
-
466
- $input1 = apply_filters('saswp_modify_apartment_schema_output', $input1 );
467
 
468
  }
469
 
@@ -475,13 +429,13 @@ function saswp_schema_output() {
475
 
476
  $input1 = saswp_append_fetched_reviews($input1);
477
 
 
 
478
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
479
  $service = new saswp_output_service();
480
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
481
  }
482
-
483
- $input1 = apply_filters('saswp_modify_music_playlist_schema_output', $input1 );
484
-
485
  }
486
 
487
  if( 'Book' === $schema_type){
@@ -492,13 +446,13 @@ function saswp_schema_output() {
492
 
493
  $input1 = saswp_append_fetched_reviews($input1);
494
 
 
 
495
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
496
  $service = new saswp_output_service();
497
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
498
  }
499
-
500
- $input1 = apply_filters('saswp_modify_music_playlist_schema_output', $input1 );
501
-
502
  }
503
 
504
 
@@ -509,14 +463,13 @@ function saswp_schema_output() {
509
  $input1['@id'] = trailingslashit(get_permalink()).'#MusicAlbum';
510
 
511
  $input1 = saswp_append_fetched_reviews($input1);
 
512
 
513
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
514
  $service = new saswp_output_service();
515
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
516
  }
517
-
518
- $input1 = apply_filters('saswp_modify_music_album_schema_output', $input1 );
519
-
520
  }
521
 
522
  if( 'TouristDestination' === $schema_type){
@@ -526,6 +479,8 @@ function saswp_schema_output() {
526
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#TouristDestination';
527
  $input1['address']['@type'] = 'PostalAddress';
528
 
 
 
529
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
530
  $service = new saswp_output_service();
531
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -540,6 +495,8 @@ function saswp_schema_output() {
540
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#TouristAttraction';
541
  $input1['address']['@type'] = 'PostalAddress';
542
 
 
 
543
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
544
  $service = new saswp_output_service();
545
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -554,6 +511,8 @@ function saswp_schema_output() {
554
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#LandmarksOrHistoricalBuildings';
555
  $input1['address']['@type'] = 'PostalAddress';
556
 
 
 
557
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
558
  $service = new saswp_output_service();
559
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -568,6 +527,8 @@ function saswp_schema_output() {
568
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#HinduTemple';
569
  $input1['address']['@type'] = 'PostalAddress';
570
 
 
 
571
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
572
  $service = new saswp_output_service();
573
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -582,6 +543,8 @@ function saswp_schema_output() {
582
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Church';
583
  $input1['address']['@type'] = 'PostalAddress';
584
 
 
 
585
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
586
  $service = new saswp_output_service();
587
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -596,6 +559,8 @@ function saswp_schema_output() {
596
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Mosque';
597
  $input1['address']['@type'] = 'PostalAddress';
598
 
 
 
599
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
600
  $service = new saswp_output_service();
601
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -614,6 +579,8 @@ function saswp_schema_output() {
614
  $input1['baseSalary']['@type'] = 'MonetaryAmount';
615
  $input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
616
 
 
 
617
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
618
  $service = new saswp_output_service();
619
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -628,6 +595,8 @@ function saswp_schema_output() {
628
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Person';
629
  $input1['address']['@type'] = 'PostalAddress';
630
 
 
 
631
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
632
  $service = new saswp_output_service();
633
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -659,11 +628,7 @@ function saswp_schema_output() {
659
  'sameAs' => get_home_url()
660
  )
661
  );
662
-
663
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
664
- $service = new saswp_output_service();
665
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
666
- }
667
  if(!empty($aggregateRating)){
668
  $input1['aggregateRating'] = $aggregateRating;
669
  }
@@ -674,7 +639,12 @@ function saswp_schema_output() {
674
  $input1['comment'] = saswp_get_comments(get_the_ID());
675
  }
676
 
677
- $input1 = apply_filters('saswp_modify_course_schema_output', $input1 );
 
 
 
 
 
678
  }
679
 
680
  if( 'DiscussionForumPosting' === $schema_type){
@@ -721,11 +691,7 @@ function saswp_schema_output() {
721
  $input1 = array_merge($input1, $publisher);
722
 
723
  }
724
-
725
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
726
- $service = new saswp_output_service();
727
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
728
- }
729
  if(!empty($aggregateRating)){
730
  $input1['aggregateRating'] = $aggregateRating;
731
  }
@@ -737,6 +703,11 @@ function saswp_schema_output() {
737
  }
738
 
739
  $input1 = apply_filters('saswp_modify_d_forum_posting_schema_output', $input1 );
 
 
 
 
 
740
  }
741
 
742
  if( 'Blogposting' === $schema_type){
@@ -761,11 +732,6 @@ function saswp_schema_output() {
761
  $input1 = array_merge($input1, $publisher);
762
 
763
  }
764
-
765
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
766
- $service = new saswp_output_service();
767
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
768
- }
769
 
770
  if(!empty($aggregateRating)){
771
  $input1['aggregateRating'] = $aggregateRating;
@@ -778,6 +744,11 @@ function saswp_schema_output() {
778
  }
779
 
780
  $input1 = apply_filters('saswp_modify_blogposting_schema_output', $input1 );
 
 
 
 
 
781
  }
782
 
783
  if( 'AudioObject' === $schema_type){
@@ -807,13 +778,14 @@ function saswp_schema_output() {
807
  }
808
 
809
  $input1 = saswp_append_fetched_reviews($input1);
 
 
 
810
 
811
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
812
  $service = new saswp_output_service();
813
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
814
  }
815
-
816
- $input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
817
  }
818
 
819
  if( 'Event' === $schema_type){
@@ -835,13 +807,13 @@ function saswp_schema_output() {
835
  }
836
 
837
  $input1 = saswp_append_fetched_reviews($input1);
 
 
838
 
839
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
840
  $service = new saswp_output_service();
841
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
842
  }
843
-
844
- $input1 = apply_filters('saswp_modify_event_schema_output', $input1 );
845
 
846
  }
847
 
@@ -871,24 +843,20 @@ function saswp_schema_output() {
871
  }
872
 
873
  $input1 = saswp_append_fetched_reviews($input1);
 
 
874
 
875
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
876
  $service = new saswp_output_service();
877
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
878
  }
879
-
880
- $input1 = apply_filters('saswp_modify_software_application_schema_output', $input1 );
881
  }
882
 
883
  if( 'WebPage' === $schema_type){
884
 
885
  $service = new saswp_output_service();
886
  $input1 = $service->saswp_schema_markup_generator($schema_type);
887
-
888
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
889
- $service = new saswp_output_service();
890
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
891
- }
892
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
893
  $input1['comment'] = saswp_get_comments(get_the_ID());
894
  }
@@ -899,33 +867,35 @@ function saswp_schema_output() {
899
  $input1 = array_merge($input1, $extra_theme_review);
900
  }
901
 
902
- $input1 = apply_filters('saswp_modify_webpage_schema_output', $input1 );
 
 
 
 
 
903
  }
904
 
905
  if( 'Article' === $schema_type ){
906
 
907
  $service = new saswp_output_service();
908
  $input1 = $service->saswp_schema_markup_generator($schema_type);
909
-
910
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
911
- $service = new saswp_output_service();
912
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
913
- }
914
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
915
  $input1['comment'] = saswp_get_comments(get_the_ID());
916
  }
917
  $input1 = apply_filters('saswp_modify_article_schema_output', $input1 );
 
 
 
 
 
918
  }
919
 
920
  if( 'TechArticle' === $schema_type ){
921
 
922
  $service = new saswp_output_service();
923
  $input1 = $service->saswp_schema_markup_generator($schema_type);
924
-
925
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
926
- $service = new saswp_output_service();
927
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
928
- }
929
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
930
  $input1['comment'] = saswp_get_comments(get_the_ID());
931
  }
@@ -934,6 +904,11 @@ function saswp_schema_output() {
934
  }
935
 
936
  $input1 = apply_filters('saswp_modify_tech_article_schema_output', $input1 );
 
 
 
 
 
937
  }
938
 
939
  if( 'Recipe' === $schema_type){
@@ -1012,13 +987,14 @@ function saswp_schema_output() {
1012
  $input1 = $service_object->saswp_bb_press_topic_details(get_the_ID());
1013
 
1014
  }
1015
-
 
 
 
1016
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1017
  $service = new saswp_output_service();
1018
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1019
  }
1020
-
1021
- $input1 = apply_filters('saswp_modify_qanda_schema_output', $input1 );
1022
  }
1023
 
1024
  if( 'Product' === $schema_type){
@@ -1027,6 +1003,8 @@ function saswp_schema_output() {
1027
  $input1 = $service->saswp_schema_markup_generator($schema_type);
1028
 
1029
  $input1 = saswp_append_fetched_reviews($input1);
 
 
1030
 
1031
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1032
 
@@ -1034,8 +1012,6 @@ function saswp_schema_output() {
1034
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1035
 
1036
  }
1037
-
1038
- $input1 = apply_filters('saswp_modify_product_schema_output', $input1 );
1039
  }
1040
 
1041
  if( 'NewsArticle' === $schema_type ){
@@ -1076,11 +1052,7 @@ function saswp_schema_output() {
1076
 
1077
  $input1 = array_merge($input1, $publisher);
1078
 
1079
- }
1080
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1081
- $service = new saswp_output_service();
1082
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1083
- }
1084
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
1085
  $input1['comment'] = saswp_get_comments(get_the_ID());
1086
  }
@@ -1093,6 +1065,12 @@ function saswp_schema_output() {
1093
  }
1094
 
1095
  $input1 = apply_filters('saswp_modify_news_article_schema_output', $input1 );
 
 
 
 
 
 
1096
  }
1097
 
1098
  if( 'Service' === $schema_type ){
@@ -1109,6 +1087,8 @@ function saswp_schema_output() {
1109
  }
1110
 
1111
  $input1 = saswp_append_fetched_reviews($input1);
 
 
1112
 
1113
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1114
 
@@ -1117,40 +1097,44 @@ function saswp_schema_output() {
1117
 
1118
  }
1119
 
1120
- $input1 = apply_filters('saswp_modify_service_schema_output', $input1 );
1121
  }
1122
 
1123
  if('Review' === $schema_type){
1124
 
1125
- $schema_data = saswp_get_schema_data($schema_post_id, 'saswp_review_schema_details');
 
 
 
 
 
 
 
 
 
 
 
 
 
1126
 
1127
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1128
-
1129
- $service = new saswp_output_service();
1130
- $review_markup = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1131
-
1132
  if($review_markup){
1133
 
1134
- $input1['@context'] = saswp_context_url();
1135
- $input1['@type'] = 'Review';
1136
- $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Review';
1137
-
1138
  if(isset($review_markup['review'])){
1139
 
1140
  $input1 = $input1 + $review_markup['review'];
1141
 
1142
  }
1143
 
1144
- if(isset($review_markup['item_reviewed'])){
1145
-
1146
- $item_reviewed = array( '@type' => $schema_data['saswp_review_schema_item_type']) + $review_markup['item_reviewed'];
1147
  $input1['itemReviewed'] = $item_reviewed;
1148
 
1149
  }
1150
 
1151
  }
1152
  }
1153
-
1154
  if(isset($sd_data['saswp-tagyeem']) && $sd_data['saswp-tagyeem'] == 1 && (is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah') ){
1155
 
1156
  remove_action( 'TieLabs/after_post_entry', 'tie_article_schemas' );
@@ -1225,11 +1209,7 @@ function saswp_schema_output() {
1225
  'description' => $description,
1226
  'name' => saswp_get_the_title(),
1227
  'uploadDate' => esc_html($date),
1228
- 'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
1229
- 'mainEntity' => array(
1230
- '@type' => 'WebPage',
1231
- '@id' => trailingslashit(saswp_get_permalink()),
1232
- ),
1233
  'author' => saswp_get_author_details()
1234
  );
1235
  if(!empty($publisher)){
@@ -1248,13 +1228,13 @@ function saswp_schema_output() {
1248
  }
1249
 
1250
  $input1 = saswp_append_fetched_reviews($input1);
 
1251
 
1252
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1253
  $service = new saswp_output_service();
1254
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1255
  }
1256
-
1257
- $input1 = apply_filters('saswp_modify_video_object_schema_output', $input1 );
1258
  }
1259
 
1260
  if( 'local_business' === $schema_type){
@@ -1289,13 +1269,13 @@ function saswp_schema_output() {
1289
  }
1290
 
1291
  $input1 = saswp_append_fetched_reviews($input1);
 
 
1292
 
1293
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1294
  $service = new saswp_output_service();
1295
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1296
  }
1297
-
1298
- $input1 = apply_filters('saswp_modify_local_business_schema_output', $input1 );
1299
  }
1300
 
1301
  //Speakable schema
@@ -1320,13 +1300,16 @@ function saswp_schema_output() {
1320
  global $without_aggregate;
1321
 
1322
  if(!in_array($schema_type, $without_aggregate)){
1323
-
1324
- //kk star rating
 
 
 
1325
 
1326
  $kkstar_aggregateRating = saswp_extract_kk_star_ratings();
1327
 
1328
  if(!empty($kkstar_aggregateRating)){
1329
- $input1['aggregateRating'] = $kkstar_aggregateRating;
1330
  }
1331
 
1332
  //wp post-rating star rating
@@ -1334,8 +1317,30 @@ function saswp_schema_output() {
1334
  $wp_post_rating_ar = saswp_extract_wp_post_ratings();
1335
 
1336
  if(!empty($wp_post_rating_ar)){
1337
- $input1['aggregateRating'] = $wp_post_rating_ar;
1338
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1339
 
1340
  }
1341
 
23
  'DataFeed',
24
  'FAQ',
25
  'NewsArticle',
26
+ 'qanda',
 
27
  'TechArticle',
28
  'WebPage',
29
  'JobPosting',
49
  global $sd_data;
50
  $input = array();
51
  $site_url = get_home_url();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  // Organization Schema
54
 
98
  '@id' => $site_url.'#Organization',
99
  'name' => saswp_remove_warnings($sd_data, 'sd_name', 'saswp_string'),
100
  'url' => saswp_remove_warnings($sd_data, 'sd_url', 'saswp_string'),
101
+ 'sameAs' => isset($sd_data['saswp_social_links']) ? $sd_data['saswp_social_links'] : array(),
102
  );
103
 
104
  if($logo !='' && $width !='' && $height !=''){
272
  $input1['dateModified'] = esc_html($modified_date);
273
  $input1['dateCreated'] = esc_html($date);
274
  $input1['author'] = saswp_get_author_details();
275
+
276
+
277
+ $input1 = apply_filters('saswp_modify_faq_schema_output', $input1 );
278
+
279
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
280
  $service = new saswp_output_service();
281
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
282
  }
283
+
284
+
285
  }
286
 
287
  if( 'VideoGame' === $schema_type){
294
 
295
  $input1 = saswp_append_fetched_reviews($input1);
296
 
297
+ $input1 = apply_filters('saswp_modify_video_game_schema_output', $input1 );
298
+
299
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
300
  $service = new saswp_output_service();
301
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
311
  $input1['associatedAnatomy']['@type'] = 'AnatomicalStructure';
312
  $input1['code']['@type'] = 'MedicalCode';
313
 
314
+ $input1 = apply_filters('saswp_modify_medical_condition_schema_output', $input1 );
315
+
316
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
317
  $service = new saswp_output_service();
318
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
329
 
330
  $input1 = saswp_append_fetched_reviews($input1);
331
 
332
+ $input1 = apply_filters('saswp_modify_tvseries_schema_output', $input1 );
333
+
334
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
335
  $service = new saswp_output_service();
336
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
347
 
348
  $input1 = saswp_append_fetched_reviews($input1);
349
 
350
+ $input1 = apply_filters('saswp_modify_howto_schema_output', $input1 );
351
+
352
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
353
  $service = new saswp_output_service();
354
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
362
  $input1['@type'] = 'Trip';
363
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Trip';
364
 
365
+ $input1 = apply_filters('saswp_modify_trip_schema_output', $input1 );
366
+
367
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
368
  $service = new saswp_output_service();
369
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
377
  $input1['@type'] = 'SingleFamilyResidence';
378
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#SingleFamilyResidence';
379
  $input1['address']['@type'] = 'PostalAddress';
380
+
381
+ $input1 = apply_filters('saswp_modify_apartment_schema_sfr', $input1 );
382
 
383
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
384
  $service = new saswp_output_service();
385
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
386
  }
 
387
 
388
  }
389
 
394
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#House';
395
  $input1['address']['@type'] = 'PostalAddress';
396
 
397
+ $input1 = apply_filters('saswp_modify_apartment_schema_house', $input1 );
398
+
399
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
400
  $service = new saswp_output_service();
401
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
402
  }
403
+
 
404
 
405
  }
406
 
411
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Apartment';
412
  $input1['address']['@type'] = 'PostalAddress';
413
 
414
+ $input1 = apply_filters('saswp_modify_apartment_schema_output', $input1 );
415
+
416
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
417
  $service = new saswp_output_service();
418
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
419
  }
420
+
 
421
 
422
  }
423
 
429
 
430
  $input1 = saswp_append_fetched_reviews($input1);
431
 
432
+ $input1 = apply_filters('saswp_modify_music_playlist_schema_output', $input1 );
433
+
434
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
435
  $service = new saswp_output_service();
436
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
437
  }
438
+
 
 
439
  }
440
 
441
  if( 'Book' === $schema_type){
446
 
447
  $input1 = saswp_append_fetched_reviews($input1);
448
 
449
+ $input1 = apply_filters('saswp_modify_music_playlist_schema_output', $input1 );
450
+
451
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
452
  $service = new saswp_output_service();
453
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
454
  }
455
+
 
 
456
  }
457
 
458
 
463
  $input1['@id'] = trailingslashit(get_permalink()).'#MusicAlbum';
464
 
465
  $input1 = saswp_append_fetched_reviews($input1);
466
+ $input1 = apply_filters('saswp_modify_music_album_schema_output', $input1 );
467
 
468
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
469
  $service = new saswp_output_service();
470
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
471
  }
472
+
 
 
473
  }
474
 
475
  if( 'TouristDestination' === $schema_type){
479
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#TouristDestination';
480
  $input1['address']['@type'] = 'PostalAddress';
481
 
482
+ $input1 = apply_filters('saswp_modify_tourist_destination_schema_output', $input1 );
483
+
484
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
485
  $service = new saswp_output_service();
486
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
495
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#TouristAttraction';
496
  $input1['address']['@type'] = 'PostalAddress';
497
 
498
+ $input1 = apply_filters('saswp_modify_tourist_attraction_schema_output', $input1 );
499
+
500
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
501
  $service = new saswp_output_service();
502
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
511
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#LandmarksOrHistoricalBuildings';
512
  $input1['address']['@type'] = 'PostalAddress';
513
 
514
+ $input1 = apply_filters('saswp_modify_lorh_schema_output', $input1 );
515
+
516
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
517
  $service = new saswp_output_service();
518
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
527
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#HinduTemple';
528
  $input1['address']['@type'] = 'PostalAddress';
529
 
530
+ $input1 = apply_filters('saswp_modify_hindu_temple_schema_output', $input1 );
531
+
532
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
533
  $service = new saswp_output_service();
534
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
543
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Church';
544
  $input1['address']['@type'] = 'PostalAddress';
545
 
546
+ $input1 = apply_filters('saswp_modify_church_schema_output', $input1 );
547
+
548
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
549
  $service = new saswp_output_service();
550
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
559
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Mosque';
560
  $input1['address']['@type'] = 'PostalAddress';
561
 
562
+ $input1 = apply_filters('saswp_modify_mosque_schema_output', $input1 );
563
+
564
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
565
  $service = new saswp_output_service();
566
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
579
  $input1['baseSalary']['@type'] = 'MonetaryAmount';
580
  $input1['baseSalary']['value']['@type'] = 'QuantitativeValue';
581
 
582
+ $input1 = apply_filters('saswp_modify_jobposting_schema_output', $input1 );
583
+
584
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
585
  $service = new saswp_output_service();
586
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
595
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Person';
596
  $input1['address']['@type'] = 'PostalAddress';
597
 
598
+ $input1 = apply_filters('saswp_modify_person_schema_output', $input1 );
599
+
600
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
601
  $service = new saswp_output_service();
602
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
628
  'sameAs' => get_home_url()
629
  )
630
  );
631
+
 
 
 
 
632
  if(!empty($aggregateRating)){
633
  $input1['aggregateRating'] = $aggregateRating;
634
  }
639
  $input1['comment'] = saswp_get_comments(get_the_ID());
640
  }
641
 
642
+ $input1 = apply_filters('saswp_modify_course_schema_output', $input1 );
643
+
644
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
645
+ $service = new saswp_output_service();
646
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
647
+ }
648
  }
649
 
650
  if( 'DiscussionForumPosting' === $schema_type){
691
  $input1 = array_merge($input1, $publisher);
692
 
693
  }
694
+
 
 
 
 
695
  if(!empty($aggregateRating)){
696
  $input1['aggregateRating'] = $aggregateRating;
697
  }
703
  }
704
 
705
  $input1 = apply_filters('saswp_modify_d_forum_posting_schema_output', $input1 );
706
+
707
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
708
+ $service = new saswp_output_service();
709
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
710
+ }
711
  }
712
 
713
  if( 'Blogposting' === $schema_type){
732
  $input1 = array_merge($input1, $publisher);
733
 
734
  }
 
 
 
 
 
735
 
736
  if(!empty($aggregateRating)){
737
  $input1['aggregateRating'] = $aggregateRating;
744
  }
745
 
746
  $input1 = apply_filters('saswp_modify_blogposting_schema_output', $input1 );
747
+
748
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
749
+ $service = new saswp_output_service();
750
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
751
+ }
752
  }
753
 
754
  if( 'AudioObject' === $schema_type){
778
  }
779
 
780
  $input1 = saswp_append_fetched_reviews($input1);
781
+
782
+
783
+ $input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
784
 
785
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
786
  $service = new saswp_output_service();
787
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
788
  }
 
 
789
  }
790
 
791
  if( 'Event' === $schema_type){
807
  }
808
 
809
  $input1 = saswp_append_fetched_reviews($input1);
810
+
811
+ $input1 = apply_filters('saswp_modify_event_schema_output', $input1 );
812
 
813
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
814
  $service = new saswp_output_service();
815
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
816
  }
 
 
817
 
818
  }
819
 
843
  }
844
 
845
  $input1 = saswp_append_fetched_reviews($input1);
846
+
847
+ $input1 = apply_filters('saswp_modify_software_application_schema_output', $input1 );
848
 
849
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
850
  $service = new saswp_output_service();
851
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
852
  }
 
 
853
  }
854
 
855
  if( 'WebPage' === $schema_type){
856
 
857
  $service = new saswp_output_service();
858
  $input1 = $service->saswp_schema_markup_generator($schema_type);
859
+
 
 
 
 
860
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
861
  $input1['comment'] = saswp_get_comments(get_the_ID());
862
  }
867
  $input1 = array_merge($input1, $extra_theme_review);
868
  }
869
 
870
+ $input1 = apply_filters('saswp_modify_webpage_schema_output', $input1 );
871
+
872
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
873
+ $service = new saswp_output_service();
874
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
875
+ }
876
  }
877
 
878
  if( 'Article' === $schema_type ){
879
 
880
  $service = new saswp_output_service();
881
  $input1 = $service->saswp_schema_markup_generator($schema_type);
882
+
 
 
 
 
883
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
884
  $input1['comment'] = saswp_get_comments(get_the_ID());
885
  }
886
  $input1 = apply_filters('saswp_modify_article_schema_output', $input1 );
887
+
888
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
889
+ $service = new saswp_output_service();
890
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
891
+ }
892
  }
893
 
894
  if( 'TechArticle' === $schema_type ){
895
 
896
  $service = new saswp_output_service();
897
  $input1 = $service->saswp_schema_markup_generator($schema_type);
898
+
 
 
 
 
899
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
900
  $input1['comment'] = saswp_get_comments(get_the_ID());
901
  }
904
  }
905
 
906
  $input1 = apply_filters('saswp_modify_tech_article_schema_output', $input1 );
907
+
908
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
909
+ $service = new saswp_output_service();
910
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
911
+ }
912
  }
913
 
914
  if( 'Recipe' === $schema_type){
987
  $input1 = $service_object->saswp_bb_press_topic_details(get_the_ID());
988
 
989
  }
990
+
991
+
992
+ $input1 = apply_filters('saswp_modify_qanda_schema_output', $input1 );
993
+
994
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
995
  $service = new saswp_output_service();
996
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
997
  }
 
 
998
  }
999
 
1000
  if( 'Product' === $schema_type){
1003
  $input1 = $service->saswp_schema_markup_generator($schema_type);
1004
 
1005
  $input1 = saswp_append_fetched_reviews($input1);
1006
+
1007
+ $input1 = apply_filters('saswp_modify_product_schema_output', $input1 );
1008
 
1009
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1010
 
1012
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1013
 
1014
  }
 
 
1015
  }
1016
 
1017
  if( 'NewsArticle' === $schema_type ){
1052
 
1053
  $input1 = array_merge($input1, $publisher);
1054
 
1055
+ }
 
 
 
 
1056
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
1057
  $input1['comment'] = saswp_get_comments(get_the_ID());
1058
  }
1065
  }
1066
 
1067
  $input1 = apply_filters('saswp_modify_news_article_schema_output', $input1 );
1068
+
1069
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1070
+ $service = new saswp_output_service();
1071
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1072
+ }
1073
+
1074
  }
1075
 
1076
  if( 'Service' === $schema_type ){
1087
  }
1088
 
1089
  $input1 = saswp_append_fetched_reviews($input1);
1090
+
1091
+ $input1 = apply_filters('saswp_modify_service_schema_output', $input1 );
1092
 
1093
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1094
 
1097
 
1098
  }
1099
 
 
1100
  }
1101
 
1102
  if('Review' === $schema_type){
1103
 
1104
+ $schema_data = saswp_get_schema_data($schema_post_id, 'saswp_review_schema_details');
1105
+ $service = new saswp_output_service();
1106
+ $review_markup = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1107
+
1108
+ $item_reviewed = $schema_data['saswp_review_schema_item_type'];
1109
+
1110
+ if($item_reviewed == 'local_business'){
1111
+ $item_reviewed = 'LocalBusiness';
1112
+ }
1113
+
1114
+ $input1['@context'] = saswp_context_url();
1115
+ $input1['@type'] = 'Review';
1116
+ $input1['@id'] = trailingslashit(saswp_get_permalink()).'#Review';
1117
+ $input1['itemReviewed']['@type'] = $item_reviewed;
1118
 
1119
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1120
+
 
 
 
1121
  if($review_markup){
1122
 
 
 
 
 
1123
  if(isset($review_markup['review'])){
1124
 
1125
  $input1 = $input1 + $review_markup['review'];
1126
 
1127
  }
1128
 
1129
+ if(isset($review_markup['item_reviewed'])){
1130
+ $item_reviewed = array( '@type' => $item_reviewed) + $review_markup['item_reviewed'];
 
1131
  $input1['itemReviewed'] = $item_reviewed;
1132
 
1133
  }
1134
 
1135
  }
1136
  }
1137
+
1138
  if(isset($sd_data['saswp-tagyeem']) && $sd_data['saswp-tagyeem'] == 1 && (is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah') ){
1139
 
1140
  remove_action( 'TieLabs/after_post_entry', 'tie_article_schemas' );
1209
  'description' => $description,
1210
  'name' => saswp_get_the_title(),
1211
  'uploadDate' => esc_html($date),
1212
+ 'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
 
 
 
 
1213
  'author' => saswp_get_author_details()
1214
  );
1215
  if(!empty($publisher)){
1228
  }
1229
 
1230
  $input1 = saswp_append_fetched_reviews($input1);
1231
+ $input1 = apply_filters('saswp_modify_video_object_schema_output', $input1 );
1232
 
1233
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1234
  $service = new saswp_output_service();
1235
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1236
  }
1237
+
 
1238
  }
1239
 
1240
  if( 'local_business' === $schema_type){
1269
  }
1270
 
1271
  $input1 = saswp_append_fetched_reviews($input1);
1272
+
1273
+ $input1 = apply_filters('saswp_modify_local_business_schema_output', $input1 );
1274
 
1275
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1276
  $service = new saswp_output_service();
1277
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1278
  }
 
 
1279
  }
1280
 
1281
  //Speakable schema
1300
  global $without_aggregate;
1301
 
1302
  if(!in_array($schema_type, $without_aggregate)){
1303
+
1304
+
1305
+ if($schema_type == 'Review'){
1306
+
1307
+ //kk star rating
1308
 
1309
  $kkstar_aggregateRating = saswp_extract_kk_star_ratings();
1310
 
1311
  if(!empty($kkstar_aggregateRating)){
1312
+ $input1['itemReviewed']['aggregateRating'] = $kkstar_aggregateRating;
1313
  }
1314
 
1315
  //wp post-rating star rating
1317
  $wp_post_rating_ar = saswp_extract_wp_post_ratings();
1318
 
1319
  if(!empty($wp_post_rating_ar)){
1320
+ $input1['itemReviewed']['aggregateRating'] = $wp_post_rating_ar;
1321
+ }
1322
+
1323
+ }else{
1324
+
1325
+ //kk star rating
1326
+
1327
+ $kkstar_aggregateRating = saswp_extract_kk_star_ratings();
1328
+
1329
+ if(!empty($kkstar_aggregateRating)){
1330
+ $input1['aggregateRating'] = $kkstar_aggregateRating;
1331
+ }
1332
+
1333
+ //wp post-rating star rating
1334
+
1335
+ $wp_post_rating_ar = saswp_extract_wp_post_ratings();
1336
+
1337
+ if(!empty($wp_post_rating_ar)){
1338
+ $input1['aggregateRating'] = $wp_post_rating_ar;
1339
+ }
1340
+
1341
+ }
1342
+
1343
+
1344
 
1345
  }
1346
 
output/output_post_specific.php CHANGED
@@ -220,36 +220,7 @@ function saswp_post_specific_schema_output() {
220
 
221
  if( 'MusicPlaylist' === $schema_type){
222
 
223
- $input1['@context'] = saswp_context_url();
224
- $input1['@type'] = 'MusicPlaylist';
225
- $input1['@id'] = trailingslashit(get_permalink()).'#MusicPlaylist';
226
- $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_music_playlist_url_'.$schema_id, 'saswp_array');
227
- $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_music_playlist_name_'.$schema_id, 'saswp_array');
228
- $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_music_playlist_description_'.$schema_id, 'saswp_array');
229
-
230
- $faq_question = get_post_meta($schema_post_id, 'music_playlist_track_'.$schema_id, true);
231
-
232
-
233
- $faq_question_arr = array();
234
-
235
- if(!empty($faq_question)){
236
-
237
- $input1['numTracks'] = count($faq_question);
238
-
239
- foreach($faq_question as $val){
240
-
241
- $supply_data = array();
242
- $supply_data['@type'] = 'MusicRecording';
243
- $supply_data['byArtist'] = $val['saswp_music_playlist_track_artist'];
244
- $supply_data['duration'] = $val['saswp_music_playlist_track_duration'];
245
- $supply_data['inAlbum'] = $val['saswp_music_playlist_track_inalbum'];
246
- $supply_data['name'] = $val['saswp_music_playlist_track_name'];
247
- $supply_data['url'] = $val['saswp_music_playlist_track_url'];
248
-
249
- $faq_question_arr[] = $supply_data;
250
- }
251
- $input1['track'] = $faq_question_arr;
252
- }
253
 
254
  $input1 = saswp_append_fetched_reviews($input1);
255
 
@@ -486,42 +457,7 @@ function saswp_post_specific_schema_output() {
486
 
487
  if( 'Book' === $schema_type){
488
 
489
- $howto_image = get_post_meta( get_the_ID(), 'saswp_book_image_'.$schema_id.'_detail',true);
490
-
491
- $input1['@context'] = saswp_context_url();
492
- $input1['@type'] = 'Book';
493
- $input1['@id'] = trailingslashit(get_permalink()).'#Book';
494
- $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_book_url_'.$schema_id, 'saswp_array');
495
- $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_book_name_'.$schema_id, 'saswp_array');
496
- $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_book_description_'.$schema_id, 'saswp_array');
497
-
498
- if(!(empty($howto_image))){
499
-
500
- $input1['image']['@type'] = 'ImageObject';
501
- $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
502
- $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
503
- $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
504
-
505
- }
506
-
507
- $input1['author'] = saswp_remove_warnings($all_post_meta, 'saswp_book_author_'.$schema_id, 'saswp_array');
508
- $input1['datePublished'] = isset($all_post_meta['saswp_book_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_book_date_published_'.$schema_id][0])):'';
509
- $input1['isbn'] = saswp_remove_warnings($all_post_meta, 'saswp_book_isbn_'.$schema_id, 'saswp_array');
510
- $input1['numberOfPages'] = saswp_remove_warnings($all_post_meta, 'saswp_book_no_of_page_'.$schema_id, 'saswp_array');
511
- $input1['publisher'] = saswp_remove_warnings($all_post_meta, 'saswp_book_publisher_'.$schema_id, 'saswp_array');
512
-
513
- if(isset($all_post_meta['saswp_book_price_'.$schema_id]) && isset($all_post_meta['saswp_book_price_currency_'.$schema_id])){
514
- $input1['offers']['@type'] = 'Offer';
515
- $input1['offers']['availability'] = saswp_remove_warnings($all_post_meta, 'saswp_book_availability_'.$schema_id, 'saswp_array');
516
- $input1['offers']['price'] = $all_post_meta['saswp_book_price_'.$schema_id];
517
- $input1['offers']['priceCurrency'] = $all_post_meta['saswp_book_price_currency_'.$schema_id];
518
- }
519
-
520
- if(isset($all_post_meta['saswp_book_enable_rating_'.$schema_id]) && isset($all_post_meta['saswp_book_rating_value_'.$schema_id]) && isset($all_post_meta['saswp_book_rating_count_'.$schema_id])){
521
- $input1['aggregateRating']['@type'] = 'aggregateRating';
522
- $input1['aggregateRating']['ratingValue'] = $all_post_meta['saswp_book_rating_value_'.$schema_id];
523
- $input1['aggregateRating']['ratingCount'] = $all_post_meta['saswp_book_rating_count_'.$schema_id];
524
- }
525
 
526
  $input1 = saswp_append_fetched_reviews($input1);
527
 
@@ -739,149 +675,8 @@ function saswp_post_specific_schema_output() {
739
 
740
  if( 'HowTo' === $schema_type){
741
 
742
- $howto_image = get_post_meta( get_the_ID(), 'saswp_howto_schema_image_'.$schema_id.'_detail',true);
743
-
744
- $tool = get_post_meta($schema_post_id, 'howto_tool_'.$schema_id, true);
745
- $step = get_post_meta($schema_post_id, 'howto_step_'.$schema_id, true);
746
- $supply = get_post_meta($schema_post_id, 'howto_supply_'.$schema_id, true);
747
-
748
- $input1['@context'] = saswp_context_url();
749
- $input1['@type'] = 'HowTo';
750
- $input1['@id'] = trailingslashit(get_permalink()).'#HowTo';
751
- $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_name_'.$schema_id, 'saswp_array');
752
- $input1['datePublished'] = isset($all_post_meta['saswp_howto_ec_schema_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_howto_ec_schema_date_published_'.$schema_id][0])):'';
753
- $input1['dateModified'] = isset($all_post_meta['saswp_howto_ec_schema_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_howto_ec_schema_date_modified_'.$schema_id][0])):'';
754
- $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_description_'.$schema_id, 'saswp_array');
755
-
756
- if(!(empty($howto_image))){
757
 
758
- $input1['image']['@type'] = 'ImageObject';
759
- $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
760
- $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
761
- $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
762
-
763
- }
764
-
765
- if(saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_currency_'.$schema_id, 'saswp_array') !='' && saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_value_'.$schema_id, 'saswp_array') !='')
766
- {
767
- $input1['estimatedCost']['@type'] = 'MonetaryAmount';
768
- $input1['estimatedCost']['currency']= saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_currency_'.$schema_id, 'saswp_array');
769
- $input1['estimatedCost']['value'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_ec_schema_value_'.$schema_id, 'saswp_array');
770
- }
771
-
772
-
773
- $supply_arr = array();
774
- if(!empty($supply)){
775
-
776
- foreach($supply as $val){
777
-
778
- $supply_data = array();
779
-
780
- if($val['saswp_howto_supply_name'] || $val['saswp_howto_supply_url']){
781
- $supply_data['@type'] = 'HowToSupply';
782
- $supply_data['name'] = $val['saswp_howto_supply_name'];
783
- $supply_data['url'] = $val['saswp_howto_supply_url'];
784
- }
785
-
786
-
787
-
788
- if(isset($val['saswp_howto_supply_image_id']) && $val['saswp_howto_supply_image_id'] !=''){
789
-
790
- $image_details = wp_get_attachment_image_src($val['saswp_howto_supply_image_id']);
791
-
792
- $supply_data['image']['@type'] = 'ImageObject';
793
- $supply_data['image']['url'] = esc_url($image_details[0]);
794
- $supply_data['image']['width'] = esc_attr($image_details[1]);
795
- $supply_data['image']['height'] = esc_attr($image_details[2]);
796
-
797
-
798
-
799
- }
800
- $supply_arr[] = $supply_data;
801
- }
802
- $input1['supply'] = $supply_arr;
803
- }
804
-
805
- $tool_arr = array();
806
- if(!empty($tool)){
807
-
808
- foreach($tool as $val){
809
-
810
- $supply_data = array();
811
-
812
- if($val['saswp_howto_tool_name'] || $val['saswp_howto_tool_url']){
813
- $supply_data['@type'] = 'HowToTool';
814
- $supply_data['name'] = $val['saswp_howto_tool_name'];
815
- $supply_data['url'] = $val['saswp_howto_tool_url'];
816
- }
817
-
818
- if(isset($val['saswp_howto_tool_image_id']) && $val['saswp_howto_tool_image_id'] !=''){
819
-
820
- $image_details = wp_get_attachment_image_src($val['saswp_howto_tool_image_id']);
821
-
822
- $supply_data['image']['@type'] = 'ImageObject';
823
- $supply_data['image']['url'] = esc_url($image_details[0]);
824
- $supply_data['image']['width'] = esc_attr($image_details[1]);
825
- $supply_data['image']['height'] = esc_attr($image_details[2]);
826
-
827
-
828
-
829
- }
830
- $tool_arr[] = $supply_data;
831
- }
832
- $input1['tool'] = $tool_arr;
833
- }
834
-
835
- //step
836
-
837
- $step_arr = array();
838
- if(!empty($step)){
839
-
840
- foreach($step as $key => $val){
841
-
842
- $supply_data = array();
843
- $direction = array();
844
- $tip = array();
845
-
846
- if($val['saswp_howto_direction_text']){
847
- $direction['@type'] = 'HowToDirection';
848
- $direction['text'] = $val['saswp_howto_direction_text'];
849
- }
850
-
851
- if($val['saswp_howto_tip_text']){
852
-
853
- $tip['@type'] = 'HowToTip';
854
- $tip['text'] = $val['saswp_howto_tip_text'];
855
-
856
- }
857
-
858
- $supply_data['@type'] = 'HowToStep';
859
- $supply_data['url'] = trailingslashit(get_permalink()).'#step'.++$key;
860
- $supply_data['name'] = $val['saswp_howto_step_name'];
861
-
862
- if($direction['text'] || $tip['text']){
863
- $supply_data['itemListElement'] = array($direction, $tip);
864
- }
865
-
866
- if(isset($val['saswp_howto_step_image_id']) && $val['saswp_howto_step_image_id'] !=''){
867
-
868
- $image_details = wp_get_attachment_image_src($val['saswp_howto_step_image_id']);
869
- $supply_data['image']['@type'] = 'ImageObject';
870
- $supply_data['image']['url'] = esc_url($image_details[0]);
871
- $supply_data['image']['width'] = esc_attr($image_details[1]);
872
- $supply_data['image']['height'] = esc_attr($image_details[2]);
873
-
874
- }
875
-
876
- $step_arr[] = $supply_data;
877
-
878
- }
879
-
880
- $input1['step'] = $step_arr;
881
-
882
- }
883
-
884
- $input1['totalTime'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_totaltime_'.$schema_id, 'saswp_array');
885
  $input1 = saswp_append_fetched_reviews($input1);
886
 
887
  }
@@ -1023,54 +818,8 @@ function saswp_post_specific_schema_output() {
1023
 
1024
  if( 'VideoGame' === $schema_type){
1025
 
1026
- $howto_image = get_post_meta( get_the_ID(), 'saswp_vg_schema_image_'.$schema_id.'_detail',true);
1027
-
1028
-
1029
- $input1['@context'] = saswp_context_url();
1030
- $input1['@type'] = 'VideoGame';
1031
- $input1['@id'] = trailingslashit(get_permalink()).'#VideoGame';
1032
- $input1['name'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_name_'.$schema_id, 'saswp_array');
1033
- $input1['url'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_url_'.$schema_id, 'saswp_array');
1034
- $input1['description'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_description_'.$schema_id, 'saswp_array');
1035
-
1036
- if(!(empty($howto_image))){
1037
-
1038
- $input1['image']['@type'] = 'ImageObject';
1039
- $input1['image']['url'] = isset($howto_image['thumbnail']) ? esc_url($howto_image['thumbnail']):'';
1040
- $input1['image']['height'] = isset($howto_image['width']) ? esc_attr($howto_image['width']) :'';
1041
- $input1['image']['width'] = isset($howto_image['height']) ? esc_attr($howto_image['height']) :'';
1042
-
1043
- }
1044
-
1045
- $input1['operatingSystem'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_operating_system_'.$schema_id, 'saswp_array');
1046
- $input1['applicationCategory'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_application_category_'.$schema_id, 'saswp_array');
1047
-
1048
- $input1['author']['@type'] = 'Organization';
1049
- $input1['author']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_author_name_'.$schema_id, 'saswp_array');
1050
-
1051
- $input1['offers']['@type'] = 'Offer';
1052
- $input1['offers']['price'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_price_'.$schema_id, 'saswp_array');
1053
- $input1['offers']['priceCurrency'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_price_currency_'.$schema_id, 'saswp_array');
1054
- $input1['offers']['availability'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_price_availability_'.$schema_id, 'saswp_array');
1055
-
1056
-
1057
- $input1['publisher'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_publisher_'.$schema_id, 'saswp_array');
1058
- $input1['genre'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_genre_'.$schema_id, 'saswp_array');
1059
- $input1['processorRequirements'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_processor_requirements_'.$schema_id, 'saswp_array');
1060
- $input1['memoryRequirements'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_memory_requirements_'.$schema_id, 'saswp_array');
1061
- $input1['storageRequirements'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_storage_requirements_'.$schema_id, 'saswp_array');
1062
- $input1['gamePlatform'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_game_platform_'.$schema_id, 'saswp_array');
1063
- $input1['cheatCode'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_cheat_code_'.$schema_id, 'saswp_array');
1064
-
1065
-
1066
- if( saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_review_count_'.$schema_id, 'saswp_array')){
1067
-
1068
- $input1['aggregateRating']['@type'] = 'AggregateRating';
1069
- $input1['aggregateRating']['ratingValue'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_rating_'.$schema_id, 'saswp_array');
1070
- $input1['aggregateRating']['ratingCount'] = saswp_remove_warnings($all_post_meta, 'saswp_vg_schema_review_count_'.$schema_id, 'saswp_array');
1071
-
1072
- }
1073
-
1074
  $input1 = saswp_append_fetched_reviews($input1);
1075
 
1076
  }
@@ -1117,7 +866,7 @@ function saswp_post_specific_schema_output() {
1117
  }
1118
  }
1119
 
1120
- if( 'DataFeed' === $schema_type){
1121
 
1122
 
1123
  $input1 = array(
@@ -1159,65 +908,8 @@ function saswp_post_specific_schema_output() {
1159
 
1160
  if( 'Event' === $schema_type){
1161
 
1162
- $event_image = get_post_meta( get_the_ID(), 'saswp_event_schema_image_'.$schema_id.'_detail',true);
1163
-
1164
- $input1 = array(
1165
- '@context' => saswp_context_url(),
1166
- '@type' => (isset($all_post_meta['saswp_event_schema_type_'.$schema_id][0]) && $all_post_meta['saswp_event_schema_type_'.$schema_id][0] !='') ? $all_post_meta['saswp_event_schema_type_'.$schema_id][0] : 'Event' ,
1167
- '@id' => trailingslashit(get_permalink()).'#event',
1168
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_name_'.$schema_id, 'saswp_array'),
1169
- 'description' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_description_'.$schema_id, 'saswp_array'),
1170
- 'startDate' => isset($all_post_meta['saswp_event_schema_start_date_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_event_schema_start_date_'.$schema_id][0])):'',
1171
- 'endDate' => isset($all_post_meta['saswp_event_schema_end_date_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_event_schema_end_date_'.$schema_id][0])):'',
1172
- 'image' => array(
1173
- '@type' =>'ImageObject',
1174
- 'url' => isset($event_image['thumbnail']) ? esc_url($event_image['thumbnail']):'' ,
1175
- 'width' => isset($event_image['width']) ? esc_attr($event_image['width']) :'' ,
1176
- 'height' => isset($event_image['height']) ? esc_attr($event_image['height']) :'' ,
1177
- ),
1178
- 'location' => array(
1179
- '@type' => 'Place',
1180
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_name_'.$schema_id, 'saswp_array'),
1181
- 'address' => array(
1182
- '@type' => 'PostalAddress',
1183
- 'streetAddress' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_streetaddress_'.$schema_id, 'saswp_array'),
1184
- 'addressLocality' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_locality_'.$schema_id, 'saswp_array'),
1185
- 'postalCode' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_postalcode_'.$schema_id, 'saswp_array'),
1186
- 'addressRegion' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_location_region_'.$schema_id, 'saswp_array'),
1187
- )
1188
- ),
1189
- 'offers' => array(
1190
- '@type' => 'Offer',
1191
- 'url' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_url_'.$schema_id, 'saswp_array'),
1192
- 'price' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_price_'.$schema_id, 'saswp_array'),
1193
- 'priceCurrency' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_price_currency_'.$schema_id, 'saswp_array'),
1194
- 'availability' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_availability_'.$schema_id, 'saswp_array'),
1195
- 'validFrom' => isset($all_post_meta['saswp_event_schema_validfrom_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_event_schema_validfrom_'.$schema_id][0])):'',
1196
- )
1197
- );
1198
-
1199
-
1200
- $performer = get_post_meta($schema_post_id, 'performer_'.$schema_id, true);
1201
-
1202
- $performer_arr = array();
1203
-
1204
- if(!empty($performer)){
1205
-
1206
- foreach($performer as $val){
1207
-
1208
- $supply_data = array();
1209
- $supply_data['@type'] = $val['saswp_event_performer_type'];
1210
- $supply_data['name'] = $val['saswp_event_performer_name'];
1211
- $supply_data['url'] = $val['saswp_event_performer_url'];
1212
-
1213
- $performer_arr[] = $supply_data;
1214
- }
1215
-
1216
- $input1['performer'] = $performer_arr;
1217
-
1218
- }
1219
-
1220
-
1221
  if(!empty($aggregateRating)){
1222
  $input1['aggregateRating'] = $aggregateRating;
1223
  }
@@ -1269,21 +961,7 @@ function saswp_post_specific_schema_output() {
1269
 
1270
  if( 'Course' === $schema_type){
1271
 
1272
- $input1 = array(
1273
- '@context' => saswp_context_url(),
1274
- '@type' => 'Course' ,
1275
- '@id' => trailingslashit(get_permalink()).'#course',
1276
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_course_name_'.$schema_id, 'saswp_array'),
1277
- 'description' => saswp_remove_warnings($all_post_meta, 'saswp_course_description_'.$schema_id, 'saswp_array'),
1278
- 'url' => saswp_remove_warnings($all_post_meta, 'saswp_course_url_'.$schema_id, 'saswp_array'),
1279
- 'datePublished' => isset($all_post_meta['saswp_course_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_course_date_published_'.$schema_id][0])):'',
1280
- 'dateModified' => isset($all_post_meta['saswp_course_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_course_date_modified_'.$schema_id][0])):'',
1281
- 'provider' => array(
1282
- '@type' => 'Organization',
1283
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_course_provider_name_'.$schema_id, 'saswp_array'),
1284
- 'sameAs' => saswp_remove_warnings($all_post_meta, 'saswp_course_sameas_'.$schema_id, 'saswp_array')
1285
- )
1286
- );
1287
 
1288
  if(!empty($aggregateRating)){
1289
 
@@ -1389,44 +1067,8 @@ function saswp_post_specific_schema_output() {
1389
 
1390
  if( 'SoftwareApplication' === $schema_type){
1391
 
1392
- $input1 = array(
1393
- '@context' => saswp_context_url(),
1394
- '@type' => 'SoftwareApplication',
1395
- '@id' => trailingslashit(get_permalink()).'#softwareapplication',
1396
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_name_'.$schema_id, 'saswp_array'),
1397
- 'description' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_description_'.$schema_id, 'saswp_array'),
1398
- 'operatingSystem' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_operating_system_'.$schema_id, 'saswp_array'),
1399
- 'applicationCategory' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_application_category_'.$schema_id, 'saswp_array'),
1400
- 'offers' => array(
1401
- '@type' => 'Offer',
1402
- 'price' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_price_'.$schema_id, 'saswp_array'),
1403
- 'priceCurrency' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_price_currency_'.$schema_id, 'saswp_array'),
1404
- ),
1405
- 'datePublished' => isset($all_post_meta['saswp_software_schema_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_software_schema_date_published_'.$schema_id][0])):'',
1406
- 'dateModified' => isset($all_post_meta['saswp_software_schema_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_software_schema_date_modified_'.$schema_id][0])):'',
1407
-
1408
- );
1409
-
1410
- $soft_image = get_post_meta( get_the_ID(), 'saswp_software_schema_image_'.$schema_id.'_detail',true);
1411
-
1412
- if(!(empty($soft_image))){
1413
-
1414
- $input1['image']['@type'] = 'ImageObject';
1415
- $input1['image']['url'] = isset($soft_image['thumbnail']) ? esc_url($soft_image['thumbnail']):'';
1416
- $input1['image']['height'] = isset($soft_image['width']) ? esc_attr($soft_image['width']) :'';
1417
- $input1['image']['width'] = isset($soft_image['height']) ? esc_attr($soft_image['height']) :'';
1418
-
1419
- }
1420
-
1421
- if(saswp_remove_warnings($all_post_meta, 'saswp_software_schema_enable_rating_'.$schema_id, 'saswp_array') == 1){
1422
-
1423
- $input1['aggregateRating'] = array(
1424
- "@type" => "AggregateRating",
1425
- "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_rating_'.$schema_id, 'saswp_array'),
1426
- "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_rating_count_'.$schema_id, 'saswp_array')
1427
- );
1428
- }
1429
-
1430
  if(!empty($aggregateRating)){
1431
  $input1['aggregateRating'] = $aggregateRating;
1432
  }
@@ -1620,130 +1262,8 @@ function saswp_post_specific_schema_output() {
1620
 
1621
  if( 'Recipe' === $schema_type){
1622
 
1623
- $recipe_logo = get_post_meta( get_the_ID(), 'saswp_recipe_organization_logo_'.$schema_id.'_detail',true);
1624
- $recipe_image = get_post_meta( get_the_ID(), 'saswp_recipe_image_'.$schema_id.'_detail',true);
1625
- $recipe_author_image = get_post_meta( get_the_ID(), 'saswp_recipe_author_image_'.$schema_id.'_detail',true);
1626
-
1627
- $ingredient = array();
1628
- $instruction = array();
1629
-
1630
- if(isset($all_post_meta['saswp_recipe_ingredient_'.$schema_id])){
1631
-
1632
- $explod = explode(';', $all_post_meta['saswp_recipe_ingredient_'.$schema_id][0]);
1633
-
1634
- if($explod){
1635
-
1636
- foreach ($explod as $val){
1637
-
1638
- $ingredient[] = $val;
1639
-
1640
- }
1641
-
1642
- }
1643
-
1644
-
1645
-
1646
- }
1647
-
1648
- if(isset($all_post_meta['saswp_recipe_instructions_'.$schema_id])){
1649
-
1650
- $explod = explode(';', $all_post_meta['saswp_recipe_instructions_'.$schema_id][0]);
1651
-
1652
- if($explod){
1653
-
1654
- foreach ($explod as $val){
1655
-
1656
- $instruction[] = array(
1657
- '@type' => "HowToStep",
1658
- 'text' => $val,
1659
- );
1660
-
1661
- }
1662
-
1663
- }
1664
-
1665
- }
1666
-
1667
- $input1 = array(
1668
- '@context' => saswp_context_url(),
1669
- '@type' => $schema_type ,
1670
- '@id' => trailingslashit(get_permalink()).'#recipe',
1671
- 'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_url_'.$schema_id, 'saswp_array'),
1672
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_name_'.$schema_id, 'saswp_array'),
1673
- 'image' =>array(
1674
- '@type' => 'ImageObject',
1675
- 'url' => saswp_remove_warnings( $recipe_image, 'thumbnail', 'saswp_string'),
1676
- 'width' => saswp_remove_warnings( $recipe_image, 'width', 'saswp_string'),
1677
- 'height' => saswp_remove_warnings( $recipe_image , 'height', 'saswp_string'),
1678
- ),
1679
- 'author' => array(
1680
- '@type' => 'Person',
1681
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_name_'.$schema_id, 'saswp_array'),
1682
- 'description' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_description_'.$schema_id, 'saswp_array'),
1683
- 'Image' => array(
1684
- '@type' => 'ImageObject',
1685
- 'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_author_image_'.$schema_id, 'saswp_array'),
1686
- 'height' => saswp_remove_warnings($recipe_author_image, 'height', 'saswp_string'),
1687
- 'width' => saswp_remove_warnings($recipe_author_image, 'width', 'saswp_string')
1688
- ),
1689
- ),
1690
-
1691
-
1692
- 'prepTime' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_preptime_'.$schema_id, 'saswp_array'),
1693
- 'cookTime' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_cooktime_'.$schema_id, 'saswp_array'),
1694
- 'totalTime' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_totaltime_'.$schema_id, 'saswp_array'),
1695
- 'keywords' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_keywords_'.$schema_id, 'saswp_array'),
1696
- 'recipeYield' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_recipeyield_'.$schema_id, 'saswp_array'),
1697
- 'recipeCategory' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_category_'.$schema_id, 'saswp_array'),
1698
- 'recipeCuisine' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_cuisine_'.$schema_id, 'saswp_array'),
1699
- 'nutrition' => array(
1700
- '@type' => "NutritionInformation",
1701
- 'calories' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_nutrition_'.$schema_id, 'saswp_array'),
1702
- ),
1703
- 'recipeIngredient' => $ingredient,
1704
- 'recipeInstructions' => $instruction,
1705
- 'datePublished' => isset($all_post_meta['saswp_recipe_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_recipe_date_published_'.$schema_id][0])):'',
1706
- 'dateModified' => isset($all_post_meta['saswp_recipe_date_modified_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_recipe_date_modified_'.$schema_id][0])):'',
1707
- 'description' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_description_'.$schema_id, 'saswp_array'),
1708
- 'mainEntity' => array(
1709
- '@type' => 'WebPage',
1710
- '@id' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_main_entity_'.$schema_id, 'saswp_array'),
1711
- 'publisher' => array(
1712
- '@type' => 'Organization',
1713
- 'logo' => array(
1714
- '@type' => 'ImageObject',
1715
- 'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_organization_logo_'.$schema_id, 'saswp_array'),
1716
- 'width' => saswp_remove_warnings($recipe_logo, 'width', 'saswp_string'),
1717
- 'height' => saswp_remove_warnings($recipe_logo, 'height', 'saswp_string'),
1718
- ),
1719
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_organization_name_'.$schema_id, 'saswp_array'),
1720
- ),
1721
- ),
1722
-
1723
-
1724
- );
1725
-
1726
- if(saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_name_'.$schema_id, 'saswp_array') !='' && saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_thumbnailurl_'.$schema_id, 'saswp_array') !='' && saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_description_'.$schema_id, 'saswp_array') !=''){
1727
-
1728
- $input1['video']['@type'] = 'VideoObject';
1729
- $input1['video']['name'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_name_'.$schema_id, 'saswp_array');
1730
- $input1['video']['description'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_description_'.$schema_id, 'saswp_array');
1731
- $input1['video']['thumbnailUrl'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_thumbnailurl_'.$schema_id, 'saswp_array');
1732
- $input1['video']['contentUrl'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_contenturl_'.$schema_id, 'saswp_array');
1733
- $input1['video']['embedUrl'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_embedurl_'.$schema_id, 'saswp_array');
1734
- $input1['video']['uploadDate'] = isset($all_post_meta['saswp_recipe_video_upload_date_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_recipe_video_upload_date_'.$schema_id][0])):'';
1735
- $input1['video']['duration'] = saswp_remove_warnings($all_post_meta, 'saswp_recipe_video_duration_'.$schema_id, 'saswp_array');
1736
- }
1737
-
1738
- if(saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_review_count_'.$schema_id, 'saswp_array')){
1739
-
1740
- $input1['aggregateRating'] = array(
1741
- "@type" => "AggregateRating",
1742
- "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_rating_'.$schema_id, 'saswp_array'),
1743
- "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_recipe_schema_review_count_'.$schema_id, 'saswp_array')
1744
- );
1745
- }
1746
-
1747
  if(!empty($aggregateRating)){
1748
  $input1['aggregateRating'] = $aggregateRating;
1749
  }
@@ -1755,126 +1275,16 @@ function saswp_post_specific_schema_output() {
1755
 
1756
  if( 'Product' === $schema_type){
1757
 
1758
- $product_image = get_post_meta( get_the_ID(), 'saswp_product_schema_image_'.$schema_id.'_detail',true);
1759
- $input1 = array(
1760
- '@context' => saswp_context_url(),
1761
- '@type' => 'Product',
1762
- '@id' => trailingslashit(get_permalink()).'#product',
1763
- 'url' => trailingslashit(get_permalink()),
1764
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_name_'.$schema_id, 'saswp_array'),
1765
- 'sku' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_sku_'.$schema_id, 'saswp_array'),
1766
- 'description' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_description_'.$schema_id, 'saswp_array'),
1767
- 'image' =>array(
1768
- '@type' => 'ImageObject',
1769
- 'url' => saswp_remove_warnings($product_image, 'thumbnail', 'saswp_string'),
1770
- 'width' => saswp_remove_warnings($product_image, 'width', 'saswp_string'),
1771
- 'height' => saswp_remove_warnings($product_image, 'height', 'saswp_string'),
1772
- ),
1773
- 'offers' => array(
1774
- '@type' => 'Offer',
1775
- 'availability' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_availability_'.$schema_id, 'saswp_array'),
1776
- 'itemCondition' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_condition_'.$schema_id, 'saswp_array'),
1777
- 'price' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_price_'.$schema_id, 'saswp_array'),
1778
- 'priceCurrency' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_currency_'.$schema_id, 'saswp_array'),
1779
- 'url' => trailingslashit(get_permalink()),
1780
- 'priceValidUntil' => isset($all_post_meta['saswp_product_schema_priceValidUntil_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_product_schema_priceValidUntil_'.$schema_id][0])):'',
1781
- ),
1782
- 'brand' => array('@type' => 'Thing',
1783
- 'name' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_brand_name_'.$schema_id, 'saswp_array'),
1784
- )
1785
- );
1786
-
1787
- if(isset($all_post_meta['saswp_product_schema_seller_'.$schema_id])){
1788
- $input1['offers']['seller']['@type'] = 'Organization';
1789
- $input1['offers']['seller']['name'] = esc_attr($all_post_meta['saswp_product_schema_seller_'.$schema_id][0]);
1790
- }
1791
- if(isset($all_post_meta['saswp_product_schema_gtin8_'.$schema_id])){
1792
- $input1['gtin8'] = esc_attr($all_post_meta['saswp_product_schema_gtin8_'.$schema_id][0]);
1793
- }
1794
- if(isset($all_post_meta['saswp_product_schema_mpn_'.$schema_id])){
1795
- $input1['mpn'] = esc_attr($all_post_meta['saswp_product_schema_mpn_'.$schema_id][0]);
1796
- }
1797
-
1798
- if(saswp_remove_warnings($all_post_meta, 'saswp_product_schema_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_product_schema_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_product_schema_review_count_'.$schema_id, 'saswp_array')){
1799
-
1800
- $input1['aggregateRating'] = array(
1801
- "@type" => "AggregateRating",
1802
- "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_rating_'.$schema_id, 'saswp_array'),
1803
- "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_review_count_'.$schema_id, 'saswp_array')
1804
- );
1805
- }
1806
-
1807
-
1808
- $itinerary = get_post_meta($schema_post_id, 'product_reviews_'.$schema_id, true);
1809
-
1810
- $itinerary_arr = array();
1811
-
1812
- if(!empty($itinerary)){
1813
-
1814
- foreach($itinerary as $review){
1815
-
1816
-
1817
- $review_fields = array();
1818
-
1819
- $review_fields['@type'] = 'Review';
1820
- $review_fields['author'] = esc_attr($review['saswp_product_reviews_reviewer_name']);
1821
- $review_fields['datePublished'] = esc_html($review['saswp_product_reviews_created_date']);
1822
- $review_fields['description'] = esc_textarea($review['saswp_product_reviews_text']);
1823
-
1824
- if(is_int($review['saswp_product_reviews_reviewer_rating'])){
1825
-
1826
- $review_fields['reviewRating']['@type'] = 'Rating';
1827
- $review_fields['reviewRating']['bestRating'] = '5';
1828
- $review_fields['reviewRating']['ratingValue'] = esc_attr($review['saswp_product_reviews_reviewer_rating']);
1829
- $review_fields['reviewRating']['worstRating'] = '1';
1830
-
1831
- }
1832
-
1833
- $itinerary_arr[] = $review_fields;
1834
- }
1835
- $input1['review'] = $itinerary_arr;
1836
- }
1837
-
1838
-
1839
  if(!empty($aggregateRating)){
1840
  $input1['aggregateRating'] = $aggregateRating;
1841
  }
1842
  if(!empty($extra_theme_review)){
1843
  $input1 = array_merge($input1, $extra_theme_review);
1844
  }
1845
-
1846
- $service = new saswp_output_service();
1847
- $product_details = $service->saswp_woocommerce_product_details(get_the_ID());
1848
-
1849
-
1850
- if(!empty($product_details['product_reviews'])){
1851
-
1852
- $reviews = array();
1853
-
1854
- foreach ($product_details['product_reviews'] as $review){
1855
-
1856
- $review_fields = array();
1857
-
1858
- $review_fields['@type'] = 'Review';
1859
- $review_fields['author'] = esc_attr($review['author']);
1860
- $review_fields['datePublished'] = esc_html($review['datePublished']);
1861
- $review_fields['description'] = $review['description'];
1862
-
1863
- if(isset($review['reviewRating']) && $review['reviewRating'] !=''){
1864
-
1865
- $review_fields['reviewRating']['@type'] = 'Rating';
1866
- $review_fields['reviewRating']['bestRating'] = '5';
1867
- $review_fields['reviewRating']['ratingValue'] = esc_attr($review['reviewRating']);
1868
- $review_fields['reviewRating']['worstRating'] = '1';
1869
-
1870
- }
1871
-
1872
- $reviews[] = $review_fields;
1873
-
1874
- }
1875
- $input1['review'] = $reviews;
1876
- }
1877
- $input1 = saswp_append_fetched_reviews($input1);
1878
  }
1879
 
1880
  if( 'NewsArticle' === $schema_type ){
@@ -2053,21 +1463,7 @@ function saswp_post_specific_schema_output() {
2053
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_name_'.$schema_id, 'saswp_array'),
2054
  'itemListElement' => $serviceOffer
2055
  );
2056
-
2057
- if(saswp_remove_warnings($all_post_meta, 'saswp_service_schema_enable_rating_'.$schema_id, 'saswp_array') == 1){
2058
- $input1['aggregateRating'] = array(
2059
- "@type" => "AggregateRating",
2060
- "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_rating_'.$schema_id, 'saswp_array'),
2061
- "reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_review_count_'.$schema_id, 'saswp_array')
2062
- );
2063
- }
2064
- if(!empty($aggregateRating)){
2065
- $input1['aggregateRating'] = $aggregateRating;
2066
- }
2067
- if(!empty($extra_theme_review)){
2068
- $input1 = array_merge($input1, $extra_theme_review);
2069
- }
2070
- $input1 = saswp_append_fetched_reviews($input1);
2071
  }
2072
 
2073
  if( 'Review' === $schema_type ){
@@ -2080,281 +1476,120 @@ function saswp_post_specific_schema_output() {
2080
 
2081
  $service = new saswp_output_service();
2082
 
2083
- $review_author = get_the_author();
2084
-
2085
- if(isset($all_post_meta['saswp_review_schema_author_'.$schema_id])){
2086
-
2087
- $review_author = $all_post_meta['saswp_review_schema_author_'.$schema_id][0];
2088
-
2089
- }
2090
-
2091
  $input1['@context'] = saswp_context_url();
2092
  $input1['@type'] = 'Review';
2093
  $input1['@id'] = trailingslashit(get_permalink()).'#review';
2094
- $input1['url'] = trailingslashit(get_permalink());
2095
- $input1['datePublished'] = get_the_date("c");
2096
- $input1['dateModified'] = get_the_modified_date("c");
2097
-
2098
- if($review_author){
2099
-
2100
- $input1['author']['@type'] = 'Person';
2101
- $input1['author']['name'] = esc_attr($review_author);
2102
-
2103
- if(isset($all_post_meta['saswp_review_schema_author_sameas_'.$schema_id])){
2104
-
2105
- $input1['author']['sameAs'] = esc_url($all_post_meta['saswp_review_schema_author_sameas_'.$schema_id][0]);
2106
-
2107
- }
2108
-
2109
- }
2110
 
2111
- if($site_name && $logo && $width && $height){
2112
-
2113
- $input1['publisher']['@type'] = 'Organization';
2114
- $input1['publisher']['name'] = esc_attr($site_name);
2115
- $input1['publisher']['logo']['@type'] = 'ImageObject';
2116
- $input1['publisher']['logo']['url'] = esc_url($logo);
2117
- $input1['publisher']['logo']['width'] = esc_attr($width);
2118
- $input1['publisher']['logo']['height'] = esc_attr($height);
2119
-
2120
- }
2121
-
2122
- if(isset($all_post_meta['saswp_review_schema_description_'.$schema_id])){
2123
-
2124
- $input1['reviewBody'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
2125
- $input1['description'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
2126
- }else {
2127
- $input1['reviewBody'] = saswp_get_the_excerpt();
2128
- $input1['description'] = saswp_get_the_excerpt();
2129
- }
2130
-
2131
- if(isset($all_post_meta['saswp_review_schema_item_type_'.$schema_id])){
2132
- $input1['itemReviewed']['@type'] = esc_attr($all_post_meta['saswp_review_schema_item_type_'.$schema_id][0]);
2133
- }
2134
- if(isset($all_post_meta['saswp_review_schema_name_'.$schema_id])){
2135
- $input1['itemReviewed']['name'] = esc_attr($all_post_meta['saswp_review_schema_name_'.$schema_id][0]);
2136
- }
2137
- if(isset($all_post_meta['saswp_review_schema_url_'.$schema_id])){
2138
- $input1['itemReviewed']['url'] = esc_url($all_post_meta['saswp_review_schema_url_'.$schema_id][0]);
2139
- }
2140
-
2141
- if(isset($all_post_meta['saswp_review_schema_price_range_'.$schema_id])){
2142
-
2143
- $input1['itemReviewed']['priceRange'] = esc_attr($all_post_meta['saswp_review_schema_price_range_'.$schema_id][0]);
2144
-
2145
- }
2146
 
2147
- if(isset($all_post_meta['saswp_review_schema_telephone_'.$schema_id])){
2148
-
2149
- $input1['itemReviewed']['telephone'] = esc_attr($all_post_meta['saswp_review_schema_telephone_'.$schema_id][0]);
2150
-
2151
  }
2152
 
2153
- if(isset($all_post_meta['saswp_review_schema_servescuisine_'.$schema_id])){
2154
-
2155
- $input1['itemReviewed']['servesCuisine'] = esc_attr($all_post_meta['saswp_review_schema_servescuisine_'.$schema_id][0]);
2156
 
 
 
2157
  }
2158
 
2159
- if(isset($all_post_meta['saswp_review_schema_menu_'.$schema_id])){
2160
-
2161
- $input1['itemReviewed']['hasMenu'] = esc_url($all_post_meta['saswp_review_schema_menu_'.$schema_id][0]);
2162
 
2163
- }
 
2164
 
2165
- if(isset($all_post_meta['saswp_review_schema_itemreviewed_sameas_'.$schema_id])){
2166
 
2167
- $input1['itemReviewed']['sameAs'] = esc_url($all_post_meta['saswp_review_schema_itemreviewed_sameas_'.$schema_id][0]);
2168
 
 
2169
  }
2170
 
2171
-
2172
- if(isset($all_post_meta['saswp_review_schema_director_'.$schema_id])){
2173
-
2174
- $input1['itemReviewed']['director'] = esc_attr($all_post_meta['saswp_review_schema_director_'.$schema_id][0]);
2175
-
2176
- }
2177
- if(isset($all_post_meta['saswp_review_schema_date_created_'.$schema_id])){
2178
-
2179
- $input1['itemReviewed']['dateCreated'] = isset($all_post_meta['saswp_review_schema_date_created_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_review_schema_date_created_'.$schema_id][0])):'';
2180
 
2181
- }
2182
-
2183
- $review_image = get_post_meta( get_the_ID(), 'saswp_review_schema_image_'.$schema_id.'_detail',true);
2184
-
2185
- if(!empty($review_image)){
2186
-
2187
- $input1['itemReviewed']['image']['@type'] = 'ImageObject';
2188
- $input1['itemReviewed']['image']['url'] = esc_url($review_image['thumbnail']);
2189
- $input1['itemReviewed']['image']['width'] = esc_attr($review_image['width']);
2190
- $input1['itemReviewed']['image']['height'] = esc_attr($review_image['height']);
2191
-
2192
- }
2193
-
2194
- if(saswp_remove_warnings($all_post_meta, 'saswp_review_schema_street_address_'.$schema_id, 'saswp_array') !='' || saswp_remove_warnings($all_post_meta, 'saswp_review_schema_locality_'.$schema_id, 'saswp_array') !=''){
2195
-
2196
-
2197
- $input1['itemReviewed']['address']['@type'] = 'PostalAddress';
2198
- $input1['itemReviewed']['address']['streetAddress'] = saswp_remove_warnings($all_post_meta, 'saswp_review_schema_street_address_'.$schema_id, 'saswp_array');
2199
- $input1['itemReviewed']['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_review_schema_locality_'.$schema_id, 'saswp_array');
2200
- $input1['itemReviewed']['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_review_schema_region_'.$schema_id, 'saswp_array');
2201
- $input1['itemReviewed']['address']['postalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_review_schema_postal_code_'.$schema_id, 'saswp_array');
2202
- $input1['itemReviewed']['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_review_schema_country_'.$schema_id, 'saswp_array');
2203
-
2204
- }
2205
-
2206
- switch ($all_post_meta['saswp_review_schema_item_type_'.$schema_id][0]) {
2207
-
2208
- case 'Article':
2209
-
2210
- $markup = $service->saswp_schema_markup_generator($all_post_meta['saswp_review_schema_item_type_'.$schema_id][0]);
2211
- $input1['itemReviewed'] = $markup;
2212
-
2213
- break;
2214
- case 'Adultentertainment':
2215
- $input1 = $input1;
2216
- break;
2217
- case 'Blog':
2218
- $input1 = $input1;
2219
- break;
2220
- case 'Book':
2221
-
2222
- if(isset($all_post_meta['saswp_review_schema_isbn_'.$schema_id])){
2223
-
2224
- $input1['itemReviewed']['isbn'] = $all_post_meta['saswp_review_schema_isbn_'.$schema_id];
2225
-
2226
- }
2227
- if($review_author) {
2228
-
2229
- $input1['itemReviewed']['author']['@type'] = 'Person';
2230
- $input1['itemReviewed']['author']['name'] = esc_attr($review_author);
2231
- $input1['itemReviewed']['author']['sameAs'] = esc_url($all_post_meta['saswp_review_schema_author_sameas_'.$schema_id][0]);
2232
-
2233
- }
2234
-
2235
- break;
2236
- case 'Casino':
2237
- break;
2238
- case 'Diet':
2239
- break;
2240
- case 'Episode':
2241
- break;
2242
- case 'ExercisePlan':
2243
- break;
2244
- case 'Game':
2245
- break;
2246
- case 'Movie':
2247
-
2248
- if($review_author){
2249
-
2250
- $input1['author']['sameAs'] = trailingslashit(get_permalink());
2251
-
2252
- }
2253
-
2254
- break;
2255
- case 'MusicPlaylist':
2256
- break;
2257
- case 'MusicRecording':
2258
- break;
2259
- case 'Photograph':
2260
- break;
2261
- case 'Recipe':
2262
- break;
2263
- case 'Restaurant':
2264
- break;
2265
- case 'Series':
2266
- break;
2267
- case 'SoftwareApplication':
2268
- break;
2269
- case 'VisualArtwork':
2270
- break;
2271
- case 'WebPage':
2272
-
2273
- $markup = $service->saswp_schema_markup_generator($all_post_meta['saswp_review_schema_item_type_'.$schema_id][0]);
2274
- $input1['itemReviewed'] = $markup;
2275
-
2276
- break;
2277
- case 'WebSite':
2278
- break;
2279
 
2280
- default:
2281
- $input1 = $input1;
2282
- break;
2283
- }
2284
-
2285
- if(saswp_remove_warnings($all_post_meta, 'saswp_review_schema_enable_rating_'.$schema_id, 'saswp_array') == 1){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2286
 
2287
- $input1['reviewRating'] = array(
2288
- "@type" => "Rating",
2289
- "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_review_schema_rating_'.$schema_id, 'saswp_array'),
2290
- "bestRating" => saswp_remove_warnings($all_post_meta, 'saswp_review_schema_review_count_'.$schema_id, 'saswp_array')
2291
- );
2292
- }
2293
- unset($input1['aggregateRating']);
2294
-
2295
  }
2296
 
2297
  if( 'local_business' === $schema_type){
2298
 
2299
- $operation_days = explode( "rn", esc_html( stripslashes(saswp_remove_warnings($all_post_meta, 'saswp_dayofweek_'.$schema_id, 'saswp_array'))) );;
2300
- $business_sub_name = '';
2301
- $business_type = saswp_remove_warnings($all_post_meta, 'saswp_business_type_'.$schema_id, 'saswp_array');
2302
- $post_specific_obj = new saswp_post_specific();
2303
-
2304
- if(array_key_exists($business_type, $post_specific_obj->_local_sub_business)){
2305
-
2306
- $check_business_type = $post_specific_obj->_local_sub_business[$business_type];
2307
-
2308
- if(!empty($check_business_type)){
2309
-
2310
- $business_sub_name = saswp_remove_warnings($all_post_meta, 'saswp_business_name_'.$schema_id, 'saswp_array');
2311
-
2312
- }
2313
 
2314
- }
2315
-
2316
- if($business_sub_name){
2317
-
2318
- $local_business = $business_sub_name;
2319
-
2320
- }else if($business_type){
2321
-
2322
- $local_business = $business_type;
2323
-
2324
- }else{
2325
-
2326
- $local_business = 'LocalBusiness';
2327
-
2328
- }
2329
-
2330
- $local_image = get_post_meta( get_the_ID(), 'local_business_logo_'.$schema_id.'_detail',true);
2331
-
2332
- $input1 = array(
2333
- '@context' => saswp_context_url(),
2334
- '@type' => $local_business ,
2335
- '@id' => ((isset($all_post_meta['saswp_business_id_'.$schema_id][0]) && $all_post_meta['saswp_business_id_'.$schema_id][0] !='') ? $all_post_meta['saswp_business_id_'.$schema_id][0] : trailingslashit(get_permalink()).'#'.strtolower($local_business)),
2336
- 'name' => saswp_remove_warnings($all_post_meta, 'local_business_name_'.$schema_id, 'saswp_array'),
2337
- 'url' => saswp_remove_warnings($all_post_meta, 'local_business_name_url_'.$schema_id, 'saswp_array'),
2338
- 'description' => saswp_remove_warnings($all_post_meta, 'local_business_description_'.$schema_id, 'saswp_array'),
2339
- 'image' => array(
2340
- '@type' => 'ImageObject',
2341
- 'url' => saswp_remove_warnings($local_image, 'thumbnail', 'saswp_string'),
2342
- 'width' => saswp_remove_warnings($local_image, 'width', 'saswp_string'),
2343
- 'height' => saswp_remove_warnings($local_image, 'height', 'saswp_string'),
2344
- ),
2345
- 'address' => array(
2346
- "@type" => "PostalAddress",
2347
- "streetAddress" => saswp_remove_warnings($all_post_meta, 'local_street_address_'.$schema_id, 'saswp_array'),
2348
- "addressLocality" => saswp_remove_warnings($all_post_meta, 'local_city_'.$schema_id, 'saswp_array'),
2349
- "addressRegion" => saswp_remove_warnings($all_post_meta, 'local_state_'.$schema_id, 'saswp_array'),
2350
- "postalCode" => saswp_remove_warnings($all_post_meta, 'local_postal_code_'.$schema_id, 'saswp_array'),
2351
- ),
2352
- 'telephone' => saswp_remove_warnings($all_post_meta, 'local_phone_'.$schema_id, 'saswp_array'),
2353
- 'openingHours' => $operation_days,
2354
- );
2355
-
2356
-
2357
-
2358
  if(isset($all_post_meta['local_enable_rating_'.$schema_id]) && saswp_remove_warnings($all_post_meta, 'local_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'local_review_count_'.$schema_id, 'saswp_array')){
2359
 
2360
  $input1['aggregateRating'] = array(
@@ -2370,67 +1605,6 @@ function saswp_post_specific_schema_output() {
2370
  if(!empty($extra_theme_review)){
2371
  $input1 = array_merge($input1, $extra_theme_review);
2372
  }
2373
- if(isset($all_post_meta['local_price_range_'.$schema_id][0])){
2374
- $input1['priceRange'] = esc_attr($all_post_meta['local_price_range_'.$schema_id][0]);
2375
- }
2376
-
2377
- if(isset($all_post_meta['local_accepts_reservations_'.$schema_id][0])){
2378
- $input1['acceptsReservations'] = esc_attr($all_post_meta['local_price_accepts_reservations_'.$schema_id][0]);
2379
- }
2380
-
2381
- if(isset($all_post_meta['local_serves_cuisine_'.$schema_id][0])){
2382
- $input1['servesCuisine'] = esc_attr($all_post_meta['local_serves_cuisine_'.$schema_id][0]);
2383
- }
2384
-
2385
- //social fields starts here
2386
-
2387
- $local_social = array();
2388
-
2389
- if(isset($all_post_meta['local_facebook_'.$schema_id][0]) && $all_post_meta['local_facebook_'.$schema_id][0] !=''){
2390
- $local_social[] = esc_url($all_post_meta['local_facebook_'.$schema_id][0]);
2391
- }
2392
- if(isset($all_post_meta['local_twitter_'.$schema_id][0]) && $all_post_meta['local_twitter_'.$schema_id][0] !=''){
2393
- $local_social[] = esc_url($all_post_meta['local_twitter_'.$schema_id][0]);
2394
- }
2395
- if(isset($all_post_meta['local_instagram_'.$schema_id][0]) && $all_post_meta['local_instagram_'.$schema_id][0] !=''){
2396
- $local_social[] = esc_url($all_post_meta['local_instagram_'.$schema_id][0]);
2397
- }
2398
- if(isset($all_post_meta['local_pinterest_'.$schema_id][0]) && $all_post_meta['local_pinterest_'.$schema_id][0] !=''){
2399
- $local_social[] = esc_url($all_post_meta['local_pinterest_'.$schema_id][0]);
2400
- }
2401
- if(isset($all_post_meta['local_linkedin_'.$schema_id][0]) && $all_post_meta['local_linkedin_'.$schema_id][0] !=''){
2402
- $local_social[] = esc_url($all_post_meta['local_linkedin_'.$schema_id][0]);
2403
- }
2404
- if(isset($all_post_meta['local_soundcloud_'.$schema_id][0]) && $all_post_meta['local_soundcloud_'.$schema_id][0] !=''){
2405
- $local_social[] = esc_url($all_post_meta['local_soundcloud_'.$schema_id][0]);
2406
- }
2407
- if(isset($all_post_meta['local_tumblr_'.$schema_id][0]) && $all_post_meta['local_tumblr_'.$schema_id][0] !=''){
2408
- $local_social[] = esc_url($all_post_meta['local_tumblr_'.$schema_id][0]);
2409
- }
2410
- if(isset($all_post_meta['local_youtube_'.$schema_id][0]) && $all_post_meta['local_youtube_'.$schema_id][0] !=''){
2411
- $local_social[] = esc_url($all_post_meta['local_youtube_'.$schema_id][0]);
2412
- }
2413
-
2414
- if(!empty($local_social)){
2415
- $input1['sameAs'] = $local_social;
2416
- }
2417
- //social fields ends here
2418
-
2419
- if(isset($all_post_meta['local_menu_'.$schema_id][0])){
2420
- $input1['hasMenu'] = esc_url($all_post_meta['local_menu_'.$schema_id][0]);
2421
- }
2422
-
2423
- if(isset($all_post_meta['local_hasmap_'.$schema_id][0])){
2424
- $input1['hasMap'] = esc_url($all_post_meta['local_hasmap_'.$schema_id][0]);
2425
- }
2426
-
2427
- if(isset($all_post_meta['local_latitude_'.$schema_id][0]) && isset($all_post_meta['local_longitude_'.$schema_id][0])){
2428
-
2429
- $input1['geo']['@type'] = 'GeoCoordinates';
2430
- $input1['geo']['latitude'] = $all_post_meta['local_latitude_'.$schema_id][0];
2431
- $input1['geo']['longitude'] = $all_post_meta['local_longitude_'.$schema_id][0];
2432
-
2433
- }
2434
 
2435
  $input1 = saswp_append_fetched_reviews($input1);
2436
  }
@@ -2439,7 +1613,27 @@ function saswp_post_specific_schema_output() {
2439
 
2440
  if(!in_array($schema_type, $without_aggregate)){
2441
 
2442
- //kk star rating
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2443
 
2444
  $kkstar_aggregateRating = saswp_extract_kk_star_ratings();
2445
 
@@ -2454,6 +1648,8 @@ function saswp_post_specific_schema_output() {
2454
  if(!empty($wp_post_rating_ar)){
2455
  $input1['aggregateRating'] = $wp_post_rating_ar;
2456
  }
 
 
2457
 
2458
  }
2459
 
220
 
221
  if( 'MusicPlaylist' === $schema_type){
222
 
223
+ $input1 = saswp_music_playlist_schema_markup($schema_id, $schema_post_id, $all_post_meta);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
 
225
  $input1 = saswp_append_fetched_reviews($input1);
226
 
457
 
458
  if( 'Book' === $schema_type){
459
 
460
+ $input1 = saswp_book_schema_markup($schema_id, $all_post_meta);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
  $input1 = saswp_append_fetched_reviews($input1);
463
 
675
 
676
  if( 'HowTo' === $schema_type){
677
 
678
+ $input1 = saswp_howto_schema_markup($schema_id, $schema_post_id, $all_post_meta);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  $input1 = saswp_append_fetched_reviews($input1);
681
 
682
  }
818
 
819
  if( 'VideoGame' === $schema_type){
820
 
821
+ $input1 = saswp_video_game_schema_markup($schema_id, $schema_post_id, $all_post_meta);
822
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
823
  $input1 = saswp_append_fetched_reviews($input1);
824
 
825
  }
866
  }
867
  }
868
 
869
+ if( 'DataFeed' === $schema_type){
870
 
871
 
872
  $input1 = array(
908
 
909
  if( 'Event' === $schema_type){
910
 
911
+ $input1 = saswp_event_schema_markup($schema_id, $schema_post_id, $all_post_meta);
912
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
913
  if(!empty($aggregateRating)){
914
  $input1['aggregateRating'] = $aggregateRating;
915
  }
961
 
962
  if( 'Course' === $schema_type){
963
 
964
+ $input1 = saswp_course_schema_markup($schema_id, $schema_post_id, $all_post_meta);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
965
 
966
  if(!empty($aggregateRating)){
967
 
1067
 
1068
  if( 'SoftwareApplication' === $schema_type){
1069
 
1070
+ $input1 = saswp_software_app_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1071
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1072
  if(!empty($aggregateRating)){
1073
  $input1['aggregateRating'] = $aggregateRating;
1074
  }
1262
 
1263
  if( 'Recipe' === $schema_type){
1264
 
1265
+ $input1 = saswp_recipe_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1266
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1267
  if(!empty($aggregateRating)){
1268
  $input1['aggregateRating'] = $aggregateRating;
1269
  }
1275
 
1276
  if( 'Product' === $schema_type){
1277
 
1278
+ $input1 = saswp_product_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1279
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1280
  if(!empty($aggregateRating)){
1281
  $input1['aggregateRating'] = $aggregateRating;
1282
  }
1283
  if(!empty($extra_theme_review)){
1284
  $input1 = array_merge($input1, $extra_theme_review);
1285
  }
1286
+
1287
+ $input1 = saswp_append_fetched_reviews($input1);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1288
  }
1289
 
1290
  if( 'NewsArticle' === $schema_type ){
1463
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_name_'.$schema_id, 'saswp_array'),
1464
  'itemListElement' => $serviceOffer
1465
  );
1466
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1467
  }
1468
 
1469
  if( 'Review' === $schema_type ){
1476
 
1477
  $service = new saswp_output_service();
1478
 
 
 
 
 
 
 
 
 
1479
  $input1['@context'] = saswp_context_url();
1480
  $input1['@type'] = 'Review';
1481
  $input1['@id'] = trailingslashit(get_permalink()).'#review';
1482
+ $input1['name'] = $all_post_meta['saswp_review_name_'.$schema_id][0];
1483
+ $input1['url'] = $all_post_meta['saswp_review_url_'.$schema_id][0];
1484
+ $input1['datePublished'] = isset($all_post_meta['saswp_review_date_published_'.$schema_id][0])&& $all_post_meta['saswp_review_date_published_'.$schema_id][0] !='' ? date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_review_date_published_'.$schema_id][0])):'';
 
 
 
 
 
 
 
 
 
 
 
 
 
1485
 
1486
+ if(isset($all_post_meta['saswp_review_publisher_'.$schema_id][0])){
1487
+ $input1['publisher']['@type'] = 'Organization';
1488
+ $input1['publisher']['name'] = $all_post_meta['saswp_review_publisher_'.$schema_id][0];
1489
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1490
 
1491
+ if(isset($all_post_meta['saswp_review_description_'.$schema_id])){
1492
+ $input1['description'] = $all_post_meta['saswp_review_description_'.$schema_id][0];
 
 
1493
  }
1494
 
1495
+ if(isset($all_post_meta['saswp_review_author_'.$schema_id])){
 
 
1496
 
1497
+ $review_author = $all_post_meta['saswp_review_author_'.$schema_id][0];
1498
+
1499
  }
1500
 
1501
+ if($review_author){
 
 
1502
 
1503
+ $input1['author']['@type'] = 'Person';
1504
+ $input1['author']['name'] = esc_attr($review_author);
1505
 
1506
+ if(isset($all_post_meta['saswp_review_author_url_'.$schema_id])){
1507
 
1508
+ $input1['author']['sameAs'] = esc_url($all_post_meta['saswp_review_author_url_'.$schema_id][0]);
1509
 
1510
+ }
1511
  }
1512
 
1513
+ if(saswp_remove_warnings($all_post_meta, 'saswp_review_enable_rating_'.$schema_id, 'saswp_array') == 1){
1514
+
1515
+ $input1['reviewRating'] = array(
1516
+ "@type" => "Rating",
1517
+ "ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_review_rating_'.$schema_id, 'saswp_array'),
1518
+ "bestRating" => saswp_remove_warnings($all_post_meta, 'saswp_review_review_count_'.$schema_id, 'saswp_array')
1519
+ );
1520
+ }
 
1521
 
1522
+ $item_reviewed = $all_post_meta['saswp_review_item_reviewed_'.$schema_id][0];
1523
+ $item_schema = array();
1524
+ switch ($item_reviewed) {
1525
+ case 'Book':
1526
+
1527
+ $item_schema = saswp_book_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1528
+
1529
+ break;
1530
+ case 'Course':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1531
 
1532
+ $item_schema = saswp_course_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1533
+
1534
+ break;
1535
+ case 'Event':
1536
+
1537
+ $item_schema = saswp_event_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1538
+
1539
+ break;
1540
+ case 'HowTo':
1541
+
1542
+ $item_schema = saswp_howto_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1543
+
1544
+ break;
1545
+ case 'local_business':
1546
+
1547
+ $item_schema = saswp_local_business_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1548
+
1549
+ break;
1550
+ case 'MusicPlaylist':
1551
+
1552
+ $item_schema = saswp_music_playlist_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1553
+
1554
+ break;
1555
+ case 'Product':
1556
+
1557
+ $item_schema = saswp_product_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1558
+
1559
+ break;
1560
+ case 'Recipe':
1561
+
1562
+ $item_schema = saswp_recipe_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1563
+
1564
+ break;
1565
+ case 'SoftwareApplication':
1566
+
1567
+ $item_schema = saswp_software_app_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1568
+
1569
+ break;
1570
+ case 'VideoGame':
1571
+
1572
+ $item_schema = saswp_video_game_schema_markup($schema_id, $schema_post_id, $all_post_meta);
1573
+
1574
+ break;
1575
+
1576
+ default:
1577
+ break;
1578
+ }
1579
 
1580
+ if($item_schema){
1581
+ unset($item_schema['@context']);
1582
+ unset($item_schema['@id']);
1583
+ $input1['itemReviewed'] = $item_schema;
1584
+
1585
+ }
1586
+
 
1587
  }
1588
 
1589
  if( 'local_business' === $schema_type){
1590
 
1591
+ $input1 = saswp_local_business_schema_markup($schema_id, $schema_post_id, $all_post_meta);
 
 
 
 
 
 
 
 
 
 
 
 
 
1592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1593
  if(isset($all_post_meta['local_enable_rating_'.$schema_id]) && saswp_remove_warnings($all_post_meta, 'local_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'local_review_count_'.$schema_id, 'saswp_array')){
1594
 
1595
  $input1['aggregateRating'] = array(
1605
  if(!empty($extra_theme_review)){
1606
  $input1 = array_merge($input1, $extra_theme_review);
1607
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1608
 
1609
  $input1 = saswp_append_fetched_reviews($input1);
1610
  }
1613
 
1614
  if(!in_array($schema_type, $without_aggregate)){
1615
 
1616
+ if($schema_type == 'Review'){
1617
+
1618
+ //kk star rating
1619
+
1620
+ $kkstar_aggregateRating = saswp_extract_kk_star_ratings();
1621
+
1622
+ if(!empty($kkstar_aggregateRating)){
1623
+ $input1['itemReviewed']['aggregateRating'] = $kkstar_aggregateRating;
1624
+ }
1625
+
1626
+ //wp post-rating star rating
1627
+
1628
+ $wp_post_rating_ar = saswp_extract_wp_post_ratings();
1629
+
1630
+ if(!empty($wp_post_rating_ar)){
1631
+ $input1['itemReviewed']['aggregateRating'] = $wp_post_rating_ar;
1632
+ }
1633
+
1634
+ }else{
1635
+
1636
+ //kk star rating
1637
 
1638
  $kkstar_aggregateRating = saswp_extract_kk_star_ratings();
1639
 
1648
  if(!empty($wp_post_rating_ar)){
1649
  $input1['aggregateRating'] = $wp_post_rating_ar;
1650
  }
1651
+
1652
+ }
1653
 
1654
  }
1655
 
output/service.php CHANGED
@@ -350,11 +350,13 @@ Class saswp_output_service{
350
  $main_schema_type = $schema_type;
351
  $review_post_meta = get_post_meta($schema_post_id, 'saswp_review_schema_details', true);
352
  $schema_type = $review_post_meta['saswp_review_schema_item_type'];
353
-
354
-
355
  if(isset($custom_fields['saswp_review_name'])){
356
  $review_markup['name'] = $custom_fields['saswp_review_name'];
357
  }
 
 
 
358
  if(isset($custom_fields['saswp_review_description'])){
359
  $review_markup['description'] = $custom_fields['saswp_review_description'];
360
  }
@@ -367,18 +369,21 @@ Class saswp_output_service{
367
  if(isset($custom_fields['saswp_review_publisher'])){
368
  $review_markup['publisher']['@type'] = 'Organization';
369
  $review_markup['publisher']['name'] = $custom_fields['saswp_review_publisher'];
370
- }
371
- if(isset($custom_fields['saswp_review_body'])){
372
- $review_markup['reviewBody'] = $custom_fields['saswp_review_body'];
373
- }
374
  if(isset($custom_fields['saswp_review_author'])){
375
  $review_markup['author']['@type'] = 'Person';
376
  $review_markup['author']['name'] = $custom_fields['saswp_review_author'];
 
 
 
 
377
  }
 
 
 
378
 
379
  }
380
-
381
-
382
  switch ($schema_type) {
383
 
384
  case 'Book':
@@ -393,7 +398,13 @@ Class saswp_output_service{
393
  $input1['url'] = $custom_fields['saswp_book_url'];
394
  }
395
  if(isset($custom_fields['saswp_book_author'])){
396
- $input1['author'] = $custom_fields['saswp_book_author'];
 
 
 
 
 
 
397
  }
398
  if(isset($custom_fields['saswp_book_isbn'])){
399
  $input1['isbn'] = $custom_fields['saswp_book_isbn'];
@@ -407,8 +418,8 @@ Class saswp_output_service{
407
  if(isset($custom_fields['saswp_book_image'])){
408
  $input1['image'] = $custom_fields['saswp_book_image'];
409
  }
410
- if(isset($custom_fields['saswp_book_date_published'])){
411
- $input1['datePublished'] = date('Y-m-d\TH:i:s\Z',strtotime($custom_fields['saswp_book_date_published']));
412
  }
413
  if(isset($custom_fields['saswp_book_price_currency']) && isset($custom_fields['saswp_book_price'])){
414
  $input1['offers']['@type'] = 'Offer';
@@ -419,7 +430,7 @@ Class saswp_output_service{
419
  if(isset($custom_fields['saswp_book_rating_value']) && isset($custom_fields['saswp_book_rating_count'])){
420
  $input1['aggregateRating']['@type'] = 'aggregateRating';
421
  $input1['aggregateRating']['worstRating'] = 0;
422
- $input1['aggregateRating']['bestRating'] = 5;
423
  $input1['aggregateRating']['ratingValue'] = $custom_fields['saswp_book_rating_value'];
424
  $input1['aggregateRating']['ratingCount'] = $custom_fields['saswp_book_rating_count'];
425
  }
@@ -586,7 +597,10 @@ Class saswp_output_service{
586
  }
587
  if(isset($custom_fields['saswp_dayofweek'])){
588
  $input1['openingHours'] = $custom_fields['saswp_dayofweek'];
589
- }
 
 
 
590
  if(isset($custom_fields['local_price_range'])){
591
  $input1['priceRange'] = $custom_fields['local_price_range'];
592
  }
@@ -598,8 +612,7 @@ Class saswp_output_service{
598
  }
599
  if(isset($custom_fields['local_menu'])){
600
  $input1['hasMenu'] = $custom_fields['local_menu'];
601
- }
602
-
603
  if(isset($custom_fields['local_rating_value']) && isset($custom_fields['local_rating_count'])){
604
  $input1['aggregateRating']['@type'] = 'AggregateRating';
605
  $input1['aggregateRating']['worstRating'] = 0;
@@ -844,10 +857,31 @@ Class saswp_output_service{
844
  }
845
 
846
  if(isset($custom_fields['saswp_event_schema_start_date'])){
847
- $input1['startDate'] = $custom_fields['saswp_event_schema_start_date'];
 
 
 
 
 
 
 
 
 
 
848
  }
 
849
  if(isset($custom_fields['saswp_event_schema_end_date'])){
850
- $input1['endDate'] = $custom_fields['saswp_event_schema_end_date'];
 
 
 
 
 
 
 
 
 
 
851
  }
852
 
853
  if(isset($custom_fields['saswp_event_schema_image'])){
@@ -1132,8 +1166,8 @@ Class saswp_output_service{
1132
  $input1['sku'] = $custom_fields['saswp_product_sku'];
1133
  }
1134
  if(isset($custom_fields['saswp_product_seller'])){
1135
- $input1['seller']['@type'] = 'Organization';
1136
- $input1['seller']['name'] = $custom_fields['saswp_product_seller'];
1137
  }
1138
 
1139
  if(isset($custom_fields['saswp_product_rating']) && isset($custom_fields['saswp_product_rating_count'])){
@@ -1179,15 +1213,7 @@ Class saswp_output_service{
1179
  if(isset($custom_fields['saswp_service_schema_service_offer'])){
1180
  $input1['hasOfferCatalog'] = $custom_fields['saswp_service_schema_service_offer'];
1181
  }
1182
-
1183
- if(isset($custom_fields['saswp_service_schema_rating_value']) && isset($custom_fields['saswp_service_schema_rating_count'])){
1184
- $input1['aggregateRating']['@type'] = 'AggregateRating';
1185
- $input1['aggregateRating']['worstRating'] = 0;
1186
- $input1['aggregateRating']['bestRating'] = 5;
1187
- $input1['aggregateRating']['ratingValue'] = $custom_fields['saswp_service_schema_rating_value'];
1188
- $input1['aggregateRating']['ratingCount'] = $custom_fields['saswp_service_schema_rating_count'];
1189
- }
1190
-
1191
  break;
1192
 
1193
  case 'VideoObject':
@@ -1200,8 +1226,7 @@ Class saswp_output_service{
1200
  }
1201
  if(isset($custom_fields['saswp_video_object_date_published'])){
1202
  $input1['datePublished'] = $custom_fields['saswp_video_object_date_published'];
1203
- }
1204
-
1205
  if(isset($custom_fields['saswp_video_object_date_modified'])){
1206
  $input1['dateModified'] = $custom_fields['saswp_video_object_date_modified'];
1207
  }
@@ -1210,8 +1235,7 @@ Class saswp_output_service{
1210
  }
1211
  if(isset($custom_fields['saswp_video_object_name'])){
1212
  $input1['name'] = $custom_fields['saswp_video_object_name'];
1213
- }
1214
-
1215
  if(isset($custom_fields['saswp_video_object_upload_date'])){
1216
  $input1['uploadDate'] = $custom_fields['saswp_video_object_upload_date'];
1217
  }
@@ -1219,26 +1243,23 @@ Class saswp_output_service{
1219
  $input1['thumbnailUrl'] = $custom_fields['saswp_video_object_thumbnail_url'];
1220
  }
1221
  if(isset($custom_fields['saswp_video_object_content_url'])){
1222
- $input1['thumbnailUrl'] = $custom_fields['saswp_video_object_content_url'];
1223
  }
1224
  if(isset($custom_fields['saswp_video_object_embed_url'])){
1225
- $input1['thumbnailUrl'] = $custom_fields['saswp_video_object_embed_url'];
1226
- }
1227
- if(isset($custom_fields['saswp_video_object_main_entity_id'])){
1228
- $input1['mainEntity']['@id'] = $custom_fields['saswp_video_object_main_entity_id'];
1229
- }
1230
-
1231
  if(isset($custom_fields['saswp_video_object_author_name'])){
1232
  $input1['author']['name'] = $custom_fields['saswp_video_object_author_name'];
1233
  }
1234
  if(isset($custom_fields['saswp_video_object_author_image'])){
1235
- $input1['author']['Image']['url'] = $custom_fields['saswp_video_object_author_image'];
1236
  }
1237
  if(isset($custom_fields['saswp_video_object_organization_logo']) && isset($custom_fields['saswp_video_object_organization_name'])){
1238
- $input1['Publisher']['@type'] = 'Organization';
1239
- $input1['Publisher']['name'] = $custom_fields['saswp_video_object_organization_name'];
1240
- $input1['Publisher']['logo'] = $custom_fields['saswp_video_object_organization_logo'];
1241
  }
 
1242
  break;
1243
 
1244
  case 'qanda':
@@ -1929,7 +1950,7 @@ Class saswp_output_service{
1929
  default:
1930
  break;
1931
  }
1932
-
1933
  if($main_schema_type == 'Review'){
1934
 
1935
  $review_response['item_reviewed'] = $input1;
@@ -1961,16 +1982,7 @@ Class saswp_output_service{
1961
 
1962
  if($schema_type == 'Review'){
1963
 
1964
- $meta_fields = $this->saswp_get_all_schema_type_fields($schema_subtype);
1965
-
1966
- $review_fields['saswp_review_name'] = 'Review Name';
1967
- $review_fields['saswp_review_description'] = 'Review Description';
1968
- $review_fields['saswp_review_body'] = 'Review Body';
1969
- $review_fields['saswp_review_author'] = 'Review Author';
1970
- $review_fields['saswp_review_publisher'] = 'Review Publisher';
1971
- $review_fields['saswp_review_rating_value'] = 'Review Rating Value';
1972
-
1973
- $meta_fields = $review_fields + $meta_fields;
1974
 
1975
  }else{
1976
  $meta_fields = $this->saswp_get_all_schema_type_fields($schema_type);
@@ -2048,10 +2060,10 @@ Class saswp_output_service{
2048
 
2049
  if($product->get_type() == 'variable'){
2050
 
2051
- $product_id_some = $woocommerce->product_factory->get_product();
2052
-
2053
- $variations = $product_id_some->get_available_variations();
2054
 
 
 
2055
  if($variations){
2056
 
2057
  foreach($variations as $value){
@@ -2104,7 +2116,7 @@ Class saswp_output_service{
2104
  $product_details['product_description'] = strip_tags(get_the_excerpt());
2105
 
2106
  }
2107
-
2108
  if($product->get_attributes()){
2109
 
2110
  foreach ($product->get_attributes() as $attribute) {
@@ -2179,9 +2191,13 @@ Class saswp_output_service{
2179
  }else{
2180
  $product_details['product_availability'] = $product->get_stock_status();
2181
  }
2182
-
2183
- $product_details['product_price'] = $product->get_price();
2184
- $product_details['product_varible_price'] = $varible_prices;
 
 
 
 
2185
  $product_details['product_sku'] = $product->get_sku() ? $product->get_sku(): get_the_ID();
2186
 
2187
  if(isset($date_on_sale)){
@@ -2199,7 +2215,63 @@ Class saswp_output_service{
2199
  $reviews_arr = array();
2200
  $reviews = get_approved_comments( $post_id );
2201
 
2202
- if($reviews){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2203
 
2204
  foreach($reviews as $review){
2205
 
@@ -2482,6 +2554,7 @@ Class saswp_output_service{
2482
  'local_website' => 'Website',
2483
  'local_business_logo' => 'Image',
2484
  'saswp_dayofweek' => 'Operation Days',
 
2485
  'local_price_range' => 'Price Range',
2486
  'local_hasmap' => 'HasMap',
2487
  'local_menu' => 'Menu',
@@ -2868,10 +2941,8 @@ Class saswp_output_service{
2868
  'saswp_service_schema_description' => 'Description',
2869
  'saswp_service_schema_area_served' => 'Area Served (City)',
2870
  'saswp_service_schema_service_offer' => 'Service Offer',
2871
- 'saswp_service_schema_country' => 'Address Country',
2872
- 'saswp_service_schema_telephone' => 'Telephone',
2873
- 'saswp_service_schema_rating_value' => 'Rating Value',
2874
- 'saswp_service_schema_rating_count' => 'Rating Count',
2875
  );
2876
 
2877
  break;
@@ -2890,8 +2961,7 @@ Class saswp_output_service{
2890
  'saswp_video_object_duration' => 'Duration',
2891
  'saswp_video_object_thumbnail_url' => 'Thumbnail Url',
2892
  'saswp_video_object_content_url' => 'Content URL',
2893
- 'saswp_video_object_embed_url' => 'Embed Url',
2894
- 'saswp_video_object_main_entity_id' => 'Main Entity Id',
2895
  'saswp_video_object_author_name' => 'Author Name',
2896
  'saswp_video_object_author_image' => 'Author Image',
2897
  'saswp_video_object_organization_name' => 'Organization Name',
@@ -2947,8 +3017,10 @@ Class saswp_output_service{
2947
  'saswp_event_schema_location_region' => 'Location Region',
2948
  'saswp_event_schema_location_postalcode' => 'PostalCode',
2949
  'saswp_event_schema_location_hasmap' => 'HasMape',
2950
- 'saswp_event_schema_start_date' => 'Start Date',
 
2951
  'saswp_event_schema_end_date' => 'End Date',
 
2952
  'saswp_event_schema_image' => 'Image',
2953
  'saswp_event_schema_performer_name' => 'Performer Name',
2954
  'saswp_event_schema_price' => 'Price',
@@ -3024,7 +3096,8 @@ Class saswp_output_service{
3024
  'saswp_book_description' => 'Description',
3025
  'saswp_book_url' => 'URL',
3026
  'saswp_book_image' => 'Image',
3027
- 'saswp_book_author' => 'Author',
 
3028
  'saswp_book_isbn' => 'Isbn',
3029
  'saswp_book_no_of_page' => 'Number Of Page',
3030
  'saswp_book_publisher' => 'Publisher',
@@ -3356,7 +3429,7 @@ Class saswp_output_service{
3356
 
3357
  }else{
3358
 
3359
- if(isset($product_details['product_varible_price']) && is_array($product_details['product_varible_price'])){
3360
 
3361
  $input1['offers']['@type'] = 'AggregateOffer';
3362
  $input1['offers']['lowPrice'] = min($product_details['product_varible_price']);
@@ -3456,7 +3529,7 @@ Class saswp_output_service{
3456
 
3457
  if( is_array($image_details) ){
3458
 
3459
- if(isset($image_details[1]) && ($image_details[1] < 1200) && function_exists('aq_resize')){
3460
 
3461
  $width = array(1280, 640, 300);
3462
  $height = array(720, 480, 300);
@@ -3534,7 +3607,9 @@ Class saswp_output_service{
3534
  }
3535
 
3536
  //Get All the images available on post
3537
-
 
 
3538
  $content = @get_the_content();
3539
 
3540
  if($content){
@@ -3604,6 +3679,8 @@ Class saswp_output_service{
3604
  }
3605
 
3606
  }
 
 
3607
 
3608
  if(empty($input2)){
3609
 
@@ -3699,4 +3776,4 @@ Class saswp_output_service{
3699
  if (class_exists('saswp_output_service')) {
3700
  $object = new saswp_output_service();
3701
  $object->saswp_service_hooks();
3702
- };
350
  $main_schema_type = $schema_type;
351
  $review_post_meta = get_post_meta($schema_post_id, 'saswp_review_schema_details', true);
352
  $schema_type = $review_post_meta['saswp_review_schema_item_type'];
353
+
 
354
  if(isset($custom_fields['saswp_review_name'])){
355
  $review_markup['name'] = $custom_fields['saswp_review_name'];
356
  }
357
+ if(isset($custom_fields['saswp_review_url'])){
358
+ $review_markup['url'] = $custom_fields['saswp_review_url'];
359
+ }
360
  if(isset($custom_fields['saswp_review_description'])){
361
  $review_markup['description'] = $custom_fields['saswp_review_description'];
362
  }
369
  if(isset($custom_fields['saswp_review_publisher'])){
370
  $review_markup['publisher']['@type'] = 'Organization';
371
  $review_markup['publisher']['name'] = $custom_fields['saswp_review_publisher'];
372
+ }
 
 
 
373
  if(isset($custom_fields['saswp_review_author'])){
374
  $review_markup['author']['@type'] = 'Person';
375
  $review_markup['author']['name'] = $custom_fields['saswp_review_author'];
376
+
377
+ if(isset($custom_fields['saswp_review_author_url'])){
378
+ $review_markup['author']['sameAs'] = array($custom_fields['saswp_review_author_url']);
379
+ }
380
  }
381
+ if(isset($custom_fields['saswp_review_date_published'])){
382
+ $review_markup['datePublished'] = date('c',strtotime($custom_fields['saswp_review_date_published']));
383
+ }
384
 
385
  }
386
+
 
387
  switch ($schema_type) {
388
 
389
  case 'Book':
398
  $input1['url'] = $custom_fields['saswp_book_url'];
399
  }
400
  if(isset($custom_fields['saswp_book_author'])){
401
+ $input1['author']['@type'] = 'Person';
402
+ $input1['author']['name'] = $custom_fields['saswp_book_author'];
403
+
404
+ if(isset($custom_fields['saswp_book_author_url'])){
405
+ $input1['author']['sameAs'] = array($custom_fields['saswp_book_author_url']);
406
+ }
407
+
408
  }
409
  if(isset($custom_fields['saswp_book_isbn'])){
410
  $input1['isbn'] = $custom_fields['saswp_book_isbn'];
418
  if(isset($custom_fields['saswp_book_image'])){
419
  $input1['image'] = $custom_fields['saswp_book_image'];
420
  }
421
+ if(isset($custom_fields['saswp_book_published_date'])){
422
+ $input1['datePublished'] = date('c',strtotime($custom_fields['saswp_book_published_date']));
423
  }
424
  if(isset($custom_fields['saswp_book_price_currency']) && isset($custom_fields['saswp_book_price'])){
425
  $input1['offers']['@type'] = 'Offer';
430
  if(isset($custom_fields['saswp_book_rating_value']) && isset($custom_fields['saswp_book_rating_count'])){
431
  $input1['aggregateRating']['@type'] = 'aggregateRating';
432
  $input1['aggregateRating']['worstRating'] = 0;
433
+ $input1['aggregateRating']['bestRating'] = 5;
434
  $input1['aggregateRating']['ratingValue'] = $custom_fields['saswp_book_rating_value'];
435
  $input1['aggregateRating']['ratingCount'] = $custom_fields['saswp_book_rating_count'];
436
  }
597
  }
598
  if(isset($custom_fields['saswp_dayofweek'])){
599
  $input1['openingHours'] = $custom_fields['saswp_dayofweek'];
600
+ }
601
+ if(isset($custom_fields['local_area_served'])){
602
+ $input1['areaServed'] = $custom_fields['local_area_served'];
603
+ }
604
  if(isset($custom_fields['local_price_range'])){
605
  $input1['priceRange'] = $custom_fields['local_price_range'];
606
  }
612
  }
613
  if(isset($custom_fields['local_menu'])){
614
  $input1['hasMenu'] = $custom_fields['local_menu'];
615
+ }
 
616
  if(isset($custom_fields['local_rating_value']) && isset($custom_fields['local_rating_count'])){
617
  $input1['aggregateRating']['@type'] = 'AggregateRating';
618
  $input1['aggregateRating']['worstRating'] = 0;
857
  }
858
 
859
  if(isset($custom_fields['saswp_event_schema_start_date'])){
860
+
861
+ $time = '';
862
+
863
+ if(isset($custom_fields['saswp_event_schema_start_time'])){
864
+
865
+ $time = $custom_fields['saswp_event_schema_start_time'];
866
+
867
+ }
868
+
869
+ $input1['startDate'] = saswp_format_date_time($custom_fields['saswp_event_schema_start_date'], $time);
870
+
871
  }
872
+
873
  if(isset($custom_fields['saswp_event_schema_end_date'])){
874
+
875
+ $time = '';
876
+
877
+ if(isset($custom_fields['saswp_event_schema_end_time'])){
878
+
879
+ $time = $custom_fields['saswp_event_schema_end_time'];
880
+
881
+ }
882
+
883
+ $input1['endDate'] = saswp_format_date_time($custom_fields['saswp_event_schema_end_date'], $time);
884
+
885
  }
886
 
887
  if(isset($custom_fields['saswp_event_schema_image'])){
1166
  $input1['sku'] = $custom_fields['saswp_product_sku'];
1167
  }
1168
  if(isset($custom_fields['saswp_product_seller'])){
1169
+ $input1['offers']['seller']['@type'] = 'Organization';
1170
+ $input1['offers']['seller']['name'] = $custom_fields['saswp_product_seller'];
1171
  }
1172
 
1173
  if(isset($custom_fields['saswp_product_rating']) && isset($custom_fields['saswp_product_rating_count'])){
1213
  if(isset($custom_fields['saswp_service_schema_service_offer'])){
1214
  $input1['hasOfferCatalog'] = $custom_fields['saswp_service_schema_service_offer'];
1215
  }
1216
+
 
 
 
 
 
 
 
 
1217
  break;
1218
 
1219
  case 'VideoObject':
1226
  }
1227
  if(isset($custom_fields['saswp_video_object_date_published'])){
1228
  $input1['datePublished'] = $custom_fields['saswp_video_object_date_published'];
1229
+ }
 
1230
  if(isset($custom_fields['saswp_video_object_date_modified'])){
1231
  $input1['dateModified'] = $custom_fields['saswp_video_object_date_modified'];
1232
  }
1235
  }
1236
  if(isset($custom_fields['saswp_video_object_name'])){
1237
  $input1['name'] = $custom_fields['saswp_video_object_name'];
1238
+ }
 
1239
  if(isset($custom_fields['saswp_video_object_upload_date'])){
1240
  $input1['uploadDate'] = $custom_fields['saswp_video_object_upload_date'];
1241
  }
1243
  $input1['thumbnailUrl'] = $custom_fields['saswp_video_object_thumbnail_url'];
1244
  }
1245
  if(isset($custom_fields['saswp_video_object_content_url'])){
1246
+ $input1['contentUrl'] = $custom_fields['saswp_video_object_content_url'];
1247
  }
1248
  if(isset($custom_fields['saswp_video_object_embed_url'])){
1249
+ $input1['embedUrl'] = $custom_fields['saswp_video_object_embed_url'];
1250
+ }
 
 
 
 
1251
  if(isset($custom_fields['saswp_video_object_author_name'])){
1252
  $input1['author']['name'] = $custom_fields['saswp_video_object_author_name'];
1253
  }
1254
  if(isset($custom_fields['saswp_video_object_author_image'])){
1255
+ $input1['author']['image'] = $custom_fields['saswp_video_object_author_image'];
1256
  }
1257
  if(isset($custom_fields['saswp_video_object_organization_logo']) && isset($custom_fields['saswp_video_object_organization_name'])){
1258
+ $input1['publisher']['@type'] = 'Organization';
1259
+ $input1['publisher']['name'] = $custom_fields['saswp_video_object_organization_name'];
1260
+ $input1['publisher']['logo'] = $custom_fields['saswp_video_object_organization_logo'];
1261
  }
1262
+
1263
  break;
1264
 
1265
  case 'qanda':
1950
  default:
1951
  break;
1952
  }
1953
+
1954
  if($main_schema_type == 'Review'){
1955
 
1956
  $review_response['item_reviewed'] = $input1;
1982
 
1983
  if($schema_type == 'Review'){
1984
 
1985
+ $meta_fields = $this->saswp_get_all_schema_type_fields($schema_subtype);
 
 
 
 
 
 
 
 
 
1986
 
1987
  }else{
1988
  $meta_fields = $this->saswp_get_all_schema_type_fields($schema_type);
2060
 
2061
  if($product->get_type() == 'variable'){
2062
 
2063
+ $product_id_some = $woocommerce->product_factory->get_product();
 
 
2064
 
2065
+ $variations = $product_id_some->get_available_variations();
2066
+
2067
  if($variations){
2068
 
2069
  foreach($variations as $value){
2116
  $product_details['product_description'] = strip_tags(get_the_excerpt());
2117
 
2118
  }
2119
+
2120
  if($product->get_attributes()){
2121
 
2122
  foreach ($product->get_attributes() as $attribute) {
2191
  }else{
2192
  $product_details['product_availability'] = $product->get_stock_status();
2193
  }
2194
+
2195
+ if($product->get_type() == 'variable'){
2196
+ $product_details['product_varible_price'] = $varible_prices;
2197
+ }else{
2198
+ $product_details['product_price'] = $product->get_price();
2199
+ }
2200
+
2201
  $product_details['product_sku'] = $product->get_sku() ? $product->get_sku(): get_the_ID();
2202
 
2203
  if(isset($date_on_sale)){
2215
  $reviews_arr = array();
2216
  $reviews = get_approved_comments( $post_id );
2217
 
2218
+ $judge_me_post = null;
2219
+
2220
+ if(class_exists('saswp_reviews_platform_markup') && class_exists('JGM_ProductService')){
2221
+
2222
+ $judge_me_post = get_posts(
2223
+ array(
2224
+ 'post_type' => 'saswp_reviews',
2225
+ 'posts_per_page' => -1,
2226
+ 'post_status' => 'publish',
2227
+ 'meta_query' => array(
2228
+ array(
2229
+ 'key' => 'saswp_review_product_id',
2230
+ 'value' => $post_id,
2231
+ 'compare' => '==',
2232
+ )
2233
+ )
2234
+
2235
+ ) );
2236
+
2237
+ }
2238
+
2239
+ if($judge_me_post){
2240
+
2241
+ $post_meta = array(
2242
+ 'saswp_reviewer_name' => 'author',
2243
+ 'saswp_review_rating' => 'reviewRating',
2244
+ 'saswp_review_date' => 'datePublished',
2245
+ 'saswp_review_text' => 'description',
2246
+ );
2247
+
2248
+ $sumofrating = 0;
2249
+
2250
+ foreach($judge_me_post as $me_post){
2251
+
2252
+ $rv = array();
2253
+
2254
+ foreach($post_meta as $key => $val){
2255
+
2256
+ $rv[$val] = get_post_meta($me_post->ID, $key, true );
2257
+
2258
+ if($val == 'reviewRating'){
2259
+ $sumofrating += get_post_meta($me_post->ID, $key, true );
2260
+ }
2261
+
2262
+
2263
+ }
2264
+
2265
+ $reviews_arr[] = $rv;
2266
+
2267
+ }
2268
+ $product_details['product_review_count'] = count($judge_me_post);
2269
+ if($sumofrating > 0){
2270
+ $product_details['product_average_rating'] = $sumofrating / count($judge_me_post);
2271
+ }
2272
+
2273
+ }else if($reviews){
2274
+
2275
 
2276
  foreach($reviews as $review){
2277
 
2554
  'local_website' => 'Website',
2555
  'local_business_logo' => 'Image',
2556
  'saswp_dayofweek' => 'Operation Days',
2557
+ 'local_area_served' => 'Area Served',
2558
  'local_price_range' => 'Price Range',
2559
  'local_hasmap' => 'HasMap',
2560
  'local_menu' => 'Menu',
2941
  'saswp_service_schema_description' => 'Description',
2942
  'saswp_service_schema_area_served' => 'Area Served (City)',
2943
  'saswp_service_schema_service_offer' => 'Service Offer',
2944
+ 'saswp_service_schema_country' => 'Address Country',
2945
+ 'saswp_service_schema_telephone' => 'Telephone'
 
 
2946
  );
2947
 
2948
  break;
2961
  'saswp_video_object_duration' => 'Duration',
2962
  'saswp_video_object_thumbnail_url' => 'Thumbnail Url',
2963
  'saswp_video_object_content_url' => 'Content URL',
2964
+ 'saswp_video_object_embed_url' => 'Embed Url',
 
2965
  'saswp_video_object_author_name' => 'Author Name',
2966
  'saswp_video_object_author_image' => 'Author Image',
2967
  'saswp_video_object_organization_name' => 'Organization Name',
3017
  'saswp_event_schema_location_region' => 'Location Region',
3018
  'saswp_event_schema_location_postalcode' => 'PostalCode',
3019
  'saswp_event_schema_location_hasmap' => 'HasMape',
3020
+ 'saswp_event_schema_start_date' => 'Start Date',
3021
+ 'saswp_event_schema_start_time' => 'Start Time',
3022
  'saswp_event_schema_end_date' => 'End Date',
3023
+ 'saswp_event_schema_end_time' => 'End Time',
3024
  'saswp_event_schema_image' => 'Image',
3025
  'saswp_event_schema_performer_name' => 'Performer Name',
3026
  'saswp_event_schema_price' => 'Price',
3096
  'saswp_book_description' => 'Description',
3097
  'saswp_book_url' => 'URL',
3098
  'saswp_book_image' => 'Image',
3099
+ 'saswp_book_author' => 'Author',
3100
+ 'saswp_book_author_url' => 'Author Profile URL',
3101
  'saswp_book_isbn' => 'Isbn',
3102
  'saswp_book_no_of_page' => 'Number Of Page',
3103
  'saswp_book_publisher' => 'Publisher',
3429
 
3430
  }else{
3431
 
3432
+ if(isset($product_details['product_varible_price']) && $product_details['product_varible_price']){
3433
 
3434
  $input1['offers']['@type'] = 'AggregateOffer';
3435
  $input1['offers']['lowPrice'] = min($product_details['product_varible_price']);
3529
 
3530
  if( is_array($image_details) ){
3531
 
3532
+ if(isset($image_details[1]) && ($image_details[1] < 1200) && function_exists('saswp_aq_resize')){
3533
 
3534
  $width = array(1280, 640, 300);
3535
  $height = array(720, 480, 300);
3607
  }
3608
 
3609
  //Get All the images available on post
3610
+
3611
+ if( (isset($sd_data['saswp-other-images']) && $sd_data['saswp-other-images'] == 1) || !isset($sd_data['saswp-other-images']) ){
3612
+
3613
  $content = @get_the_content();
3614
 
3615
  if($content){
3679
  }
3680
 
3681
  }
3682
+
3683
+ }
3684
 
3685
  if(empty($input2)){
3686
 
3776
  if (class_exists('saswp_output_service')) {
3777
  $object = new saswp_output_service();
3778
  $object->saswp_service_hooks();
3779
+ };
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.2
6
- Stable tag: 1.9.15
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -118,6 +118,22 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  = 1.9.15 (23 Oct 2019) =
122
 
123
  * Fixed: Multiple Instances of Schema Type (i.e. LocalBusiness) Merging Improperly on Same Page #537
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 1.9.16
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
118
 
119
  == Changelog ==
120
 
121
+ = 1.9.16 (04 Nov 2019) =
122
+
123
+ * Fixed: Warning: Use of undefined constant __return_empty_array #573
124
+ * Fixed: Rating Module & Review Module learn more goes to 404 #567
125
+ * Fixed: On tag archive pages, there is an Unparsable and Breadcrumbs error. #574
126
+ * Fixed: In videoObject, Content url and embed url appeared inside thumbnail propery #585
127
+ * Fixed: Warring Product schema property seller is not recognized by Google for an object of type Product. #579
128
+ * Fixed: Item Reviewed type property's fields is not being generated dynamically on post specific modification. #578
129
+ * Fixed: Issue with kk Star Rating plugin #570
130
+ * Fixed: Aggregate rating is not supported in service schema #591
131
+ * Fixed: Real Breadcrumb list is not rendering in schema markup #563
132
+ * Added: Time field in event schema
133
+ * Added: areaServed property in Local Business
134
+ * Added: An option to add all the available images on a post to schema markup in Advanced tab
135
+ * Enhancement: Social fields has now dynamic option to add as many as user want #553
136
+
137
  = 1.9.15 (23 Oct 2019) =
138
 
139
  * Fixed: Multiple Instances of Schema Type (i.e. LocalBusiness) Merging Improperly on Same Page #537
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.9.15
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.15');
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.9.16
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.16');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
view/post_specific.php CHANGED
@@ -362,6 +362,8 @@ class saswp_post_specific {
362
  public function saswp_post_specific_hooks(){
363
 
364
  add_action( 'admin_init', array( $this, 'saswp_get_all_schema_list' ) );
 
 
365
 
366
  add_action( 'add_meta_boxes', array( $this, 'saswp_post_specifc_add_meta_boxes' ) );
367
  add_action( 'save_post', array( $this, 'saswp_post_specific_save_fields' ) );
@@ -376,6 +378,34 @@ class saswp_post_specific {
376
  add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
377
 
378
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  /**
380
  *
381
  */
@@ -693,13 +723,23 @@ class saswp_post_specific {
693
  $checked = 'checked';
694
 
695
  }
 
 
 
 
696
 
697
- $response = $this->saswp_get_fields_by_schema_type($schema->ID);
698
- $this->meta_fields = $response;
699
-
700
- $output = $this->saswp_saswp_post_specific( $post, $schema->ID );
701
- $schema_type = get_post_meta($schema->ID, 'schema_type', true);
702
-
 
 
 
 
 
 
703
  if($key==0){
704
 
705
  $tabs .='<li class="selected"><a saswp-schema-type="'.esc_attr($schema_type).'" data-id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-tab-links selected">'.esc_attr($schema_type == 'local_business'? 'LocalBusiness': $schema_type).'</a>'
@@ -709,13 +749,7 @@ class saswp_post_specific {
709
  . '</li>';
710
 
711
  $tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper">';
712
- $tabs_fields .= '<div class="saswp-table-create-onload">';
713
- //varible $output has been escapped while creating it
714
- $tabs_fields .= '<table class="form-table"><tbody>' . $output . '</tbody></table>';
715
- $tabs_fields .= '</div>';
716
-
717
- $tabs_fields .= $this->saswp_schema_fields_html_on_the_fly($schema_type, $schema->ID, $post->ID);
718
-
719
  $tabs_fields .= '</div>';
720
 
721
  }else{
@@ -725,14 +759,10 @@ class saswp_post_specific {
725
  . '<label class="saswp-switch">'
726
  . '<input type="checkbox" class="saswp-schema-type-toggle" value="1" data-schema-id="'.esc_attr($schema->ID).'" data-post-id="'.esc_attr($post->ID).'" '.$checked.'>'
727
  . '<span class="saswp-slider"></span>'
728
- . '</li>';
729
- $tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper saswp_hide">';
730
- $tabs_fields .= '<div class="saswp-table-create-onload">';
731
- $tabs_fields .= '<table class="form-table"><tbody>' . $output . '</tbody></table>';
732
- $tabs_fields .= '</div>';
733
-
734
- $tabs_fields .= $this->saswp_schema_fields_html_on_the_fly($schema_type, $schema->ID, $post->ID);
735
 
 
 
736
  $tabs_fields .= '</div>';
737
 
738
  }
@@ -858,7 +888,7 @@ class saswp_post_specific {
858
 
859
  public function saswp_post_meta_box_callback() {
860
 
861
- global $post;
862
  wp_nonce_field( 'post_specific_data', 'post_specific_nonce' );
863
  echo $this->saswp_post_meta_box_html($post);
864
 
@@ -939,7 +969,7 @@ class saswp_post_specific {
939
 
940
  }
941
 
942
- public function saswp_saswp_post_specific( $post, $schema_id ) {
943
 
944
  global $sd_data;
945
 
@@ -962,15 +992,14 @@ class saswp_post_specific {
962
  }
963
  $schema_type = get_post_meta($schema_id, 'schema_type', true);
964
  $output = '';
965
- $this->meta_fields = array_filter($this->meta_fields);
966
-
967
- foreach ( $this->meta_fields as $meta_field ) {
968
 
969
  $input = '';
970
  $attributes = '';
971
 
972
  $label = '<label for="' . esc_attr($meta_field['id']) . '">' . esc_html__( $meta_field['label'], 'schema-and-structured-data-for-wp' ). '</label>';
973
- $meta_value = get_post_meta( $post->ID, $meta_field['id'], true );
974
 
975
  if ( empty( $meta_value ) && isset($meta_field['default'])) {
976
 
@@ -996,7 +1025,7 @@ class saswp_post_specific {
996
  $media_value = array();
997
  $media_key = $meta_field['id'].'_detail';
998
 
999
- $media_value_meta = get_post_meta( $post->ID, $media_key, true );
1000
 
1001
  if(!empty($media_value_meta)){
1002
  $media_value = $media_value_meta;
@@ -1095,7 +1124,7 @@ class saswp_post_specific {
1095
  if (strpos($meta_field['id'], 'business_name') !== false){
1096
  $class='saswp-local-business-name-select';
1097
  }
1098
- if (strpos($meta_field['id'], 'saswp_review_schema_item_type') !== false){
1099
  $class='saswp-item-reviewed';
1100
  }
1101
 
@@ -1181,8 +1210,8 @@ class saswp_post_specific {
1181
  case 'text':
1182
  case 'number':
1183
  $class = '';
1184
- if (strpos($meta_field['id'], 'closes_time') !== false || strpos($meta_field['id'], 'opens_time') !== false){
1185
- $class='saswp-local-schema-time-picker';
1186
  }
1187
  if (strpos($meta_field['id'], 'date_modified') !== false
1188
  || strpos($meta_field['id'], 'date_published') !== false
@@ -1232,10 +1261,11 @@ class saswp_post_specific {
1232
  $meta_field['id'] == 'saswp_software_schema_rating_'.$schema_id ||
1233
  $meta_field['id'] == 'saswp_service_schema_review_count_'.$schema_id ||
1234
  $meta_field['id'] == 'saswp_product_schema_review_count_'.$schema_id ||
1235
- $meta_field['id'] == 'saswp_review_schema_review_count_'.$schema_id ||
 
1236
  $meta_field['id'] == 'local_review_count_'.$schema_id ||
1237
  $meta_field['id'] == 'saswp_recipe_schema_rating_'.$schema_id ||
1238
- $meta_field['id'] == 'saswp_recipe_schema_review_count_'.$schema_id ||
1239
  $meta_field['id'] == 'saswp_software_schema_rating_count_'.$schema_id
1240
 
1241
  )
@@ -1250,7 +1280,22 @@ class saswp_post_specific {
1250
  }
1251
 
1252
  }
1253
- return $output;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1254
  }
1255
  /**
1256
  * Function to save post specific metabox fields value
@@ -1262,7 +1307,7 @@ class saswp_post_specific {
1262
 
1263
  if ( ! isset( $_POST['post_specific_nonce'] ) )
1264
  return $post_id;
1265
- $nonce = $_POST['post_specific_nonce'];
1266
  if ( !wp_verify_nonce( $nonce, 'post_specific_data' ) )
1267
  return $post_id;
1268
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
@@ -1272,7 +1317,7 @@ class saswp_post_specific {
1272
 
1273
  $option = get_option('modify_schema_post_enable_'.$post_id);
1274
 
1275
- $custom_schema = wp_unslash($_POST['saswp_custom_schema_field']);
1276
  update_post_meta( $post_id, 'saswp_custom_schema_field', $custom_schema );
1277
 
1278
  if($option != 'enable'){
@@ -1299,7 +1344,8 @@ class saswp_post_specific {
1299
 
1300
  foreach($element as $key => $val){
1301
 
1302
- $element_val = array();
 
1303
  $data = (array) $_POST[$val.'_'.$schema->ID];
1304
 
1305
  foreach ($data as $supply){
@@ -1318,13 +1364,26 @@ class saswp_post_specific {
1318
 
1319
  }
1320
 
1321
- }
1322
-
1323
- $response = $this->saswp_get_fields_by_schema_type($schema->ID, 'save');
1324
-
1325
- $this->meta_fields = $response;
1326
-
1327
- foreach ( $this->meta_fields as $meta_field ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
1328
 
1329
  if ( isset( $post_meta[ $meta_field['id'] ] ) ) {
1330
 
@@ -1362,10 +1421,8 @@ class saswp_post_specific {
1362
  update_post_meta( $post_id, $meta_field['id'], '0' );
1363
  }
1364
  }
1365
-
1366
- }
1367
- }
1368
- }
1369
 
1370
  public function saswp_get_sub_business_ajax(){
1371
 
@@ -1395,7 +1452,7 @@ class saswp_post_specific {
1395
  * @return array
1396
  * @since version 1.0.4
1397
  */
1398
- public function saswp_get_fields_by_schema_type( $schema_id, $condition = null ) {
1399
 
1400
  global $post;
1401
  global $sd_data;
@@ -1428,7 +1485,11 @@ class saswp_post_specific {
1428
  $author_details = get_avatar_data($current_user->ID);
1429
  }
1430
 
1431
- $schema_type = get_post_meta($schema_id, 'schema_type', true);
 
 
 
 
1432
 
1433
  $business_type = get_post_meta($schema_id, 'saswp_business_type', true);
1434
  $business_name = get_post_meta($schema_id, 'saswp_business_name', true);
@@ -1563,7 +1624,20 @@ class saswp_post_specific {
1563
  array(
1564
  'label' => 'Operation Days',
1565
  'id' => 'saswp_dayofweek_'.$schema_id,
1566
- 'type' => 'textarea',
 
 
 
 
 
 
 
 
 
 
 
 
 
1567
  ),
1568
  array(
1569
  'label' => 'Price Range',
@@ -2109,11 +2183,21 @@ class saswp_post_specific {
2109
  'id' => 'saswp_event_schema_start_date_'.$schema_id,
2110
  'type' => 'text',
2111
  ),
 
 
 
 
 
2112
  array(
2113
  'label' => 'End Date',
2114
  'id' => 'saswp_event_schema_end_date_'.$schema_id,
2115
  'type' => 'text',
2116
  ),
 
 
 
 
 
2117
  array(
2118
  'label' => 'Image',
2119
  'id' => 'saswp_event_schema_image_'.$schema_id,
@@ -2774,91 +2858,83 @@ class saswp_post_specific {
2774
  'note' => 'Note: Enter all the service offer in comma separated',
2775
  'attributes' => array(
2776
  'placeholder' => 'Apartment light cleaning, carpet cleaning'
2777
- ),
2778
- ),
2779
-
2780
- array(
2781
- 'label' => 'Aggregate Rating',
2782
- 'id' => 'saswp_service_schema_enable_rating_'.$schema_id,
2783
- 'type' => 'checkbox',
2784
- ),
2785
- array(
2786
- 'label' => 'Rating',
2787
- 'id' => 'saswp_service_schema_rating_'.$schema_id,
2788
- 'type' => 'text',
2789
- ),
2790
- array(
2791
- 'label' => 'Number of Reviews',
2792
- 'id' => 'saswp_service_schema_review_count_'.$schema_id,
2793
- 'type' => 'text',
2794
- ),
2795
-
2796
  );
2797
  break;
2798
 
2799
  case 'Review':
2800
-
2801
- $service_schema_details = array();
2802
-
2803
- if(isset($_POST['saswp_review_schema_item_type_'.$schema_id])){
2804
-
2805
- $reviewed_field = saswp_item_reviewed_fields(sanitize_text_field($_POST['saswp_review_schema_item_type_'.$schema_id]), $post_specific=1, $schema_id);
2806
-
2807
-
2808
- }else{
2809
-
2810
- $item_type_by_post = get_post_meta($post->ID, 'saswp_review_schema_item_type_'.$schema_id, true);
2811
-
2812
- if($item_type_by_post){
2813
-
2814
- $reviewed_field = saswp_item_reviewed_fields($item_type_by_post, $post_specific=1, $schema_id);
2815
-
2816
- }else{
2817
-
2818
- $service_schema_details = get_post_meta($schema_id, 'saswp_review_schema_details', true);
2819
- $reviewed_field = saswp_item_reviewed_fields($service_schema_details['saswp_review_schema_item_type'], $post_specific=1, $schema_id);
2820
-
2821
- }
2822
-
2823
- }
2824
 
2825
  $meta_field = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2826
  array(
2827
  'label' => 'Item Reviewed Type',
2828
- 'id' => 'saswp_review_schema_item_type_'.$schema_id,
2829
  'type' => 'select',
2830
  'options' => array(
2831
  'Book' => 'Book',
2832
  'Course' => 'Course',
2833
  'Event' => 'Event',
2834
  'HowTo' => 'HowTo',
2835
- 'LocalBusiness' => 'LocalBusiness',
2836
  'MusicPlaylist' => 'Music Playlist',
2837
  'Product' => 'Product',
2838
  'Recipe' => 'Recipe',
2839
  'SoftwareApplication' => 'SoftwareApplication',
2840
  'VideoGame' => 'VideoGame',
2841
  ),
2842
- ),
2843
- array(
2844
- 'label' => 'Review Rating',
2845
- 'id' => 'saswp_review_schema_enable_rating_'.$schema_id,
2846
- 'type' => 'checkbox',
2847
- ),
2848
- array(
2849
- 'label' => 'Rating Value',
2850
- 'id' => 'saswp_review_schema_rating_'.$schema_id,
2851
- 'type' => 'text',
2852
- ),
2853
- array(
2854
- 'label' => 'Best Rating',
2855
- 'id' => 'saswp_review_schema_review_count_'.$schema_id,
2856
- 'type' => 'text',
2857
- ),
2858
-
2859
 
2860
- );
2861
- $meta_field = array_merge($meta_field, $reviewed_field);
2862
  break;
2863
 
2864
  case 'AudioObject':
@@ -4522,6 +4598,11 @@ class saswp_post_specific {
4522
  'id' => 'saswp_book_author_'.$schema_id,
4523
  'type' => 'text',
4524
  ),
 
 
 
 
 
4525
  array(
4526
  'label' => 'ISBN',
4527
  'id' => 'saswp_book_isbn_'.$schema_id,
@@ -4584,8 +4665,9 @@ class saswp_post_specific {
4584
 
4585
  default:
4586
  break;
4587
- }
4588
- return $meta_field;
 
4589
  }
4590
  }
4591
  if (class_exists('saswp_post_specific')) {
362
  public function saswp_post_specific_hooks(){
363
 
364
  add_action( 'admin_init', array( $this, 'saswp_get_all_schema_list' ) );
365
+
366
+ add_action( 'wp_ajax_saswp_get_item_reviewed_fields', array($this, 'saswp_get_item_reviewed_fields')) ;
367
 
368
  add_action( 'add_meta_boxes', array( $this, 'saswp_post_specifc_add_meta_boxes' ) );
369
  add_action( 'save_post', array( $this, 'saswp_post_specific_save_fields' ) );
378
  add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
379
 
380
  }
381
+
382
+ /**
383
+ * Function to get review schema type html markup
384
+ * @since 1.0.8
385
+ * @return type html string
386
+ */
387
+ public function saswp_get_item_reviewed_fields(){
388
+
389
+ if ( ! isset( $_GET['saswp_security_nonce'] ) ){
390
+ return;
391
+ }
392
+ if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
393
+ return;
394
+ }
395
+
396
+ $output = '';
397
+ $item_reviewed = sanitize_text_field($_GET['item']);
398
+ $schema_id = sanitize_text_field($_GET['schema_id']);
399
+ $post_id = intval($_GET['post_id']);
400
+
401
+ $response = $this->saswp_get_fields_by_schema_type($schema_id, null, $item_reviewed);
402
+ $saswp_meta_fields = array_filter($response);
403
+ $output = $this->saswp_saswp_post_specific($saswp_meta_fields, $post_id, $schema_id, $item_reviewed);
404
+
405
+ echo $output;
406
+
407
+ wp_die();
408
+ }
409
  /**
410
  *
411
  */
723
  $checked = 'checked';
724
 
725
  }
726
+ $schema_type = get_post_meta($schema->ID, 'schema_type', true);
727
+ $response = $this->saswp_get_fields_by_schema_type($schema->ID);
728
+ $saswp_meta_fields = array_filter($response);
729
+ $output = $this->saswp_saswp_post_specific($saswp_meta_fields, $post->ID, $schema->ID );
730
 
731
+ if($schema_type == 'Review'){
732
+
733
+ $item_reviewed = get_post_meta($post->ID, 'saswp_review_item_reviewed_'.$schema->ID, true);
734
+ if(!$item_reviewed){
735
+ $item_reviewed = 'Book';
736
+ }
737
+ $response = $this->saswp_get_fields_by_schema_type($schema->ID, null, $item_reviewed);
738
+ $saswp_meta_fields = array_filter($response);
739
+ $output .= $this->saswp_saswp_post_specific($saswp_meta_fields, $post->ID, $schema->ID ,$item_reviewed);
740
+
741
+ }
742
+
743
  if($key==0){
744
 
745
  $tabs .='<li class="selected"><a saswp-schema-type="'.esc_attr($schema_type).'" data-id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-tab-links selected">'.esc_attr($schema_type == 'local_business'? 'LocalBusiness': $schema_type).'</a>'
749
  . '</li>';
750
 
751
  $tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper">';
752
+ $tabs_fields .= $output;
 
 
 
 
 
 
753
  $tabs_fields .= '</div>';
754
 
755
  }else{
759
  . '<label class="saswp-switch">'
760
  . '<input type="checkbox" class="saswp-schema-type-toggle" value="1" data-schema-id="'.esc_attr($schema->ID).'" data-post-id="'.esc_attr($post->ID).'" '.$checked.'>'
761
  . '<span class="saswp-slider"></span>'
762
+ . '</li>';
 
 
 
 
 
 
763
 
764
+ $tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper saswp_hide">';
765
+ $tabs_fields .= $output;
766
  $tabs_fields .= '</div>';
767
 
768
  }
888
 
889
  public function saswp_post_meta_box_callback() {
890
 
891
+ global $post;
892
  wp_nonce_field( 'post_specific_data', 'post_specific_nonce' );
893
  echo $this->saswp_post_meta_box_html($post);
894
 
969
 
970
  }
971
 
972
+ public function saswp_saswp_post_specific($saswp_meta_fields, $post_id, $schema_id, $item_reviewed = null) {
973
 
974
  global $sd_data;
975
 
992
  }
993
  $schema_type = get_post_meta($schema_id, 'schema_type', true);
994
  $output = '';
995
+
996
+ foreach ( $saswp_meta_fields as $meta_field ) {
 
997
 
998
  $input = '';
999
  $attributes = '';
1000
 
1001
  $label = '<label for="' . esc_attr($meta_field['id']) . '">' . esc_html__( $meta_field['label'], 'schema-and-structured-data-for-wp' ). '</label>';
1002
+ $meta_value = get_post_meta( $post_id, $meta_field['id'], true );
1003
 
1004
  if ( empty( $meta_value ) && isset($meta_field['default'])) {
1005
 
1025
  $media_value = array();
1026
  $media_key = $meta_field['id'].'_detail';
1027
 
1028
+ $media_value_meta = get_post_meta( $post_id, $media_key, true );
1029
 
1030
  if(!empty($media_value_meta)){
1031
  $media_value = $media_value_meta;
1124
  if (strpos($meta_field['id'], 'business_name') !== false){
1125
  $class='saswp-local-business-name-select';
1126
  }
1127
+ if (strpos($meta_field['id'], 'saswp_review_item_reviewed') !== false){
1128
  $class='saswp-item-reviewed';
1129
  }
1130
 
1210
  case 'text':
1211
  case 'number':
1212
  $class = '';
1213
+ if (strpos($meta_field['id'], 'closes_time') !== false || strpos($meta_field['id'], 'opens_time') !== false || strpos($meta_field['id'], 'start_time') !== false || strpos($meta_field['id'], 'end_time') !== false){
1214
+ $class='saswp-timepicker';
1215
  }
1216
  if (strpos($meta_field['id'], 'date_modified') !== false
1217
  || strpos($meta_field['id'], 'date_published') !== false
1261
  $meta_field['id'] == 'saswp_software_schema_rating_'.$schema_id ||
1262
  $meta_field['id'] == 'saswp_service_schema_review_count_'.$schema_id ||
1263
  $meta_field['id'] == 'saswp_product_schema_review_count_'.$schema_id ||
1264
+ $meta_field['id'] == 'saswp_review_review_count_'.$schema_id ||
1265
+ $meta_field['id'] == 'saswp_review_rating_'.$schema_id ||
1266
  $meta_field['id'] == 'local_review_count_'.$schema_id ||
1267
  $meta_field['id'] == 'saswp_recipe_schema_rating_'.$schema_id ||
1268
+ $meta_field['id'] == 'saswp_recipe_schema_review_count_'.$schema_id ||
1269
  $meta_field['id'] == 'saswp_software_schema_rating_count_'.$schema_id
1270
 
1271
  )
1280
  }
1281
 
1282
  }
1283
+
1284
+ $tabs_fields = '';
1285
+ $tabs_fields .= '<div class="saswp-table-create-onload">';
1286
+ //$output variable is already escaped above
1287
+ $tabs_fields .= '<table class="form-table"><tbody>' . $output . '</tbody></table>';
1288
+ $tabs_fields .= '</div>';
1289
+
1290
+ if($item_reviewed){
1291
+ $tabs_fields .= $this->saswp_schema_fields_html_on_the_fly($item_reviewed, $schema_id, $post_id);
1292
+ }else{
1293
+ $tabs_fields .= $this->saswp_schema_fields_html_on_the_fly($schema_type, $schema_id, $post_id);
1294
+ }
1295
+
1296
+
1297
+
1298
+ return $tabs_fields;
1299
  }
1300
  /**
1301
  * Function to save post specific metabox fields value
1307
 
1308
  if ( ! isset( $_POST['post_specific_nonce'] ) )
1309
  return $post_id;
1310
+ $nonce = $_POST['post_specific_nonce'];
1311
  if ( !wp_verify_nonce( $nonce, 'post_specific_data' ) )
1312
  return $post_id;
1313
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
1317
 
1318
  $option = get_option('modify_schema_post_enable_'.$post_id);
1319
 
1320
+ $custom_schema = wp_unslash($_POST['saswp_custom_schema_field']);
1321
  update_post_meta( $post_id, 'saswp_custom_schema_field', $custom_schema );
1322
 
1323
  if($option != 'enable'){
1344
 
1345
  foreach($element as $key => $val){
1346
 
1347
+ $element_val = array();
1348
+
1349
  $data = (array) $_POST[$val.'_'.$schema->ID];
1350
 
1351
  foreach ($data as $supply){
1364
 
1365
  }
1366
 
1367
+ }
1368
+
1369
+ $response = $this->saswp_get_fields_by_schema_type($schema->ID, 'save');
1370
+
1371
+ $this->saswp_save_meta_fields_value($post_meta, $response, $post_id);
1372
+
1373
+ if(isset($_POST['saswp_review_item_reviewed_'.$schema->ID]) && $_POST['saswp_review_item_reviewed_'.$schema->ID] !=''){
1374
+ $item_reviewed = sanitize_text_field($_POST['saswp_review_item_reviewed_'.$schema->ID]);
1375
+
1376
+ $response = $this->saswp_get_fields_by_schema_type($schema->ID, 'save', $item_reviewed);
1377
+ $this->saswp_save_meta_fields_value($post_meta, $response, $post_id);
1378
+ }
1379
+
1380
+ }
1381
+ }
1382
+ }
1383
+
1384
+ public function saswp_save_meta_fields_value($post_meta, $response, $post_id){
1385
+
1386
+ foreach ( $response as $meta_field ) {
1387
 
1388
  if ( isset( $post_meta[ $meta_field['id'] ] ) ) {
1389
 
1421
  update_post_meta( $post_id, $meta_field['id'], '0' );
1422
  }
1423
  }
1424
+
1425
+ }
 
 
1426
 
1427
  public function saswp_get_sub_business_ajax(){
1428
 
1452
  * @return array
1453
  * @since version 1.0.4
1454
  */
1455
+ public function saswp_get_fields_by_schema_type( $schema_id, $condition = null, $review_type = null ) {
1456
 
1457
  global $post;
1458
  global $sd_data;
1485
  $author_details = get_avatar_data($current_user->ID);
1486
  }
1487
 
1488
+ $schema_type = get_post_meta($schema_id, 'schema_type', true);
1489
+
1490
+ if($review_type){
1491
+ $schema_type = $review_type;
1492
+ }
1493
 
1494
  $business_type = get_post_meta($schema_id, 'saswp_business_type', true);
1495
  $business_name = get_post_meta($schema_id, 'saswp_business_name', true);
1624
  array(
1625
  'label' => 'Operation Days',
1626
  'id' => 'saswp_dayofweek_'.$schema_id,
1627
+ 'type' => 'textarea',
1628
+ 'attributes' => array(
1629
+ 'placeholder' => 'Mo-Sa 11:00-14:30&#10;Mo-Th 17:00-21:30&#10;Fr-Sa 17:00-22:00'
1630
+ ),
1631
+ 'note' => 'Note: Enter one operation days per line without comma.'
1632
+ ),
1633
+ array(
1634
+ 'label' => 'Area Served',
1635
+ 'id' => 'local_area_served_'.$schema_id,
1636
+ 'type' => 'textarea',
1637
+ 'attributes' => array(
1638
+ 'placeholder' => 'Example, Example2'
1639
+ ),
1640
+ 'note' => 'Note: Separate area served list by comma ( , )'
1641
  ),
1642
  array(
1643
  'label' => 'Price Range',
2183
  'id' => 'saswp_event_schema_start_date_'.$schema_id,
2184
  'type' => 'text',
2185
  ),
2186
+ array(
2187
+ 'label' => 'Start Time',
2188
+ 'id' => 'saswp_event_schema_start_time_'.$schema_id,
2189
+ 'type' => 'text',
2190
+ ),
2191
  array(
2192
  'label' => 'End Date',
2193
  'id' => 'saswp_event_schema_end_date_'.$schema_id,
2194
  'type' => 'text',
2195
  ),
2196
+ array(
2197
+ 'label' => 'End Time',
2198
+ 'id' => 'saswp_event_schema_end_time_'.$schema_id,
2199
+ 'type' => 'text',
2200
+ ),
2201
  array(
2202
  'label' => 'Image',
2203
  'id' => 'saswp_event_schema_image_'.$schema_id,
2858
  'note' => 'Note: Enter all the service offer in comma separated',
2859
  'attributes' => array(
2860
  'placeholder' => 'Apartment light cleaning, carpet cleaning'
2861
+ )
2862
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2863
  );
2864
  break;
2865
 
2866
  case 'Review':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2867
 
2868
  $meta_field = array(
2869
+ array(
2870
+ 'label' => 'Review Name',
2871
+ 'id' => 'saswp_review_name_'.$schema_id,
2872
+ 'type' => 'text',
2873
+ ),
2874
+ array(
2875
+ 'label' => 'Review Description',
2876
+ 'id' => 'saswp_review_description_'.$schema_id,
2877
+ 'type' => 'textarea',
2878
+ ),
2879
+ array(
2880
+ 'label' => 'Review Author',
2881
+ 'id' => 'saswp_review_author_'.$schema_id,
2882
+ 'type' => 'text',
2883
+ ),
2884
+ array(
2885
+ 'label' => 'Review Author Profile URL',
2886
+ 'id' => 'saswp_review_author_url_'.$schema_id,
2887
+ 'type' => 'text',
2888
+ ),
2889
+ array(
2890
+ 'label' => 'Review Publisher',
2891
+ 'id' => 'saswp_review_publisher_'.$schema_id,
2892
+ 'type' => 'text',
2893
+ ),
2894
+ array(
2895
+ 'label' => 'Review Published Date',
2896
+ 'id' => 'saswp_review_date_published_'.$schema_id,
2897
+ 'type' => 'text',
2898
+ ),
2899
+ array(
2900
+ 'label' => 'Review URL',
2901
+ 'id' => 'saswp_review_url_'.$schema_id,
2902
+ 'type' => 'text',
2903
+ ),
2904
+ array(
2905
+ 'label' => 'Review Rating',
2906
+ 'id' => 'saswp_review_enable_rating_'.$schema_id,
2907
+ 'type' => 'checkbox',
2908
+ ),
2909
+ array(
2910
+ 'label' => 'Rating Value',
2911
+ 'id' => 'saswp_review_rating_'.$schema_id,
2912
+ 'type' => 'text',
2913
+ ),
2914
+ array(
2915
+ 'label' => 'Best Rating',
2916
+ 'id' => 'saswp_review_review_count_'.$schema_id,
2917
+ 'type' => 'text',
2918
+ ),
2919
  array(
2920
  'label' => 'Item Reviewed Type',
2921
+ 'id' => 'saswp_review_item_reviewed_'.$schema_id,
2922
  'type' => 'select',
2923
  'options' => array(
2924
  'Book' => 'Book',
2925
  'Course' => 'Course',
2926
  'Event' => 'Event',
2927
  'HowTo' => 'HowTo',
2928
+ 'local_business' => 'LocalBusiness',
2929
  'MusicPlaylist' => 'Music Playlist',
2930
  'Product' => 'Product',
2931
  'Recipe' => 'Recipe',
2932
  'SoftwareApplication' => 'SoftwareApplication',
2933
  'VideoGame' => 'VideoGame',
2934
  ),
2935
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2936
 
2937
+ );
 
2938
  break;
2939
 
2940
  case 'AudioObject':
4598
  'id' => 'saswp_book_author_'.$schema_id,
4599
  'type' => 'text',
4600
  ),
4601
+ array(
4602
+ 'label' => 'Author Profile URL',
4603
+ 'id' => 'saswp_book_author_url_'.$schema_id,
4604
+ 'type' => 'text',
4605
+ ),
4606
  array(
4607
  'label' => 'ISBN',
4608
  'id' => 'saswp_book_isbn_'.$schema_id,
4665
 
4666
  default:
4667
  break;
4668
+ }
4669
+
4670
+ return $meta_field;
4671
  }
4672
  }
4673
  if (class_exists('saswp_post_specific')) {
view/schema_type.php CHANGED
@@ -12,465 +12,9 @@ if ( ! defined( 'ABSPATH' ) ) exit;
12
  /**
13
  * List of hooks used in this file
14
  */
15
- add_action( 'wp_ajax_saswp_get_item_reviewed_fields', 'saswp_get_item_reviewed_fields' ) ;
16
  add_action( 'save_post', 'saswp_schema_type_add_meta_box_save' ) ;
17
  add_action( 'add_meta_boxes', 'saswp_schema_type_add_meta_box' ) ;
18
 
19
- /**
20
- * Function to get review schema type fields as an array
21
- * @param type $item
22
- * @param type $post_specific
23
- * @param type $schema_id
24
- * @return array
25
- * @since 1.0.8
26
- */
27
- function saswp_item_reviewed_fields($item, $post_specific = null, $schema_id = null){
28
-
29
- $post_fix = '';
30
-
31
- if($post_specific == 1 && isset($schema_id)){
32
-
33
- $post_fix = '_'.esc_attr($schema_id);
34
-
35
- }
36
-
37
- $reviewed_field = array(
38
- array(
39
- 'label' => 'Name',
40
- 'id' => 'saswp_review_schema_name'.$post_fix,
41
- 'type' => 'text',
42
- 'default' => '',
43
- 'attributes' => array(
44
- 'placeholder' => 'Name'
45
- )
46
-
47
- ),
48
- array(
49
- 'label' => 'Review Body',
50
- 'id' => 'saswp_review_schema_description'.$post_fix,
51
- 'type' => 'textarea',
52
- 'default' => '',
53
- 'attributes' => array(
54
- 'placeholder' => 'Review Body'
55
- )
56
- ),
57
- array(
58
- 'label' => 'Image',
59
- 'id' => 'saswp_review_schema_image'.$post_fix,
60
- 'type' => 'media',
61
- 'default' => '',
62
- 'attributes' => array(
63
- 'placeholder' => 'Image'
64
- )
65
- ),
66
- array(
67
- 'label' => 'Author',
68
- 'id' => 'saswp_review_schema_author'.$post_fix,
69
- 'type' => 'text',
70
- 'default' => '',
71
- 'attributes' => array(
72
- 'placeholder' => 'Author'
73
- )
74
- ),
75
- array(
76
- 'label' => 'Price Range',
77
- 'id' => 'saswp_review_schema_price_range'.$post_fix,
78
- 'type' => 'text',
79
- 'default' => '',
80
- 'attributes' => array(
81
- 'placeholder' => '$$$ or 55$-100$'
82
- )
83
- ),
84
- array(
85
- 'label' => 'Street Address',
86
- 'id' => 'saswp_review_schema_street_address'.$post_fix,
87
- 'type' => 'text',
88
- 'default' => '',
89
- 'attributes' => array(
90
- 'placeholder' => 'Street Address'
91
- )
92
- ),
93
- array(
94
- 'label' => 'Address Locality',
95
- 'id' => 'saswp_review_schema_locality'.$post_fix,
96
- 'type' => 'text',
97
- 'default' => '',
98
- 'attributes' => array(
99
- 'placeholder' => 'Address Locality'
100
- )
101
- ),
102
- array(
103
- 'label' => 'Address Region',
104
- 'id' => 'saswp_review_schema_region'.$post_fix,
105
- 'type' => 'text',
106
- 'default' => '',
107
- 'attributes' => array(
108
- 'placeholder' => 'Address Region'
109
- )
110
- ),
111
- array(
112
- 'label' => 'Postal Code',
113
- 'id' => 'saswp_review_schema_postal_code'.$post_fix,
114
- 'type' => 'text',
115
- 'default' => '',
116
- 'attributes' => array(
117
- 'placeholder' => 'Postal Code'
118
- )
119
- ),
120
- array(
121
- 'label' => 'Address Country',
122
- 'id' => 'saswp_review_schema_country'.$post_fix,
123
- 'type' => 'text',
124
- 'default' => '',
125
- 'attributes' => array(
126
- 'placeholder' => 'Country'
127
- )
128
- ),
129
- array(
130
- 'label' => 'Telephone',
131
- 'id' => 'saswp_review_schema_telephone'.$post_fix,
132
- 'type' => 'text',
133
- 'default' => '',
134
- 'attributes' => array(
135
- 'placeholder' => '123456789'
136
- )
137
- ),
138
-
139
- );
140
-
141
- switch ($item) {
142
-
143
-
144
- case 'Adultentertainment':
145
-
146
- $reviewed_field;
147
-
148
- break;
149
- case 'Blog':
150
-
151
- $reviewed_field = array(
152
- array(
153
- 'label' => 'Name',
154
- 'id' => 'saswp_review_schema_name'.$post_fix,
155
- 'type' => 'text',
156
- 'default' => $site_name = get_bloginfo()
157
- ),
158
- array(
159
- 'label' => 'Url',
160
- 'id' => 'saswp_review_schema_url'.$post_fix,
161
- 'type' => 'text',
162
- 'default' => get_site_url()
163
- )
164
- );
165
-
166
- break;
167
- case 'Book':
168
-
169
- $reviewed_field = array(
170
- array(
171
- 'label' => 'Name',
172
- 'id' => 'saswp_review_schema_name'.$post_fix,
173
- 'type' => 'text',
174
- 'default' => '',
175
- 'attributes' => array(
176
- 'placeholder' => 'Name'
177
- )
178
- ),
179
- array(
180
- 'label' => 'Author',
181
- 'id' => 'saswp_review_schema_author'.$post_fix,
182
- 'type' => 'text',
183
- 'default' => '',
184
- 'attributes' => array(
185
- 'placeholder' => 'Author'
186
- )
187
- ),
188
- array(
189
- 'label' => 'ISBN',
190
- 'id' => 'saswp_review_schema_isbn'.$post_fix,
191
- 'type' => 'text',
192
- 'default' => '',
193
- 'attributes' => array(
194
- 'placeholder' => 'ISBN'
195
- )
196
- ),
197
- array(
198
- 'label' => 'URL',
199
- 'id' => 'saswp_review_schema_author_sameas'.$post_fix,
200
- 'type' => 'text',
201
- 'default' => '',
202
- 'attributes' => array(
203
- 'placeholder' => 'URL'
204
- )
205
- ),
206
- array(
207
- 'label' => 'Review Body',
208
- 'id' => 'saswp_review_schema_description'.$post_fix,
209
- 'type' => 'textarea',
210
- 'default' => '',
211
- 'attributes' => array(
212
- 'placeholder' => 'Review Body'
213
- )
214
- )
215
-
216
- );
217
-
218
- break;
219
- case 'Movie':
220
- $reviewed_field = array(
221
- array(
222
- 'label' => 'Name',
223
- 'id' => 'saswp_review_schema_name'.$post_fix,
224
- 'type' => 'text',
225
- 'default' => '',
226
- 'attributes' => array(
227
- 'placeholder' => 'Name'
228
- )
229
- ),
230
- array(
231
- 'label' => 'Date Created',
232
- 'id' => 'saswp_review_schema_date_created'.$post_fix,
233
- 'type' => 'text',
234
- 'default' => '',
235
- 'attributes' => array(
236
- 'placeholder' => '2017-05-17'
237
- )
238
- ),
239
- array(
240
- 'label' => 'Image',
241
- 'id' => 'saswp_review_schema_image'.$post_fix,
242
- 'type' => 'media',
243
- 'default' => '',
244
- 'attributes' => array(
245
- 'placeholder' => 'Image'
246
- )
247
- ),
248
- array(
249
- 'label' => 'Director',
250
- 'id' => 'saswp_review_schema_director'.$post_fix,
251
- 'type' => 'text',
252
- 'default' => '',
253
- 'attributes' => array(
254
- 'placeholder' => 'Director'
255
- )
256
- ),
257
- array(
258
- 'label' => 'URL',
259
- 'id' => 'saswp_review_schema_itemreviewed_sameas'.$post_fix,
260
- 'type' => 'text',
261
- 'default' => '',
262
- 'attributes' => array(
263
- 'placeholder' => 'URL'
264
- )
265
- ),
266
- array(
267
- 'label' => 'Review Body',
268
- 'id' => 'saswp_review_schema_description'.$post_fix,
269
- 'type' => 'textarea',
270
- 'default' => '',
271
- 'attributes' => array(
272
- 'placeholder' => 'Review Body'
273
- )
274
- )
275
-
276
- );
277
- break;
278
- case 'Restaurant':
279
- $reviewed_field[] = array(
280
- 'label' => 'Serves Cuisine',
281
- 'id' => 'saswp_review_schema_servescuisine'.$post_fix,
282
- 'type' => 'text',
283
- 'default' => '',
284
- 'attributes' => array(
285
- 'placeholder' => 'Serves Cuisine'
286
- )
287
- );
288
- $reviewed_field[] = array(
289
- 'label' => 'Menu',
290
- 'id' => 'saswp_review_schema_menu'.$post_fix,
291
- 'type' => 'text',
292
- 'default' => '',
293
- 'attributes' => array(
294
- 'placeholder' => 'https://example.com/menu'
295
- )
296
- );
297
- break;
298
- case 'WebSite':
299
- $reviewed_field = array(
300
- array(
301
- 'label' => 'Name',
302
- 'id' => 'saswp_review_schema_name'.$post_fix,
303
- 'type' => 'text',
304
- 'default' => $site_name = get_bloginfo()
305
- ),
306
- array(
307
- 'label' => 'Url',
308
- 'id' => 'saswp_review_schema_url'.$post_fix,
309
- 'type' => 'text',
310
- 'default' => get_site_url()
311
- )
312
- );
313
- break;
314
-
315
- default:
316
- break;
317
- }
318
-
319
- return $reviewed_field;
320
-
321
- }
322
- /**
323
- * Function to get review schema type html markup
324
- * @since 1.0.8
325
- * @return type html string
326
- */
327
- function saswp_get_item_reviewed_fields(){
328
-
329
- if ( ! isset( $_GET['saswp_security_nonce'] ) ){
330
- return;
331
- }
332
- if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
333
- return;
334
- }
335
-
336
- $post_specific = '';
337
- $output = '';
338
- $item = sanitize_text_field($_GET['item']);
339
- $schema_id = sanitize_text_field($_GET['schema_id']);
340
- $post_id = intval($_GET['post_id']);
341
-
342
- if(isset($_GET['post_specific'])){
343
- $post_specific = sanitize_text_field($_GET['post_specific']);
344
- }
345
-
346
- $meta_fields = saswp_item_reviewed_fields($item, $post_specific, $schema_id);
347
-
348
- if($meta_fields){
349
-
350
- foreach ($meta_fields as $meta_field){
351
-
352
- $attributes ='';
353
-
354
- if(isset($meta_field['attributes'])){
355
-
356
- foreach ($meta_field['attributes'] as $key => $attr ){
357
-
358
- $attributes .=''.esc_attr($key).'="'.esc_attr($attr).'"';
359
-
360
- }
361
- }
362
-
363
-
364
- if($post_specific == 1){
365
-
366
- $meta_value = get_post_meta( $post_id, $meta_field['id'], true );
367
-
368
- if(!$meta_value){
369
-
370
- $schema_data = get_post_meta( $schema_id, 'saswp_review_schema_details', true );
371
-
372
- $meta_value = $schema_data[chop($meta_field['id'], '_'.$schema_id)];
373
- }
374
-
375
- }else{
376
-
377
- $schema_data = get_post_meta( $schema_id, 'saswp_review_schema_details', true );
378
- $meta_value = $schema_data[$meta_field['id']];
379
-
380
- }
381
-
382
- if ( empty( $meta_value ) ) {
383
-
384
- $meta_value = $meta_field['default'];
385
-
386
- }
387
-
388
- switch ($meta_field['type']) {
389
-
390
- case 'media':
391
-
392
- $media_value = array();
393
- $media_key = $meta_field['id'].'_detail';
394
-
395
- if($post_specific == 1){
396
-
397
- $media_value_meta = get_post_meta( $post_id, $media_key, true );
398
-
399
- if(empty($media_value_meta)){
400
-
401
- $media_key = chop($meta_field['id'], '_'.$schema_id).'_detail';
402
- $media_value_meta = $schema_data[$media_key];
403
-
404
- }
405
-
406
- }else{
407
-
408
- $media_value_meta = $schema_data[$media_key];
409
-
410
- }
411
-
412
- if(!empty($media_value_meta)){
413
-
414
- $media_value = $media_value_meta;
415
-
416
- }
417
-
418
- $input = sprintf(
419
- ' <input style="width: 80%%" id="%s" name="%s" type="text" value="%s" readonly>'
420
- . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_height" class="upload-height" name="'.esc_attr($meta_field['id']).'_height" id="'.esc_attr($meta_field['id']).'_height" value="'.esc_attr($media_value['height']).'">'
421
- . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_width" class="upload-width" name="'.esc_attr($meta_field['id']).'_width" id="'.esc_attr($meta_field['id']).'_width" value="'.esc_attr($media_value['width']).'">'
422
- . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_thumbnail" class="upload-thumbnail" name="'.esc_attr($meta_field['id']).'_thumbnail" id="'.esc_attr($meta_field['id']).'_thumbnail" value="'.esc_url($media_value['thumbnail']).'">'
423
- . '<input data-id="media" style="width: 19%%" class="button" id="%s_button" name="%s_button" type="button" value="Upload" />',
424
- esc_attr($meta_field['id']),
425
- esc_attr($meta_field['id']),
426
- esc_url($meta_value),
427
- esc_attr($meta_field['id']),
428
- esc_attr($meta_field['id'])
429
- );
430
-
431
-
432
- break;
433
-
434
- case 'textarea':
435
- $input = sprintf(
436
- '<textarea %s style="width: 100%%" id="%s" name="%s" rows="5">%s</textarea>',
437
- $attributes,
438
- esc_attr($meta_field['id']),
439
- esc_attr($meta_field['id']),
440
- $meta_value
441
- );
442
- break;
443
-
444
- default:
445
-
446
- $input = sprintf(
447
- '<input %s %s id="%s" name="%s" type="%s" value="%s">',
448
- $attributes,
449
- $meta_field['type'] !== 'color' ? 'style="width: 100%"' : '',
450
- esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
451
- esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
452
- esc_attr(saswp_remove_warnings($meta_field, 'type', 'saswp_string')),
453
- $meta_value
454
- );
455
-
456
- break;
457
-
458
- }
459
-
460
- $output .= '<tr class="saswp-review-tr">'
461
- . '<td>'.esc_html__($meta_field['label'], 'schema-and-structured-data-for-wp' ).'</td>'
462
- . '<td>'.$input.'</td>'
463
- . '</tr>';
464
-
465
- }
466
-
467
- }
468
-
469
-
470
- echo $output;
471
-
472
- wp_die();
473
- }
474
  /**
475
  * Register a schema type metabox
476
  * @return null
@@ -744,7 +288,7 @@ function saswp_schema_type_meta_box_callback( $post) {
744
  'Course' => 'Course',
745
  'Event' => 'Event',
746
  'HowTo' => 'HowTo',
747
- 'LocalBusiness' => 'LocalBusiness',
748
  'MusicPlaylist' => 'Music Playlist',
749
  'Product' => 'Product',
750
  'Recipe' => 'Recipe',
@@ -1146,9 +690,10 @@ function saswp_schema_type_meta_box_callback( $post) {
1146
  <?php
1147
 
1148
  if(!empty($meta_list)){
1149
-
1150
- $service = new saswp_output_service();
1151
 
 
 
 
1152
  $schema_type = get_post_meta($post->ID, 'schema_type', true);
1153
 
1154
  if($schema_type == 'Review'){
@@ -1156,30 +701,49 @@ function saswp_schema_type_meta_box_callback( $post) {
1156
  $review_post_meta = get_post_meta($post->ID, 'saswp_review_schema_details', true);
1157
  $schema_type = $review_post_meta['saswp_review_schema_item_type'];
1158
 
1159
- $review_fields['saswp_review_name'] = 'Review Name';
1160
- $review_fields['saswp_review_description'] = 'Review Description';
1161
- $review_fields['saswp_review_body'] = 'Review Body';
1162
- $review_fields['saswp_review_author'] = 'Review Author';
1163
- $review_fields['saswp_review_publisher'] = 'Review Publisher';
1164
- $review_fields['saswp_review_rating_value'] = 'Review Rating Value';
1165
-
1166
- $item_rv_meta_fields = $service->saswp_get_all_schema_type_fields($schema_type);
1167
-
1168
- $meta_fields = $review_fields + $item_rv_meta_fields;
1169
-
1170
-
1171
- }else{
1172
-
1173
- $meta_fields = $service->saswp_get_all_schema_type_fields($schema_type);
1174
-
1175
  }
1176
 
 
 
1177
  foreach($meta_list as $fieldkey => $fieldval){
1178
 
1179
  $option = '';
1180
  echo '<tr>';
1181
  echo '<td><select class="saswp-custom-fields-name">';
1182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
  foreach ($meta_fields as $key =>$val){
1184
 
1185
  if( $fieldkey == $key){
@@ -1193,6 +757,10 @@ function saswp_schema_type_meta_box_callback( $post) {
1193
  }
1194
 
1195
  }
 
 
 
 
1196
 
1197
  echo $option;
1198
  echo '</select>';
12
  /**
13
  * List of hooks used in this file
14
  */
 
15
  add_action( 'save_post', 'saswp_schema_type_add_meta_box_save' ) ;
16
  add_action( 'add_meta_boxes', 'saswp_schema_type_add_meta_box' ) ;
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  /**
19
  * Register a schema type metabox
20
  * @return null
288
  'Course' => 'Course',
289
  'Event' => 'Event',
290
  'HowTo' => 'HowTo',
291
+ 'local_business' => 'LocalBusiness',
292
  'MusicPlaylist' => 'Music Playlist',
293
  'Product' => 'Product',
294
  'Recipe' => 'Recipe',
690
  <?php
691
 
692
  if(!empty($meta_list)){
 
 
693
 
694
+ $review_fields = array();
695
+ $service = new saswp_output_service();
696
+
697
  $schema_type = get_post_meta($post->ID, 'schema_type', true);
698
 
699
  if($schema_type == 'Review'){
701
  $review_post_meta = get_post_meta($post->ID, 'saswp_review_schema_details', true);
702
  $schema_type = $review_post_meta['saswp_review_schema_item_type'];
703
 
704
+ $review_fields['saswp_review_name'] = 'Review Name';
705
+ $review_fields['saswp_review_description'] = 'Review Description';
706
+ $review_fields['saswp_review_author'] = 'Review Author';
707
+ $review_fields['saswp_review_author_url'] = 'Review Author Profile URL';
708
+ $review_fields['saswp_review_publisher'] = 'Review Publisher';
709
+ $review_fields['saswp_review_rating_value'] = 'Review Rating Value';
710
+ $review_fields['saswp_review_date_published'] = 'Review Published Date';
711
+ $review_fields['saswp_review_url'] = 'Review URL';
712
+
 
 
 
 
 
 
 
713
  }
714
 
715
+ $meta_fields = $service->saswp_get_all_schema_type_fields($schema_type);
716
+
717
  foreach($meta_list as $fieldkey => $fieldval){
718
 
719
  $option = '';
720
  echo '<tr>';
721
  echo '<td><select class="saswp-custom-fields-name">';
722
 
723
+ if($review_fields){
724
+
725
+ $option .= '<optgroup label="Reviews">';
726
+
727
+ foreach ($review_fields as $key =>$val){
728
+
729
+ if( $fieldkey == $key){
730
+
731
+ $option .='<option value="'.esc_attr($key).'" selected>'.esc_attr($val).'</option>';
732
+
733
+ }else{
734
+
735
+ $option .='<option value="'.esc_attr($key).'">'.esc_attr($val).'</option>';
736
+
737
+ }
738
+
739
+ }
740
+ $option .= '</optgroup>';
741
+ }
742
+
743
+ if($review_fields){
744
+ $option .= '<optgroup label="'.esc_attr($schema_type).'">';
745
+ }
746
+
747
  foreach ($meta_fields as $key =>$val){
748
 
749
  if( $fieldkey == $key){
757
  }
758
 
759
  }
760
+
761
+ if($review_fields){
762
+ $option .= '</optgroup>';
763
+ }
764
 
765
  echo $option;
766
  echo '</select>';