Version Description
(25 Feb 2020) =
- Fixed: GPS coordinates are not working on Post for tourist attraction schema type. #800
- Fixed: BlogPosting is not a known valid target type for the itemReviewed property. #812
- Fixed: User is not able to view the embeded url in the post url #815
- Fixed: Allow the form when ampforwp-form-allow class is available #798
- Fixed: Shortcode should not be there in article body #802
- Fixed: Reviews are not integrating into the Course schema type.(urgent) #816
- Fixed: Change the URL of "Upgrade to premium" option in dashboard. #808
- Fixed: Itemlist schema always show article as item type on individual post #810
- Fixed: Speed issue after activation of schema plugin #778
- Fixed: DiscussionForumPosting issue with headline #801
- Fixed: Corporation is not a known valid target type for the publisher property. #783
- Fixed: Date is not appearing single review shortcode #791
- Fixed: Resize the image based on height and width #811
- Fixed: Restore to Auto Fetch option does not fetch the data from the current article, but displays data from previous article. #825
- Fixed: Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' #829
- Fixed: Question Title in Q&A schema is not being displayed. Shows "Unspecified Type" in its place. #827
- Added: Allow Multiple Size Images Creation #828
- Added: sameAs property in Review schema #803
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.9.27 |
Comparing to | |
See all releases |
Code changes from version 1.9.26 to 1.9.27
- admin_section/common-function.php +13 -12
- admin_section/js/functions-list.js +2 -1
- admin_section/js/functions-list.min.js +1 -1
- admin_section/js/main-script.js +63 -35
- admin_section/js/main-script.min.js +1 -1
- admin_section/settings.php +14 -2
- core/3rd-party/class-amp-review-form-blacklist.php +1 -1
- core/array-list/schema-properties.php +41 -11
- modules/reviews/reviews_service.php +3 -2
- output/function.php +1 -1
- output/markup.php +52 -25
- output/output.php +73 -48
- output/service.php +68 -62
- readme.txt +22 -1
- structured-data-for-wp.php +2 -2
- view/common.php +25 -24
- view/paywall.php +1 -0
- view/post_specific.php +120 -9
- view/schema_type.php +3 -0
admin_section/common-function.php
CHANGED
@@ -1700,18 +1700,19 @@ if ( ! defined('ABSPATH') ) exit;
|
|
1700 |
}
|
1701 |
$defaults = array(
|
1702 |
|
1703 |
-
'saswp_kb_type'
|
1704 |
-
'sd_name'
|
1705 |
-
'sd_alt_name'
|
1706 |
-
'sd_url'
|
1707 |
-
'sd-person-name'
|
1708 |
-
'sd-person-url'
|
1709 |
-
'saswp_kb_contact_1'
|
1710 |
-
'saswp-for-wordpress'
|
1711 |
-
'sd_initial_wizard_status'
|
1712 |
-
'saswp-microdata-cleanup'
|
1713 |
-
'saswp-other-images'
|
1714 |
-
'saswp_default_review'
|
|
|
1715 |
|
1716 |
);
|
1717 |
|
1700 |
}
|
1701 |
$defaults = array(
|
1702 |
|
1703 |
+
'saswp_kb_type' => 'Organization',
|
1704 |
+
'sd_name' => $sd_name,
|
1705 |
+
'sd_alt_name' => $sd_name,
|
1706 |
+
'sd_url' => $current_url,
|
1707 |
+
'sd-person-name' => $username,
|
1708 |
+
'sd-person-url' => $current_url,
|
1709 |
+
'saswp_kb_contact_1' => 0,
|
1710 |
+
'saswp-for-wordpress' => 1,
|
1711 |
+
'sd_initial_wizard_status' => 1,
|
1712 |
+
'saswp-microdata-cleanup' => 1,
|
1713 |
+
'saswp-other-images' => 1,
|
1714 |
+
'saswp_default_review' => 1,
|
1715 |
+
'saswp-multiple-size-image' => 1
|
1716 |
|
1717 |
);
|
1718 |
|
admin_section/js/functions-list.js
CHANGED
@@ -246,7 +246,8 @@
|
|
246 |
html += '<option value="saswp_review_description">Review Description</option>';
|
247 |
html += '<option value="saswp_review_author">Review Author</option>';
|
248 |
html += '<option value="saswp_review_author_url">Review Author Profile URL</option>';
|
249 |
-
html += '<option value="saswp_review_publisher">Review Publisher</option>';
|
|
|
250 |
html += '<option value="saswp_review_rating_value">Review Rating Value</option>';
|
251 |
html += '<option value="saswp_review_date_published">Review Published Date</option>';
|
252 |
html += '<option value="saswp_review_url">Review URL</option>';
|
246 |
html += '<option value="saswp_review_description">Review Description</option>';
|
247 |
html += '<option value="saswp_review_author">Review Author</option>';
|
248 |
html += '<option value="saswp_review_author_url">Review Author Profile URL</option>';
|
249 |
+
html += '<option value="saswp_review_publisher">Review Publisher</option>';
|
250 |
+
html += '<option value="saswp_review_publisher_url">Review Publisher URL</option>';
|
251 |
html += '<option value="saswp_review_rating_value">Review Rating Value</option>';
|
252 |
html += '<option value="saswp_review_date_published">Review Published Date</option>';
|
253 |
html += '<option value="saswp_review_url">Review URL</option>';
|
admin_section/js/functions-list.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var saswp_meta_list=[],saswp_meta_fields=[],saswp_meta_list_fields=[],saswp_taxonomy_term=[],saswp_collection=[],saswp_total_collection=[],saswp_total_reviews=[],saswp_coll_json=null,saswp_grid_page=1;function saswp_convert_datetostring(s){var e={};if(s){var a=new Date(s);e={time:a.toLocaleTimeString(),date:a.toLocaleDateString()}}else e={time:"",date:""};return e}function saswp_taxonomy_term_html(s,e){var a="";return a+="<td>",a+='<select name="saswp_taxonomy_term['+e+']">',jQuery.each(s,function(s,e){a+='<option value="'+s+'">'+e+"</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 s="";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")),s&&jQuery(".saswp-enable-rating-review-"+s.toLowerCase()).change(function(){jQuery(this).is(":checked")?jQuery(this).parent().parent().siblings(".saswp-rating-review-"+s.toLowerCase()).show():jQuery(this).parent().parent().siblings(".saswp-rating-review-"+s.toLowerCase()).hide()}).change()}function getParameterByName(s,e){e||(e=window.location.href),s=s.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+s+"(=([^&#]*)|&|#|$)").exec(e);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(s){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:s.term,action:"saswp_get_custom_meta_fields"}},processResults:function(s){return{results:s}},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_ajax(s,e,a=null){var t=e.val(),i=saswp_localize_data.post_id,n=jQuery(e).attr("data-id"),p=jQuery(e).attr("post-specific"),r=jQuery(".saswp_modify_this_schema_hidden_"+n).val();append_id=null==a?jQuery("#saswp_specific_"+n):jQuery(".saswp-manual-modification"),jQuery.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",modify_this:r,schema_type:s,schema_id:n,post_specific:p,item:t,post_id:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){jQuery(append_id).find(".saswp-table-create-onajax").remove();var e=jQuery(append_id).find(".saswp-table-create-onload");jQuery.each(e,function(s,e){0!=s&&jQuery(this).remove()}),jQuery(append_id).append(s),saswp_schema_datepicker(),saswp_schema_timepicker()})}function saswp_item_reviewed_call(){jQuery(".saswp-item-reviewed").change(function(s){s.preventDefault();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")),"Review"===e)&&saswp_item_reviewed_ajax(e,jQuery(this))}).change()}function saswp_compatibliy_notes(s,e){var a=e.replace("-checkbox",""),t=jQuery("#"+a).next("p").text();s.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(s,e,a,t,i,n){var p=t;null==p&&(p=Object.keys(a)[0]);var r="";if(r+='<select class="saswp-custom-meta-list" name="saswp_meta_list_val['+p+']">',jQuery.each(e,function(s,e){r+='<optgroup label="'+e.label+'">',jQuery.each(e["meta-list"],function(s,e){r+='<option value="'+s+'">'+e+"</option>"}),r+="</optgroup>"}),r+="</select>",a){var l=jQuery("select#schema_type option:selected").val(),c="";"Review"==l&&(c=jQuery("select.saswp-item-reivewed-list option:selected").val());var o="<tr>";o+="<td>",o+='<select class="saswp-custom-fields-name">',"Review"==l&&(o+='<optgroup label="Review">',o+='<option value="saswp_review_name">Review Name</option>',o+='<option value="saswp_review_description">Review Description</option>',o+='<option value="saswp_review_author">Review Author</option>',o+='<option value="saswp_review_author_url">Review Author Profile URL</option>',o+='<option value="saswp_review_publisher">Review Publisher</option>',o+='<option value="saswp_review_rating_value">Review Rating Value</option>',o+='<option value="saswp_review_date_published">Review Published Date</option>',o+='<option value="saswp_review_url">Review URL</option>',o+="</optgroup>"),"Review"==l&&(o+='<optgroup label="'+c+'">'),jQuery.each(a,function(s,e){o+='<option value="'+s+'">'+e+"</option>"}),"Review"==l&&(o+="</optgroup>"),o+="</select>",o+="</td>",o+="<td>",o+=r,o+="</td>",o+='<td></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td>',o+="</tr>",jQuery(".saswp-custom-fields-table").append(o),null!=s&&s.removeClass("updating-message")}else jQuery(i).html(r),null!=s&&s.removeClass("updating-message")}function saswp_get_meta_list(s,e,a,t,i,n){saswp_meta_list[e]?saswp_meta_list_html(s,saswp_meta_list[e],a,i,t,n):jQuery.get(ajaxurl,{action:"saswp_get_meta_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(p){saswp_meta_list[e]=p[e],saswp_meta_list_html(s,saswp_meta_list[e],a,i,t,n)},"json")}function saswp_get_post_specific_schema_fields(s,e,a,t,i,n,p){if(saswp_meta_fields[n]){var r=saswp_fields_html_generator(e,i,n,t,saswp_meta_fields[n]);r&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(r),saswp_schema_datepicker(),saswp_schema_timepicker(),s.removeClass("updating-message"))}else jQuery.get(ajaxurl,{action:"saswp_get_schema_dynamic_fields_ajax",schema_id:i,schema_type:p,meta_name:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){saswp_meta_fields[n]=a;var p=saswp_fields_html_generator(e,i,n,t,a);p&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(p),saswp_schema_datepicker(),saswp_schema_timepicker(),s.removeClass("updating-message"))},"json")}function saswp_fields_html_generator(s,e,a,t,i){var n="";return n+='<div class="saswp-'+t+'-table-div saswp-dynamic-properties" data-id="'+s+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',jQuery.each(i,function(t,i){var p="";switch((i.name.indexOf("published_date")>-1||i.name.indexOf("date_created")>-1||i.name.indexOf("created_date")>-1||i.name.indexOf("modified_date")>-1||i.name.indexOf("date_published")>-1||i.name.indexOf("date_modified")>-1)&&(p="saswp-datepicker-picker"),i.type){case"number":case"text":n+="<tr><th>"+i.label+'</th><td><input class="'+p+'" style="width:100%" type="'+i.type+'" id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']"></td></tr>';break;case"textarea":n+="<tr><th>"+i.label+'</th><td><textarea style="width: 100%" id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']" rows="5"></textarea></td></tr>';break;case"select":var r="";jQuery.each(i.options,function(s,e){r+='<option value="'+s+'">'+e+"</option>"}),n+="<tr><th>"+i.label+'</th><td><select id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']">'+r+"</select></td></tr>";break;case"media":n+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+s+"_"+e+'" name="'+i.name+"_"+s+"_"+e+'"><input type="hidden" data-id="'+i.name+"_"+s+"_"+e+'_id" name="'+a+e+"["+s+"]["+i.name+'_id]" id="'+i.name+"_"+s+"_"+e+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+s+"_"+e+'_button" name="'+i.name+"_"+s+"_"+e+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+s+"_"+e+'"></div></fieldset></td></tr>'}}),n+="</table></div>"}function saswp_create_total_collection(){var s="";for(var e in saswp_total_collection=[],saswp_collection)saswp_collection[e]&&(jQuery.each(saswp_collection[e],function(s,e){saswp_total_collection.push(e)}),s+=saswp_function_added_platform(e,saswp_collection[e].length));jQuery(".saswp-platform-added-list").html(""),jQuery(".saswp-platform-added-list").append(s)}function saswp_create_rating_html_by_value(s){var e="";e+='<div class="saswp-rvw-str">';for(var a=0;a<5;a++)if(s>a){var t=s.split(".");t[1]?a<t[0]?e+='<span class="str-ic"></span>':e+='<span class="half-str"></span>':e+='<span class="str-ic"></span>'}else e+='<span class="df-clr"></span>';return e+="</div>"}function saswpChunkArray(s,e){for(var a=JSON.parse(JSON.stringify(s)),t=[];a.length;)t.push(a.splice(0,e));return t}function saswp_function_added_platform(s,e){var a="";return a+='<div class="cancel-btn">',a+="<span>"+jQuery("#saswp-plaftorm-list option[value="+s+"]").text()+"</span>",a+='<input type="hidden" name="saswp_platform_ids['+s+']" value="'+e+'">',a+='<a platform-id="'+s+'" class="button button-default saswp-remove-platform"></a>',a+="</div>"}function saswpCollectionSlider(){jQuery(".saswp-cs").each(function(){var s=jQuery(this),e=s.find(".saswp-sic");function a(){var s=0;jQuery(e).find(".saswp-si").each(function(){s+=jQuery(this).outerWidth()}),e.width(s)}function t(){if(jQuery(".saswp-si.saswp-active").length>0){var s=e.find(".saswp-si.saswp-active").offset().left-e.offset().left;e.css({transform:"translate( -"+s+"px, 0px)"})}}0==e.find(".saswp-si.saswp-active").length&&e.find(".saswp-si").first().addClass("saswp-active"),a(),t(),function(){var a=e.find(".saswp-si.saswp-active").index(),t=e.find(".saswp-si").length;for(i=0;i<t;i++)s.find(".saswp-slider-dots").append("<div class='saswp-dot'></div>");s.find(".saswp-slider-dots").find(".saswp-dot").eq(a).addClass("saswp-active")}(),jQuery(document).ready(function(){a(),t()}),jQuery(window).resize(function(){a(),t()});var n=s.find(".saswp-slider-controls").find(".saswp-slider-next-btn"),p=s.find(".saswp-slider-controls").find(".saswp-slider-prev-btn");n.on("click",function(a){a.preventDefault(),function(){var a=e.find(".saswp-si.saswp-active").index(),t=0;t=a+1>e.find(".saswp-si").length-1?0:a+1;var i=e.find(".saswp-si").eq(t),n=e.offset().left,p=i.offset().left-n;e.find(".saswp-si.saswp-active").removeClass("saswp-active"),i.addClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").removeClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").eq(t).addClass("saswp-active"),e.css({transform:"translate( -"+p+"px, 0px)"})}()}),p.on("click",function(a){a.preventDefault(),function(){var a=e.find(".saswp-si.saswp-active").index(),t=e.find(".saswp-si").length,i=0;i=a-1<0?t-1:a-1;var n=e.find(".saswp-si").eq(i),p=e.offset().left,r=n.offset().left-p;e.find(".saswp-si.saswp-active").removeClass("saswp-active"),n.addClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").removeClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").eq(i).addClass("saswp-active"),e.css({transform:"translate( -"+r+"px, 0px)"})}()}),s.find(".saswp-slider-dots").find(".saswp-dot").on("click",function(a){var t=jQuery(this).index(),i=e.find(".saswp-si").eq(t).offset().left-e.offset().left;e.find(".saswp-si.saswp-active").removeClass("saswp-active"),e.find(".saswp-si").eq(t).addClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").removeClass("saswp-active"),jQuery(this).addClass("saswp-active"),e.css({transform:"translate( -"+i+"px, 0px)"})})})}function saswp_review_desing_for_slider(s){var e=saswp_convert_datetostring(s.saswp_review_date),a="";return a+='<div class="saswp-r2-sli">',a+='<div class="saswp-r2-b">',a+='<div class="saswp-r2-q">',a+='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="95.333px" height="95.332px" viewBox="0 0 95.333 95.332" style="enable-background:new 0 0 95.333 95.332;" xml:space="preserve"><path d="M30.512,43.939c-2.348-0.676-4.696-1.019-6.98-1.019c-3.527,0-6.47,0.806-8.752,1.793 c2.2-8.054,7.485-21.951,18.013-23.516c0.975-0.145,1.774-0.85,2.04-1.799l2.301-8.23c0.194-0.696,0.079-1.441-0.318-2.045 s-1.035-1.007-1.75-1.105c-0.777-0.106-1.569-0.16-2.354-0.16c-12.637,0-25.152,13.19-30.433,32.076 c-3.1,11.08-4.009,27.738,3.627,38.223c4.273,5.867,10.507,9,18.529,9.313c0.033,0.001,0.065,0.002,0.098,0.002 c9.898,0,18.675-6.666,21.345-16.209c1.595-5.705,0.874-11.688-2.032-16.851C40.971,49.307,36.236,45.586,30.512,43.939z"></path><path d="M92.471,54.413c-2.875-5.106-7.61-8.827-13.334-10.474c-2.348-0.676-4.696-1.019-6.979-1.019 c-3.527,0-6.471,0.806-8.753,1.793c2.2-8.054,7.485-21.951,18.014-23.516c0.975-0.145,1.773-0.85,2.04-1.799l2.301-8.23 c0.194-0.696,0.079-1.441-0.318-2.045c-0.396-0.604-1.034-1.007-1.75-1.105c-0.776-0.106-1.568-0.16-2.354-0.16 c-12.637,0-25.152,13.19-30.434,32.076c-3.099,11.08-4.008,27.738,3.629,38.225c4.272,5.866,10.507,9,18.528,9.312 c0.033,0.001,0.065,0.002,0.099,0.002c9.897,0,18.675-6.666,21.345-16.209C96.098,65.559,95.376,59.575,92.471,54.413z"></path></svg>',a+="</div>",a+='<div class="saswp-rc-cnt">',a+="<p>",a+=s.saswp_review_text,a+="</p>",a+="</div>",a+='<div class="saswp-r2-strs">',a+='<span class="saswp-r2-s">',a+=saswp_create_rating_html_by_value(s.saswp_review_rating),a+="</span>",a+="</div>",a+="</div>",a+='<div class="saswp-rc">',a+='<div class="saswp-rc-a">',a+='<img src="'+s.saswp_reviewer_image+'"/>',a+='<div class="saswp-rc-nm">',a+='<a href="#">'+s.saswp_reviewer_name+"</a>",a+='<span class="saswp-rc-dt">'+e.date+"</span>",a+="</div>",a+='<div class="saswp-rc-lg">',a+='<img src="'+s.saswp_review_platform_icon+'"/>',a+="</div>",a+="</div>",a+="</div>",a+="</div>"}function saswp_create_collection_slider(s,e,a){var t="";if(saswp_total_collection.length>0){if(t+="slider"==s?'<div class="saswp-cst">':'<div class="saswp-cct">',t+='<div class="saswp-cs">',t+='<div class="saswp-sic">',"slider"==s&&jQuery.each(saswp_total_collection,function(s,e){t+='<div class="saswp-si">',t+=saswp_review_desing_for_slider(e),t+="</div>"}),"carousel"==s){var i=saswpChunkArray(saswp_total_collection,3);i&&jQuery.each(i,function(s,e){t+='<div class="saswp-si">',jQuery.each(e,function(s,e){t+=saswp_review_desing_for_slider(e)}),t+="</div>"})}t+="</div>",e&&(t+='<div class="saswp-slider-controls">',t+='<a href="#" class="saswp-slider-prev-btn"></a>',t+='<a href="#" class="saswp-slider-next-btn"></a>',t+="</div>"),a&&(t+='<div class="saswp-slider-dots">',t+="</div>"),t+="</div>",t+="</div>"}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(t),saswpCollectionSlider()}function saswp_create_collection_badge(){var s="";if(saswp_total_collection.length>0){for(var e in s+='<div class="saswp-rd3-warp">',s+="<ul>",saswp_collection){var a="",t="",i=0,n=0,p=1;jQuery.each(saswp_collection[e],function(s,e){a=e.saswp_review_platform_icon,t=e.saswp_review_platform_name,n+=parseFloat(e.saswp_review_rating),i++}),n>0&&(p=n/i),saswp_collection[e]&&(s+="<li>",s+='<a href="#">',s+='<div class="saswp-r3-lg">',s+="<span>",s+='<img src="'+a+'"/>',s+="</span>",s+='<span class="saswp-r3-tlt">'+t+'</span">',s+="</div>",s+='<div class="saswp-r3-rtng">',s+='<div class="saswp-r3-rtxt">',s+='<span class="saswp-r3-num">',s+=p.toFixed(1),s+="</span>",s+='<span class="saswp-stars">',s+=saswp_create_rating_html_by_value(p.toString()),s+="</span>",s+="</div>",s+='<span class="saswp-r3-brv">',s+="Based on "+i+" Reviews",s+="</span>",s+="</div>",s+="</a>",s+="</li>")}s+="</ul>",s+="</div>"}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(s)}function saswp_create_collection_popup(){var s="",e="";if(saswp_total_collection.length>0){var a=0,t=0,i=1;jQuery.each(saswp_total_collection,function(s,i){platform_icon=i.saswp_review_platform_icon,t+=parseFloat(i.saswp_review_rating),a++;var n=saswp_convert_datetostring(i.saswp_review_date);e+="<li>",e+='<div class="saswp-r4-b">',e+='<span class="saswp-r4-str">',e+=saswp_create_rating_html_by_value(i.saswp_review_rating),e+="</span>",e+='<span class="saswp-r4-tx">'+n.date+"</span>",e+="</div>",e+='<div class="saswp-r4-cnt">',e+="<h3>"+i.saswp_reviewer_name+"</h3>",e+="<p>"+i.saswp_review_text+"</p>",e+="</div>",e+="</li>"}),t>0&&(i=t/a),a>0&&(s+='<div id="saswp-sticky-review">',s+='<div class="saswp-open-class saswp-popup-btn">',s+='<div class="saswp-opn-cls-btn">',s+='<div class="saswp-onclick-hide">',s+="<span>",s+=saswp_create_rating_html_by_value(i.toString()),s+="</span>",s+='<span class="saswp-r4-rnm">'+i.toFixed(1)+" from "+a+" reviews</span>",s+="</div>",s+='<div class="saswp-onclick-show">',s+="<span>Ratings and reviews</span>",s+='<span class="saswp-mines"></span>',s+="</div>",s+="</div>",s+='<div id="saswp-reviews-cntn">',s+='<div class="saswp-r4-info">',s+="<ul>",s+='<li class="saswp-r4-r">',s+="<span>",s+=saswp_create_rating_html_by_value(i.toString()),s+="</span>",s+='<span class="saswp-r4-rnm">'+i.toFixed(1)+" from "+a+" reviews</span>",s+="</li>",s+=e,s+="</ul>",s+="</div>",s+="</div>",s+="</div>",s+="</div>")}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(s)}function saswp_create_collection_fomo(s,e){var a="";saswp_total_collection.length>0&&jQuery.each(saswp_total_collection,function(s,e){var t=saswp_convert_datetostring(e.saswp_review_date);a+='<div id="'+s+'" class="saswp-r5">',a+='<div class="saswp-r5-r">',a+='<div class="saswp-r5-lg">',a+="<span>",a+='<img height="70" width="70" src="'+e.saswp_review_platform_icon+'"/>',a+="</span>",a+="</div>",a+='<div class="saswp-r5-rng">',a+=saswp_create_rating_html_by_value(e.saswp_review_rating),a+='<div class="saswp-r5-txrng">',a+="<span>"+e.saswp_review_rating+" Stars</span>",a+="<span>by</span>",a+="<span>"+e.saswp_reviewer_name+"</span>",a+="</div>",a+='<span class="saswp-r5-dt">'+t.date+"</span>",a+="</div>",a+="</div>",a+="</div>"}),jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(a),saswp_fomo_slide(s,e)}function saswp_fomo_slide(s,e){var a=jQuery(".saswp-collection-preview .saswp-r5"),t=a.length,i=0;!function s(){a.eq(i%t).fadeIn(6e3,function(){a.eq(i%t).fadeOut(3e3,s),i++})}()}function saswp_collection_sorting(s){if(saswp_total_collection.length>0)switch(s){case"lowest":saswp_total_collection.sort(function(s,e){return s.saswp_review_rating-e.saswp_review_rating});break;case"highest":saswp_total_collection.sort(function(s,e){return s.saswp_review_rating-e.saswp_review_rating}),saswp_total_collection.reverse();break;case"newest":case"recent":saswp_total_collection.sort(function(s,e){return new Date(s.saswp_review_date)-new Date(e.saswp_review_date)}),saswp_total_collection.reverse();break;case"oldest":saswp_total_collection.sort(function(s,e){return new Date(s.saswp_review_date)-new Date(e.saswp_review_date)});break;case"random":saswp_total_collection.sort(function(s,e){return.5-Math.random()})}}function saswp_collection_total_reviews_id(){if(saswp_total_collection.length>0){saswp_total_reviews=[],jQuery.each(saswp_total_collection,function(s,e){saswp_total_reviews.push(e.saswp_review_id)});var s='<input type="hidden" name="saswp_total_reviews" value="'+JSON.stringify(saswp_total_reviews)+'">';jQuery(".saswp-total-reviews-list").html(""),jQuery(".saswp-total-reviews-list").append(s)}}function saswp_create_collection_grid(s,e,a,t,i){var n="",p="",r=0;if(saswp_total_collection.length>0){r=Math.ceil(saswp_total_collection.length/a),n+='<div class="saswp-r1">';for(var l=1;l<=s;l++)p+=" 1fr";if(s.length>3?n+='<ul style="grid-template-columns:'+p+';overflow-y: scroll;">':n+='<ul style="grid-template-columns:'+p+';overflow-y:hidden;">',saswp_total_collection){var c=saswp_total_collection;e&&a>0&&(c=c.slice(t,i)),jQuery.each(c,function(s,e){var a=saswp_convert_datetostring(e.saswp_review_date);n+="<li>",n+='<div class="saswp-rc">',n+='<div class="saswp-rc-a">',n+='<div class="saswp-r1-aimg">',n+='<img src="'+e.saswp_reviewer_image+'" width="56" height="56"/>',n+="</div>",n+='<div class="saswp-rc-nm">',n+='<a href="#">'+e.saswp_reviewer_name+"</a>",n+=saswp_create_rating_html_by_value(e.saswp_review_rating),a.date&&(n+='<span class="saswp-rc-dt">'+a.date+"</span>"),n+="</div>",n+="</div>",n+='<div class="saswp-rc-lg">',n+='<img src="'+e.saswp_review_platform_icon+'"/>',n+="</div>",n+="</div>",n+='<div class="saswp-rc-cnt">',n+="<p>"+e.saswp_review_text+"</p>",n+="</div>",n+="</li>"})}if(n+="</ul>",r>0&&e){n+='<div class="saswp-grid-pagination">',n+='<a class="saswp-grid-page" data-id="1" href="#">«</a>';for(l=1;l<=r;l++)n+=l==saswp_grid_page?'<a class="active saswp-grid-page" data-id="'+l+'" href="#">'+l+"</a>":'<a class="saswp-grid-page" data-id="'+l+'" href="#">'+l+"</a>";n+='<a class="saswp-grid-page" data-id="'+r+'" href="#">»</a>',n+="</div>"}n+="</div>"}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(n)}function saswp_create_collection_by_design(s,e,a,t,i,n,p,r,l,c,o){switch(s){case"grid":saswp_create_collection_grid(e,r,l,c,o);break;case"gallery":saswp_create_collection_slider(a,t,i);break;case"badge":saswp_create_collection_badge();break;case"popup":saswp_create_collection_popup();break;case"fomo":saswp_create_collection_fomo(n,p)}}function saswp_on_collection_design_change(){var s=jQuery(".saswp-collection-sorting").val(),e=jQuery(".saswp-collection-desing").val(),a=jQuery("#saswp-collection-cols").val(),t=jQuery(".saswp-slider-type").val(),i=jQuery("#saswp_fomo_interval").val(),n=parseInt(jQuery("#saswp-coll-per-page").val()),p=!1,r=0,l=n;if(jQuery("#saswp-coll-pagination").is(":checked")){p=!0;saswp_grid_page>0&&(l=saswp_grid_page*n),r=l-n}if(jQuery("#saswp_gallery_arrow").is(":checked"))var c=!0;else c=!1;if(jQuery("#saswp_gallery_dots").is(":checked"))var o=!0;else o=!1;saswp_create_total_collection(),saswp_collection_sorting(s),saswp_collection_total_reviews_id(),saswp_create_collection_by_design(e,a,t,c,o,i,i,p,n,r,l)}function saswp_get_collection_data(s,e,a=null){jQuery.get(ajaxurl,{action:"saswp_add_to_collection",rvcount:s,platform_id:e,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){if(s.status){var t=s.message;saswp_collection[e]=t,saswp_collection[e]=jQuery.extend(saswp_collection[e],t),saswp_on_collection_design_change()}a&&a.removeClass("updating-message")},"json")}function saswpIsEmail(s){return/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(s)}
|
1 |
+
var saswp_meta_list=[],saswp_meta_fields=[],saswp_meta_list_fields=[],saswp_taxonomy_term=[],saswp_collection=[],saswp_total_collection=[],saswp_total_reviews=[],saswp_coll_json=null,saswp_grid_page=1;function saswp_convert_datetostring(s){var e={};if(s){var a=new Date(s);e={time:a.toLocaleTimeString(),date:a.toLocaleDateString()}}else e={time:"",date:""};return e}function saswp_taxonomy_term_html(s,e){var a="";return a+="<td>",a+='<select name="saswp_taxonomy_term['+e+']">',jQuery.each(s,function(s,e){a+='<option value="'+s+'">'+e+"</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 s="";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")),s&&jQuery(".saswp-enable-rating-review-"+s.toLowerCase()).change(function(){jQuery(this).is(":checked")?jQuery(this).parent().parent().siblings(".saswp-rating-review-"+s.toLowerCase()).show():jQuery(this).parent().parent().siblings(".saswp-rating-review-"+s.toLowerCase()).hide()}).change()}function getParameterByName(s,e){e||(e=window.location.href),s=s.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+s+"(=([^&#]*)|&|#|$)").exec(e);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(s){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:s.term,action:"saswp_get_custom_meta_fields"}},processResults:function(s){return{results:s}},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_ajax(s,e,a=null){var t=e.val(),i=saswp_localize_data.post_id,n=jQuery(e).attr("data-id"),p=jQuery(e).attr("post-specific"),r=jQuery(".saswp_modify_this_schema_hidden_"+n).val();append_id=null==a?jQuery("#saswp_specific_"+n):jQuery(".saswp-manual-modification"),jQuery.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",modify_this:r,schema_type:s,schema_id:n,post_specific:p,item:t,post_id:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){jQuery(append_id).find(".saswp-table-create-onajax").remove();var e=jQuery(append_id).find(".saswp-table-create-onload");jQuery.each(e,function(s,e){0!=s&&jQuery(this).remove()}),jQuery(append_id).append(s),saswp_schema_datepicker(),saswp_schema_timepicker()})}function saswp_item_reviewed_call(){jQuery(".saswp-item-reviewed").change(function(s){s.preventDefault();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")),"Review"===e)&&saswp_item_reviewed_ajax(e,jQuery(this))}).change()}function saswp_compatibliy_notes(s,e){var a=e.replace("-checkbox",""),t=jQuery("#"+a).next("p").text();s.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(s,e,a,t,i,n){var p=t;null==p&&(p=Object.keys(a)[0]);var r="";if(r+='<select class="saswp-custom-meta-list" name="saswp_meta_list_val['+p+']">',jQuery.each(e,function(s,e){r+='<optgroup label="'+e.label+'">',jQuery.each(e["meta-list"],function(s,e){r+='<option value="'+s+'">'+e+"</option>"}),r+="</optgroup>"}),r+="</select>",a){var l=jQuery("select#schema_type option:selected").val(),c="";"Review"==l&&(c=jQuery("select.saswp-item-reivewed-list option:selected").val());var o="<tr>";o+="<td>",o+='<select class="saswp-custom-fields-name">',"Review"==l&&(o+='<optgroup label="Review">',o+='<option value="saswp_review_name">Review Name</option>',o+='<option value="saswp_review_description">Review Description</option>',o+='<option value="saswp_review_author">Review Author</option>',o+='<option value="saswp_review_author_url">Review Author Profile URL</option>',o+='<option value="saswp_review_publisher">Review Publisher</option>',o+='<option value="saswp_review_publisher_url">Review Publisher URL</option>',o+='<option value="saswp_review_rating_value">Review Rating Value</option>',o+='<option value="saswp_review_date_published">Review Published Date</option>',o+='<option value="saswp_review_url">Review URL</option>',o+="</optgroup>"),"Review"==l&&(o+='<optgroup label="'+c+'">'),jQuery.each(a,function(s,e){o+='<option value="'+s+'">'+e+"</option>"}),"Review"==l&&(o+="</optgroup>"),o+="</select>",o+="</td>",o+="<td>",o+=r,o+="</td>",o+='<td></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td>',o+="</tr>",jQuery(".saswp-custom-fields-table").append(o),null!=s&&s.removeClass("updating-message")}else jQuery(i).html(r),null!=s&&s.removeClass("updating-message")}function saswp_get_meta_list(s,e,a,t,i,n){saswp_meta_list[e]?saswp_meta_list_html(s,saswp_meta_list[e],a,i,t,n):jQuery.get(ajaxurl,{action:"saswp_get_meta_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(p){saswp_meta_list[e]=p[e],saswp_meta_list_html(s,saswp_meta_list[e],a,i,t,n)},"json")}function saswp_get_post_specific_schema_fields(s,e,a,t,i,n,p){if(saswp_meta_fields[n]){var r=saswp_fields_html_generator(e,i,n,t,saswp_meta_fields[n]);r&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(r),saswp_schema_datepicker(),saswp_schema_timepicker(),s.removeClass("updating-message"))}else jQuery.get(ajaxurl,{action:"saswp_get_schema_dynamic_fields_ajax",schema_id:i,schema_type:p,meta_name:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){saswp_meta_fields[n]=a;var p=saswp_fields_html_generator(e,i,n,t,a);p&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(p),saswp_schema_datepicker(),saswp_schema_timepicker(),s.removeClass("updating-message"))},"json")}function saswp_fields_html_generator(s,e,a,t,i){var n="";return n+='<div class="saswp-'+t+'-table-div saswp-dynamic-properties" data-id="'+s+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',jQuery.each(i,function(t,i){var p="";switch((i.name.indexOf("published_date")>-1||i.name.indexOf("date_created")>-1||i.name.indexOf("created_date")>-1||i.name.indexOf("modified_date")>-1||i.name.indexOf("date_published")>-1||i.name.indexOf("date_modified")>-1)&&(p="saswp-datepicker-picker"),i.type){case"number":case"text":n+="<tr><th>"+i.label+'</th><td><input class="'+p+'" style="width:100%" type="'+i.type+'" id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']"></td></tr>';break;case"textarea":n+="<tr><th>"+i.label+'</th><td><textarea style="width: 100%" id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']" rows="5"></textarea></td></tr>';break;case"select":var r="";jQuery.each(i.options,function(s,e){r+='<option value="'+s+'">'+e+"</option>"}),n+="<tr><th>"+i.label+'</th><td><select id="'+i.name+"_"+s+"_"+e+'" name="'+a+e+"["+s+"]["+i.name+']">'+r+"</select></td></tr>";break;case"media":n+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+s+"_"+e+'" name="'+i.name+"_"+s+"_"+e+'"><input type="hidden" data-id="'+i.name+"_"+s+"_"+e+'_id" name="'+a+e+"["+s+"]["+i.name+'_id]" id="'+i.name+"_"+s+"_"+e+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+s+"_"+e+'_button" name="'+i.name+"_"+s+"_"+e+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+s+"_"+e+'"></div></fieldset></td></tr>'}}),n+="</table></div>"}function saswp_create_total_collection(){var s="";for(var e in saswp_total_collection=[],saswp_collection)saswp_collection[e]&&(jQuery.each(saswp_collection[e],function(s,e){saswp_total_collection.push(e)}),s+=saswp_function_added_platform(e,saswp_collection[e].length));jQuery(".saswp-platform-added-list").html(""),jQuery(".saswp-platform-added-list").append(s)}function saswp_create_rating_html_by_value(s){var e="";e+='<div class="saswp-rvw-str">';for(var a=0;a<5;a++)if(s>a){var t=s.split(".");t[1]?a<t[0]?e+='<span class="str-ic"></span>':e+='<span class="half-str"></span>':e+='<span class="str-ic"></span>'}else e+='<span class="df-clr"></span>';return e+="</div>"}function saswpChunkArray(s,e){for(var a=JSON.parse(JSON.stringify(s)),t=[];a.length;)t.push(a.splice(0,e));return t}function saswp_function_added_platform(s,e){var a="";return a+='<div class="cancel-btn">',a+="<span>"+jQuery("#saswp-plaftorm-list option[value="+s+"]").text()+"</span>",a+='<input type="hidden" name="saswp_platform_ids['+s+']" value="'+e+'">',a+='<a platform-id="'+s+'" class="button button-default saswp-remove-platform"></a>',a+="</div>"}function saswpCollectionSlider(){jQuery(".saswp-cs").each(function(){var s=jQuery(this),e=s.find(".saswp-sic");function a(){var s=0;jQuery(e).find(".saswp-si").each(function(){s+=jQuery(this).outerWidth()}),e.width(s)}function t(){if(jQuery(".saswp-si.saswp-active").length>0){var s=e.find(".saswp-si.saswp-active").offset().left-e.offset().left;e.css({transform:"translate( -"+s+"px, 0px)"})}}0==e.find(".saswp-si.saswp-active").length&&e.find(".saswp-si").first().addClass("saswp-active"),a(),t(),function(){var a=e.find(".saswp-si.saswp-active").index(),t=e.find(".saswp-si").length;for(i=0;i<t;i++)s.find(".saswp-slider-dots").append("<div class='saswp-dot'></div>");s.find(".saswp-slider-dots").find(".saswp-dot").eq(a).addClass("saswp-active")}(),jQuery(document).ready(function(){a(),t()}),jQuery(window).resize(function(){a(),t()});var n=s.find(".saswp-slider-controls").find(".saswp-slider-next-btn"),p=s.find(".saswp-slider-controls").find(".saswp-slider-prev-btn");n.on("click",function(a){a.preventDefault(),function(){var a=e.find(".saswp-si.saswp-active").index(),t=0;t=a+1>e.find(".saswp-si").length-1?0:a+1;var i=e.find(".saswp-si").eq(t),n=e.offset().left,p=i.offset().left-n;e.find(".saswp-si.saswp-active").removeClass("saswp-active"),i.addClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").removeClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").eq(t).addClass("saswp-active"),e.css({transform:"translate( -"+p+"px, 0px)"})}()}),p.on("click",function(a){a.preventDefault(),function(){var a=e.find(".saswp-si.saswp-active").index(),t=e.find(".saswp-si").length,i=0;i=a-1<0?t-1:a-1;var n=e.find(".saswp-si").eq(i),p=e.offset().left,r=n.offset().left-p;e.find(".saswp-si.saswp-active").removeClass("saswp-active"),n.addClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").removeClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").eq(i).addClass("saswp-active"),e.css({transform:"translate( -"+r+"px, 0px)"})}()}),s.find(".saswp-slider-dots").find(".saswp-dot").on("click",function(a){var t=jQuery(this).index(),i=e.find(".saswp-si").eq(t).offset().left-e.offset().left;e.find(".saswp-si.saswp-active").removeClass("saswp-active"),e.find(".saswp-si").eq(t).addClass("saswp-active"),s.find(".saswp-slider-dots").find(".saswp-dot").removeClass("saswp-active"),jQuery(this).addClass("saswp-active"),e.css({transform:"translate( -"+i+"px, 0px)"})})})}function saswp_review_desing_for_slider(s){var e=saswp_convert_datetostring(s.saswp_review_date),a="";return a+='<div class="saswp-r2-sli">',a+='<div class="saswp-r2-b">',a+='<div class="saswp-r2-q">',a+='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="95.333px" height="95.332px" viewBox="0 0 95.333 95.332" style="enable-background:new 0 0 95.333 95.332;" xml:space="preserve"><path d="M30.512,43.939c-2.348-0.676-4.696-1.019-6.98-1.019c-3.527,0-6.47,0.806-8.752,1.793 c2.2-8.054,7.485-21.951,18.013-23.516c0.975-0.145,1.774-0.85,2.04-1.799l2.301-8.23c0.194-0.696,0.079-1.441-0.318-2.045 s-1.035-1.007-1.75-1.105c-0.777-0.106-1.569-0.16-2.354-0.16c-12.637,0-25.152,13.19-30.433,32.076 c-3.1,11.08-4.009,27.738,3.627,38.223c4.273,5.867,10.507,9,18.529,9.313c0.033,0.001,0.065,0.002,0.098,0.002 c9.898,0,18.675-6.666,21.345-16.209c1.595-5.705,0.874-11.688-2.032-16.851C40.971,49.307,36.236,45.586,30.512,43.939z"></path><path d="M92.471,54.413c-2.875-5.106-7.61-8.827-13.334-10.474c-2.348-0.676-4.696-1.019-6.979-1.019 c-3.527,0-6.471,0.806-8.753,1.793c2.2-8.054,7.485-21.951,18.014-23.516c0.975-0.145,1.773-0.85,2.04-1.799l2.301-8.23 c0.194-0.696,0.079-1.441-0.318-2.045c-0.396-0.604-1.034-1.007-1.75-1.105c-0.776-0.106-1.568-0.16-2.354-0.16 c-12.637,0-25.152,13.19-30.434,32.076c-3.099,11.08-4.008,27.738,3.629,38.225c4.272,5.866,10.507,9,18.528,9.312 c0.033,0.001,0.065,0.002,0.099,0.002c9.897,0,18.675-6.666,21.345-16.209C96.098,65.559,95.376,59.575,92.471,54.413z"></path></svg>',a+="</div>",a+='<div class="saswp-rc-cnt">',a+="<p>",a+=s.saswp_review_text,a+="</p>",a+="</div>",a+='<div class="saswp-r2-strs">',a+='<span class="saswp-r2-s">',a+=saswp_create_rating_html_by_value(s.saswp_review_rating),a+="</span>",a+="</div>",a+="</div>",a+='<div class="saswp-rc">',a+='<div class="saswp-rc-a">',a+='<img src="'+s.saswp_reviewer_image+'"/>',a+='<div class="saswp-rc-nm">',a+='<a href="#">'+s.saswp_reviewer_name+"</a>",a+='<span class="saswp-rc-dt">'+e.date+"</span>",a+="</div>",a+='<div class="saswp-rc-lg">',a+='<img src="'+s.saswp_review_platform_icon+'"/>',a+="</div>",a+="</div>",a+="</div>",a+="</div>"}function saswp_create_collection_slider(s,e,a){var t="";if(saswp_total_collection.length>0){if(t+="slider"==s?'<div class="saswp-cst">':'<div class="saswp-cct">',t+='<div class="saswp-cs">',t+='<div class="saswp-sic">',"slider"==s&&jQuery.each(saswp_total_collection,function(s,e){t+='<div class="saswp-si">',t+=saswp_review_desing_for_slider(e),t+="</div>"}),"carousel"==s){var i=saswpChunkArray(saswp_total_collection,3);i&&jQuery.each(i,function(s,e){t+='<div class="saswp-si">',jQuery.each(e,function(s,e){t+=saswp_review_desing_for_slider(e)}),t+="</div>"})}t+="</div>",e&&(t+='<div class="saswp-slider-controls">',t+='<a href="#" class="saswp-slider-prev-btn"></a>',t+='<a href="#" class="saswp-slider-next-btn"></a>',t+="</div>"),a&&(t+='<div class="saswp-slider-dots">',t+="</div>"),t+="</div>",t+="</div>"}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(t),saswpCollectionSlider()}function saswp_create_collection_badge(){var s="";if(saswp_total_collection.length>0){for(var e in s+='<div class="saswp-rd3-warp">',s+="<ul>",saswp_collection){var a="",t="",i=0,n=0,p=1;jQuery.each(saswp_collection[e],function(s,e){a=e.saswp_review_platform_icon,t=e.saswp_review_platform_name,n+=parseFloat(e.saswp_review_rating),i++}),n>0&&(p=n/i),saswp_collection[e]&&(s+="<li>",s+='<a href="#">',s+='<div class="saswp-r3-lg">',s+="<span>",s+='<img src="'+a+'"/>',s+="</span>",s+='<span class="saswp-r3-tlt">'+t+'</span">',s+="</div>",s+='<div class="saswp-r3-rtng">',s+='<div class="saswp-r3-rtxt">',s+='<span class="saswp-r3-num">',s+=p.toFixed(1),s+="</span>",s+='<span class="saswp-stars">',s+=saswp_create_rating_html_by_value(p.toString()),s+="</span>",s+="</div>",s+='<span class="saswp-r3-brv">',s+="Based on "+i+" Reviews",s+="</span>",s+="</div>",s+="</a>",s+="</li>")}s+="</ul>",s+="</div>"}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(s)}function saswp_create_collection_popup(){var s="",e="";if(saswp_total_collection.length>0){var a=0,t=0,i=1;jQuery.each(saswp_total_collection,function(s,i){platform_icon=i.saswp_review_platform_icon,t+=parseFloat(i.saswp_review_rating),a++;var n=saswp_convert_datetostring(i.saswp_review_date);e+="<li>",e+='<div class="saswp-r4-b">',e+='<span class="saswp-r4-str">',e+=saswp_create_rating_html_by_value(i.saswp_review_rating),e+="</span>",e+='<span class="saswp-r4-tx">'+n.date+"</span>",e+="</div>",e+='<div class="saswp-r4-cnt">',e+="<h3>"+i.saswp_reviewer_name+"</h3>",e+="<p>"+i.saswp_review_text+"</p>",e+="</div>",e+="</li>"}),t>0&&(i=t/a),a>0&&(s+='<div id="saswp-sticky-review">',s+='<div class="saswp-open-class saswp-popup-btn">',s+='<div class="saswp-opn-cls-btn">',s+='<div class="saswp-onclick-hide">',s+="<span>",s+=saswp_create_rating_html_by_value(i.toString()),s+="</span>",s+='<span class="saswp-r4-rnm">'+i.toFixed(1)+" from "+a+" reviews</span>",s+="</div>",s+='<div class="saswp-onclick-show">',s+="<span>Ratings and reviews</span>",s+='<span class="saswp-mines"></span>',s+="</div>",s+="</div>",s+='<div id="saswp-reviews-cntn">',s+='<div class="saswp-r4-info">',s+="<ul>",s+='<li class="saswp-r4-r">',s+="<span>",s+=saswp_create_rating_html_by_value(i.toString()),s+="</span>",s+='<span class="saswp-r4-rnm">'+i.toFixed(1)+" from "+a+" reviews</span>",s+="</li>",s+=e,s+="</ul>",s+="</div>",s+="</div>",s+="</div>",s+="</div>")}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(s)}function saswp_create_collection_fomo(s,e){var a="";saswp_total_collection.length>0&&jQuery.each(saswp_total_collection,function(s,e){var t=saswp_convert_datetostring(e.saswp_review_date);a+='<div id="'+s+'" class="saswp-r5">',a+='<div class="saswp-r5-r">',a+='<div class="saswp-r5-lg">',a+="<span>",a+='<img height="70" width="70" src="'+e.saswp_review_platform_icon+'"/>',a+="</span>",a+="</div>",a+='<div class="saswp-r5-rng">',a+=saswp_create_rating_html_by_value(e.saswp_review_rating),a+='<div class="saswp-r5-txrng">',a+="<span>"+e.saswp_review_rating+" Stars</span>",a+="<span>by</span>",a+="<span>"+e.saswp_reviewer_name+"</span>",a+="</div>",a+='<span class="saswp-r5-dt">'+t.date+"</span>",a+="</div>",a+="</div>",a+="</div>"}),jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(a),saswp_fomo_slide(s,e)}function saswp_fomo_slide(s,e){var a=jQuery(".saswp-collection-preview .saswp-r5"),t=a.length,i=0;!function s(){a.eq(i%t).fadeIn(6e3,function(){a.eq(i%t).fadeOut(3e3,s),i++})}()}function saswp_collection_sorting(s){if(saswp_total_collection.length>0)switch(s){case"lowest":saswp_total_collection.sort(function(s,e){return s.saswp_review_rating-e.saswp_review_rating});break;case"highest":saswp_total_collection.sort(function(s,e){return s.saswp_review_rating-e.saswp_review_rating}),saswp_total_collection.reverse();break;case"newest":case"recent":saswp_total_collection.sort(function(s,e){return new Date(s.saswp_review_date)-new Date(e.saswp_review_date)}),saswp_total_collection.reverse();break;case"oldest":saswp_total_collection.sort(function(s,e){return new Date(s.saswp_review_date)-new Date(e.saswp_review_date)});break;case"random":saswp_total_collection.sort(function(s,e){return.5-Math.random()})}}function saswp_collection_total_reviews_id(){if(saswp_total_collection.length>0){saswp_total_reviews=[],jQuery.each(saswp_total_collection,function(s,e){saswp_total_reviews.push(e.saswp_review_id)});var s='<input type="hidden" name="saswp_total_reviews" value="'+JSON.stringify(saswp_total_reviews)+'">';jQuery(".saswp-total-reviews-list").html(""),jQuery(".saswp-total-reviews-list").append(s)}}function saswp_create_collection_grid(s,e,a,t,i){var n="",p="",r=0;if(saswp_total_collection.length>0){r=Math.ceil(saswp_total_collection.length/a),n+='<div class="saswp-r1">';for(var l=1;l<=s;l++)p+=" 1fr";if(s.length>3?n+='<ul style="grid-template-columns:'+p+';overflow-y: scroll;">':n+='<ul style="grid-template-columns:'+p+';overflow-y:hidden;">',saswp_total_collection){var c=saswp_total_collection;e&&a>0&&(c=c.slice(t,i)),jQuery.each(c,function(s,e){var a=saswp_convert_datetostring(e.saswp_review_date);n+="<li>",n+='<div class="saswp-rc">',n+='<div class="saswp-rc-a">',n+='<div class="saswp-r1-aimg">',n+='<img src="'+e.saswp_reviewer_image+'" width="56" height="56"/>',n+="</div>",n+='<div class="saswp-rc-nm">',n+='<a href="#">'+e.saswp_reviewer_name+"</a>",n+=saswp_create_rating_html_by_value(e.saswp_review_rating),a.date&&(n+='<span class="saswp-rc-dt">'+a.date+"</span>"),n+="</div>",n+="</div>",n+='<div class="saswp-rc-lg">',n+='<img src="'+e.saswp_review_platform_icon+'"/>',n+="</div>",n+="</div>",n+='<div class="saswp-rc-cnt">',n+="<p>"+e.saswp_review_text+"</p>",n+="</div>",n+="</li>"})}if(n+="</ul>",r>0&&e){n+='<div class="saswp-grid-pagination">',n+='<a class="saswp-grid-page" data-id="1" href="#">«</a>';for(l=1;l<=r;l++)n+=l==saswp_grid_page?'<a class="active saswp-grid-page" data-id="'+l+'" href="#">'+l+"</a>":'<a class="saswp-grid-page" data-id="'+l+'" href="#">'+l+"</a>";n+='<a class="saswp-grid-page" data-id="'+r+'" href="#">»</a>',n+="</div>"}n+="</div>"}jQuery(".saswp-collection-preview").html(""),jQuery(".saswp-collection-preview").append(n)}function saswp_create_collection_by_design(s,e,a,t,i,n,p,r,l,c,o){switch(s){case"grid":saswp_create_collection_grid(e,r,l,c,o);break;case"gallery":saswp_create_collection_slider(a,t,i);break;case"badge":saswp_create_collection_badge();break;case"popup":saswp_create_collection_popup();break;case"fomo":saswp_create_collection_fomo(n,p)}}function saswp_on_collection_design_change(){var s=jQuery(".saswp-collection-sorting").val(),e=jQuery(".saswp-collection-desing").val(),a=jQuery("#saswp-collection-cols").val(),t=jQuery(".saswp-slider-type").val(),i=jQuery("#saswp_fomo_interval").val(),n=parseInt(jQuery("#saswp-coll-per-page").val()),p=!1,r=0,l=n;if(jQuery("#saswp-coll-pagination").is(":checked")){p=!0;saswp_grid_page>0&&(l=saswp_grid_page*n),r=l-n}if(jQuery("#saswp_gallery_arrow").is(":checked"))var c=!0;else c=!1;if(jQuery("#saswp_gallery_dots").is(":checked"))var o=!0;else o=!1;saswp_create_total_collection(),saswp_collection_sorting(s),saswp_collection_total_reviews_id(),saswp_create_collection_by_design(e,a,t,c,o,i,i,p,n,r,l)}function saswp_get_collection_data(s,e,a=null){jQuery.get(ajaxurl,{action:"saswp_add_to_collection",rvcount:s,platform_id:e,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){if(s.status){var t=s.message;saswp_collection[e]=t,saswp_collection[e]=jQuery.extend(saswp_collection[e],t),saswp_on_collection_design_change()}a&&a.removeClass("updating-message")},"json")}function saswpIsEmail(s){return/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(s)}
|
admin_section/js/main-script.js
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
var saswp_attached_rv = [];
|
2 |
var saswp_attached_col = [];
|
3 |
-
jQuery(document).ready(function($){
|
|
|
|
|
|
|
4 |
|
5 |
$(document).on("click", '.saswp-attach-reviews', function(){
|
6 |
|
@@ -1154,6 +1157,16 @@ return false;
|
|
1154 |
}
|
1155 |
|
1156 |
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1157 |
|
1158 |
case 'saswp-easy-testimonials-checkbox':
|
1159 |
|
@@ -1401,26 +1414,59 @@ return false;
|
|
1401 |
//Settings page jquery ends here
|
1402 |
|
1403 |
$(document).on("click", ".saswp-modify-schema", function(e){
|
|
|
1404 |
e.preventDefault();
|
1405 |
-
|
1406 |
var schema_id = $(this).attr('schema-id');
|
1407 |
-
|
1408 |
-
$(
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1413 |
});
|
1414 |
|
1415 |
$(document).on("click", ".saswp-restore-schema", function(e){
|
1416 |
e.preventDefault();
|
1417 |
-
|
1418 |
var schema_id = $(this).attr('schema-id');
|
1419 |
-
|
1420 |
-
$(
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1424 |
});
|
1425 |
|
1426 |
$(document).on("change",".saswp-schema-type-toggle", function(e){
|
@@ -1692,25 +1738,7 @@ return false;
|
|
1692 |
$(".saswp-add-custom-schema").show();
|
1693 |
|
1694 |
});
|
1695 |
-
|
1696 |
-
$(".saswp-modify_schema_post_enable").on("click", function(e){
|
1697 |
-
var current = $(this);
|
1698 |
-
current.addClass('updating-message');
|
1699 |
-
e.preventDefault();
|
1700 |
-
$.get(ajaxurl,
|
1701 |
-
{ action:"saswp_modify_schema_post_enable", post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1702 |
-
function(response){
|
1703 |
-
current.remove();
|
1704 |
-
$(".saswp-add-custom-schema-div").remove();
|
1705 |
-
$("#post_specific .inside").append(response);
|
1706 |
-
current.removeClass('updating-message');
|
1707 |
-
saswp_schema_datepicker();
|
1708 |
-
saswp_schema_timepicker();
|
1709 |
-
saswp_enable_rating_review();
|
1710 |
-
saswp_item_reviewed_call();
|
1711 |
-
});
|
1712 |
-
|
1713 |
-
});
|
1714 |
saswp_schema_datepicker();
|
1715 |
saswp_schema_timepicker();
|
1716 |
|
@@ -1940,8 +1968,8 @@ return false;
|
|
1940 |
|
1941 |
var schema_id = $(this).attr('data-id');
|
1942 |
var fields_type = $(this).attr('fields_type');
|
1943 |
-
var div_type = $(this).attr('div_type');
|
1944 |
-
var schema_type = '
|
1945 |
var count = $("saswp_specific_"+schema_id+" , .saswp-"+div_type+"-table-div").length;
|
1946 |
var index = $( "saswp_specific_"+schema_id+" , .saswp-"+div_type+"-table-div:nth-child("+count+")" ).attr('data-id');
|
1947 |
index = ++index;
|
1 |
var saswp_attached_rv = [];
|
2 |
var saswp_attached_col = [];
|
3 |
+
jQuery(document).ready(function($){
|
4 |
+
|
5 |
+
$(".saswp-upgrade-to-pro").parent().attr({'href': 'https://structured-data-for-wp.com/pricing/', 'target': '_blank'});
|
6 |
+
|
7 |
|
8 |
$(document).on("click", '.saswp-attach-reviews', function(){
|
9 |
|
1157 |
}
|
1158 |
|
1159 |
break;
|
1160 |
+
|
1161 |
+
case 'saswp-multiple-size-image-checkbox':
|
1162 |
+
|
1163 |
+
if ($(this).is(':checked')) {
|
1164 |
+
$("#saswp-multiple-size-image").val(1);
|
1165 |
+
}else{
|
1166 |
+
$("#saswp-multiple-size-image").val(0);
|
1167 |
+
}
|
1168 |
+
|
1169 |
+
break;
|
1170 |
|
1171 |
case 'saswp-easy-testimonials-checkbox':
|
1172 |
|
1414 |
//Settings page jquery ends here
|
1415 |
|
1416 |
$(document).on("click", ".saswp-modify-schema", function(e){
|
1417 |
+
|
1418 |
e.preventDefault();
|
1419 |
+
|
1420 |
var schema_id = $(this).attr('schema-id');
|
1421 |
+
|
1422 |
+
var current = $(this);
|
1423 |
+
current.addClass('updating-message');
|
1424 |
+
|
1425 |
+
$.get(ajaxurl,
|
1426 |
+
{ action:"saswp_modify_schema_post_enable", schema_id:schema_id, post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1427 |
+
function(response){
|
1428 |
+
|
1429 |
+
$(".saswp-post-specific-wrapper[data-id="+schema_id+"] .saswp-post-specific-setting").after(response);
|
1430 |
+
$(".saswp_modify_this_schema_hidden_"+schema_id).val(1);
|
1431 |
+
$(".saswp-ps-toggle[schema-id="+schema_id+"]").removeClass('saswp_hide');
|
1432 |
+
$(".saswp-restore-schema[schema-id="+schema_id+"]").parent().removeClass('saswp_hide');
|
1433 |
+
$(".saswp-modify-schema[schema-id="+schema_id+"]").parent().addClass('saswp_hide');
|
1434 |
+
|
1435 |
+
current.removeClass('updating-message');
|
1436 |
+
saswp_schema_datepicker();
|
1437 |
+
saswp_enable_rating_review();
|
1438 |
+
saswp_item_reviewed_call();
|
1439 |
+
|
1440 |
+
});
|
1441 |
+
|
1442 |
});
|
1443 |
|
1444 |
$(document).on("click", ".saswp-restore-schema", function(e){
|
1445 |
e.preventDefault();
|
1446 |
+
|
1447 |
var schema_id = $(this).attr('schema-id');
|
1448 |
+
|
1449 |
+
var current = $(this);
|
1450 |
+
current.addClass('updating-message');
|
1451 |
+
|
1452 |
+
$.post(ajaxurl,
|
1453 |
+
{ action:"saswp_modify_schema_post_restore", schema_id:schema_id, post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
|
1454 |
+
function(response){
|
1455 |
+
current.removeClass('updating-message');
|
1456 |
+
|
1457 |
+
if(response['status'] == 't'){
|
1458 |
+
|
1459 |
+
$(".saswp_modify_this_schema_hidden_"+schema_id).val(0);
|
1460 |
+
$(".saswp-restore-schema[schema-id="+schema_id+"]").parent().addClass('saswp_hide');
|
1461 |
+
$(".saswp-modify-schema[schema-id="+schema_id+"]").parent().removeClass('saswp_hide');
|
1462 |
+
$(".saswp-ps-toggle[schema-id="+schema_id+"]").remove();
|
1463 |
+
|
1464 |
+
}else{
|
1465 |
+
alert('Something went wrong');
|
1466 |
+
}
|
1467 |
+
|
1468 |
+
}, 'json');
|
1469 |
+
|
1470 |
});
|
1471 |
|
1472 |
$(document).on("change",".saswp-schema-type-toggle", function(e){
|
1738 |
$(".saswp-add-custom-schema").show();
|
1739 |
|
1740 |
});
|
1741 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1742 |
saswp_schema_datepicker();
|
1743 |
saswp_schema_timepicker();
|
1744 |
|
1968 |
|
1969 |
var schema_id = $(this).attr('data-id');
|
1970 |
var fields_type = $(this).attr('fields_type');
|
1971 |
+
var div_type = $(this).attr('div_type');
|
1972 |
+
var schema_type = $(this).attr('itemlist_sub_type');
|
1973 |
var count = $("saswp_specific_"+schema_id+" , .saswp-"+div_type+"-table-div").length;
|
1974 |
var index = $( "saswp_specific_"+schema_id+" , .saswp-"+div_type+"-table-div:nth-child("+count+")" ).attr('data-id');
|
1975 |
index = ++index;
|
admin_section/js/main-script.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var saswp_attached_rv=[],saswp_attached_col=[];jQuery(document).ready(function(s){if(s(document).on("click",".saswp-attach-reviews",function(){s(".saswp-enable-append-reviews").is(":checked")?(tb_show("Attach reviews to this schema type","#TB_inline??width=615&height=400&inlineId=saswp-embed-code-div"),s(document).find("#TB_window").width(600).height(415).css({top:"200px","margin-top":"0px"}),s(".saswp-attached-rv-count").show()):s(".saswp-attached-rv-count").hide()}),s(".close-attached-reviews-popup").on("click",function(){s("#TB_closeWindowButton").trigger("click")}),s("#saswp_attahced_reviews").val()&&(saswp_attached_rv=JSON.parse(s("#saswp_attahced_reviews").val())),s("#saswp_attached_collection").val()&&(saswp_attached_col=JSON.parse(s("#saswp_attached_collection").val())),s(document).on("click",".saswp-attach-rv-checkbox",function(){var e;e=parseInt(s(this).parent().attr("data-id"));var a=s(this).parent().attr("data-type");s(this).is(":checked")?("review"==a&&saswp_attached_rv.push(e),"collection"==a&&saswp_attached_col.push(e)):("review"==a&&saswp_attached_rv.splice(saswp_attached_rv.indexOf(e),1),"collection"==a&&saswp_attached_col.splice(saswp_attached_col.indexOf(e),1));var t=saswp_attached_rv.length,i=saswp_attached_col.length,p="";t>0&&(p+=t+" Reviews, "),i>0&&(p+=i+" Collection"),p||(p=0),s(".saswp-attached-rv-count").text("Attached "+p),s("#saswp_attahced_reviews").val(JSON.stringify(saswp_attached_rv)),s("#saswp_attached_collection").val(JSON.stringify(saswp_attached_col))}),s(".saswp-load-more-rv").on("click",function(e){var a=s(this).attr("data-type"),t=s(".saswp-add-rv-loop[data-type="+a+"]").length,i=t/10+1;s("#saswp-add-rv-automatic .spinner").addClass("is-active"),e.preventDefault(),s.get(ajaxurl,{action:"saswp_get_reviews_on_load",data_type:a,offset:t,paged:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if("t"==e.status){var t="";e.result&&(s.each(e.result,function(s,e){var i="";"review"==a&&saswp_attached_rv.includes(parseInt(e.saswp_review_id))&&(i="checked"),"collection"==a&&saswp_attached_col.includes(parseInt(e.saswp_review_id))&&(i="checked"),t+='<div class="saswp-add-rv-loop" data-type="'+a+'" data-id="'+e.saswp_review_id+'">',"review"==a&&(t+='<input class="saswp-attach-rv-checkbox" type="checkbox" '+i+"> <strong> "+e.saswp_reviewer_name+" ( Rating - "+e.saswp_review_rating+' ) <span class="saswp-g-plus"><img src="'+e.saswp_review_platform_icon+'"/></span></strong>'),"collection"==a&&(t+='<input class="saswp-attach-rv-checkbox" type="checkbox" '+i+"> <strong> "+e.saswp_reviewer_name+" </strong>"),t+="</div>"}),s(".saswp-add-rv-automatic-list[data-type="+a+"]").append(t)),e.message&&(s(".saswp-rv-not-found[data-type="+a+"]").removeClass("saswp_hide"),s(".saswp-load-more-rv[data-type="+a+"]").addClass("saswp_hide"))}else alert(e.message);s("#saswp-add-rv-automatic .spinner").removeClass("is-active")},"json")}),s(".saswp-modify-schema-toggle").click(function(e){e.preventDefault(),s(".saswp-modify-container").slideToggle("300");var a=s("#saswp_enable_custom_field"),t=a.val();a.val("1"===t?"0":"1"),s(".saswp-enable-modify-schema-output").change()}),s(".saswp-enable-itemlist").change(function(){s(this).is(":checked")?(s("#saswp_item_list_tags").show(),s(".saspw-item-list-note").show(),"custom"==s("#saswp_item_list_tags").val()?s("#saswp_item_list_custom").show():s("#saswp_item_list_custom").hide()):(s(".saspw-item-list-note").hide(),s("#saswp_item_list_tags").hide(),s("#saswp_item_list_custom").hide())}),s("#saswp_item_list_tags").change(function(){"custom"==s(this).val()?s("#saswp_item_list_custom").show():s("#saswp_item_list_custom").hide()}),s(document).on("click",".saswp-add-g-location-btn",function(e){var a="";a=s("#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">',e.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>')&&s(".saswp-g-reviews-settings-table").append(t)}),s(document).on("click",".saswp-fetch-g-reviews",function(){var e=s(this),a="free";e.addClass("updating-message");var t=s(this).parent().parent().find(".saswp-g-location-field").val(),i=s(this).parent().parent().find(".saswp-g-blocks-field").val(),p=s("#saswp_google_place_api_key").val(),o=s("#reviews_addon_license_key").val(),c=s("#reviews_addon_license_key_status").val();if("premium"==(a=s("#saswp_google_place_api_key").length?"free":"premium")){if(!(i>0))return alert("Blocks value is zero"),e.removeClass("updating-message"),!1;if(0!=i%10)return e.parent().parent().find(".saswp-rv-fetched-msg").text("Reviews count should be in step of 10"),e.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b"),e.removeClass("updating-message"),!1}""!=t&&(o||p)?s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_fetch_google_reviews",reviews_api_status:c,reviews_api:o,location:t,blocks:i,g_api:p,premium_status:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){"t"==s.status?(e.parent().parent().find(".saswp-rv-fetched-msg").text("Success"),e.parent().parent().find(".saswp-rv-fetched-msg").css("color","green")):(e.parent().parent().find(".saswp-rv-fetched-msg").text(s.message),e.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b")),e.removeClass("updating-message")},error:function(s){console.log(s)}}):(""==t&&alert("Please enter place id"),""==p&&alert("Please enter api key"),""==o&&alert("Please enter reviews api key"),e.removeClass("updating-message"))}),saswp_localize_data.do_tour){var e,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} #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"}};e=function(){s(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(){s.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})}))},(t=s.extend(t,{buttons:function(s,e){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(){e.element.pointer("close")}),button_2.on("click",function(){e.element.pointer("close")}),button},close:function(){s.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(s,e){e.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?s(window).bind("load.wp-pointers",e):e()}if(s(".saswp-tabs a").click(function(e){var a=s(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),s(this).siblings().removeClass("nav-tab-active"),s(this).addClass("nav-tab-active"),s(".form-wrap").find(".saswp-"+t).siblings().hide(),s(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),s(".saswp-schame-type-select").change(function(e){e.preventDefault(),s(".saswp-custom-fields-table").html("");var a=s(this).val();s(".saswp-option-table-class tr").each(function(e,a){e>0&&s(this).hide()}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?s(".saswp-enable-speakable").parent().parent().show():s(".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||"Review"==a?s(".saswp-enable-append-reviews").parent().parent().show():s(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(s(".saswp-option-table-class tr").eq(1).show(),s(".saswp-business-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".select-post-type").val("show_globally").trigger("change")),"Service"==a&&(s(".saswp-service-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==a&&(s(".saswp-event-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==a&&(s(".saswp-review-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".saswp-item-reivewed-list").change()),"ItemList"==a?(s(".saswp-schema-modify-section").hide(),s(".saswp-itemlist-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".saswp-itemlist-item-type-list").change()):s(".saswp-schema-modify-section").show(),saswp_enable_rating_review(),s(".saswp-manual-modification").html(""),s(".saswp-static-container .spinner").addClass("is-active"),s.get(ajaxurl,{action:"saswp_get_manual_fields_on_ajax",schema_type:a,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){s(".saswp-static-container .spinner").removeClass("is-active"),s(".saswp-manual-modification").append(e),saswp_schema_datepicker(),saswp_schema_timepicker(),saswp_item_reviewed_call()}),"HowTo"==a||"local_business"==a||"FAQ"==a?s(".saswp-enable-modify-schema").show():(s(".saswp-enable-modify-schema-output").val("automatic"),s(".saswp-enable-modify-schema-output").change(),s(".saswp-enable-modify-schema").hide())}),s("#saswp_business_type").change(function(){var e=s(this).val(),a=s(".saswp-schame-type-select").val();s(".saswp-option-table-class tr").each(function(e,a){e>1&&(s(this).hide(),s(this).find(".saswp-local-sub-type-2").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?s(".saswp-enable-speakable").parent().parent().show():s(".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||"Review"==a?s(".saswp-enable-append-reviews").parent().parent().show():s(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(s(".saswp-"+e+"-tr").show(),s(".saswp-business-text-field-tr").show(),s(".saswp-"+e+"-tr").find("select").attr("disabled",!1)),"Review"==a&&(s(".saswp-review-text-field-tr").show(),s(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"ItemList"==a?(s(".saswp-schema-modify-section").hide(),s(".saswp-itemlist-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)):s(".saswp-schema-modify-section").show(),"Event"==a&&(s(".saswp-event-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),saswp_enable_rating_review()}).change(),s(".saswp-checkbox").change(function(){var e=s(this).attr("id"),a=s(this);switch(e){case"saswp-the-seo-framework-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-the-seo-framework").val(1):s("#saswp-the-seo-framework").val(0);break;case"saswp-seo-press-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-seo-press").val(1):s("#saswp-seo-press").val(0);break;case"saswp-aiosp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-aiosp").val(1):s("#saswp-aiosp").val(0);break;case"saswp-smart-crawl-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-smart-crawl").val(1):s("#saswp-smart-crawl").val(0);break;case"saswp-squirrly-seo-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-squirrly-seo").val(1):s("#saswp-squirrly-seo").val(0);break;case"saswp-wp-recipe-maker-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-recipe-maker").val(1):s("#saswp-wp-recipe-maker").val(0);break;case"saswp-wp-ultimate-recipe-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-ultimate-recipe").val(1):s("#saswp-wp-ultimate-recipe").val(0);break;case"saswp-zip-recipes-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-zip-recipes").val(1):s("#saswp-zip-recipes").val(0);break;case"saswp-mediavine-create-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-mediavine-create").val(1):s("#saswp-mediavine-create").val(0);break;case"saswp-ht-recipes-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ht-recipes").val(1):s("#saswp-ht-recipes").val(0);break;case"saswp-wpsso-core-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wpsso-core").val(1):s("#saswp-wpsso-core").val(0);break;case"saswp-for-wordpress-checkbox":s(this).is(":checked")?s("#saswp-for-wordpress").val(1):s("#saswp-for-wordpress").val(0);break;case"saswp-for-amp-checkbox":s(this).is(":checked")?s("#saswp-for-amp").val(1):s("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":s(this).is(":checked")?(s("#saswp_kb_contact_1").val(1),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(s("#saswp_kb_contact_1").val(0),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":s(this).is(":checked")?(s("#saswp-logo-dimensions").val(1),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(s("#saswp-logo-dimensions").val(0),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":s(this).is(":checked")?(s("#saswp_archive_schema").val(1),s(".saswp_archive_schema_type_class").parent().parent().show()):(s("#saswp_archive_schema").val(0),s(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":s(this).is(":checked")?(s("#saswp_website_schema").val(1),s("#saswp_search_box_schema").parent().parent().show()):(s("#saswp_website_schema").val(0),s("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":s(this).is(":checked")?s("#saswp_search_box_schema").val(1):s("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":s(this).is(":checked")?s("#saswp_breadcrumb_schema").val(1):s("#saswp_breadcrumb_schema").val(0);break;case"saswp_comments_schema_checkbox":s(this).is(":checked")?s("#saswp_comments_schema").val(1):s("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":s(this).is(":checked")?s("#saswp-review-module").val(1):s("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-kk-star-raring").val(1):s("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-woocommerce").val(1):s("#saswp-woocommerce").val(0);break;case"saswp-default-review-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp_default_review").val(1):s("#saswp_default_review").val(0);break;case"saswp-extra-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-extra").val(1):s("#saswp-extra").val(0);break;case"saswp-soledad-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-soledad").val(1):s("#saswp-soledad").val(0);break;case"saswp-dw-question-answer-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-dw-question-answer").val(1):s("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-job-manager").val(1):s("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-yoast").val(1):s("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-rankmath").val(1):s("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-tagyeem").val(1):s("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-the-events-calendar").val(1):s("#saswp-the-events-calendar").val(0);break;case"saswp-homeland-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-homeland").val(1):s("#saswp-homeland").val(0);break;case"saswp-wpresidence-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wpresidence").val(1):s("#saswp-wpresidence").val(0);break;case"saswp-realhomes-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-realhomes").val(1):s("#saswp-realhomes").val(0);break;case"saswp-learn-press-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-learn-press").val(1):s("#saswp-learn-press").val(0);break;case"saswp-learn-dash-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-learn-dash").val(1):s("#saswp-learn-dash").val(0);break;case"saswp-lifter-lms-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-lifter-lms").val(1):s("#saswp-lifter-lms").val(0);break;case"saswp-wp-event-manager-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-event-manager").val(1):s("#saswp-wp-event-manager").val(0);break;case"saswp-events-manager-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-events-manager").val(1):s("#saswp-events-manager").val(0);break;case"saswp-event-calendar-wd-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-event-calendar-wd").val(1):s("#saswp-event-calendar-wd").val(0);break;case"saswp-event-organiser-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-event-organiser").val(1):s("#saswp-event-organiser").val(0);break;case"saswp-modern-events-calendar-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-modern-events-calendar").val(1):s("#saswp-modern-events-calendar").val(0);break;case"saswp-woocommerce-booking-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking").val(1),s("#saswp-woocommerce-booking-main").val(1)):(s("#saswp-woocommerce-booking").val(0),s("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking-main").val(1),s("#saswp-woocommerce-booking").val(1)):(s("#saswp-woocommerce-booking-main").val(0),s("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-woocommerce-membership").val(1):s("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":s(this).is(":checked")?s("#saswp-defragment").val(1):s("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-cooked").val(1):s("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-shopper-approved-review-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?(s("#saswp-shopper-approved-review").val(1),s(".saswp-s-reviews-settings-table").parent().parent().parent().show()):(s("#saswp-shopper-approved-review").val(0),s(".saswp-s-reviews-settings-table").parent().parent().parent().hide());break;case"saswp-google-review-checkbox":s(this).is(":checked")?(s("#saswp-google-review").val(1),s("#saswp-google-rv-free-checkbox").length?(s("#saswp-google-review-free").parent().parent().show(),s("#saswp-google-rv-free-checkbox").is(":checked")?s("#saswp_google_place_api_key").parent().parent().show():s("#saswp_google_place_api_key").parent().parent().hide()):s("#saswp_google_place_api_key").parent().parent().show(),s(".saswp-g-reviews-settings-table").parent().parent().parent().show()):(s("#saswp-google-review").val(0),s("#saswp_google_place_api_key").parent().parent().hide(),s(".saswp-g-reviews-settings-table").parent().parent().parent().hide(),s("#saswp-google-rv-free-checkbox").length&&s("#saswp-google-review-free").parent().parent().hide());break;case"saswp-google-rv-free-checkbox":s("#saswp-google-review-checkbox").is(":checked")&&s(this).is(":checked")?(s("#saswp-google-review-free").val(1),s("#saswp_google_place_api_key").parent().parent().show()):(s("#saswp-google-review-free").val(0),s("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":s(this).is(":checked")?s("#saswp-markup-footer").val(1):s("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":s(this).is(":checked")?s("#saswp-pretty-print").val(1):s("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wppostratings-raring").val(1):s("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-bbpress").val(1):s("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":s(this).is(":checked")?s("#saswp-microdata-cleanup").val(1):s("#saswp-microdata-cleanup").val(0);break;case"saswp-other-images-checkbox":s(this).is(":checked")?s("#saswp-other-images").val(1):s("#saswp-other-images").val(0);break;case"saswp-easy-testimonials-checkbox":s(this).is(":checked")?s("#saswp-easy-testimonials").val(1):s("#saswp-easy-testimonials").val(0);break;case"saswp-testimonial-pro-checkbox":s(this).is(":checked")?s("#saswp-testimonial-pro").val(1):s("#saswp-testimonial-pro").val(0);break;case"saswp-bne-testimonials-checkbox":s(this).is(":checked")?s("#saswp-bne-testimonials").val(1):s("#saswp-bne-testimonials").val(0);break;case"saswp-ampforwp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ampforwp").val(1):s("#saswp-ampforwp").val(0);break;case"saswp-ampbyautomatic-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ampbyautomatic").val(1):s("#saswp-ampbyautomatic").val(0);break;case"saswp-total-recipe-generator-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-total-recipe-generator").val(1):s("#saswp-total-recipe-generator").val(0);break;case"saswp-wordpress-news-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wordpress-news").val(1):s("#saswp-wordpress-news").val(0);break;case"saswp-ampwp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ampwp").val(1):s("#saswp-ampwp").val(0);break;case"saswp-wp-event-aggregator-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-event-aggregator").val(1):s("#saswp-wp-event-aggregator").val(0);break;case"saswp-easy-recipe-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-easy-recipe").val(1):s("#saswp-easy-recipe").val(0);break;case"saswp-tevolution-events-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-tevolution-events").val(1):s("#saswp-tevolution-events").val(0);break;case"saswp-strong-testimonials-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-strong-testimonials").val(1):s("#saswp-strong-testimonials").val(0);break;case"saswp-wordlift-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wordlift").val(1):s("#saswp-wordlift").val(0);break;case"saswp-betteramp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-betteramp").val(1):s("#saswp-betteramp").val(0);break;case"saswp-wpamp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wpamp").val(1):s("#saswp-wpamp").val(0)}}).change(),s("#saswp_kb_type").change(function(){var e=s(this).val();s(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==e&&(s(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==e&&(s(".saswp_org_fields").parent().parent().addClass("saswp_hide"),s(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),s(document).on("click","input[data-id=media]",function(e){e.preventDefault();var a=s(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 e=i.state().get("selection").first().toJSON();s("#"+t).val(e.url),s("input[data-id='"+t+"_id']").val(e.id),s("input[data-id='"+t+"_height']").val(e.height),s("input[data-id='"+t+"_width']").val(e.width),s("input[data-id='"+t+"_thumbnail']").val(e.url),"sd_default_image_button"===a.attr("id")&&(s("#sd_default_image_width").val(e.width),s("#sd_default_image_height").val(e.height));var p="";"saswp_image_div_"+t=="saswp_image_div_sd_default_image"&&e.height<1200&&(p='<p class="saswp_warning">Image size is smaller than recommended size</p>'),s(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+e.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>'+p)}).open()}),s(document).on("click",".saswp_prev_close",function(e){e.preventDefault();var a=s(this).attr("data-id");s(this).parent().remove(),s("#"+a).val(""),s("input[data-id='"+a+"_id']").val(""),s("input[data-id='"+a+"_height']").val(""),s("input[data-id='"+a+"_width']").val(""),s("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(s("#sd_default_image_width").val(""),s("#sd_default_image_height").val(""))}),s(document).on("click",".saswp-modify-schema",function(e){e.preventDefault();var a=s(this).attr("schema-id");s(".saswp_modify_this_schema_hidden_"+a).val(1),s(".saswp-restore-schema[schema-id="+a+"]").parent().removeClass("saswp_hide"),s(".saswp-modify-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s(".saswp-ps-toggle[schema-id="+a+"]").removeClass("saswp_hide")}),s(document).on("click",".saswp-restore-schema",function(e){e.preventDefault();var a=s(this).attr("schema-id");s(".saswp_modify_this_schema_hidden_"+a).val(0),s(".saswp-restore-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s(".saswp-modify-schema[schema-id="+a+"]").parent().removeClass("saswp_hide"),s(".saswp-ps-toggle[schema-id="+a+"]").addClass("saswp_hide")}),s(document).on("change",".saswp-schema-type-toggle",function(e){var a=s(this).attr("data-schema-id"),t=s(this).attr("data-post-id"),i=s(".saswp_modify_this_schema_hidden_"+a).val();if(s(this).is(":checked")){var p=0;s(".saswp-ps-toggle[schema-id="+a+"]").addClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s(".saswp-modify-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s("#saswp_custom_schema_field[schema-id="+a+"]").parent().addClass("saswp_hide")}else{s("#saswp_custom_schema_field[schema-id="+a+"]").parent().removeClass("saswp_hide"),1==i?(s(".saswp-ps-toggle[schema-id="+a+"]").removeClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().removeClass("saswp_hide")):(s(".saswp-modify-schema[schema-id="+a+"]").parent().removeClass("saswp_hide"),s(".saswp-ps-toggle[schema-id="+a+"]").addClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().addClass("saswp_hide"));p=1}s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:p,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){},error:function(s){console.log(s)}})}),s(document).on("click",".saswp-reset-data",function(e){e.preventDefault(),1==confirm("Are you sure?")&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){setTimeout(function(){location.reload()},1e3)},error:function(s){console.log(s)}})}),s(document).on("click",".saswp_license_activation",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("license-status"),i=s(this).attr("add-on"),p=s("#"+i+"_addon_license_key").val();t&&i&&p?s.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(e){s("#"+i+"_addon_license_key_status").val(e.status),"active"==e.status?(s(".saswp-"+i+"-dashicons").addClass("dashicons-yes"),s(".saswp-"+i+"-dashicons").removeClass("dashicons-no-alt"),s(".saswp-"+i+"-dashicons").css("color","green"),s(".saswp_license_activation[add-on='"+i+"']").attr("license-status","inactive"),s(".saswp_license_activation[add-on='"+i+"']").text("Deactivate"),s(".saswp_license_status_msg[add-on='"+i+"']").text("Activated"),s(".saswp_license_status_msg[add-on='"+i+"']").css("color","green"),s(".saswp_license_status_msg[add-on='"+i+"']").text(e.message)):(s(".saswp-"+i+"-dashicons").addClass("dashicons-no-alt"),s(".saswp-"+i+"-dashicons").removeClass("dashicons-yes"),s(".saswp-"+i+"-dashicons").css("color","red"),s(".saswp_license_activation[add-on='"+i+"']").attr("license-status","active"),s(".saswp_license_activation[add-on='"+i+"']").text("Activate"),s(".saswp_license_status_msg[add-on='"+i+"']").css("color","red"),s(".saswp_license_status_msg[add-on='"+i+"']").text(e.message)),a.removeClass("updating-message")},error:function(s){console.log(s)}}):(alert("Please enter value license key"),a.removeClass("updating-message"))}),s(".saswp-send-query").on("click",function(e){e.preventDefault();var a=s("#saswp_query_message").val(),t=s("#saswp_query_email").val(),i=s("#saswp_query_premium_cus").val();console.log(saswpIsEmail(t)),""!=s.trim(a)&&i&&""!=s.trim(t)&&1==saswpIsEmail(t)?s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",premium_cus:i,message:a,email:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s(".saswp-query-success").show(),s(".saswp-query-error").hide()):(s(".saswp-query-success").hide(),s(".saswp-query-error").show())},error:function(s){console.log(s)}}):""==s.trim(a)&&""==i&&""==s.trim(t)?alert("Please enter the message, email and select customer type"):(""==i&&alert("Select Customer type"),""==s.trim(a)&&alert("Please enter the message"),""==s.trim(t)&&alert("Please enter the email"),0==saswpIsEmail(t)&&alert("Please enter a valid email"))}),s(".saswp-import-plugins").on("click",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("data-id");s.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?(s(a).parent().find(".saswp-imported-message").text(e.message),s(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(s(a).parent().find(".saswp-imported-message").addClass("saswp-error"),s(a).parent().find(".saswp-imported-message").text(e.message)),a.removeClass("updating-message")},"json")}),s(".saswp-feedback-no-thanks").on("click",function(e){e.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_no_thanks",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status&&s(".saswp-feedback-notice").hide()},"json")}),s(".saswp-feedback-remindme").on("click",function(e){e.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_remindme",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status&&s(".saswp-feedback-notice").hide()},"json")}),s(document).on("change",".saswp-local-business-type-select",function(e){e.preventDefault();var a=s(this),t=s(this).val();s.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if("t"==e.status){s(".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+'">',s.each(e.result,function(s,e){i+='<option value="'+s+'">'+e+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else s(".saswp-local-business-name-select").parents("tr").remove()},"json")}),saswp_item_reviewed_call(),jQuery(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),s(document).on("click",".saswp-add-custom-schema",function(e){e.preventDefault(),s(".saswp-add-custom-schema-field").removeClass("saswp_hide"),s(this).hide()}),s(document).on("click",".saswp-delete-custom-schema",function(e){e.preventDefault(),s("#saswp_custom_schema_field").val(""),s(".saswp-add-custom-schema-field").addClass("saswp_hide"),s(".saswp-add-custom-schema").show()}),s(".saswp-modify_schema_post_enable").on("click",function(e){var a=s(this);a.addClass("updating-message"),e.preventDefault(),s.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(e){a.remove(),s(".saswp-add-custom-schema-div").remove(),s("#post_specific .inside").append(e),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(),s(document).on("click",".saswp-add-more-item",function(e){e.preventDefault();s(".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>')}),s(document).on("click",".saswp-remove-review-item",function(e){e.preventDefault(),s(this).parent().parent("tr").remove()}),s(document).on("focusout",".saswp-review-item-tr input[type=number]",function(e){e.preventDefault();var a=0,t=s(".saswp-review-item-tr input[type=number]").length;s(".saswp-review-item-tr input[type=number]").each(function(e,t){""==s(t).val()?a+=parseFloat(0):a+=parseFloat(s(t).val())});var i=a/t;s("#saswp-review-item-over-all").val(i)}),s("#saswp-review-location").change(function(){var e=s(this).val();s(".saswp-review-shortcode").addClass("saswp_hide"),3==e&&s(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),s("#saswp-review-item-enable").change(function(){s(this).is(":checked")?s(".saswp-review-fields").show():s(".saswp-review-fields").hide()}).change(),s(document).on("click",".saswp-restore-post-schema",function(e){e.preventDefault();var a=s(this);if(a.addClass("updating-message"),s(".saswp-post-specific-schema-ids").val())var t=JSON.parse(s(".saswp-post-specific-schema-ids").val());s.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(s){"t"==s.status?setTimeout(function(){location.reload()},1e3):(alert(s.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),s(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(e){e.preventDefault();var a=s(this).attr("data-id");s(".saswp-post-specific-wrapper").hide(),s("#"+a).show(),s("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),s("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),s(this).addClass("selected"),s(this).parent().addClass("selected"),saswp_enable_rating_review()}),s("#saswp-global-tabs a:first").addClass("saswp-global-selected"),s(".saswp-global-container").hide(),"#saswp-default-container"==window.location.hash?s(".saswp-global-container:eq(2)").show():s(".saswp-global-container:first").show(),s("#saswp-global-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-global-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-global-container").hide(),s("#"+e).show())}),s("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),s(".saswp-tools-container").hide(),s(".saswp-tools-container:first").show(),s("#saswp-tools-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-tools-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-tools-container").hide(),s("#"+e).show())}),s("#saswp-review-tabs a:first").addClass("saswp-global-selected"),s(".saswp-review-container").hide(),s(".saswp-review-container:first").show(),s("#saswp-review-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-review-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-review-container").hide(),s("#"+e).show())}),s("#saswp-compatibility-tabs a:first").addClass("saswp-global-selected"),s(".saswp-compatibility-container").hide(),s(".saswp-compatibility-container:first").show(),s("#saswp-compatibility-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-compatibility-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-compatibility-container").hide(),s("#"+e).show())}),s('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),s(".saswp-enable-modify-schema-output").on("change",function(){s(".saswp-static-container").addClass("saswp_hide"),s(".saswp-dynamic-container").addClass("saswp_hide"),"manual"==s(this).val()&&(s(".saswp-static-container").removeClass("saswp_hide"),s(".saswp-dynamic-container").addClass("saswp_hide")),"automatic"==s(this).val()&&(s(".saswp-static-container").addClass("saswp_hide"),s(".saswp-dynamic-container").removeClass("saswp_hide"))}),s(document).on("change",".saswp-custom-fields-name",function(){var e="text",a=s(this).parent().parent("tr"),t=s(this).val();-1==t.indexOf("_image")&&-1==t.indexOf("_logo")||(e="image");var i=s(this).parent().parent("tr").find("td:eq(1)");saswp_get_meta_list(null,e,null,i,t,a)}),s(document).on("click",".saswp-skip-button",function(e){e.preventDefault(),s(this).parent().parent().hide(),s.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){},"json")}),s(document).on("click",".saswp_add_schema_fields_on_fly",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("data-id"),i=s(this).attr("fields_type"),p=s(this).attr("div_type"),o=s("saswp_specific_"+t+" , .saswp-"+p+"-table-div").length,c=s("saswp_specific_"+t+" , .saswp-"+p+"-table-div:nth-child("+o+")").attr("data-id");(c=++c)||(c=0),saswp_get_post_specific_schema_fields(a,c,i,p,t,i+"_","Article")}),s(document).on("click",".saswp-table-close",function(){s(this).parent().remove()}),s(document).on("click",".saswp-rmv-modify_row",function(e){e.preventDefault(),s(this).parent().parent().remove()}),s(document).on("change",".saswp-custom-meta-list",function(){var e=s(this),a=s("select#schema_type option:selected").val(),t=s(this).val(),i=s(this).parent().parent("tr").find(".saswp-custom-fields-name").val(),p="",o=a.toLowerCase()+"_"+i,c="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>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(this).parent().parent("tr").append(p),saswpCustomSelect2()):"taxonomy_term"==t?saswp_taxonomy_term.taxonomy?(p+=saswp_taxonomy_term_html(saswp_taxonomy_term.taxonomy,i),e.parent().parent("tr").find("td:gt(1)").remove(),e.parent().parent("tr").append(p),saswpCustomSelect2()):s.get(ajaxurl,{action:"saswp_get_taxonomy_term_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){s&&(saswp_taxonomy_term.taxonomy=s,p+=saswp_taxonomy_term_html(s,i),e.parent().parent("tr").find("td:gt(1)").remove(),e.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>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(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="'+c+'[height]" id="'+o+'_height" value="">',p+='<input type="hidden" data-id="'+o+'_width" class="upload-width" name="'+c+'[width]" id="'+o+'_width" value="">',p+='<input type="hidden" data-id="'+o+'_thumbnail" class="upload-thumbnail" name="'+c+'[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>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(this).parent().parent("tr").append(p),saswpCustomSelect2()):(p+="<td></td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(this).parent().parent("tr").append(p),saswpCustomSelect2())}),s(document).on("change",".saswp-item-reivewed-list",function(){s(".saswp-custom-fields-table").html(""),saswp_meta_list_fields=[];var e=s(this),a=s("select#schema_type option:selected").val();saswp_item_reviewed_ajax(a,e,"manual")}),s(document).on("click",".saswp-add-custom-fields",function(){var e=s(this);e.addClass("updating-message");var a=s("select#schema_type option:selected").val(),t="",i=null;"Review"==a&&(t=s("select.saswp-item-reivewed-list option:selected").val(),i="saswp_review_name");var p=s("#post_ID").val();""!=a&&(saswp_meta_list_fields[a]?saswp_get_meta_list(e,"text",saswp_meta_list_fields[a],null,i,null):s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:p,schema_type:a,schema_subtype:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){saswp_meta_list_fields[a]=s,saswp_get_meta_list(e,"text",saswp_meta_list_fields[a],null,i,null)},error:function(s){console.log(s)}}))}),saswpCustomSelect2(),saswp_enable_rating_review(),s('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),s(document).on("click",".saswp_coonect_google_place",function(){var e=s("#saswp_google_place_id").val(),a=s("#saswp_language_list").val(),t=s("#saswp_googel_api").val();""!=e&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:e,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){console.log(s.status)},error:function(s){console.log(s)}})}),s(document).on("click",".saswp-add-social-links",function(){s(".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>')}),s(document).on("click",".saswp-show-accept-rv-popup",function(){tb_show("Reviews Form","#TB_inline??width=600&height=400&inlineId=saswp-accept-reviews-popup"),s(document).find("#TB_window").width(600).height(400).css({top:"100px","margin-top":"0px"})}),("saswp_reviews"==saswp_localize_data.post_type||"saswp-collections"==saswp_localize_data.post_type)&&"edit.php"==saswp_localize_data.page_now){var i='<div class="saswp-custom-post-tab">';i+='<div style="display:none;" id="saswp-accept-reviews-popup">',i+='<div class="saswp-accept-rv-container">',i+="<p>Use Below shortcode to show reviews form in your website. Using this you can accept reviews from your website directly</p>",i+='<div class="saswp-show-form-on-tab"><strong>Simple Form</strong> <input value="[saswp-reviews-form]" type="text" readonly></div>',i+='<div class="saswp-show-form-on-tab"><strong>Show form on button tap</strong> <input value="[saswp-reviews-form onbutton="1"]" type="text" readonly></div>',i+="</div>",i+="</div>",i+='<h2 class="nav-tab-wrapper">',i+="<a href="+saswp_localize_data.reviews_page_url+' class="nav-tab '+(saswp_localize_data.current_url==saswp_localize_data.reviews_page_url?"saswp-global-selected":"")+'">Reviews</a>',i+="<a href="+saswp_localize_data.collections_page_url+' class="nav-tab '+(saswp_localize_data.current_url==saswp_localize_data.collections_page_url?"saswp-global-selected":"")+'">Collections</a>',i+='<a class="nav-tab saswp-show-accept-rv-popup">Accept Reviews</a>',i+="</h2>",i+="</div>",jQuery(jQuery(".wrap")).prepend(i)}"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&&s(".saswp-rating-div").rateYo({rating:saswp_reviews_data.rating_val,halfStar:!0,readOnly:saswp_reviews_data.readonly,onSet:function(e,a){s(this).next().val(e)}}),s("#sd-person-phone-number, #saswp_kb_telephone").focusout(function(){var e=s(this);e.parent().find(".saswp-phone-validation").remove();var a=s(this).val();/^\+([0-9]{1,3})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})$/.test(a)?e.parent().find(".saswp-phone-validation").remove():e.after('<span style="color:red;" class="saswp-phone-validation">Invalid Phone Number</span>')}),saswpCollectionSlider(),s(document).on("click",".saswp-grid-page",function(e){e.preventDefault(),saswp_grid_page=s(this).attr("data-id"),saswp_on_collection_design_change()}),s("#saswp-coll-pagination").change(function(){saswp_grid_page=1,s("#saswp-coll-per-page").parent().addClass("saswp_hide_imp"),s(this).is(":checked")&&s("#saswp-coll-per-page").parent().removeClass("saswp_hide_imp"),saswp_on_collection_design_change()}),s(".saswp-accordion").click(function(){s(this).toggleClass("active"),s(this).next(".saswp-accordion-panel").slideToggle(200)}),s(document).on("click",".saswp-opn-cls-btn",function(){s("#saswp-reviews-cntn").toggle(),s("#saswp-reviews-cntn").is(":visible")?(s(".saswp-onclick-show").css("display","flex"),s(".saswp-onclick-hide").hide(),s(".saswp-open-class").css("width","500px")):(s(".saswp-onclick-show").css("display","none"),s(".saswp-onclick-hide").show(),s(".saswp-open-class").css("width","300px"))}),s(".saswp-collection-display-method").change(function(){"shortcode"==s(this).val()?s(".saswp-collection-shortcode").removeClass("saswp_hide"):s(".saswp-collection-shortcode").addClass("saswp_hide")}).change(),s(document).on("click",".saswp-remove-platform",function(e){e.preventDefault();var a=s(this).attr("platform-id");saswp_collection.splice(a,1),s(this).parent().remove(),saswp_on_collection_design_change()}),s(".saswp-number-change").bind("keyup mouseup",function(){saswp_on_collection_design_change()}),s(".saswp-coll-settings-options").change(function(){saswp_grid_page=1;var e=s(".saswp-collection-desing").val();s(".saswp-coll-options").addClass("saswp_hide"),s(".saswp-collection-lp").css("height","auto"),"grid"==e&&s(".saswp-grid-options").removeClass("saswp_hide"),"gallery"==e&&s(".saswp-slider-options").removeClass("saswp_hide"),"fomo"==e&&(s(".saswp-fomo-options").removeClass("saswp_hide"),s(".saswp-collection-lp").css("height","31px")),"popup"==e&&s(".saswp-collection-lp").css("height","31px"),saswp_on_collection_design_change()}).change(),s(".saswp-add-to-collection").on("click",function(e){e.preventDefault();var a=s(this),t=s("#saswp-plaftorm-list").val(),i=s("#saswp-review-count").val();t&&i>0?(a.addClass("updating-message"),saswp_get_collection_data(i,t,a)):alert("Enter Count")});var p,o,c=s("#saswp_collection_id").val();c&&(s(".spinner").addClass("is-active"),s.get(ajaxurl,{action:"saswp_get_collection_platforms",collection_id:c,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if(e.status){var a=e.message;s.each(a,function(s,e){saswp_get_collection_data(e,s,null)})}s(".spinner").removeClass("is-active")},"json")),(p=document.createElement("div")).style.cssText="position:absolute; background:black; color:white; padding:4px 6px;z-index:10000;border-radius:2px; font-size:12px;box-shadow:3px 3px 3px rgba(0,0,0,.4);opacity:0;transition:opacity 0.3s",p.innerHTML="Copied!",document.body.appendChild(p);var n=document.getElementById("motivatebox");n&&n.addEventListener("mouseup",function(s){var e=(s=s||event).target||s.srcElement;"motivate"==e.className&&(!function(s){var e=document.createRange();e.selectNodeContents(s);var a=window.getSelection();a.removeAllRanges(),a.addRange(e)}(e),function(){var s;try{s=document.execCommand("copy")}catch(e){s=!1}return s}()&&function(s){var e=s||event;clearTimeout(o),p.style.left=e.pageX-10+"px",p.style.top=e.pageY+15+"px",p.style.opacity=1,o=setTimeout(function(){p.style.opacity=0},500)}(s))},!1)});
|
1 |
+
var saswp_attached_rv=[],saswp_attached_col=[];jQuery(document).ready(function(s){if(s(".saswp-upgrade-to-pro").parent().attr({href:"https://structured-data-for-wp.com/pricing/",target:"_blank"}),s(document).on("click",".saswp-attach-reviews",function(){s(".saswp-enable-append-reviews").is(":checked")?(tb_show("Attach reviews to this schema type","#TB_inline??width=615&height=400&inlineId=saswp-embed-code-div"),s(document).find("#TB_window").width(600).height(415).css({top:"200px","margin-top":"0px"}),s(".saswp-attached-rv-count").show()):s(".saswp-attached-rv-count").hide()}),s(".close-attached-reviews-popup").on("click",function(){s("#TB_closeWindowButton").trigger("click")}),s("#saswp_attahced_reviews").val()&&(saswp_attached_rv=JSON.parse(s("#saswp_attahced_reviews").val())),s("#saswp_attached_collection").val()&&(saswp_attached_col=JSON.parse(s("#saswp_attached_collection").val())),s(document).on("click",".saswp-attach-rv-checkbox",function(){var e;e=parseInt(s(this).parent().attr("data-id"));var a=s(this).parent().attr("data-type");s(this).is(":checked")?("review"==a&&saswp_attached_rv.push(e),"collection"==a&&saswp_attached_col.push(e)):("review"==a&&saswp_attached_rv.splice(saswp_attached_rv.indexOf(e),1),"collection"==a&&saswp_attached_col.splice(saswp_attached_col.indexOf(e),1));var t=saswp_attached_rv.length,i=saswp_attached_col.length,p="";t>0&&(p+=t+" Reviews, "),i>0&&(p+=i+" Collection"),p||(p=0),s(".saswp-attached-rv-count").text("Attached "+p),s("#saswp_attahced_reviews").val(JSON.stringify(saswp_attached_rv)),s("#saswp_attached_collection").val(JSON.stringify(saswp_attached_col))}),s(".saswp-load-more-rv").on("click",function(e){var a=s(this).attr("data-type"),t=s(".saswp-add-rv-loop[data-type="+a+"]").length,i=t/10+1;s("#saswp-add-rv-automatic .spinner").addClass("is-active"),e.preventDefault(),s.get(ajaxurl,{action:"saswp_get_reviews_on_load",data_type:a,offset:t,paged:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if("t"==e.status){var t="";e.result&&(s.each(e.result,function(s,e){var i="";"review"==a&&saswp_attached_rv.includes(parseInt(e.saswp_review_id))&&(i="checked"),"collection"==a&&saswp_attached_col.includes(parseInt(e.saswp_review_id))&&(i="checked"),t+='<div class="saswp-add-rv-loop" data-type="'+a+'" data-id="'+e.saswp_review_id+'">',"review"==a&&(t+='<input class="saswp-attach-rv-checkbox" type="checkbox" '+i+"> <strong> "+e.saswp_reviewer_name+" ( Rating - "+e.saswp_review_rating+' ) <span class="saswp-g-plus"><img src="'+e.saswp_review_platform_icon+'"/></span></strong>'),"collection"==a&&(t+='<input class="saswp-attach-rv-checkbox" type="checkbox" '+i+"> <strong> "+e.saswp_reviewer_name+" </strong>"),t+="</div>"}),s(".saswp-add-rv-automatic-list[data-type="+a+"]").append(t)),e.message&&(s(".saswp-rv-not-found[data-type="+a+"]").removeClass("saswp_hide"),s(".saswp-load-more-rv[data-type="+a+"]").addClass("saswp_hide"))}else alert(e.message);s("#saswp-add-rv-automatic .spinner").removeClass("is-active")},"json")}),s(".saswp-modify-schema-toggle").click(function(e){e.preventDefault(),s(".saswp-modify-container").slideToggle("300");var a=s("#saswp_enable_custom_field"),t=a.val();a.val("1"===t?"0":"1"),s(".saswp-enable-modify-schema-output").change()}),s(".saswp-enable-itemlist").change(function(){s(this).is(":checked")?(s("#saswp_item_list_tags").show(),s(".saspw-item-list-note").show(),"custom"==s("#saswp_item_list_tags").val()?s("#saswp_item_list_custom").show():s("#saswp_item_list_custom").hide()):(s(".saspw-item-list-note").hide(),s("#saswp_item_list_tags").hide(),s("#saswp_item_list_custom").hide())}),s("#saswp_item_list_tags").change(function(){"custom"==s(this).val()?s("#saswp_item_list_custom").show():s("#saswp_item_list_custom").hide()}),s(document).on("click",".saswp-add-g-location-btn",function(e){var a="";a=s("#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">',e.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>')&&s(".saswp-g-reviews-settings-table").append(t)}),s(document).on("click",".saswp-fetch-g-reviews",function(){var e=s(this),a="free";e.addClass("updating-message");var t=s(this).parent().parent().find(".saswp-g-location-field").val(),i=s(this).parent().parent().find(".saswp-g-blocks-field").val(),p=s("#saswp_google_place_api_key").val(),o=s("#reviews_addon_license_key").val(),c=s("#reviews_addon_license_key_status").val();if("premium"==(a=s("#saswp_google_place_api_key").length?"free":"premium")){if(!(i>0))return alert("Blocks value is zero"),e.removeClass("updating-message"),!1;if(0!=i%10)return e.parent().parent().find(".saswp-rv-fetched-msg").text("Reviews count should be in step of 10"),e.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b"),e.removeClass("updating-message"),!1}""!=t&&(o||p)?s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_fetch_google_reviews",reviews_api_status:c,reviews_api:o,location:t,blocks:i,g_api:p,premium_status:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){"t"==s.status?(e.parent().parent().find(".saswp-rv-fetched-msg").text("Success"),e.parent().parent().find(".saswp-rv-fetched-msg").css("color","green")):(e.parent().parent().find(".saswp-rv-fetched-msg").text(s.message),e.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b")),e.removeClass("updating-message")},error:function(s){console.log(s)}}):(""==t&&alert("Please enter place id"),""==p&&alert("Please enter api key"),""==o&&alert("Please enter reviews api key"),e.removeClass("updating-message"))}),saswp_localize_data.do_tour){var e,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} #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"}};e=function(){s(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(){s.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})}))},(t=s.extend(t,{buttons:function(s,e){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(){e.element.pointer("close")}),button_2.on("click",function(){e.element.pointer("close")}),button},close:function(){s.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(s,e){e.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?s(window).bind("load.wp-pointers",e):e()}if(s(".saswp-tabs a").click(function(e){var a=s(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),s(this).siblings().removeClass("nav-tab-active"),s(this).addClass("nav-tab-active"),s(".form-wrap").find(".saswp-"+t).siblings().hide(),s(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),s(".saswp-schame-type-select").change(function(e){e.preventDefault(),s(".saswp-custom-fields-table").html("");var a=s(this).val();s(".saswp-option-table-class tr").each(function(e,a){e>0&&s(this).hide()}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?s(".saswp-enable-speakable").parent().parent().show():s(".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||"Review"==a?s(".saswp-enable-append-reviews").parent().parent().show():s(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(s(".saswp-option-table-class tr").eq(1).show(),s(".saswp-business-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".select-post-type").val("show_globally").trigger("change")),"Service"==a&&(s(".saswp-service-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==a&&(s(".saswp-event-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==a&&(s(".saswp-review-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".saswp-item-reivewed-list").change()),"ItemList"==a?(s(".saswp-schema-modify-section").hide(),s(".saswp-itemlist-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".saswp-itemlist-item-type-list").change()):s(".saswp-schema-modify-section").show(),saswp_enable_rating_review(),s(".saswp-manual-modification").html(""),s(".saswp-static-container .spinner").addClass("is-active"),s.get(ajaxurl,{action:"saswp_get_manual_fields_on_ajax",schema_type:a,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){s(".saswp-static-container .spinner").removeClass("is-active"),s(".saswp-manual-modification").append(e),saswp_schema_datepicker(),saswp_schema_timepicker(),saswp_item_reviewed_call()}),"HowTo"==a||"local_business"==a||"FAQ"==a?s(".saswp-enable-modify-schema").show():(s(".saswp-enable-modify-schema-output").val("automatic"),s(".saswp-enable-modify-schema-output").change(),s(".saswp-enable-modify-schema").hide())}),s("#saswp_business_type").change(function(){var e=s(this).val(),a=s(".saswp-schame-type-select").val();s(".saswp-option-table-class tr").each(function(e,a){e>1&&(s(this).hide(),s(this).find(".saswp-local-sub-type-2").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?s(".saswp-enable-speakable").parent().parent().show():s(".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||"Review"==a?s(".saswp-enable-append-reviews").parent().parent().show():s(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(s(".saswp-"+e+"-tr").show(),s(".saswp-business-text-field-tr").show(),s(".saswp-"+e+"-tr").find("select").attr("disabled",!1)),"Review"==a&&(s(".saswp-review-text-field-tr").show(),s(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"ItemList"==a?(s(".saswp-schema-modify-section").hide(),s(".saswp-itemlist-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)):s(".saswp-schema-modify-section").show(),"Event"==a&&(s(".saswp-event-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),saswp_enable_rating_review()}).change(),s(".saswp-checkbox").change(function(){var e=s(this).attr("id"),a=s(this);switch(e){case"saswp-the-seo-framework-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-the-seo-framework").val(1):s("#saswp-the-seo-framework").val(0);break;case"saswp-seo-press-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-seo-press").val(1):s("#saswp-seo-press").val(0);break;case"saswp-aiosp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-aiosp").val(1):s("#saswp-aiosp").val(0);break;case"saswp-smart-crawl-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-smart-crawl").val(1):s("#saswp-smart-crawl").val(0);break;case"saswp-squirrly-seo-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-squirrly-seo").val(1):s("#saswp-squirrly-seo").val(0);break;case"saswp-wp-recipe-maker-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-recipe-maker").val(1):s("#saswp-wp-recipe-maker").val(0);break;case"saswp-wp-ultimate-recipe-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-ultimate-recipe").val(1):s("#saswp-wp-ultimate-recipe").val(0);break;case"saswp-zip-recipes-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-zip-recipes").val(1):s("#saswp-zip-recipes").val(0);break;case"saswp-mediavine-create-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-mediavine-create").val(1):s("#saswp-mediavine-create").val(0);break;case"saswp-ht-recipes-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ht-recipes").val(1):s("#saswp-ht-recipes").val(0);break;case"saswp-wpsso-core-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wpsso-core").val(1):s("#saswp-wpsso-core").val(0);break;case"saswp-for-wordpress-checkbox":s(this).is(":checked")?s("#saswp-for-wordpress").val(1):s("#saswp-for-wordpress").val(0);break;case"saswp-for-amp-checkbox":s(this).is(":checked")?s("#saswp-for-amp").val(1):s("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":s(this).is(":checked")?(s("#saswp_kb_contact_1").val(1),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(s("#saswp_kb_contact_1").val(0),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":s(this).is(":checked")?(s("#saswp-logo-dimensions").val(1),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(s("#saswp-logo-dimensions").val(0),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":s(this).is(":checked")?(s("#saswp_archive_schema").val(1),s(".saswp_archive_schema_type_class").parent().parent().show()):(s("#saswp_archive_schema").val(0),s(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":s(this).is(":checked")?(s("#saswp_website_schema").val(1),s("#saswp_search_box_schema").parent().parent().show()):(s("#saswp_website_schema").val(0),s("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":s(this).is(":checked")?s("#saswp_search_box_schema").val(1):s("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":s(this).is(":checked")?s("#saswp_breadcrumb_schema").val(1):s("#saswp_breadcrumb_schema").val(0);break;case"saswp_comments_schema_checkbox":s(this).is(":checked")?s("#saswp_comments_schema").val(1):s("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":s(this).is(":checked")?s("#saswp-review-module").val(1):s("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-kk-star-raring").val(1):s("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-woocommerce").val(1):s("#saswp-woocommerce").val(0);break;case"saswp-default-review-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp_default_review").val(1):s("#saswp_default_review").val(0);break;case"saswp-extra-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-extra").val(1):s("#saswp-extra").val(0);break;case"saswp-soledad-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-soledad").val(1):s("#saswp-soledad").val(0);break;case"saswp-dw-question-answer-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-dw-question-answer").val(1):s("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-job-manager").val(1):s("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-yoast").val(1):s("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-rankmath").val(1):s("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-tagyeem").val(1):s("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-the-events-calendar").val(1):s("#saswp-the-events-calendar").val(0);break;case"saswp-homeland-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-homeland").val(1):s("#saswp-homeland").val(0);break;case"saswp-wpresidence-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wpresidence").val(1):s("#saswp-wpresidence").val(0);break;case"saswp-realhomes-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-realhomes").val(1):s("#saswp-realhomes").val(0);break;case"saswp-learn-press-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-learn-press").val(1):s("#saswp-learn-press").val(0);break;case"saswp-learn-dash-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-learn-dash").val(1):s("#saswp-learn-dash").val(0);break;case"saswp-lifter-lms-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-lifter-lms").val(1):s("#saswp-lifter-lms").val(0);break;case"saswp-wp-event-manager-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-event-manager").val(1):s("#saswp-wp-event-manager").val(0);break;case"saswp-events-manager-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-events-manager").val(1):s("#saswp-events-manager").val(0);break;case"saswp-event-calendar-wd-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-event-calendar-wd").val(1):s("#saswp-event-calendar-wd").val(0);break;case"saswp-event-organiser-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-event-organiser").val(1):s("#saswp-event-organiser").val(0);break;case"saswp-modern-events-calendar-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-modern-events-calendar").val(1):s("#saswp-modern-events-calendar").val(0);break;case"saswp-woocommerce-booking-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking").val(1),s("#saswp-woocommerce-booking-main").val(1)):(s("#saswp-woocommerce-booking").val(0),s("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking-main").val(1),s("#saswp-woocommerce-booking").val(1)):(s("#saswp-woocommerce-booking-main").val(0),s("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-woocommerce-membership").val(1):s("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":s(this).is(":checked")?s("#saswp-defragment").val(1):s("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-cooked").val(1):s("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-shopper-approved-review-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?(s("#saswp-shopper-approved-review").val(1),s(".saswp-s-reviews-settings-table").parent().parent().parent().show()):(s("#saswp-shopper-approved-review").val(0),s(".saswp-s-reviews-settings-table").parent().parent().parent().hide());break;case"saswp-google-review-checkbox":s(this).is(":checked")?(s("#saswp-google-review").val(1),s("#saswp-google-rv-free-checkbox").length?(s("#saswp-google-review-free").parent().parent().show(),s("#saswp-google-rv-free-checkbox").is(":checked")?s("#saswp_google_place_api_key").parent().parent().show():s("#saswp_google_place_api_key").parent().parent().hide()):s("#saswp_google_place_api_key").parent().parent().show(),s(".saswp-g-reviews-settings-table").parent().parent().parent().show()):(s("#saswp-google-review").val(0),s("#saswp_google_place_api_key").parent().parent().hide(),s(".saswp-g-reviews-settings-table").parent().parent().parent().hide(),s("#saswp-google-rv-free-checkbox").length&&s("#saswp-google-review-free").parent().parent().hide());break;case"saswp-google-rv-free-checkbox":s("#saswp-google-review-checkbox").is(":checked")&&s(this).is(":checked")?(s("#saswp-google-review-free").val(1),s("#saswp_google_place_api_key").parent().parent().show()):(s("#saswp-google-review-free").val(0),s("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":s(this).is(":checked")?s("#saswp-markup-footer").val(1):s("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":s(this).is(":checked")?s("#saswp-pretty-print").val(1):s("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wppostratings-raring").val(1):s("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-bbpress").val(1):s("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":s(this).is(":checked")?s("#saswp-microdata-cleanup").val(1):s("#saswp-microdata-cleanup").val(0);break;case"saswp-other-images-checkbox":s(this).is(":checked")?s("#saswp-other-images").val(1):s("#saswp-other-images").val(0);break;case"saswp-multiple-size-image-checkbox":s(this).is(":checked")?s("#saswp-multiple-size-image").val(1):s("#saswp-multiple-size-image").val(0);break;case"saswp-easy-testimonials-checkbox":s(this).is(":checked")?s("#saswp-easy-testimonials").val(1):s("#saswp-easy-testimonials").val(0);break;case"saswp-testimonial-pro-checkbox":s(this).is(":checked")?s("#saswp-testimonial-pro").val(1):s("#saswp-testimonial-pro").val(0);break;case"saswp-bne-testimonials-checkbox":s(this).is(":checked")?s("#saswp-bne-testimonials").val(1):s("#saswp-bne-testimonials").val(0);break;case"saswp-ampforwp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ampforwp").val(1):s("#saswp-ampforwp").val(0);break;case"saswp-ampbyautomatic-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ampbyautomatic").val(1):s("#saswp-ampbyautomatic").val(0);break;case"saswp-total-recipe-generator-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-total-recipe-generator").val(1):s("#saswp-total-recipe-generator").val(0);break;case"saswp-wordpress-news-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wordpress-news").val(1):s("#saswp-wordpress-news").val(0);break;case"saswp-ampwp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-ampwp").val(1):s("#saswp-ampwp").val(0);break;case"saswp-wp-event-aggregator-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wp-event-aggregator").val(1):s("#saswp-wp-event-aggregator").val(0);break;case"saswp-easy-recipe-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-easy-recipe").val(1):s("#saswp-easy-recipe").val(0);break;case"saswp-tevolution-events-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-tevolution-events").val(1):s("#saswp-tevolution-events").val(0);break;case"saswp-strong-testimonials-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-strong-testimonials").val(1):s("#saswp-strong-testimonials").val(0);break;case"saswp-wordlift-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wordlift").val(1):s("#saswp-wordlift").val(0);break;case"saswp-betteramp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-betteramp").val(1):s("#saswp-betteramp").val(0);break;case"saswp-wpamp-checkbox":saswp_compatibliy_notes(a,e),s(this).is(":checked")?s("#saswp-wpamp").val(1):s("#saswp-wpamp").val(0)}}).change(),s("#saswp_kb_type").change(function(){var e=s(this).val();s(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==e&&(s(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==e&&(s(".saswp_org_fields").parent().parent().addClass("saswp_hide"),s(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),s(document).on("click","input[data-id=media]",function(e){e.preventDefault();var a=s(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 e=i.state().get("selection").first().toJSON();s("#"+t).val(e.url),s("input[data-id='"+t+"_id']").val(e.id),s("input[data-id='"+t+"_height']").val(e.height),s("input[data-id='"+t+"_width']").val(e.width),s("input[data-id='"+t+"_thumbnail']").val(e.url),"sd_default_image_button"===a.attr("id")&&(s("#sd_default_image_width").val(e.width),s("#sd_default_image_height").val(e.height));var p="";"saswp_image_div_"+t=="saswp_image_div_sd_default_image"&&e.height<1200&&(p='<p class="saswp_warning">Image size is smaller than recommended size</p>'),s(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+e.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>'+p)}).open()}),s(document).on("click",".saswp_prev_close",function(e){e.preventDefault();var a=s(this).attr("data-id");s(this).parent().remove(),s("#"+a).val(""),s("input[data-id='"+a+"_id']").val(""),s("input[data-id='"+a+"_height']").val(""),s("input[data-id='"+a+"_width']").val(""),s("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(s("#sd_default_image_width").val(""),s("#sd_default_image_height").val(""))}),s(document).on("click",".saswp-modify-schema",function(e){e.preventDefault();var a=s(this).attr("schema-id"),t=s(this);t.addClass("updating-message"),s.get(ajaxurl,{action:"saswp_modify_schema_post_enable",schema_id:a,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){s(".saswp-post-specific-wrapper[data-id="+a+"] .saswp-post-specific-setting").after(e),s(".saswp_modify_this_schema_hidden_"+a).val(1),s(".saswp-ps-toggle[schema-id="+a+"]").removeClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().removeClass("saswp_hide"),s(".saswp-modify-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),t.removeClass("updating-message"),saswp_schema_datepicker(),saswp_enable_rating_review(),saswp_item_reviewed_call()})}),s(document).on("click",".saswp-restore-schema",function(e){e.preventDefault();var a=s(this).attr("schema-id"),t=s(this);t.addClass("updating-message"),s.post(ajaxurl,{action:"saswp_modify_schema_post_restore",schema_id:a,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){t.removeClass("updating-message"),"t"==e.status?(s(".saswp_modify_this_schema_hidden_"+a).val(0),s(".saswp-restore-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s(".saswp-modify-schema[schema-id="+a+"]").parent().removeClass("saswp_hide"),s(".saswp-ps-toggle[schema-id="+a+"]").remove()):alert("Something went wrong")},"json")}),s(document).on("change",".saswp-schema-type-toggle",function(e){var a=s(this).attr("data-schema-id"),t=s(this).attr("data-post-id"),i=s(".saswp_modify_this_schema_hidden_"+a).val();if(s(this).is(":checked")){var p=0;s(".saswp-ps-toggle[schema-id="+a+"]").addClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s(".saswp-modify-schema[schema-id="+a+"]").parent().addClass("saswp_hide"),s("#saswp_custom_schema_field[schema-id="+a+"]").parent().addClass("saswp_hide")}else{s("#saswp_custom_schema_field[schema-id="+a+"]").parent().removeClass("saswp_hide"),1==i?(s(".saswp-ps-toggle[schema-id="+a+"]").removeClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().removeClass("saswp_hide")):(s(".saswp-modify-schema[schema-id="+a+"]").parent().removeClass("saswp_hide"),s(".saswp-ps-toggle[schema-id="+a+"]").addClass("saswp_hide"),s(".saswp-restore-schema[schema-id="+a+"]").parent().addClass("saswp_hide"));p=1}s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:p,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){},error:function(s){console.log(s)}})}),s(document).on("click",".saswp-reset-data",function(e){e.preventDefault(),1==confirm("Are you sure?")&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){setTimeout(function(){location.reload()},1e3)},error:function(s){console.log(s)}})}),s(document).on("click",".saswp_license_activation",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("license-status"),i=s(this).attr("add-on"),p=s("#"+i+"_addon_license_key").val();t&&i&&p?s.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(e){s("#"+i+"_addon_license_key_status").val(e.status),"active"==e.status?(s(".saswp-"+i+"-dashicons").addClass("dashicons-yes"),s(".saswp-"+i+"-dashicons").removeClass("dashicons-no-alt"),s(".saswp-"+i+"-dashicons").css("color","green"),s(".saswp_license_activation[add-on='"+i+"']").attr("license-status","inactive"),s(".saswp_license_activation[add-on='"+i+"']").text("Deactivate"),s(".saswp_license_status_msg[add-on='"+i+"']").text("Activated"),s(".saswp_license_status_msg[add-on='"+i+"']").css("color","green"),s(".saswp_license_status_msg[add-on='"+i+"']").text(e.message)):(s(".saswp-"+i+"-dashicons").addClass("dashicons-no-alt"),s(".saswp-"+i+"-dashicons").removeClass("dashicons-yes"),s(".saswp-"+i+"-dashicons").css("color","red"),s(".saswp_license_activation[add-on='"+i+"']").attr("license-status","active"),s(".saswp_license_activation[add-on='"+i+"']").text("Activate"),s(".saswp_license_status_msg[add-on='"+i+"']").css("color","red"),s(".saswp_license_status_msg[add-on='"+i+"']").text(e.message)),a.removeClass("updating-message")},error:function(s){console.log(s)}}):(alert("Please enter value license key"),a.removeClass("updating-message"))}),s(".saswp-send-query").on("click",function(e){e.preventDefault();var a=s("#saswp_query_message").val(),t=s("#saswp_query_email").val(),i=s("#saswp_query_premium_cus").val();console.log(saswpIsEmail(t)),""!=s.trim(a)&&i&&""!=s.trim(t)&&1==saswpIsEmail(t)?s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",premium_cus:i,message:a,email:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s(".saswp-query-success").show(),s(".saswp-query-error").hide()):(s(".saswp-query-success").hide(),s(".saswp-query-error").show())},error:function(s){console.log(s)}}):""==s.trim(a)&&""==i&&""==s.trim(t)?alert("Please enter the message, email and select customer type"):(""==i&&alert("Select Customer type"),""==s.trim(a)&&alert("Please enter the message"),""==s.trim(t)&&alert("Please enter the email"),0==saswpIsEmail(t)&&alert("Please enter a valid email"))}),s(".saswp-import-plugins").on("click",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("data-id");s.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?(s(a).parent().find(".saswp-imported-message").text(e.message),s(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(s(a).parent().find(".saswp-imported-message").addClass("saswp-error"),s(a).parent().find(".saswp-imported-message").text(e.message)),a.removeClass("updating-message")},"json")}),s(".saswp-feedback-no-thanks").on("click",function(e){e.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_no_thanks",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status&&s(".saswp-feedback-notice").hide()},"json")}),s(".saswp-feedback-remindme").on("click",function(e){e.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_remindme",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status&&s(".saswp-feedback-notice").hide()},"json")}),s(document).on("change",".saswp-local-business-type-select",function(e){e.preventDefault();var a=s(this),t=s(this).val();s.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if("t"==e.status){s(".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+'">',s.each(e.result,function(s,e){i+='<option value="'+s+'">'+e+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else s(".saswp-local-business-name-select").parents("tr").remove()},"json")}),saswp_item_reviewed_call(),jQuery(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),s(document).on("click",".saswp-add-custom-schema",function(e){e.preventDefault(),s(".saswp-add-custom-schema-field").removeClass("saswp_hide"),s(this).hide()}),s(document).on("click",".saswp-delete-custom-schema",function(e){e.preventDefault(),s("#saswp_custom_schema_field").val(""),s(".saswp-add-custom-schema-field").addClass("saswp_hide"),s(".saswp-add-custom-schema").show()}),saswp_schema_datepicker(),saswp_schema_timepicker(),saswp_reviews_datepicker(),s(document).on("click",".saswp-add-more-item",function(e){e.preventDefault();s(".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>')}),s(document).on("click",".saswp-remove-review-item",function(e){e.preventDefault(),s(this).parent().parent("tr").remove()}),s(document).on("focusout",".saswp-review-item-tr input[type=number]",function(e){e.preventDefault();var a=0,t=s(".saswp-review-item-tr input[type=number]").length;s(".saswp-review-item-tr input[type=number]").each(function(e,t){""==s(t).val()?a+=parseFloat(0):a+=parseFloat(s(t).val())});var i=a/t;s("#saswp-review-item-over-all").val(i)}),s("#saswp-review-location").change(function(){var e=s(this).val();s(".saswp-review-shortcode").addClass("saswp_hide"),3==e&&s(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),s("#saswp-review-item-enable").change(function(){s(this).is(":checked")?s(".saswp-review-fields").show():s(".saswp-review-fields").hide()}).change(),s(document).on("click",".saswp-restore-post-schema",function(e){e.preventDefault();var a=s(this);if(a.addClass("updating-message"),s(".saswp-post-specific-schema-ids").val())var t=JSON.parse(s(".saswp-post-specific-schema-ids").val());s.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(s){"t"==s.status?setTimeout(function(){location.reload()},1e3):(alert(s.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),s(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(e){e.preventDefault();var a=s(this).attr("data-id");s(".saswp-post-specific-wrapper").hide(),s("#"+a).show(),s("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),s("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),s(this).addClass("selected"),s(this).parent().addClass("selected"),saswp_enable_rating_review()}),s("#saswp-global-tabs a:first").addClass("saswp-global-selected"),s(".saswp-global-container").hide(),"#saswp-default-container"==window.location.hash?s(".saswp-global-container:eq(2)").show():s(".saswp-global-container:first").show(),s("#saswp-global-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-global-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-global-container").hide(),s("#"+e).show())}),s("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),s(".saswp-tools-container").hide(),s(".saswp-tools-container:first").show(),s("#saswp-tools-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-tools-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-tools-container").hide(),s("#"+e).show())}),s("#saswp-review-tabs a:first").addClass("saswp-global-selected"),s(".saswp-review-container").hide(),s(".saswp-review-container:first").show(),s("#saswp-review-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-review-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-review-container").hide(),s("#"+e).show())}),s("#saswp-compatibility-tabs a:first").addClass("saswp-global-selected"),s(".saswp-compatibility-container").hide(),s(".saswp-compatibility-container:first").show(),s("#saswp-compatibility-tabs a").click(function(){var e=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-compatibility-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-compatibility-container").hide(),s("#"+e).show())}),s('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),s(".saswp-enable-modify-schema-output").on("change",function(){s(".saswp-static-container").addClass("saswp_hide"),s(".saswp-dynamic-container").addClass("saswp_hide"),"manual"==s(this).val()&&(s(".saswp-static-container").removeClass("saswp_hide"),s(".saswp-dynamic-container").addClass("saswp_hide")),"automatic"==s(this).val()&&(s(".saswp-static-container").addClass("saswp_hide"),s(".saswp-dynamic-container").removeClass("saswp_hide"))}),s(document).on("change",".saswp-custom-fields-name",function(){var e="text",a=s(this).parent().parent("tr"),t=s(this).val();-1==t.indexOf("_image")&&-1==t.indexOf("_logo")||(e="image");var i=s(this).parent().parent("tr").find("td:eq(1)");saswp_get_meta_list(null,e,null,i,t,a)}),s(document).on("click",".saswp-skip-button",function(e){e.preventDefault(),s(this).parent().parent().hide(),s.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){},"json")}),s(document).on("click",".saswp_add_schema_fields_on_fly",function(e){e.preventDefault();var a=s(this);a.addClass("updating-message");var t=s(this).attr("data-id"),i=s(this).attr("fields_type"),p=s(this).attr("div_type"),o=s(this).attr("itemlist_sub_type"),c=s("saswp_specific_"+t+" , .saswp-"+p+"-table-div").length,n=s("saswp_specific_"+t+" , .saswp-"+p+"-table-div:nth-child("+c+")").attr("data-id");(n=++n)||(n=0),saswp_get_post_specific_schema_fields(a,n,i,p,t,i+"_",o)}),s(document).on("click",".saswp-table-close",function(){s(this).parent().remove()}),s(document).on("click",".saswp-rmv-modify_row",function(e){e.preventDefault(),s(this).parent().parent().remove()}),s(document).on("change",".saswp-custom-meta-list",function(){var e=s(this),a=s("select#schema_type option:selected").val(),t=s(this).val(),i=s(this).parent().parent("tr").find(".saswp-custom-fields-name").val(),p="",o=a.toLowerCase()+"_"+i,c="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>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(this).parent().parent("tr").append(p),saswpCustomSelect2()):"taxonomy_term"==t?saswp_taxonomy_term.taxonomy?(p+=saswp_taxonomy_term_html(saswp_taxonomy_term.taxonomy,i),e.parent().parent("tr").find("td:gt(1)").remove(),e.parent().parent("tr").append(p),saswpCustomSelect2()):s.get(ajaxurl,{action:"saswp_get_taxonomy_term_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){s&&(saswp_taxonomy_term.taxonomy=s,p+=saswp_taxonomy_term_html(s,i),e.parent().parent("tr").find("td:gt(1)").remove(),e.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>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(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="'+c+'[height]" id="'+o+'_height" value="">',p+='<input type="hidden" data-id="'+o+'_width" class="upload-width" name="'+c+'[width]" id="'+o+'_width" value="">',p+='<input type="hidden" data-id="'+o+'_thumbnail" class="upload-thumbnail" name="'+c+'[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>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(this).parent().parent("tr").append(p),saswpCustomSelect2()):(p+="<td></td>",p+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',s(this).parent().parent("tr").find("td:gt(1)").remove(),s(this).parent().parent("tr").append(p),saswpCustomSelect2())}),s(document).on("change",".saswp-item-reivewed-list",function(){s(".saswp-custom-fields-table").html(""),saswp_meta_list_fields=[];var e=s(this),a=s("select#schema_type option:selected").val();saswp_item_reviewed_ajax(a,e,"manual")}),s(document).on("click",".saswp-add-custom-fields",function(){var e=s(this);e.addClass("updating-message");var a=s("select#schema_type option:selected").val(),t="",i=null;"Review"==a&&(t=s("select.saswp-item-reivewed-list option:selected").val(),i="saswp_review_name");var p=s("#post_ID").val();""!=a&&(saswp_meta_list_fields[a]?saswp_get_meta_list(e,"text",saswp_meta_list_fields[a],null,i,null):s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:p,schema_type:a,schema_subtype:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){saswp_meta_list_fields[a]=s,saswp_get_meta_list(e,"text",saswp_meta_list_fields[a],null,i,null)},error:function(s){console.log(s)}}))}),saswpCustomSelect2(),saswp_enable_rating_review(),s('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),s(document).on("click",".saswp_coonect_google_place",function(){var e=s("#saswp_google_place_id").val(),a=s("#saswp_language_list").val(),t=s("#saswp_googel_api").val();""!=e&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:e,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){console.log(s.status)},error:function(s){console.log(s)}})}),s(document).on("click",".saswp-add-social-links",function(){s(".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>')}),s(document).on("click",".saswp-show-accept-rv-popup",function(){tb_show("Reviews Form","#TB_inline??width=600&height=400&inlineId=saswp-accept-reviews-popup"),s(document).find("#TB_window").width(600).height(400).css({top:"100px","margin-top":"0px"})}),("saswp_reviews"==saswp_localize_data.post_type||"saswp-collections"==saswp_localize_data.post_type)&&"edit.php"==saswp_localize_data.page_now){var i='<div class="saswp-custom-post-tab">';i+='<div style="display:none;" id="saswp-accept-reviews-popup">',i+='<div class="saswp-accept-rv-container">',i+="<p>Use Below shortcode to show reviews form in your website. Using this you can accept reviews from your website directly</p>",i+='<div class="saswp-show-form-on-tab"><strong>Simple Form</strong> <input value="[saswp-reviews-form]" type="text" readonly></div>',i+='<div class="saswp-show-form-on-tab"><strong>Show form on button tap</strong> <input value="[saswp-reviews-form onbutton="1"]" type="text" readonly></div>',i+="</div>",i+="</div>",i+='<h2 class="nav-tab-wrapper">',i+="<a href="+saswp_localize_data.reviews_page_url+' class="nav-tab '+(saswp_localize_data.current_url==saswp_localize_data.reviews_page_url?"saswp-global-selected":"")+'">Reviews</a>',i+="<a href="+saswp_localize_data.collections_page_url+' class="nav-tab '+(saswp_localize_data.current_url==saswp_localize_data.collections_page_url?"saswp-global-selected":"")+'">Collections</a>',i+='<a class="nav-tab saswp-show-accept-rv-popup">Accept Reviews</a>',i+="</h2>",i+="</div>",jQuery(jQuery(".wrap")).prepend(i)}"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&&s(".saswp-rating-div").rateYo({rating:saswp_reviews_data.rating_val,halfStar:!0,readOnly:saswp_reviews_data.readonly,onSet:function(e,a){s(this).next().val(e)}}),s("#sd-person-phone-number, #saswp_kb_telephone").focusout(function(){var e=s(this);e.parent().find(".saswp-phone-validation").remove();var a=s(this).val();/^\+([0-9]{1,3})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})$/.test(a)?e.parent().find(".saswp-phone-validation").remove():e.after('<span style="color:red;" class="saswp-phone-validation">Invalid Phone Number</span>')}),saswpCollectionSlider(),s(document).on("click",".saswp-grid-page",function(e){e.preventDefault(),saswp_grid_page=s(this).attr("data-id"),saswp_on_collection_design_change()}),s("#saswp-coll-pagination").change(function(){saswp_grid_page=1,s("#saswp-coll-per-page").parent().addClass("saswp_hide_imp"),s(this).is(":checked")&&s("#saswp-coll-per-page").parent().removeClass("saswp_hide_imp"),saswp_on_collection_design_change()}),s(".saswp-accordion").click(function(){s(this).toggleClass("active"),s(this).next(".saswp-accordion-panel").slideToggle(200)}),s(document).on("click",".saswp-opn-cls-btn",function(){s("#saswp-reviews-cntn").toggle(),s("#saswp-reviews-cntn").is(":visible")?(s(".saswp-onclick-show").css("display","flex"),s(".saswp-onclick-hide").hide(),s(".saswp-open-class").css("width","500px")):(s(".saswp-onclick-show").css("display","none"),s(".saswp-onclick-hide").show(),s(".saswp-open-class").css("width","300px"))}),s(".saswp-collection-display-method").change(function(){"shortcode"==s(this).val()?s(".saswp-collection-shortcode").removeClass("saswp_hide"):s(".saswp-collection-shortcode").addClass("saswp_hide")}).change(),s(document).on("click",".saswp-remove-platform",function(e){e.preventDefault();var a=s(this).attr("platform-id");saswp_collection.splice(a,1),s(this).parent().remove(),saswp_on_collection_design_change()}),s(".saswp-number-change").bind("keyup mouseup",function(){saswp_on_collection_design_change()}),s(".saswp-coll-settings-options").change(function(){saswp_grid_page=1;var e=s(".saswp-collection-desing").val();s(".saswp-coll-options").addClass("saswp_hide"),s(".saswp-collection-lp").css("height","auto"),"grid"==e&&s(".saswp-grid-options").removeClass("saswp_hide"),"gallery"==e&&s(".saswp-slider-options").removeClass("saswp_hide"),"fomo"==e&&(s(".saswp-fomo-options").removeClass("saswp_hide"),s(".saswp-collection-lp").css("height","31px")),"popup"==e&&s(".saswp-collection-lp").css("height","31px"),saswp_on_collection_design_change()}).change(),s(".saswp-add-to-collection").on("click",function(e){e.preventDefault();var a=s(this),t=s("#saswp-plaftorm-list").val(),i=s("#saswp-review-count").val();t&&i>0?(a.addClass("updating-message"),saswp_get_collection_data(i,t,a)):alert("Enter Count")});var p,o,c=s("#saswp_collection_id").val();c&&(s(".spinner").addClass("is-active"),s.get(ajaxurl,{action:"saswp_get_collection_platforms",collection_id:c,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){if(e.status){var a=e.message;s.each(a,function(s,e){saswp_get_collection_data(e,s,null)})}s(".spinner").removeClass("is-active")},"json")),(p=document.createElement("div")).style.cssText="position:absolute; background:black; color:white; padding:4px 6px;z-index:10000;border-radius:2px; font-size:12px;box-shadow:3px 3px 3px rgba(0,0,0,.4);opacity:0;transition:opacity 0.3s",p.innerHTML="Copied!",document.body.appendChild(p);var n=document.getElementById("motivatebox");n&&n.addEventListener("mouseup",function(s){var e=(s=s||event).target||s.srcElement;"motivate"==e.className&&(!function(s){var e=document.createRange();e.selectNodeContents(s);var a=window.getSelection();a.removeAllRanges(),a.addRange(e)}(e),function(){var s;try{s=document.execCommand("copy")}catch(e){s=!1}return s}()&&function(s){var e=s||event;clearTimeout(o),p.style.left=e.pageX-10+"px",p.style.top=e.pageY+15+"px",p.style.opacity=1,o=setTimeout(function(){p.style.opacity=0},500)}(s))},!1)});
|
admin_section/settings.php
CHANGED
@@ -68,7 +68,7 @@ function saswp_add_menu_links() {
|
|
68 |
);
|
69 |
|
70 |
if(!saswp_ext_installed_status()){
|
71 |
-
add_submenu_page( 'edit.php?post_type=saswp', esc_html__( 'Schema & Structured Data For Wp', 'schema-and-structured-data-for-wp' ), '<span style="color:#fff176;">'.esc_html__( 'Upgrade To Premium', 'schema-and-structured-data-for-wp' ).'</span>', 'manage_options', 'structured_data_premium', 'saswp_premium_interface_render' );
|
72 |
}
|
73 |
|
74 |
}
|
@@ -1166,7 +1166,19 @@ function saswp_import_callback(){
|
|
1166 |
'id' => 'saswp-other-images',
|
1167 |
'name' => 'sd_data[saswp-other-images]',
|
1168 |
)
|
1169 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1170 |
|
1171 |
);
|
1172 |
|
68 |
);
|
69 |
|
70 |
if(!saswp_ext_installed_status()){
|
71 |
+
add_submenu_page( 'edit.php?post_type=saswp', esc_html__( 'Schema & Structured Data For Wp', 'schema-and-structured-data-for-wp' ), '<span class="saswp-upgrade-to-pro" style="color:#fff176;">'.esc_html__( 'Upgrade To Premium', 'schema-and-structured-data-for-wp' ).'</span>', 'manage_options', 'structured_data_premium', 'saswp_premium_interface_render' );
|
72 |
}
|
73 |
|
74 |
}
|
1166 |
'id' => 'saswp-other-images',
|
1167 |
'name' => 'sd_data[saswp-other-images]',
|
1168 |
)
|
1169 |
+
),
|
1170 |
+
array(
|
1171 |
+
'label' => 'Allow Multiple Size Image Creation',
|
1172 |
+
'id' => 'saswp-multiple-size-image-checkbox',
|
1173 |
+
'name' => 'saswp-multiple-size-image-checkbox',
|
1174 |
+
'type' => 'checkbox',
|
1175 |
+
'class' => 'checkbox saswp-checkbox',
|
1176 |
+
'note' => 'According to Google, For best results, multiple high-resolution images with the following aspect ratios: 16x9, 4x3, and 1x1 should be there',
|
1177 |
+
'hidden' => array(
|
1178 |
+
'id' => 'saswp-multiple-size-image',
|
1179 |
+
'name' => 'sd_data[saswp-multiple-size-image]',
|
1180 |
+
)
|
1181 |
+
)
|
1182 |
|
1183 |
);
|
1184 |
|
core/3rd-party/class-amp-review-form-blacklist.php
CHANGED
@@ -161,7 +161,7 @@ if ( class_exists( 'AMP_Blacklist_Sanitizer' ) ) {
|
|
161 |
|
162 |
$form_class = $element->getAttribute('class');
|
163 |
|
164 |
-
if(strpos($form_class, 'saswp-review-submission-form') !== false){
|
165 |
continue;
|
166 |
}
|
167 |
|
161 |
|
162 |
$form_class = $element->getAttribute('class');
|
163 |
|
164 |
+
if( (strpos($form_class, 'saswp-review-submission-form') !== false) || (strpos($form_class, 'ampforwp-form-allow') !== false) ){
|
165 |
continue;
|
166 |
}
|
167 |
|
core/array-list/schema-properties.php
CHANGED
@@ -14,7 +14,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
14 |
global $post;
|
15 |
global $sd_data;
|
16 |
|
17 |
-
$business_type = $current_user = $author_desc = $author_url = '';
|
18 |
$author_details = array();
|
19 |
|
20 |
if($review_type){
|
@@ -25,8 +25,10 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
25 |
|
26 |
if($manual == null){
|
27 |
|
28 |
-
$
|
29 |
-
|
|
|
|
|
30 |
$current_user = wp_get_current_user();
|
31 |
$author_desc = get_the_author_meta( 'user_description' );
|
32 |
$author_url = get_the_author_meta( 'user_url' );
|
@@ -38,8 +40,8 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
38 |
$business_type = get_post_meta($schema_id, 'saswp_business_type', true);
|
39 |
$business_name = get_post_meta($schema_id, 'saswp_business_name', true);
|
40 |
$saswp_business_type_key = 'saswp_business_type_'.$schema_id;
|
41 |
-
$saved_business_type = get_post_meta( $
|
42 |
-
$saved_saswp_business_name = get_post_meta( $
|
43 |
|
44 |
if($saved_business_type){
|
45 |
$business_type = $saved_business_type;
|
@@ -445,7 +447,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
445 |
'label' => 'Article Body',
|
446 |
'id' => 'saswp_newsarticle_body_'.$schema_id,
|
447 |
'type' => 'textarea',
|
448 |
-
'default' => is_object($post) ? $post->post_content : ''
|
449 |
),
|
450 |
array(
|
451 |
'label' => 'Name',
|
@@ -657,7 +659,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
657 |
'label' => 'Article Body',
|
658 |
'id' => 'saswp_article_body_'.$schema_id,
|
659 |
'type' => 'textarea',
|
660 |
-
'default' =>
|
661 |
),
|
662 |
array(
|
663 |
'label' => 'Keywords',
|
@@ -979,6 +981,21 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
979 |
'id' => 'saswp_course_sameas_'.$schema_id,
|
980 |
'type' => 'text',
|
981 |
'default' => get_home_url()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
982 |
)
|
983 |
);
|
984 |
break;
|
@@ -1298,7 +1315,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
1298 |
|
1299 |
$product_details = array();
|
1300 |
|
1301 |
-
if($manual == null){
|
1302 |
|
1303 |
$service = new saswp_output_service();
|
1304 |
$product_details = $service->saswp_woocommerce_product_details($post_id);
|
@@ -1531,7 +1548,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
1531 |
'type' => 'text',
|
1532 |
);
|
1533 |
$meta_field[] = array(
|
1534 |
-
'label' => 'Review Author
|
1535 |
'id' => 'saswp_review_author_url_'.$schema_id,
|
1536 |
'type' => 'text',
|
1537 |
);
|
@@ -1540,6 +1557,11 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
1540 |
'id' => 'saswp_review_publisher_'.$schema_id,
|
1541 |
'type' => 'text',
|
1542 |
);
|
|
|
|
|
|
|
|
|
|
|
1543 |
$meta_field[] = array(
|
1544 |
'label' => 'Review Published Date',
|
1545 |
'id' => 'saswp_review_date_published_'.$schema_id,
|
@@ -1723,6 +1745,9 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
1723 |
break;
|
1724 |
|
1725 |
case 'VideoObject':
|
|
|
|
|
|
|
1726 |
$meta_field = array(
|
1727 |
array(
|
1728 |
'label' => 'URL',
|
@@ -1786,7 +1811,7 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
1786 |
'label' => 'Embed Url',
|
1787 |
'id' => 'saswp_video_object_embed_url_'.$schema_id,
|
1788 |
'type' => 'text',
|
1789 |
-
'default' => get_permalink()
|
1790 |
),
|
1791 |
array(
|
1792 |
'label' => 'Main Entity Id',
|
@@ -1948,7 +1973,12 @@ function saswp_get_fields_by_schema_type( $schema_id = null, $condition = null,
|
|
1948 |
'label' => 'Author Name',
|
1949 |
'id' => 'saswp_qa_question_author_name_'.$schema_id,
|
1950 |
'type' => 'text',
|
1951 |
-
),
|
|
|
|
|
|
|
|
|
|
|
1952 |
array(
|
1953 |
'label' => 'Accepted Answer Text',
|
1954 |
'id' => 'saswp_qa_accepted_answer_text_'.$schema_id,
|
14 |
global $post;
|
15 |
global $sd_data;
|
16 |
|
17 |
+
$business_type = $current_user = $author_desc = $author_url = $post_id = '';
|
18 |
$author_details = array();
|
19 |
|
20 |
if($review_type){
|
25 |
|
26 |
if($manual == null){
|
27 |
|
28 |
+
if(is_object($post)){
|
29 |
+
$post_id = $post->ID;
|
30 |
+
}
|
31 |
+
|
32 |
$current_user = wp_get_current_user();
|
33 |
$author_desc = get_the_author_meta( 'user_description' );
|
34 |
$author_url = get_the_author_meta( 'user_url' );
|
40 |
$business_type = get_post_meta($schema_id, 'saswp_business_type', true);
|
41 |
$business_name = get_post_meta($schema_id, 'saswp_business_name', true);
|
42 |
$saswp_business_type_key = 'saswp_business_type_'.$schema_id;
|
43 |
+
$saved_business_type = get_post_meta( $post_id, $saswp_business_type_key, true );
|
44 |
+
$saved_saswp_business_name = get_post_meta( $post_id, 'saswp_business_name_'.$schema_id, true );
|
45 |
|
46 |
if($saved_business_type){
|
47 |
$business_type = $saved_business_type;
|
447 |
'label' => 'Article Body',
|
448 |
'id' => 'saswp_newsarticle_body_'.$schema_id,
|
449 |
'type' => 'textarea',
|
450 |
+
'default' => is_object($post) ? wp_strip_all_tags(strip_shortcodes($post->post_content)) : ''
|
451 |
),
|
452 |
array(
|
453 |
'label' => 'Name',
|
659 |
'label' => 'Article Body',
|
660 |
'id' => 'saswp_article_body_'.$schema_id,
|
661 |
'type' => 'textarea',
|
662 |
+
'default' => is_object($post) ? wp_strip_all_tags(strip_shortcodes($post->post_content)) : ''
|
663 |
),
|
664 |
array(
|
665 |
'label' => 'Keywords',
|
981 |
'id' => 'saswp_course_sameas_'.$schema_id,
|
982 |
'type' => 'text',
|
983 |
'default' => get_home_url()
|
984 |
+
),
|
985 |
+
array(
|
986 |
+
'label' => 'Aggregate Rating',
|
987 |
+
'id' => 'saswp_course_enable_rating_'.$schema_id,
|
988 |
+
'type' => 'checkbox',
|
989 |
+
),
|
990 |
+
array(
|
991 |
+
'label' => 'Rating',
|
992 |
+
'id' => 'saswp_course_rating_'.$schema_id,
|
993 |
+
'type' => 'text',
|
994 |
+
),
|
995 |
+
array(
|
996 |
+
'label' => 'Number of Reviews',
|
997 |
+
'id' => 'saswp_course_review_count_'.$schema_id,
|
998 |
+
'type' => 'text',
|
999 |
)
|
1000 |
);
|
1001 |
break;
|
1315 |
|
1316 |
$product_details = array();
|
1317 |
|
1318 |
+
if($manual == null && $post_id){
|
1319 |
|
1320 |
$service = new saswp_output_service();
|
1321 |
$product_details = $service->saswp_woocommerce_product_details($post_id);
|
1548 |
'type' => 'text',
|
1549 |
);
|
1550 |
$meta_field[] = array(
|
1551 |
+
'label' => 'Review Author URL',
|
1552 |
'id' => 'saswp_review_author_url_'.$schema_id,
|
1553 |
'type' => 'text',
|
1554 |
);
|
1557 |
'id' => 'saswp_review_publisher_'.$schema_id,
|
1558 |
'type' => 'text',
|
1559 |
);
|
1560 |
+
$meta_field[] = array(
|
1561 |
+
'label' => 'Review Publisher URL',
|
1562 |
+
'id' => 'saswp_review_publisher_url'.$schema_id,
|
1563 |
+
'type' => 'text',
|
1564 |
+
);
|
1565 |
$meta_field[] = array(
|
1566 |
'label' => 'Review Published Date',
|
1567 |
'id' => 'saswp_review_date_published_'.$schema_id,
|
1745 |
break;
|
1746 |
|
1747 |
case 'VideoObject':
|
1748 |
+
|
1749 |
+
$video_links = saswp_get_video_links();
|
1750 |
+
|
1751 |
$meta_field = array(
|
1752 |
array(
|
1753 |
'label' => 'URL',
|
1811 |
'label' => 'Embed Url',
|
1812 |
'id' => 'saswp_video_object_embed_url_'.$schema_id,
|
1813 |
'type' => 'text',
|
1814 |
+
'default' => isset($video_links[0]) ? $video_links[0] : get_permalink()
|
1815 |
),
|
1816 |
array(
|
1817 |
'label' => 'Main Entity Id',
|
1973 |
'label' => 'Author Name',
|
1974 |
'id' => 'saswp_qa_question_author_name_'.$schema_id,
|
1975 |
'type' => 'text',
|
1976 |
+
),
|
1977 |
+
array(
|
1978 |
+
'label' => 'Answer Count',
|
1979 |
+
'id' => 'saswp_qa_answer_count_'.$schema_id,
|
1980 |
+
'type' => 'text',
|
1981 |
+
),
|
1982 |
array(
|
1983 |
'label' => 'Accepted Answer Text',
|
1984 |
'id' => 'saswp_qa_accepted_answer_text_'.$schema_id,
|
modules/reviews/reviews_service.php
CHANGED
@@ -220,7 +220,8 @@ class saswp_reviews_service {
|
|
220 |
<div class="saswp-r5-rng">
|
221 |
<div class="saswp-str">
|
222 |
<a target="_blank" href="'.esc_url($review['saswp_review_link']).'"><span class="saswp-athr">'.esc_attr($review['saswp_reviewer_name']).'</span></a>
|
223 |
-
'.$starating.'
|
|
|
224 |
</div>
|
225 |
<span class="saswp-g-plus">
|
226 |
<a target="_blank" href="'.esc_attr($review['saswp_review_link']).'"><img src="'.esc_url($review['saswp_review_platform_icon']).'"></a>
|
@@ -330,7 +331,7 @@ class saswp_reviews_service {
|
|
330 |
|
331 |
$rv_limits = get_option('reviews_addon_reviews_limits');
|
332 |
|
333 |
-
$result['message'] = esc_html__('Reviews fetched','schema-and-structured-data-for-wp').' : '. $rv_limits - $result['message']. ', '.esc_html__('Remains Limit','schema-and-structured-data-for-wp').' : '.$result['message'];
|
334 |
|
335 |
update_option('reviews_addon_reviews_limits', intval($result['message']));
|
336 |
}
|
220 |
<div class="saswp-r5-rng">
|
221 |
<div class="saswp-str">
|
222 |
<a target="_blank" href="'.esc_url($review['saswp_review_link']).'"><span class="saswp-athr">'.esc_attr($review['saswp_reviewer_name']).'</span></a>
|
223 |
+
'.$starating.'
|
224 |
+
<div>'.(isset($review['saswp_review_date']) ? esc_attr($review['saswp_review_date']) : '').'</div>
|
225 |
</div>
|
226 |
<span class="saswp-g-plus">
|
227 |
<a target="_blank" href="'.esc_attr($review['saswp_review_link']).'"><img src="'.esc_url($review['saswp_review_platform_icon']).'"></a>
|
331 |
|
332 |
$rv_limits = get_option('reviews_addon_reviews_limits');
|
333 |
|
334 |
+
$result['message'] = esc_html__('Reviews fetched','schema-and-structured-data-for-wp').' : '. ($rv_limits - $result['message'] ). ', '.esc_html__('Remains Limit','schema-and-structured-data-for-wp').' : '.$result['message'];
|
335 |
|
336 |
update_option('reviews_addon_reviews_limits', intval($result['message']));
|
337 |
}
|
output/function.php
CHANGED
@@ -313,7 +313,7 @@ function saswp_get_all_schema_markup_output() {
|
|
313 |
$kb_schema_output['@type'] = $sd_data['saswp_kb_type'];
|
314 |
|
315 |
if($sd_data['saswp_kb_type'] == 'Organization'){
|
316 |
-
$kb_schema_output['@type'] = (isset($sd_data['saswp_organization_type']) && !empty($sd_data['saswp_organization_type'])) ? $sd_data['saswp_organization_type'] : 'Organization';
|
317 |
}
|
318 |
|
319 |
}else{
|
313 |
$kb_schema_output['@type'] = $sd_data['saswp_kb_type'];
|
314 |
|
315 |
if($sd_data['saswp_kb_type'] == 'Organization'){
|
316 |
+
$kb_schema_output['@type'] = (isset($sd_data['saswp_organization_type']) && !empty($sd_data['saswp_organization_type']) && strpos($sd_data['saswp_organization_type'], 'Organization') !== false ) ? $sd_data['saswp_organization_type'] : 'Organization';
|
317 |
}
|
318 |
|
319 |
}else{
|
output/markup.php
CHANGED
@@ -443,6 +443,15 @@ function saswp_course_schema_markup($schema_id, $schema_post_id, $all_post_meta)
|
|
443 |
'sameAs' => saswp_remove_warnings($all_post_meta, 'saswp_course_sameas_'.$schema_id, 'saswp_array')
|
444 |
)
|
445 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
|
447 |
return $input1;
|
448 |
|
@@ -1499,10 +1508,17 @@ function saswp_lorh_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
|
1499 |
$input1['maximumAttendeeCapacity'] = saswp_remove_warnings($all_post_meta, 'saswp_lorh_schema_maximum_a_capacity_'.$schema_id, 'saswp_array');
|
1500 |
|
1501 |
$input1['address']['@type'] = 'PostalAddress';
|
1502 |
-
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, '
|
1503 |
-
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, '
|
1504 |
-
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, '
|
1505 |
-
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1506 |
|
1507 |
return $input1;
|
1508 |
|
@@ -1510,7 +1526,7 @@ function saswp_lorh_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
|
1510 |
|
1511 |
function saswp_tourist_attraction_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
1512 |
|
1513 |
-
$input1 = array();
|
1514 |
|
1515 |
$howto_image = get_post_meta( get_the_ID(), 'saswp_ta_schema_image_'.$schema_id.'_detail',true);
|
1516 |
|
@@ -1533,10 +1549,17 @@ function saswp_tourist_attraction_schema_markup($schema_id, $schema_post_id, $al
|
|
1533 |
$input1['isAccessibleForFree'] = saswp_remove_warnings($all_post_meta, 'saswp_ta_schema_is_acceesible_free_'.$schema_id, 'saswp_array');
|
1534 |
|
1535 |
$input1['address']['@type'] = 'PostalAddress';
|
1536 |
-
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, '
|
1537 |
-
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, '
|
1538 |
-
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, '
|
1539 |
-
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1540 |
|
1541 |
|
1542 |
return $input1;
|
@@ -1567,11 +1590,18 @@ function saswp_tourist_destination_schema_markup($schema_id, $schema_post_id, $a
|
|
1567 |
|
1568 |
|
1569 |
$input1['address']['@type'] = 'PostalAddress';
|
1570 |
-
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, '
|
1571 |
-
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, '
|
1572 |
-
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, '
|
1573 |
-
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, '
|
1574 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1575 |
return $input1;
|
1576 |
}
|
1577 |
|
@@ -1887,7 +1917,7 @@ function saswp_qanda_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
|
1887 |
$input1 = $service_object->saswp_dw_question_answers_details(get_the_ID());
|
1888 |
|
1889 |
}else{
|
1890 |
-
|
1891 |
$input1 = array(
|
1892 |
'@context' => saswp_context_url(),
|
1893 |
'@type' => 'QAPage',
|
@@ -2073,15 +2103,7 @@ function saswp_blogposting_schema_markup($schema_id, $schema_post_id, $all_post_
|
|
2073 |
"/html/head/meta[@name='description']/@content"
|
2074 |
);
|
2075 |
|
2076 |
-
}
|
2077 |
-
if(saswp_remove_warnings($all_post_meta, 'saswp_blogposting_enable_rating_'.$schema_id, 'saswp_array') == 1 && saswp_remove_warnings($all_post_meta, 'saswp_blogposting_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_blogposting_review_count_'.$schema_id, 'saswp_array')){
|
2078 |
-
|
2079 |
-
$input1['aggregateRating'] = array(
|
2080 |
-
"@type" => "AggregateRating",
|
2081 |
-
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_rating_'.$schema_id, 'saswp_array'),
|
2082 |
-
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_review_count_'.$schema_id, 'saswp_array')
|
2083 |
-
);
|
2084 |
-
}
|
2085 |
|
2086 |
return $input1;
|
2087 |
|
@@ -2190,7 +2212,7 @@ function saswp_article_schema_markup($schema_id, $schema_post_id, $all_post_meta
|
|
2190 |
'headline' => saswp_remove_warnings($all_post_meta, 'saswp_article_headline_'.$schema_id, 'saswp_array'),
|
2191 |
'description' => saswp_remove_warnings($all_post_meta, 'saswp_article_description_'.$schema_id, 'saswp_array'),
|
2192 |
'articleSection' => saswp_remove_warnings($all_post_meta, 'saswp_article_section_'.$schema_id, 'saswp_array'),
|
2193 |
-
'articleBody' =>
|
2194 |
'keywords' => saswp_remove_warnings($all_post_meta, 'saswp_article_keywords_'.$schema_id, 'saswp_array'),
|
2195 |
'datePublished' => isset($all_post_meta['saswp_article_date_published_'.$schema_id][0])? saswp_format_date_time($all_post_meta['saswp_article_date_published_'.$schema_id][0], get_post_time('h:i:s')):'',
|
2196 |
'dateModified' => isset($all_post_meta['saswp_article_date_modified_'.$schema_id][0])? saswp_format_date_time($all_post_meta['saswp_article_date_modified_'.$schema_id][0], get_the_modified_time('h:i:s')):'',
|
@@ -2596,6 +2618,11 @@ function saswp_review_schema_markup($schema_id, $schema_post_id, $all_post_meta)
|
|
2596 |
if(isset($all_post_meta['saswp_review_publisher_'.$schema_id][0])){
|
2597 |
$input1['publisher']['@type'] = 'Organization';
|
2598 |
$input1['publisher']['name'] = $all_post_meta['saswp_review_publisher_'.$schema_id][0];
|
|
|
|
|
|
|
|
|
|
|
2599 |
}
|
2600 |
|
2601 |
if(isset($all_post_meta['saswp_review_description_'.$schema_id])){
|
443 |
'sameAs' => saswp_remove_warnings($all_post_meta, 'saswp_course_sameas_'.$schema_id, 'saswp_array')
|
444 |
)
|
445 |
);
|
446 |
+
|
447 |
+
if(isset($all_post_meta['saswp_course_enable_rating_'.$schema_id]) && saswp_remove_warnings($all_post_meta, 'saswp_course_rating_'.$schema_id, 'saswp_array') && saswp_remove_warnings($all_post_meta, 'saswp_course_review_count_'.$schema_id, 'saswp_array')){
|
448 |
+
|
449 |
+
$input1['aggregateRating'] = array(
|
450 |
+
"@type" => "AggregateRating",
|
451 |
+
"ratingValue" => saswp_remove_warnings($all_post_meta, 'saswp_course_rating_'.$schema_id, 'saswp_array'),
|
452 |
+
"reviewCount" => saswp_remove_warnings($all_post_meta, 'saswp_course_review_count_'.$schema_id, 'saswp_array')
|
453 |
+
);
|
454 |
+
}
|
455 |
|
456 |
return $input1;
|
457 |
|
1508 |
$input1['maximumAttendeeCapacity'] = saswp_remove_warnings($all_post_meta, 'saswp_lorh_schema_maximum_a_capacity_'.$schema_id, 'saswp_array');
|
1509 |
|
1510 |
$input1['address']['@type'] = 'PostalAddress';
|
1511 |
+
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_lorh_schema_country_'.$schema_id, 'saswp_array');
|
1512 |
+
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_lorh_schema_locality_'.$schema_id, 'saswp_array');
|
1513 |
+
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_lorh_schema_region_'.$schema_id, 'saswp_array');
|
1514 |
+
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_lorh_schema_postal_code_'.$schema_id, 'saswp_array');
|
1515 |
+
|
1516 |
+
if(isset($all_post_meta['saswp_lorh_schema_latitude_'.$schema_id][0]) && isset($all_post_meta['saswp_lorh_schema_longitude_'.$schema_id][0])){
|
1517 |
+
|
1518 |
+
$input1['geo']['@type'] = 'GeoCoordinates';
|
1519 |
+
$input1['geo']['latitude'] = $all_post_meta['saswp_lorh_schema_latitude_'.$schema_id][0];
|
1520 |
+
$input1['geo']['longitude'] = $all_post_meta['saswp_lorh_schema_longitude_'.$schema_id][0];
|
1521 |
+
}
|
1522 |
|
1523 |
return $input1;
|
1524 |
|
1526 |
|
1527 |
function saswp_tourist_attraction_schema_markup($schema_id, $schema_post_id, $all_post_meta){
|
1528 |
|
1529 |
+
$input1 = array();
|
1530 |
|
1531 |
$howto_image = get_post_meta( get_the_ID(), 'saswp_ta_schema_image_'.$schema_id.'_detail',true);
|
1532 |
|
1549 |
$input1['isAccessibleForFree'] = saswp_remove_warnings($all_post_meta, 'saswp_ta_schema_is_acceesible_free_'.$schema_id, 'saswp_array');
|
1550 |
|
1551 |
$input1['address']['@type'] = 'PostalAddress';
|
1552 |
+
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_ta_schema_country_'.$schema_id, 'saswp_array');
|
1553 |
+
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_ta_schema_locality_'.$schema_id, 'saswp_array');
|
1554 |
+
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_ta_schema_region_'.$schema_id, 'saswp_array');
|
1555 |
+
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_ta_schema_postal_code_'.$schema_id, 'saswp_array');
|
1556 |
+
|
1557 |
+
if(isset($all_post_meta['saswp_ta_schema_latitude_'.$schema_id][0]) && isset($all_post_meta['saswp_ta_schema_longitude_'.$schema_id][0])){
|
1558 |
+
|
1559 |
+
$input1['geo']['@type'] = 'GeoCoordinates';
|
1560 |
+
$input1['geo']['latitude'] = $all_post_meta['saswp_ta_schema_latitude_'.$schema_id][0];
|
1561 |
+
$input1['geo']['longitude'] = $all_post_meta['saswp_ta_schema_longitude_'.$schema_id][0];
|
1562 |
+
}
|
1563 |
|
1564 |
|
1565 |
return $input1;
|
1590 |
|
1591 |
|
1592 |
$input1['address']['@type'] = 'PostalAddress';
|
1593 |
+
$input1['address']['addressCountry'] = saswp_remove_warnings($all_post_meta, 'saswp_td_schema_country_'.$schema_id, 'saswp_array');
|
1594 |
+
$input1['address']['addressLocality'] = saswp_remove_warnings($all_post_meta, 'saswp_td_schema_locality_'.$schema_id, 'saswp_array');
|
1595 |
+
$input1['address']['addressRegion'] = saswp_remove_warnings($all_post_meta, 'saswp_td_schema_region_'.$schema_id, 'saswp_array');
|
1596 |
+
$input1['address']['PostalCode'] = saswp_remove_warnings($all_post_meta, 'saswp_td_schema_postal_code_'.$schema_id, 'saswp_array');
|
1597 |
+
|
1598 |
+
if(isset($all_post_meta['saswp_td_schema_latitude_'.$schema_id][0]) && isset($all_post_meta['saswp_td_schema_longitude_'.$schema_id][0])){
|
1599 |
+
|
1600 |
+
$input1['geo']['@type'] = 'GeoCoordinates';
|
1601 |
+
$input1['geo']['latitude'] = $all_post_meta['saswp_td_schema_latitude_'.$schema_id][0];
|
1602 |
+
$input1['geo']['longitude'] = $all_post_meta['saswp_td_schema_longitude_'.$schema_id][0];
|
1603 |
+
}
|
1604 |
+
|
1605 |
return $input1;
|
1606 |
}
|
1607 |
|
1917 |
$input1 = $service_object->saswp_dw_question_answers_details(get_the_ID());
|
1918 |
|
1919 |
}else{
|
1920 |
+
|
1921 |
$input1 = array(
|
1922 |
'@context' => saswp_context_url(),
|
1923 |
'@type' => 'QAPage',
|
2103 |
"/html/head/meta[@name='description']/@content"
|
2104 |
);
|
2105 |
|
2106 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2107 |
|
2108 |
return $input1;
|
2109 |
|
2212 |
'headline' => saswp_remove_warnings($all_post_meta, 'saswp_article_headline_'.$schema_id, 'saswp_array'),
|
2213 |
'description' => saswp_remove_warnings($all_post_meta, 'saswp_article_description_'.$schema_id, 'saswp_array'),
|
2214 |
'articleSection' => saswp_remove_warnings($all_post_meta, 'saswp_article_section_'.$schema_id, 'saswp_array'),
|
2215 |
+
'articleBody' => isset($all_post_meta['saswp_article_body_'.$schema_id][0]) ? wp_strip_all_tags(strip_shortcodes($all_post_meta['saswp_article_body_'.$schema_id][0])) : '',
|
2216 |
'keywords' => saswp_remove_warnings($all_post_meta, 'saswp_article_keywords_'.$schema_id, 'saswp_array'),
|
2217 |
'datePublished' => isset($all_post_meta['saswp_article_date_published_'.$schema_id][0])? saswp_format_date_time($all_post_meta['saswp_article_date_published_'.$schema_id][0], get_post_time('h:i:s')):'',
|
2218 |
'dateModified' => isset($all_post_meta['saswp_article_date_modified_'.$schema_id][0])? saswp_format_date_time($all_post_meta['saswp_article_date_modified_'.$schema_id][0], get_the_modified_time('h:i:s')):'',
|
2618 |
if(isset($all_post_meta['saswp_review_publisher_'.$schema_id][0])){
|
2619 |
$input1['publisher']['@type'] = 'Organization';
|
2620 |
$input1['publisher']['name'] = $all_post_meta['saswp_review_publisher_'.$schema_id][0];
|
2621 |
+
if(isset($all_post_meta['saswp_review_publisher_url'.$schema_id][0])){
|
2622 |
+
|
2623 |
+
$input1['publisher']['sameAs'] = $all_post_meta['saswp_review_publisher_url'.$schema_id][0];
|
2624 |
+
|
2625 |
+
}
|
2626 |
}
|
2627 |
|
2628 |
if(isset($all_post_meta['saswp_review_description_'.$schema_id])){
|
output/output.php
CHANGED
@@ -144,18 +144,30 @@ function saswp_kb_schema_output() {
|
|
144 |
*/
|
145 |
function saswp_schema_output() {
|
146 |
|
147 |
-
|
148 |
|
149 |
-
|
150 |
|
151 |
-
|
152 |
-
|
153 |
-
|
|
|
|
|
|
|
|
|
154 |
|
155 |
-
$
|
156 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
|
158 |
-
$service_object = new saswp_output_service();
|
159 |
|
160 |
foreach($Conditionals as $schemaConditionals){
|
161 |
|
@@ -171,12 +183,8 @@ function saswp_schema_output() {
|
|
171 |
$input1 = array();
|
172 |
$logo = '';
|
173 |
$height = '';
|
174 |
-
$width = '';
|
175 |
-
|
176 |
-
|
177 |
-
$default_logo = $service_object->saswp_get_publisher(true);
|
178 |
-
$publisher = $service_object->saswp_get_publisher();
|
179 |
-
|
180 |
if(!empty($default_logo)){
|
181 |
|
182 |
$logo = $default_logo['url'];
|
@@ -187,20 +195,10 @@ function saswp_schema_output() {
|
|
187 |
|
188 |
if(isset($sd_data['sd_name']) && $sd_data['sd_name'] !=''){
|
189 |
$site_name = $sd_data['sd_name'];
|
190 |
-
}
|
191 |
-
|
192 |
-
$image_id = get_post_thumbnail_id();
|
193 |
-
$date = get_the_date("c");
|
194 |
-
$modified_date = get_the_modified_date("c");
|
195 |
-
|
196 |
-
$extra_theme_review = $service_object->saswp_extra_theme_review_details(get_the_ID());
|
197 |
-
$aggregateRating = $service_object->saswp_rating_box_rating_markup(get_the_ID());
|
198 |
-
$modify_option = get_option('modify_schema_post_enable_'.get_the_ID());
|
199 |
$modified_schema = get_post_meta(get_the_ID(), 'saswp_modify_this_schema_'.$schema_post_id, true);
|
200 |
-
|
201 |
-
$schema_enable = get_post_meta(get_the_ID(), 'saswp_enable_disable_schema', true);
|
202 |
-
$all_post_meta = get_post_meta(get_the_ID(), $key='', true);
|
203 |
-
|
204 |
if($modify_option == 'enable' && (isset($schema_enable[$schema_post_id]) && $schema_enable[$schema_post_id] == 1)){
|
205 |
|
206 |
$modified_schema = 1;
|
@@ -467,7 +465,7 @@ function saswp_schema_output() {
|
|
467 |
$input1['@type'] = 'Book';
|
468 |
$input1['@id'] = trailingslashit(get_permalink()).'#Book';
|
469 |
|
470 |
-
|
471 |
|
472 |
if($woo_markp){
|
473 |
$input1 = array_merge($input1, $woo_markp);
|
@@ -477,7 +475,7 @@ function saswp_schema_output() {
|
|
477 |
|
478 |
$input1 = saswp_append_fetched_reviews($input1, $schema_post_id);
|
479 |
|
480 |
-
$input1 = apply_filters('
|
481 |
|
482 |
$input1 = saswp_get_modified_markup($input1, $schema_type, $schema_post_id, $schema_options);
|
483 |
|
@@ -685,7 +683,8 @@ function saswp_schema_output() {
|
|
685 |
}
|
686 |
if(!empty($extra_theme_review)){
|
687 |
$input1 = array_merge($input1, $extra_theme_review);
|
688 |
-
}
|
|
|
689 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
690 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
691 |
}
|
@@ -706,12 +705,18 @@ function saswp_schema_output() {
|
|
706 |
|
707 |
if(isset($sd_data['saswp-bbpress']) && $sd_data['saswp-bbpress'] == 1 && is_plugin_active('bbpress/bbpress.php')){
|
708 |
|
|
|
|
|
|
|
|
|
|
|
|
|
709 |
$input1 = array(
|
710 |
'@context' => saswp_context_url(),
|
711 |
'@type' => 'DiscussionForumPosting' ,
|
712 |
'@id' => bbp_get_topic_permalink().'#discussionforumposting',
|
713 |
'mainEntityOfPage' => bbp_get_topic_permalink(),
|
714 |
-
'headline' =>
|
715 |
'description' => saswp_get_the_excerpt(),
|
716 |
"articleSection" => bbp_get_forum_title(),
|
717 |
"articleBody" => saswp_get_the_content(),
|
@@ -798,14 +803,7 @@ function saswp_schema_output() {
|
|
798 |
|
799 |
$input1 = array_merge($input1, $publisher);
|
800 |
|
801 |
-
}
|
802 |
-
|
803 |
-
if(!empty($aggregateRating)){
|
804 |
-
$input1['aggregateRating'] = $aggregateRating;
|
805 |
-
}
|
806 |
-
if(!empty($extra_theme_review)){
|
807 |
-
$input1 = array_merge($input1, $extra_theme_review);
|
808 |
-
}
|
809 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] == 1){
|
810 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
811 |
}
|
@@ -1073,6 +1071,15 @@ function saswp_schema_output() {
|
|
1073 |
break;
|
1074 |
|
1075 |
case 'qanda':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1076 |
|
1077 |
if(isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1){
|
1078 |
|
@@ -1439,7 +1446,8 @@ function saswp_schema_output() {
|
|
1439 |
'@context' => saswp_context_url(),
|
1440 |
'@type' => esc_attr($local_business),
|
1441 |
'@id' => trailingslashit(saswp_get_permalink()).'#'. strtolower(esc_attr($local_business)),
|
1442 |
-
'url' => trailingslashit(saswp_get_permalink()),
|
|
|
1443 |
);
|
1444 |
|
1445 |
if(!empty($aggregateRating)){
|
@@ -1594,16 +1602,33 @@ function saswp_schema_output() {
|
|
1594 |
|
1595 |
//Check for Featured Image
|
1596 |
|
1597 |
-
|
|
|
|
|
1598 |
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1606 |
}
|
|
|
1607 |
|
1608 |
if(isset($schema_options['notAccessibleForFree']) && $schema_options['notAccessibleForFree'] == 1){
|
1609 |
|
144 |
*/
|
145 |
function saswp_schema_output() {
|
146 |
|
147 |
+
global $sd_data;
|
148 |
|
149 |
+
$Conditionals = saswp_get_all_schema_posts();
|
150 |
|
151 |
+
if(!$Conditionals){
|
152 |
+
return ;
|
153 |
+
}
|
154 |
+
$service_object = new saswp_output_service();
|
155 |
+
|
156 |
+
$all_schema_output = array();
|
157 |
+
$recipe_json = array();
|
158 |
|
159 |
+
$site_name = get_bloginfo();
|
160 |
+
$image_id = get_post_thumbnail_id();
|
161 |
+
$date = get_the_date("c");
|
162 |
+
$modified_date = get_the_modified_date("c");
|
163 |
+
$modify_option = get_option('modify_schema_post_enable_'.get_the_ID());
|
164 |
+
$schema_enable = get_post_meta(get_the_ID(), 'saswp_enable_disable_schema', true);
|
165 |
+
$all_post_meta = get_post_meta(get_the_ID(), $key='', true);
|
166 |
+
$default_logo = $service_object->saswp_get_publisher(true);
|
167 |
+
$publisher = $service_object->saswp_get_publisher();
|
168 |
+
$extra_theme_review = $service_object->saswp_extra_theme_review_details(get_the_ID());
|
169 |
+
$aggregateRating = $service_object->saswp_rating_box_rating_markup(get_the_ID());
|
170 |
|
|
|
171 |
|
172 |
foreach($Conditionals as $schemaConditionals){
|
173 |
|
183 |
$input1 = array();
|
184 |
$logo = '';
|
185 |
$height = '';
|
186 |
+
$width = '';
|
187 |
+
|
|
|
|
|
|
|
|
|
188 |
if(!empty($default_logo)){
|
189 |
|
190 |
$logo = $default_logo['url'];
|
195 |
|
196 |
if(isset($sd_data['sd_name']) && $sd_data['sd_name'] !=''){
|
197 |
$site_name = $sd_data['sd_name'];
|
198 |
+
}
|
199 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
$modified_schema = get_post_meta(get_the_ID(), 'saswp_modify_this_schema_'.$schema_post_id, true);
|
201 |
+
|
|
|
|
|
|
|
202 |
if($modify_option == 'enable' && (isset($schema_enable[$schema_post_id]) && $schema_enable[$schema_post_id] == 1)){
|
203 |
|
204 |
$modified_schema = 1;
|
465 |
$input1['@type'] = 'Book';
|
466 |
$input1['@id'] = trailingslashit(get_permalink()).'#Book';
|
467 |
|
468 |
+
$woo_markp = $service_object->saswp_schema_markup_generator($schema_type);
|
469 |
|
470 |
if($woo_markp){
|
471 |
$input1 = array_merge($input1, $woo_markp);
|
475 |
|
476 |
$input1 = saswp_append_fetched_reviews($input1, $schema_post_id);
|
477 |
|
478 |
+
$input1 = apply_filters('saswp_modify_book_schema_output', $input1 );
|
479 |
|
480 |
$input1 = saswp_get_modified_markup($input1, $schema_type, $schema_post_id, $schema_options);
|
481 |
|
683 |
}
|
684 |
if(!empty($extra_theme_review)){
|
685 |
$input1 = array_merge($input1, $extra_theme_review);
|
686 |
+
}
|
687 |
+
$input1 = saswp_append_fetched_reviews($input1);
|
688 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
|
689 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
690 |
}
|
705 |
|
706 |
if(isset($sd_data['saswp-bbpress']) && $sd_data['saswp-bbpress'] == 1 && is_plugin_active('bbpress/bbpress.php')){
|
707 |
|
708 |
+
$headline = bbp_get_topic_title(get_the_ID());
|
709 |
+
|
710 |
+
if (strlen($headline) > 110){
|
711 |
+
$headline = substr($headline, 0, 106) . ' ...';
|
712 |
+
}
|
713 |
+
|
714 |
$input1 = array(
|
715 |
'@context' => saswp_context_url(),
|
716 |
'@type' => 'DiscussionForumPosting' ,
|
717 |
'@id' => bbp_get_topic_permalink().'#discussionforumposting',
|
718 |
'mainEntityOfPage' => bbp_get_topic_permalink(),
|
719 |
+
'headline' => $headline,
|
720 |
'description' => saswp_get_the_excerpt(),
|
721 |
"articleSection" => bbp_get_forum_title(),
|
722 |
"articleBody" => saswp_get_the_content(),
|
803 |
|
804 |
$input1 = array_merge($input1, $publisher);
|
805 |
|
806 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
807 |
if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] == 1){
|
808 |
$input1['comment'] = saswp_get_comments(get_the_ID());
|
809 |
}
|
1071 |
break;
|
1072 |
|
1073 |
case 'qanda':
|
1074 |
+
|
1075 |
+
$input1 = array(
|
1076 |
+
'@context' => saswp_context_url(),
|
1077 |
+
'@type' => 'QAPage' ,
|
1078 |
+
'@id' => trailingslashit(saswp_get_permalink()).'#QAPage',
|
1079 |
+
'mainEntity' => array(
|
1080 |
+
'@type' => 'Question'
|
1081 |
+
) ,
|
1082 |
+
);
|
1083 |
|
1084 |
if(isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1){
|
1085 |
|
1446 |
'@context' => saswp_context_url(),
|
1447 |
'@type' => esc_attr($local_business),
|
1448 |
'@id' => trailingslashit(saswp_get_permalink()).'#'. strtolower(esc_attr($local_business)),
|
1449 |
+
'url' => trailingslashit(saswp_get_permalink()),
|
1450 |
+
'name' => get_bloginfo( 'name' )
|
1451 |
);
|
1452 |
|
1453 |
if(!empty($aggregateRating)){
|
1602 |
|
1603 |
//Check for Featured Image
|
1604 |
|
1605 |
+
if($schema_type == 'WebPage'){
|
1606 |
+
|
1607 |
+
if( !empty($input1) && !isset($input1['mainEntity']['image'])){
|
1608 |
|
1609 |
+
$input2 = $service_object->saswp_get_fetaure_image();
|
1610 |
+
|
1611 |
+
if(!empty($input2)){
|
1612 |
+
|
1613 |
+
$input1['mainEntity'] = array_merge($input1['mainEntity'],$input2);
|
1614 |
+
|
1615 |
+
}
|
1616 |
+
}
|
1617 |
+
|
1618 |
+
}else{
|
1619 |
+
|
1620 |
+
if( !empty($input1) && !isset($input1['image'])){
|
1621 |
+
|
1622 |
+
$input2 = $service_object->saswp_get_fetaure_image();
|
1623 |
+
|
1624 |
+
if(!empty($input2)){
|
1625 |
+
|
1626 |
+
$input1 = array_merge($input1,$input2);
|
1627 |
+
|
1628 |
+
}
|
1629 |
+
}
|
1630 |
}
|
1631 |
+
|
1632 |
|
1633 |
if(isset($schema_options['notAccessibleForFree']) && $schema_options['notAccessibleForFree'] == 1){
|
1634 |
|
output/service.php
CHANGED
@@ -392,6 +392,9 @@ Class saswp_output_service{
|
|
392 |
if(isset($custom_fields['saswp_review_publisher'])){
|
393 |
$review_markup['publisher']['@type'] = 'Organization';
|
394 |
$review_markup['publisher']['name'] = $custom_fields['saswp_review_publisher'];
|
|
|
|
|
|
|
395 |
}
|
396 |
if(isset($custom_fields['saswp_review_author'])){
|
397 |
$review_markup['author']['@type'] = 'Person';
|
@@ -1506,14 +1509,19 @@ Class saswp_output_service{
|
|
1506 |
if(isset($custom_fields['saswp_qa_upvote_count'])){
|
1507 |
$input1['mainEntity']['upvoteCount'] = $custom_fields['saswp_qa_upvote_count'];
|
1508 |
}
|
|
|
|
|
|
|
1509 |
|
1510 |
if(isset($custom_fields['saswp_qa_date_created'])){
|
1511 |
$input1['mainEntity']['dateCreated'] = $custom_fields['saswp_qa_date_created'];
|
1512 |
}
|
1513 |
if(isset($custom_fields['saswp_qa_question_author_name'])){
|
|
|
1514 |
$input1['mainEntity']['author']['name'] = $custom_fields['saswp_qa_question_author_name'];
|
1515 |
}
|
1516 |
if(isset($custom_fields['saswp_qa_accepted_answer_text'])){
|
|
|
1517 |
$input1['mainEntity']['acceptedAnswer']['text'] = $custom_fields['saswp_qa_accepted_answer_text'];
|
1518 |
}
|
1519 |
|
@@ -1531,6 +1539,7 @@ Class saswp_output_service{
|
|
1531 |
$input1['mainEntity']['acceptedAnswer']['author']['name'] = $custom_fields['saswp_qa_accepted_author_name'];
|
1532 |
}
|
1533 |
if(isset($custom_fields['saswp_qa_suggested_answer_text'])){
|
|
|
1534 |
$input1['mainEntity']['suggestedAnswer']['text'] = $custom_fields['saswp_qa_suggested_answer_text'];
|
1535 |
}
|
1536 |
if(isset($custom_fields['saswp_qa_suggested_answer_date_created'])){
|
@@ -2810,8 +2819,7 @@ Class saswp_output_service{
|
|
2810 |
*/
|
2811 |
public function saswp_schema_markup_generator($schema_type){
|
2812 |
|
2813 |
-
global $post;
|
2814 |
-
global $sd_data;
|
2815 |
|
2816 |
$logo = '';
|
2817 |
$height = '';
|
@@ -2838,12 +2846,9 @@ Class saswp_output_service{
|
|
2838 |
|
2839 |
}
|
2840 |
|
2841 |
-
$input1 = array();
|
2842 |
-
|
2843 |
-
$
|
2844 |
-
$image_details = wp_get_attachment_image_src($image_id, 'full');
|
2845 |
-
$date = get_the_date("c");
|
2846 |
-
$modified_date = get_the_modified_date("c");
|
2847 |
|
2848 |
switch ($schema_type) {
|
2849 |
|
@@ -2910,11 +2915,7 @@ Class saswp_output_service{
|
|
2910 |
|
2911 |
case 'WebPage':
|
2912 |
|
2913 |
-
|
2914 |
-
$image_details[0] = $logo;
|
2915 |
-
}
|
2916 |
-
|
2917 |
-
$input1 = array(
|
2918 |
'@context' => saswp_context_url(),
|
2919 |
'@type' => 'WebPage' ,
|
2920 |
'@id' => trailingslashit(saswp_get_permalink()).'#webpage',
|
@@ -2924,8 +2925,7 @@ Class saswp_output_service{
|
|
2924 |
'description' => saswp_get_the_excerpt(),
|
2925 |
'mainEntity' => array(
|
2926 |
'@type' => 'Article',
|
2927 |
-
'mainEntityOfPage' => saswp_get_permalink(),
|
2928 |
-
'image' => esc_url($image_details[0]),
|
2929 |
'headline' => saswp_get_the_title(),
|
2930 |
'description' => saswp_get_the_excerpt(),
|
2931 |
'articleBody' => saswp_get_the_content(),
|
@@ -3052,17 +3052,7 @@ Class saswp_output_service{
|
|
3052 |
|
3053 |
default:
|
3054 |
break;
|
3055 |
-
}
|
3056 |
-
|
3057 |
-
if( !empty($input1) && !isset($input1['image'])){
|
3058 |
-
|
3059 |
-
$input2 = $this->saswp_get_fetaure_image();
|
3060 |
-
if(!empty($input2)){
|
3061 |
-
|
3062 |
-
$input1 = array_merge($input1,$input2);
|
3063 |
-
}
|
3064 |
-
}
|
3065 |
-
|
3066 |
return $input1;
|
3067 |
|
3068 |
}
|
@@ -3075,15 +3065,23 @@ Class saswp_output_service{
|
|
3075 |
*/
|
3076 |
public function saswp_get_fetaure_image(){
|
3077 |
|
3078 |
-
global $sd_data;
|
3079 |
-
|
3080 |
-
$input2 = array();
|
3081 |
-
$
|
3082 |
-
|
3083 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3084 |
if( is_array($image_details) && !empty($image_details)){
|
3085 |
|
3086 |
-
if(isset($image_details[1]) && ($image_details[1] < 1200) && function_exists('saswp_aq_resize')){
|
3087 |
|
3088 |
$targetHeight = 1200;
|
3089 |
|
@@ -3091,11 +3089,16 @@ Class saswp_output_service{
|
|
3091 |
$img_ratio = $image_details[1] / $image_details[2];
|
3092 |
$targetHeight = 1200 / $img_ratio;
|
3093 |
}
|
3094 |
-
|
3095 |
-
$width = array(1200, 1200, 1200);
|
3096 |
-
$height = array($targetHeight, 900, 675);
|
3097 |
|
3098 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3099 |
|
3100 |
$resize_image = saswp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
3101 |
|
@@ -3121,11 +3124,16 @@ Class saswp_output_service{
|
|
3121 |
}
|
3122 |
|
3123 |
}else{
|
3124 |
-
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
|
|
|
|
|
|
|
|
|
|
3129 |
|
3130 |
$resize_image = saswp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
3131 |
|
@@ -3266,39 +3274,37 @@ Class saswp_output_service{
|
|
3266 |
* @return type array
|
3267 |
*/
|
3268 |
public function saswp_get_publisher($d_logo = null){
|
3269 |
-
|
3270 |
-
global $sd_data;
|
3271 |
|
3272 |
$publisher = array();
|
3273 |
$default_logo = array();
|
3274 |
$custom_logo = array();
|
3275 |
|
3276 |
$logo = isset($sd_data['sd_logo']['url']) ? $sd_data['sd_logo']['url']:'';
|
3277 |
-
|
3278 |
-
|
3279 |
$site_name = isset($sd_data['sd_name']) && $sd_data['sd_name'] !='' ? $sd_data['sd_name']:get_bloginfo();
|
3280 |
|
3281 |
if($logo =='' && $height =='' && $width ==''){
|
3282 |
-
|
3283 |
-
|
3284 |
-
'width' => 600,
|
3285 |
-
'height' => 60,
|
3286 |
-
'crop' => false,
|
3287 |
-
);
|
3288 |
-
|
3289 |
-
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
3290 |
-
|
3291 |
-
if($custom_logo_id){
|
3292 |
|
3293 |
-
$
|
|
|
|
|
|
|
|
|
3294 |
|
3295 |
-
|
3296 |
-
|
|
|
|
|
3297 |
if(isset($custom_logo) && is_array($custom_logo)){
|
3298 |
|
3299 |
-
$logo = array_key_exists(0, $custom_logo)? $custom_logo[0]:'';
|
3300 |
-
$
|
3301 |
-
$
|
3302 |
|
3303 |
}
|
3304 |
|
392 |
if(isset($custom_fields['saswp_review_publisher'])){
|
393 |
$review_markup['publisher']['@type'] = 'Organization';
|
394 |
$review_markup['publisher']['name'] = $custom_fields['saswp_review_publisher'];
|
395 |
+
if(isset($custom_fields['saswp_review_publisher_url'])){
|
396 |
+
$review_markup['publisher']['sameAs'] = array($custom_fields['saswp_review_publisher_url']);
|
397 |
+
}
|
398 |
}
|
399 |
if(isset($custom_fields['saswp_review_author'])){
|
400 |
$review_markup['author']['@type'] = 'Person';
|
1509 |
if(isset($custom_fields['saswp_qa_upvote_count'])){
|
1510 |
$input1['mainEntity']['upvoteCount'] = $custom_fields['saswp_qa_upvote_count'];
|
1511 |
}
|
1512 |
+
if(isset($custom_fields['saswp_qa_answer_count'])){
|
1513 |
+
$input1['mainEntity']['answerCount'] = $custom_fields['saswp_qa_answer_count'];
|
1514 |
+
}
|
1515 |
|
1516 |
if(isset($custom_fields['saswp_qa_date_created'])){
|
1517 |
$input1['mainEntity']['dateCreated'] = $custom_fields['saswp_qa_date_created'];
|
1518 |
}
|
1519 |
if(isset($custom_fields['saswp_qa_question_author_name'])){
|
1520 |
+
$input1['mainEntity']['author']['@type'] = 'Person';
|
1521 |
$input1['mainEntity']['author']['name'] = $custom_fields['saswp_qa_question_author_name'];
|
1522 |
}
|
1523 |
if(isset($custom_fields['saswp_qa_accepted_answer_text'])){
|
1524 |
+
$input1['mainEntity']['acceptedAnswer']['@type'] = 'Answer';
|
1525 |
$input1['mainEntity']['acceptedAnswer']['text'] = $custom_fields['saswp_qa_accepted_answer_text'];
|
1526 |
}
|
1527 |
|
1539 |
$input1['mainEntity']['acceptedAnswer']['author']['name'] = $custom_fields['saswp_qa_accepted_author_name'];
|
1540 |
}
|
1541 |
if(isset($custom_fields['saswp_qa_suggested_answer_text'])){
|
1542 |
+
$input1['mainEntity']['suggestedAnswer']['@type'] = 'Answer';
|
1543 |
$input1['mainEntity']['suggestedAnswer']['text'] = $custom_fields['saswp_qa_suggested_answer_text'];
|
1544 |
}
|
1545 |
if(isset($custom_fields['saswp_qa_suggested_answer_date_created'])){
|
2819 |
*/
|
2820 |
public function saswp_schema_markup_generator($schema_type){
|
2821 |
|
2822 |
+
global $post, $sd_data;
|
|
|
2823 |
|
2824 |
$logo = '';
|
2825 |
$height = '';
|
2846 |
|
2847 |
}
|
2848 |
|
2849 |
+
$input1 = array();
|
2850 |
+
$date = get_the_date("c");
|
2851 |
+
$modified_date = get_the_modified_date("c");
|
|
|
|
|
|
|
2852 |
|
2853 |
switch ($schema_type) {
|
2854 |
|
2915 |
|
2916 |
case 'WebPage':
|
2917 |
|
2918 |
+
$input1 = array(
|
|
|
|
|
|
|
|
|
2919 |
'@context' => saswp_context_url(),
|
2920 |
'@type' => 'WebPage' ,
|
2921 |
'@id' => trailingslashit(saswp_get_permalink()).'#webpage',
|
2925 |
'description' => saswp_get_the_excerpt(),
|
2926 |
'mainEntity' => array(
|
2927 |
'@type' => 'Article',
|
2928 |
+
'mainEntityOfPage' => saswp_get_permalink(),
|
|
|
2929 |
'headline' => saswp_get_the_title(),
|
2930 |
'description' => saswp_get_the_excerpt(),
|
2931 |
'articleBody' => saswp_get_the_content(),
|
3052 |
|
3053 |
default:
|
3054 |
break;
|
3055 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3056 |
return $input1;
|
3057 |
|
3058 |
}
|
3065 |
*/
|
3066 |
public function saswp_get_fetaure_image(){
|
3067 |
|
3068 |
+
global $post, $sd_data, $saswp_featured_image;
|
3069 |
+
|
3070 |
+
$input2 = array();
|
3071 |
+
$multiple_size = false;
|
3072 |
+
|
3073 |
+
if( (isset($sd_data['saswp-multiple-size-image']) && $sd_data['saswp-multiple-size-image'] == 1) || !isset($sd_data['saswp-multiple-size-image'])){
|
3074 |
+
$multiple_size = true;
|
3075 |
+
}
|
3076 |
+
|
3077 |
+
if(!$saswp_featured_image){
|
3078 |
+
$image_id = get_post_thumbnail_id();
|
3079 |
+
$saswp_featured_image = wp_get_attachment_image_src($image_id, 'full');
|
3080 |
+
}
|
3081 |
+
$image_details = $saswp_featured_image;
|
3082 |
if( is_array($image_details) && !empty($image_details)){
|
3083 |
|
3084 |
+
if( ( (isset($image_details[1]) && ($image_details[1] < 1200)) || (isset($image_details[2]) && ($image_details[2] < 675)) ) && function_exists('saswp_aq_resize')){
|
3085 |
|
3086 |
$targetHeight = 1200;
|
3087 |
|
3089 |
$img_ratio = $image_details[1] / $image_details[2];
|
3090 |
$targetHeight = 1200 / $img_ratio;
|
3091 |
}
|
|
|
|
|
|
|
3092 |
|
3093 |
+
if($multiple_size){
|
3094 |
+
$width = array(1200, 1200, 1200);
|
3095 |
+
$height = array($targetHeight, 900, 675);
|
3096 |
+
}else{
|
3097 |
+
$width = array(1200);
|
3098 |
+
$height = array($targetHeight);
|
3099 |
+
}
|
3100 |
+
|
3101 |
+
for($i = 0; $i < count($width); $i++){
|
3102 |
|
3103 |
$resize_image = saswp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
3104 |
|
3124 |
}
|
3125 |
|
3126 |
}else{
|
3127 |
+
|
3128 |
+
if($multiple_size){
|
3129 |
+
$width = array($image_details[1], 1200, 1200);
|
3130 |
+
$height = array($image_details[2], 900, 675);
|
3131 |
+
}else{
|
3132 |
+
$width = array($image_details[1]);
|
3133 |
+
$height = array($image_details[2]);
|
3134 |
+
}
|
3135 |
+
|
3136 |
+
for($i = 0; $i < count($width); $i++){
|
3137 |
|
3138 |
$resize_image = saswp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
3139 |
|
3274 |
* @return type array
|
3275 |
*/
|
3276 |
public function saswp_get_publisher($d_logo = null){
|
3277 |
+
|
3278 |
+
global $sd_data, $saswp_custom_logo;
|
3279 |
|
3280 |
$publisher = array();
|
3281 |
$default_logo = array();
|
3282 |
$custom_logo = array();
|
3283 |
|
3284 |
$logo = isset($sd_data['sd_logo']['url']) ? $sd_data['sd_logo']['url']:'';
|
3285 |
+
$height = isset($sd_data['sd_logo']['height']) ? $sd_data['sd_logo']['height']:'';
|
3286 |
+
$width = isset($sd_data['sd_logo']['width']) ? $sd_data['sd_logo']['width']:'';
|
3287 |
$site_name = isset($sd_data['sd_name']) && $sd_data['sd_name'] !='' ? $sd_data['sd_name']:get_bloginfo();
|
3288 |
|
3289 |
if($logo =='' && $height =='' && $width ==''){
|
3290 |
+
|
3291 |
+
if(!$saswp_custom_logo){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3292 |
|
3293 |
+
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
3294 |
+
$img_details = wp_get_attachment_image_src( $custom_logo_id, 'full');
|
3295 |
+
if($img_details[0]){
|
3296 |
+
$img_details = @saswp_aq_resize( $img_details[0], 600, 60, true, false, true );
|
3297 |
+
}
|
3298 |
|
3299 |
+
$saswp_custom_logo = $img_details;
|
3300 |
+
}
|
3301 |
+
|
3302 |
+
$custom_logo = $saswp_custom_logo;
|
3303 |
if(isset($custom_logo) && is_array($custom_logo)){
|
3304 |
|
3305 |
+
$logo = array_key_exists(0, $custom_logo)? $custom_logo[0]:'';
|
3306 |
+
$width = array_key_exists(1, $custom_logo)? $custom_logo[1]:'';
|
3307 |
+
$height = array_key_exists(2, $custom_logo)? $custom_logo[2]:'';
|
3308 |
|
3309 |
}
|
3310 |
|
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.3
|
6 |
-
Stable tag: 1.9.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -118,6 +118,27 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
118 |
|
119 |
== Changelog ==
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
= 1.9.26 (15 Feb 2020) =
|
122 |
|
123 |
* Fixed: A value for the thumbnailUrl field is required(Video Object) #770
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.3
|
6 |
+
Stable tag: 1.9.27
|
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.27 (25 Feb 2020) =
|
122 |
+
|
123 |
+
* Fixed: GPS coordinates are not working on Post for tourist attraction schema type. #800
|
124 |
+
* Fixed: BlogPosting is not a known valid target type for the itemReviewed property. #812
|
125 |
+
* Fixed: User is not able to view the embeded url in the post url #815
|
126 |
+
* Fixed: Allow the form when ampforwp-form-allow class is available #798
|
127 |
+
* Fixed: Shortcode should not be there in article body #802
|
128 |
+
* Fixed: Reviews are not integrating into the Course schema type.(urgent) #816
|
129 |
+
* Fixed: Change the URL of "Upgrade to premium" option in dashboard. #808
|
130 |
+
* Fixed: Itemlist schema always show article as item type on individual post #810
|
131 |
+
* Fixed: Speed issue after activation of schema plugin #778
|
132 |
+
* Fixed: DiscussionForumPosting – issue with headline #801
|
133 |
+
* Fixed: Corporation is not a known valid target type for the publisher property. #783
|
134 |
+
* Fixed: Date is not appearing single review shortcode #791
|
135 |
+
* Fixed: Resize the image based on height and width #811
|
136 |
+
* Fixed: Restore to Auto Fetch option does not fetch the data from the current article, but displays data from previous article. #825
|
137 |
+
* Fixed: Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' #829
|
138 |
+
* Fixed: Question Title in Q&A schema is not being displayed. Shows "Unspecified Type" in its place. #827
|
139 |
+
* Added: Allow Multiple Size Images Creation #828
|
140 |
+
* Added: “sameAs” property in Review schema #803
|
141 |
+
|
142 |
= 1.9.26 (15 Feb 2020) =
|
143 |
|
144 |
* Fixed: A value for the thumbnailUrl field is required(Video Object) #770
|
structured-data-for-wp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP & AMP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
-
Version: 1.9.
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
@@ -13,7 +13,7 @@ License: GPL2
|
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
-
define('SASWP_VERSION', '1.9.
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP & AMP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
+
Version: 1.9.27
|
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.27');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
view/common.php
CHANGED
@@ -184,6 +184,7 @@ class saswp_view_common_class {
|
|
184 |
|
185 |
$howto_data = array();
|
186 |
$tabs_fields = '';
|
|
|
187 |
|
188 |
$schema_type_fields = $this->schema_type_element;
|
189 |
|
@@ -194,7 +195,7 @@ class saswp_view_common_class {
|
|
194 |
if($type_fields){
|
195 |
|
196 |
if($schema_type == 'ItemList'){
|
197 |
-
|
198 |
$tabs_fields .= '<div schema-id="'.esc_attr($schema_id).'" class="saswp-table-create-onajax saswp-ps-toggle">';
|
199 |
|
200 |
}else{
|
@@ -256,7 +257,7 @@ class saswp_view_common_class {
|
|
256 |
|
257 |
}
|
258 |
|
259 |
-
$tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" div_type="'.$key.'" fields_type="'.$value.'" class="button saswp_add_schema_fields_on_fly saswp-'.$key.'">'.esc_html__( 'Add '.$btn_text, 'schema-and-structured-data-for-wp' ).'</a>';
|
260 |
$tabs_fields .= '</div>';
|
261 |
|
262 |
}
|
@@ -578,6 +579,7 @@ class saswp_view_common_class {
|
|
578 |
}else{
|
579 |
|
580 |
$tabs_fields .= $this->saswp_schema_fields_html_on_the_fly($schema_type, $schema_id, $post_id, $disabled_schema, $modify_this, $modified);
|
|
|
581 |
}
|
582 |
|
583 |
|
@@ -641,46 +643,45 @@ class saswp_view_common_class {
|
|
641 |
if(!empty($all_schema)){
|
642 |
$schema_count = count($all_schema);
|
643 |
}
|
644 |
-
|
645 |
if($schema_count > 0){
|
646 |
|
647 |
foreach($all_schema as $schema){
|
648 |
-
|
649 |
if(isset($_POST['saswp_modify_this_schema_'.$schema->ID])){
|
650 |
update_post_meta( $post_id, 'saswp_modify_this_schema_'.$schema->ID, intval($_POST['saswp_modify_this_schema_'.$schema->ID]));
|
651 |
}
|
652 |
-
|
653 |
foreach ($this->schema_type_element as $element){
|
654 |
|
655 |
foreach($element as $key => $val){
|
656 |
|
657 |
-
|
658 |
-
|
659 |
-
$element_val = array();
|
660 |
-
|
661 |
-
$data = (array) $_POST[$val.'_'.$schema->ID];
|
662 |
|
|
|
|
|
|
|
|
|
663 |
if($data){
|
664 |
|
665 |
foreach ($data as $supply){
|
666 |
|
667 |
$sanitize_data = array();
|
668 |
|
669 |
-
foreach($supply as $k => $el){
|
670 |
-
|
|
|
|
|
|
|
671 |
}
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
}
|
682 |
-
|
683 |
-
}
|
684 |
|
685 |
}
|
686 |
|
184 |
|
185 |
$howto_data = array();
|
186 |
$tabs_fields = '';
|
187 |
+
$itemlist_sub_type = '';
|
188 |
|
189 |
$schema_type_fields = $this->schema_type_element;
|
190 |
|
195 |
if($type_fields){
|
196 |
|
197 |
if($schema_type == 'ItemList'){
|
198 |
+
$itemlist_sub_type = get_post_meta($schema_id, 'saswp_itemlist_item_type', true);
|
199 |
$tabs_fields .= '<div schema-id="'.esc_attr($schema_id).'" class="saswp-table-create-onajax saswp-ps-toggle">';
|
200 |
|
201 |
}else{
|
257 |
|
258 |
}
|
259 |
|
260 |
+
$tabs_fields .= '<a itemlist_sub_type="'.esc_attr($itemlist_sub_type).'" data-id="'.esc_attr($schema_id).'" div_type="'.$key.'" fields_type="'.$value.'" class="button saswp_add_schema_fields_on_fly saswp-'.$key.'">'.esc_html__( 'Add '.$btn_text, 'schema-and-structured-data-for-wp' ).'</a>';
|
261 |
$tabs_fields .= '</div>';
|
262 |
|
263 |
}
|
579 |
}else{
|
580 |
|
581 |
$tabs_fields .= $this->saswp_schema_fields_html_on_the_fly($schema_type, $schema_id, $post_id, $disabled_schema, $modify_this, $modified);
|
582 |
+
|
583 |
}
|
584 |
|
585 |
|
643 |
if(!empty($all_schema)){
|
644 |
$schema_count = count($all_schema);
|
645 |
}
|
646 |
+
|
647 |
if($schema_count > 0){
|
648 |
|
649 |
foreach($all_schema as $schema){
|
650 |
+
|
651 |
if(isset($_POST['saswp_modify_this_schema_'.$schema->ID])){
|
652 |
update_post_meta( $post_id, 'saswp_modify_this_schema_'.$schema->ID, intval($_POST['saswp_modify_this_schema_'.$schema->ID]));
|
653 |
}
|
654 |
+
|
655 |
foreach ($this->schema_type_element as $element){
|
656 |
|
657 |
foreach($element as $key => $val){
|
658 |
|
659 |
+
$element_val = array();
|
|
|
|
|
|
|
|
|
660 |
|
661 |
+
if(array_key_exists($val.'_'.$schema->ID, $_POST)){
|
662 |
+
|
663 |
+
$data = (array) $_POST[$val.'_'.$schema->ID];
|
664 |
+
|
665 |
if($data){
|
666 |
|
667 |
foreach ($data as $supply){
|
668 |
|
669 |
$sanitize_data = array();
|
670 |
|
671 |
+
foreach($supply as $k => $el){
|
672 |
+
if($el){
|
673 |
+
$sanitize_data[$k] = wp_kses_post(wp_unslash($el));
|
674 |
+
}
|
675 |
+
|
676 |
}
|
677 |
+
if($sanitize_data){
|
678 |
+
$element_val[] = $sanitize_data;
|
679 |
+
}
|
680 |
+
}
|
681 |
+
}
|
682 |
+
}
|
683 |
+
update_post_meta( $post_id, $val.'_'.intval($schema->ID), $element_val);
|
684 |
+
}
|
|
|
|
|
|
|
|
|
685 |
|
686 |
}
|
687 |
|
view/paywall.php
CHANGED
@@ -79,6 +79,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
79 |
$taxonomy_term = '';
|
80 |
$fixed_image = '';
|
81 |
$cus_meta_field = array();
|
|
|
82 |
|
83 |
if ( isset( $_POST['notAccessibleForFree'] ) )
|
84 |
$notAccessibleForFree = sanitize_text_field($_POST['notAccessibleForFree']);
|
79 |
$taxonomy_term = '';
|
80 |
$fixed_image = '';
|
81 |
$cus_meta_field = array();
|
82 |
+
$meta_list = array();
|
83 |
|
84 |
if ( isset( $_POST['notAccessibleForFree'] ) )
|
85 |
$notAccessibleForFree = sanitize_text_field($_POST['notAccessibleForFree']);
|
view/post_specific.php
CHANGED
@@ -45,15 +45,122 @@ class saswp_post_specific {
|
|
45 |
|
46 |
add_action( 'wp_ajax_saswp_get_item_reviewed_fields', array($this, 'saswp_get_item_reviewed_fields')) ;
|
47 |
|
48 |
-
|
49 |
-
|
50 |
add_action( 'wp_ajax_saswp_get_sub_business_ajax', array($this,'saswp_get_sub_business_ajax'));
|
51 |
|
52 |
add_action( 'wp_ajax_saswp_get_schema_dynamic_fields_ajax', array($this,'saswp_get_schema_dynamic_fields_ajax'));
|
53 |
add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
|
|
|
|
|
54 |
|
55 |
}
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Function to get review schema type html markup
|
59 |
* @since 1.0.8
|
@@ -262,7 +369,7 @@ class saswp_post_specific {
|
|
262 |
$cus_schema .= '</div>';
|
263 |
|
264 |
if(!empty($this->all_schema)){
|
265 |
-
|
266 |
foreach($this->all_schema as $key => $schema){
|
267 |
|
268 |
$advnace_status = saswp_check_advance_display_status($schema->ID);
|
@@ -274,6 +381,7 @@ class saswp_post_specific {
|
|
274 |
$disabled = '';
|
275 |
$modified = false;
|
276 |
$item_type = '';
|
|
|
277 |
|
278 |
if(isset($schema_enable[$schema->ID]) && $schema_enable[$schema->ID] == 0){
|
279 |
|
@@ -296,14 +404,17 @@ class saswp_post_specific {
|
|
296 |
$modify_this = get_post_meta($post->ID, 'saswp_modify_this_schema_'.$schema->ID, true);
|
297 |
$schema_type = get_post_meta($schema->ID, 'schema_type', true);
|
298 |
$response = saswp_get_fields_by_schema_type($schema->ID);
|
299 |
-
$saswp_meta_fields = array_filter($response);
|
300 |
-
|
|
|
|
|
|
|
301 |
|
302 |
if($schema_type == 'ItemList'){
|
303 |
$item_type = '('.get_post_meta($schema->ID, 'saswp_itemlist_item_type', true).')';
|
304 |
}
|
305 |
|
306 |
-
if($schema_type == 'Review'){
|
307 |
|
308 |
$item_reviewed = get_post_meta($post->ID, 'saswp_review_item_reviewed_'.$schema->ID, true);
|
309 |
if(!$item_reviewed){
|
@@ -370,7 +481,7 @@ class saswp_post_specific {
|
|
370 |
|
371 |
if($key==0){
|
372 |
|
373 |
-
$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.' '.$item_type ).'</a>'
|
374 |
. '</li>';
|
375 |
|
376 |
$tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper">';
|
@@ -382,7 +493,7 @@ class saswp_post_specific {
|
|
382 |
}else{
|
383 |
|
384 |
$tabs .='<li>'
|
385 |
-
. '<a saswp-schema-type="'.esc_attr($schema_type).'" data-id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-tab-links">'.esc_attr($schema_type == 'local_business'? 'LocalBusiness': $schema_type.' '.$item_type ).'</a>'
|
386 |
. '</li>';
|
387 |
|
388 |
$tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper saswp_hide">';
|
@@ -398,7 +509,7 @@ class saswp_post_specific {
|
|
398 |
|
399 |
$response_html .= '<div>';
|
400 |
$response_html .= '<div class="saswp-tab saswp-post-specific-tab-wrapper">';
|
401 |
-
|
402 |
$response_html .= $tabs;
|
403 |
|
404 |
$response_html .='<li>'
|
45 |
|
46 |
add_action( 'wp_ajax_saswp_get_item_reviewed_fields', array($this, 'saswp_get_item_reviewed_fields')) ;
|
47 |
|
48 |
+
add_action( 'add_meta_boxes', array( $this, 'saswp_post_specifc_add_meta_boxes' ) );
|
49 |
+
add_action( 'save_post', array( $this, 'saswp_post_specific_save_fields' ) );
|
50 |
add_action( 'wp_ajax_saswp_get_sub_business_ajax', array($this,'saswp_get_sub_business_ajax'));
|
51 |
|
52 |
add_action( 'wp_ajax_saswp_get_schema_dynamic_fields_ajax', array($this,'saswp_get_schema_dynamic_fields_ajax'));
|
53 |
add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
|
54 |
+
add_action( 'wp_ajax_saswp_modify_schema_post_enable', array($this,'saswp_modify_schema_post_enable'));
|
55 |
+
add_action( 'wp_ajax_saswp_modify_schema_post_restore', array($this,'saswp_modify_schema_post_restore'));
|
56 |
|
57 |
}
|
58 |
|
59 |
+
/**
|
60 |
+
* Generate the post specific metabox html with dynamic values on ajax call
|
61 |
+
* @return type string
|
62 |
+
* @since version 1.0.4
|
63 |
+
*/
|
64 |
+
public function saswp_modify_schema_post_restore(){
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
if ( ! isset( $_POST['saswp_security_nonce'] ) ){
|
69 |
+
return;
|
70 |
+
}
|
71 |
+
if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
|
72 |
+
return;
|
73 |
+
}
|
74 |
+
|
75 |
+
$post_id = intval($_POST['post_id']);
|
76 |
+
$schema_id = intval($_POST['schema_id']);
|
77 |
+
|
78 |
+
update_post_meta($post_id, 'saswp_modify_this_schema_'.$schema_id, 0);
|
79 |
+
|
80 |
+
$meta_field = saswp_get_fields_by_schema_type($schema_id);
|
81 |
+
|
82 |
+
if($meta_field){
|
83 |
+
foreach($meta_field as $field){
|
84 |
+
$result = delete_post_meta($post_id, $field['id']);
|
85 |
+
}
|
86 |
+
}
|
87 |
+
echo json_encode(array('status'=> 't', 'msg'=>esc_html__( 'Schema has been restored', 'schema-and-structured-data-for-wp' )));
|
88 |
+
wp_die();
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
public function saswp_get_schema_fields_on_ajax($post_id, $schema_id, $item_reviewed = null){
|
93 |
+
|
94 |
+
$response = array();
|
95 |
+
|
96 |
+
$args = array(
|
97 |
+
'p' => $post_id, // ID of a page, post, or custom type
|
98 |
+
'post_type' => 'any'
|
99 |
+
);
|
100 |
+
|
101 |
+
$my_posts = new WP_Query($args);
|
102 |
+
|
103 |
+
if ( $my_posts->have_posts() ) {
|
104 |
+
|
105 |
+
while ( $my_posts->have_posts() ) : $my_posts->the_post();
|
106 |
+
|
107 |
+
if($item_reviewed != null){
|
108 |
+
$response = saswp_get_fields_by_schema_type($schema_id, null, $item_reviewed);
|
109 |
+
}else{
|
110 |
+
$response = saswp_get_fields_by_schema_type($schema_id);
|
111 |
+
}
|
112 |
+
|
113 |
+
endwhile;
|
114 |
+
|
115 |
+
}
|
116 |
+
return $response;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Generate the post specific metabox html with dynamic values on ajax call
|
121 |
+
* @return type string
|
122 |
+
* @since version 1.0.4
|
123 |
+
*/
|
124 |
+
public function saswp_modify_schema_post_enable(){
|
125 |
+
|
126 |
+
if ( ! isset( $_GET['saswp_security_nonce'] ) ){
|
127 |
+
return;
|
128 |
+
}
|
129 |
+
if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
|
130 |
+
return;
|
131 |
+
}
|
132 |
+
|
133 |
+
$post_id = intval($_GET['post_id']);
|
134 |
+
$schema_id = intval($_GET['schema_id']);
|
135 |
+
$modify_this = 1;
|
136 |
+
$disabled = '';
|
137 |
+
$modified = false;
|
138 |
+
|
139 |
+
update_post_meta($post_id, 'saswp_modify_this_schema_'.$schema_id, 1);
|
140 |
+
$schema_type = get_post_meta($schema_id, 'schema_type', true);
|
141 |
+
$response = $this->saswp_get_schema_fields_on_ajax($post_id, $schema_id);
|
142 |
+
$saswp_meta_fields = array_filter($response);
|
143 |
+
|
144 |
+
$output = $this->_common_view->saswp_saswp_post_specific($schema_type, $saswp_meta_fields, $post_id, $schema_id, null, $disabled, $modify_this, $modified );
|
145 |
+
|
146 |
+
if($schema_type == 'Review'){
|
147 |
+
|
148 |
+
$item_reviewed = get_post_meta($post->ID, 'saswp_review_item_reviewed_'.$schema_id, true);
|
149 |
+
if(!$item_reviewed){
|
150 |
+
$item_reviewed = 'Book';
|
151 |
+
}
|
152 |
+
$response = $this->saswp_get_schema_fields_on_ajax($post_id, $schema_id, $item_reviewed);
|
153 |
+
$saswp_meta_fields = array_filter($response);
|
154 |
+
$output .= $this->_common_view->saswp_saswp_post_specific($schema_type, $saswp_meta_fields, $post_id, $schema_id ,$item_reviewed, $disabled, $modify_this, $modified);
|
155 |
+
|
156 |
+
}
|
157 |
+
|
158 |
+
echo $output;
|
159 |
+
|
160 |
+
wp_die();
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
/**
|
165 |
* Function to get review schema type html markup
|
166 |
* @since 1.0.8
|
369 |
$cus_schema .= '</div>';
|
370 |
|
371 |
if(!empty($this->all_schema)){
|
372 |
+
|
373 |
foreach($this->all_schema as $key => $schema){
|
374 |
|
375 |
$advnace_status = saswp_check_advance_display_status($schema->ID);
|
381 |
$disabled = '';
|
382 |
$modified = false;
|
383 |
$item_type = '';
|
384 |
+
$output = '';
|
385 |
|
386 |
if(isset($schema_enable[$schema->ID]) && $schema_enable[$schema->ID] == 0){
|
387 |
|
404 |
$modify_this = get_post_meta($post->ID, 'saswp_modify_this_schema_'.$schema->ID, true);
|
405 |
$schema_type = get_post_meta($schema->ID, 'schema_type', true);
|
406 |
$response = saswp_get_fields_by_schema_type($schema->ID);
|
407 |
+
$saswp_meta_fields = array_filter($response);
|
408 |
+
if($modify_this){
|
409 |
+
$output = $this->_common_view->saswp_saswp_post_specific($schema_type, $saswp_meta_fields, $post->ID, $schema->ID, null, $disabled, $modify_this, $modified );
|
410 |
+
}
|
411 |
+
|
412 |
|
413 |
if($schema_type == 'ItemList'){
|
414 |
$item_type = '('.get_post_meta($schema->ID, 'saswp_itemlist_item_type', true).')';
|
415 |
}
|
416 |
|
417 |
+
if($schema_type == 'Review' && $modify_this){
|
418 |
|
419 |
$item_reviewed = get_post_meta($post->ID, 'saswp_review_item_reviewed_'.$schema->ID, true);
|
420 |
if(!$item_reviewed){
|
481 |
|
482 |
if($key==0){
|
483 |
|
484 |
+
$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 =='qanda' ? 'Q&A' : $schema_type)).' '.$item_type ).'</a>'
|
485 |
. '</li>';
|
486 |
|
487 |
$tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper">';
|
493 |
}else{
|
494 |
|
495 |
$tabs .='<li>'
|
496 |
+
. '<a saswp-schema-type="'.esc_attr($schema_type).'" data-id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-tab-links">'.esc_attr(($schema_type == 'local_business'? 'LocalBusiness': ($schema_type =='qanda' ? 'Q&A' : $schema_type)).' '.$item_type ).'</a>'
|
497 |
. '</li>';
|
498 |
|
499 |
$tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper saswp_hide">';
|
509 |
|
510 |
$response_html .= '<div>';
|
511 |
$response_html .= '<div class="saswp-tab saswp-post-specific-tab-wrapper">';
|
512 |
+
$response_html .= '<ul class="saswp-tab-nav">';
|
513 |
$response_html .= $tabs;
|
514 |
|
515 |
$response_html .='<li>'
|
view/schema_type.php
CHANGED
@@ -866,6 +866,7 @@ function saswp_schema_type_meta_box_callback( $post) {
|
|
866 |
$review_fields['saswp_review_author'] = 'Review Author';
|
867 |
$review_fields['saswp_review_author_url'] = 'Review Author Profile URL';
|
868 |
$review_fields['saswp_review_publisher'] = 'Review Publisher';
|
|
|
869 |
$review_fields['saswp_review_rating_value'] = 'Review Rating Value';
|
870 |
$review_fields['saswp_review_date_published'] = 'Review Published Date';
|
871 |
$review_fields['saswp_review_url'] = 'Review URL';
|
@@ -1185,6 +1186,8 @@ function saswp_schema_type_add_meta_box_save( $post_id ) {
|
|
1185 |
|
1186 |
if(isset($_POST['saswp_enable_append_reviews'])){
|
1187 |
update_post_meta( $post_id, 'saswp_enable_append_reviews', intval($_POST['saswp_enable_append_reviews']) );
|
|
|
|
|
1188 |
}
|
1189 |
|
1190 |
if(isset($_POST['saswp_enable_itemlist_schema'])){
|
866 |
$review_fields['saswp_review_author'] = 'Review Author';
|
867 |
$review_fields['saswp_review_author_url'] = 'Review Author Profile URL';
|
868 |
$review_fields['saswp_review_publisher'] = 'Review Publisher';
|
869 |
+
$review_fields['saswp_review_publisher_url'] = 'Review Publisher URL';
|
870 |
$review_fields['saswp_review_rating_value'] = 'Review Rating Value';
|
871 |
$review_fields['saswp_review_date_published'] = 'Review Published Date';
|
872 |
$review_fields['saswp_review_url'] = 'Review URL';
|
1186 |
|
1187 |
if(isset($_POST['saswp_enable_append_reviews'])){
|
1188 |
update_post_meta( $post_id, 'saswp_enable_append_reviews', intval($_POST['saswp_enable_append_reviews']) );
|
1189 |
+
}else{
|
1190 |
+
update_post_meta( $post_id, 'saswp_enable_append_reviews', 0);
|
1191 |
}
|
1192 |
|
1193 |
if(isset($_POST['saswp_enable_itemlist_schema'])){
|