Widgets for Google Reviews - Version 7.3

Version Description

Download this release

Release Info

Developer trustindex
Plugin Icon 128x128 Widgets for Google Reviews
Version 7.3
Comparing to
See all releases

Code changes from version 7.2 to 7.3

Files changed (78) hide show
  1. languages/trustindex-af.mo +0 -0
  2. languages/trustindex-ar.mo +0 -0
  3. languages/trustindex-ary.mo +0 -0
  4. languages/trustindex-az.mo +0 -0
  5. languages/trustindex-azb.mo +0 -0
  6. languages/trustindex-bg_BG.mo +0 -0
  7. languages/trustindex-bn_BD.mo +0 -0
  8. languages/trustindex-cs_CZ.mo +0 -0
  9. languages/trustindex-da_DK.mo +0 -0
  10. languages/trustindex-de_AT.mo +0 -0
  11. languages/trustindex-de_CH.mo +0 -0
  12. languages/trustindex-de_CH_informal.mo +0 -0
  13. languages/trustindex-de_DE.mo +0 -0
  14. languages/trustindex-de_DE_formal.mo +0 -0
  15. languages/trustindex-el.mo +0 -0
  16. languages/trustindex-es_AR.mo +0 -0
  17. languages/trustindex-es_CL.mo +0 -0
  18. languages/trustindex-es_CO.mo +0 -0
  19. languages/trustindex-es_CR.mo +0 -0
  20. languages/trustindex-es_ES.mo +0 -0
  21. languages/trustindex-es_GT.mo +0 -0
  22. languages/trustindex-es_MX.mo +0 -0
  23. languages/trustindex-es_PE.mo +0 -0
  24. languages/trustindex-es_PR.mo +0 -0
  25. languages/trustindex-es_UY.mo +0 -0
  26. languages/trustindex-es_VE.mo +0 -0
  27. languages/trustindex-et.mo +0 -0
  28. languages/trustindex-fi.mo +0 -0
  29. languages/trustindex-fr_BR.mo +0 -0
  30. languages/trustindex-fr_CA.mo +0 -0
  31. languages/trustindex-fr_FR.mo +0 -0
  32. languages/trustindex-gd.mo +0 -0
  33. languages/trustindex-he_IL.mo +0 -0
  34. languages/trustindex-hi_IN.mo +0 -0
  35. languages/trustindex-hr.mo +0 -0
  36. languages/trustindex-hu_HU.mo +0 -0
  37. languages/trustindex-id_ID.mo +0 -0
  38. languages/trustindex-is_IS.mo +0 -0
  39. languages/trustindex-it_IT.mo +0 -0
  40. languages/trustindex-ja.mo +0 -0
  41. languages/trustindex-ko_KR.mo +0 -0
  42. languages/trustindex-lt_LT.mo +0 -0
  43. languages/trustindex-mk_MK.mo +0 -0
  44. languages/trustindex-ms_MY.mo +0 -0
  45. languages/trustindex-nb_NO.mo +0 -0
  46. languages/trustindex-nl_BE.mo +0 -0
  47. languages/trustindex-nl_NL.mo +0 -0
  48. languages/trustindex-nl_NL_formal.mo +0 -0
  49. languages/trustindex-nn_NO.mo +0 -0
  50. languages/trustindex-pl_PL.mo +0 -0
  51. languages/trustindex-pt_AO.mo +0 -0
  52. languages/trustindex-pt_BR.mo +0 -0
  53. languages/trustindex-pt_PT.mo +0 -0
  54. languages/trustindex-pt_PT_ao90.mo +0 -0
  55. languages/trustindex-ro_RO.mo +0 -0
  56. languages/trustindex-ru_RU.mo +0 -0
  57. languages/trustindex-sk_SK.mo +0 -0
  58. languages/trustindex-sl_SI.mo +0 -0
  59. languages/trustindex-sq.mo +0 -0
  60. languages/trustindex-sr_RS.mo +0 -0
  61. languages/trustindex-sv_SE.mo +0 -0
  62. languages/trustindex-th.mo +0 -0
  63. languages/trustindex-tr_TR.mo +0 -0
  64. languages/trustindex-uk.mo +0 -0
  65. languages/trustindex-vi.mo +0 -0
  66. languages/trustindex-zh_CN.mo +0 -0
  67. languages/trustindex-zh_HK.mo +0 -0
  68. languages/trustindex-zh_TW.mo +0 -0
  69. readme.txt +9 -7
  70. static/js/admin-page-settings-common.js +1 -1
  71. static/js/admin-page-settings-connect.js +1 -1
  72. tabs/demo_widgets.php +33 -0
  73. tabs/setup_no_reg.php +10 -33
  74. tabs/setup_no_reg_header.php +31 -1
  75. tabs/troubleshooting.php +35 -2
  76. trustindex-plugin.class.php +35 -3
  77. uninstall.php +1 -1
  78. wp-reviews-plugin-for-google.php +14 -6
languages/trustindex-af.mo CHANGED
Binary file
languages/trustindex-ar.mo CHANGED
Binary file
languages/trustindex-ary.mo CHANGED
Binary file
languages/trustindex-az.mo CHANGED
Binary file
languages/trustindex-azb.mo CHANGED
Binary file
languages/trustindex-bg_BG.mo CHANGED
Binary file
languages/trustindex-bn_BD.mo ADDED
Binary file
languages/trustindex-cs_CZ.mo CHANGED
Binary file
languages/trustindex-da_DK.mo CHANGED
Binary file
languages/trustindex-de_AT.mo CHANGED
Binary file
languages/trustindex-de_CH.mo CHANGED
Binary file
languages/trustindex-de_CH_informal.mo CHANGED
Binary file
languages/trustindex-de_DE.mo CHANGED
Binary file
languages/trustindex-de_DE_formal.mo CHANGED
Binary file
languages/trustindex-el.mo CHANGED
Binary file
languages/trustindex-es_AR.mo CHANGED
Binary file
languages/trustindex-es_CL.mo CHANGED
Binary file
languages/trustindex-es_CO.mo CHANGED
Binary file
languages/trustindex-es_CR.mo CHANGED
Binary file
languages/trustindex-es_ES.mo CHANGED
Binary file
languages/trustindex-es_GT.mo CHANGED
Binary file
languages/trustindex-es_MX.mo CHANGED
Binary file
languages/trustindex-es_PE.mo CHANGED
Binary file
languages/trustindex-es_PR.mo CHANGED
Binary file
languages/trustindex-es_UY.mo CHANGED
Binary file
languages/trustindex-es_VE.mo CHANGED
Binary file
languages/trustindex-et.mo CHANGED
Binary file
languages/trustindex-fi.mo CHANGED
Binary file
languages/trustindex-fr_BR.mo CHANGED
Binary file
languages/trustindex-fr_CA.mo CHANGED
Binary file
languages/trustindex-fr_FR.mo CHANGED
Binary file
languages/trustindex-gd.mo CHANGED
Binary file
languages/trustindex-he_IL.mo CHANGED
Binary file
languages/trustindex-hi_IN.mo CHANGED
Binary file
languages/trustindex-hr.mo CHANGED
Binary file
languages/trustindex-hu_HU.mo CHANGED
Binary file
languages/trustindex-id_ID.mo CHANGED
Binary file
languages/trustindex-is_IS.mo CHANGED
Binary file
languages/trustindex-it_IT.mo CHANGED
Binary file
languages/trustindex-ja.mo CHANGED
Binary file
languages/trustindex-ko_KR.mo CHANGED
Binary file
languages/trustindex-lt_LT.mo CHANGED
Binary file
languages/trustindex-mk_MK.mo CHANGED
Binary file
languages/trustindex-ms_MY.mo CHANGED
Binary file
languages/trustindex-nb_NO.mo CHANGED
Binary file
languages/trustindex-nl_BE.mo CHANGED
Binary file
languages/trustindex-nl_NL.mo CHANGED
Binary file
languages/trustindex-nl_NL_formal.mo CHANGED
Binary file
languages/trustindex-nn_NO.mo CHANGED
Binary file
languages/trustindex-pl_PL.mo CHANGED
Binary file
languages/trustindex-pt_AO.mo CHANGED
Binary file
languages/trustindex-pt_BR.mo CHANGED
Binary file
languages/trustindex-pt_PT.mo CHANGED
Binary file
languages/trustindex-pt_PT_ao90.mo CHANGED
Binary file
languages/trustindex-ro_RO.mo CHANGED
Binary file
languages/trustindex-ru_RU.mo CHANGED
Binary file
languages/trustindex-sk_SK.mo CHANGED
Binary file
languages/trustindex-sl_SI.mo CHANGED
Binary file
languages/trustindex-sq.mo CHANGED
Binary file
languages/trustindex-sr_RS.mo CHANGED
Binary file
languages/trustindex-sv_SE.mo CHANGED
Binary file
languages/trustindex-th.mo CHANGED
Binary file
languages/trustindex-tr_TR.mo CHANGED
Binary file
languages/trustindex-uk.mo CHANGED
Binary file
languages/trustindex-vi.mo CHANGED
Binary file
languages/trustindex-zh_CN.mo CHANGED
Binary file
languages/trustindex-zh_HK.mo CHANGED
Binary file
languages/trustindex-zh_TW.mo CHANGED
Binary file
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: google, google places reviews, reviews, widget, google business, review, t
5
  Requires at least: 3.0.1
6
  Tested up to: 5.8
7
  Requires PHP: 5.2
8
- Stable tag: 7.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  Plugin Name: Widgets for Google Reviews
@@ -14,7 +14,7 @@ Plugin URI: https://wordpress.org/plugins/wp-reviews-plugin-for-google/
14
  Author: Trustindex.io <support@trustindex.io>
15
  Author URI: https://www.trustindex.io/
16
  Text Domain: wp-reviews-plugin-for-google
17
- Version: 7.2
18
 
19
  Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google Business reviews.
20
 
@@ -47,7 +47,8 @@ If you don’t yet have any Google reviews, there’s no need to panic; simply s
47
  The Google Reviews WordPress plugin offers various layouts and styles to choose from and allows for easy integration into any WordPress page.
48
 
49
  * Free usage
50
- * Display up to 10 Google Reviews* 35+ Widget layouts
 
51
  * 16+ Pre-designed widget styles
52
  * 1 Review widget
53
  * Review filtering
@@ -128,7 +129,7 @@ Why not display your other ratings, too? Check out our other free review plugins
128
  If your company does business globally, it’s in your interest to cater to various languages.
129
 
130
  Our Widgets for Google Reviews supports the following languages:
131
- Afrikaans, Albanian, Arabic, Azerbaijani, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Lithuanian, Macedonian, Malay, Norwegian, Polish, Portuguese, Romanian, Russian, Scottish Gaelic, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukranian, Vietnamese
132
 
133
  == Support ==
134
 
@@ -137,9 +138,10 @@ If you have any issues at all setting up the Google Reviews WordPress Plugin for
137
  We offer 24/7 email support in English.
138
 
139
  We recommend the following order when searching for answers:
140
- 1. Plugin FAQ here at the bottom - if you don’t already know why it’s worth displaying Google Reviews2. You can find more info and Troublsehooting in the plugin's admin dashboard after install.
141
- 3. [https://www.trustindex.io/frequently-asked-questions/](Trustindex FAQ)
142
- 4. Check topics or ask a new question here: [https://wordpress.org/support/plugin/wp-reviews-plugin-for-google/](Support Forum)
 
143
  5. If you still can't find the answer, feel free to email us: support@trustindex.io
144
 
145
  To find out more about who we are and what we do, here are some useful links:
5
  Requires at least: 3.0.1
6
  Tested up to: 5.8
7
  Requires PHP: 5.2
8
+ Stable tag: 7.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  Plugin Name: Widgets for Google Reviews
14
  Author: Trustindex.io <support@trustindex.io>
15
  Author URI: https://www.trustindex.io/
16
  Text Domain: wp-reviews-plugin-for-google
17
+ Version: 7.3
18
 
19
  Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google Business reviews.
20
 
47
  The Google Reviews WordPress plugin offers various layouts and styles to choose from and allows for easy integration into any WordPress page.
48
 
49
  * Free usage
50
+ * Display up to 10 Google Reviews
51
+ * 35+ Widget layouts
52
  * 16+ Pre-designed widget styles
53
  * 1 Review widget
54
  * Review filtering
129
  If your company does business globally, it’s in your interest to cater to various languages.
130
 
131
  Our Widgets for Google Reviews supports the following languages:
132
+ Afrikaans, Albanian, Arabic, Azerbaijani, Bengali, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Lithuanian, Macedonian, Malay, Norwegian, Polish, Portuguese, Romanian, Russian, Scottish Gaelic, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukranian, Vietnamese
133
 
134
  == Support ==
135
 
138
  We offer 24/7 email support in English.
139
 
140
  We recommend the following order when searching for answers:
141
+ 1. Plugin FAQ here at the bottom - if you don’t already know why it’s worth displaying Google Reviews
142
+ 2. You can find more info and Troublsehooting in the plugin's admin dashboard after install.
143
+ 3. [Trustindex FAQ](https://www.trustindex.io/frequently-asked-questions/)
144
+ 4. Check topics or ask a new question here: [Support Forum](https://wordpress.org/support/plugin/wp-reviews-plugin-for-google/)
145
  5. If you still can't find the answer, feel free to email us: support@trustindex.io
146
 
147
  To find out more about who we are and what we do, here are some useful links:
static/js/admin-page-settings-common.js CHANGED
@@ -1 +1 @@
1
- String.prototype.ucfirst=function(){return this.charAt(0).toUpperCase()+this.slice(1)};jQuery(document).ready(function(){jQuery(".ti-toggle-password").on("click",function(g){g.preventDefault();let icon=jQuery(this);let parent=icon.closest(".form-group, .ti-input-field");if(icon.hasClass("dashicons-visibility")){parent.find("input").attr("type","text");icon.removeClass("dashicons-visibility").addClass("dashicons-hidden")}else{parent.find("input").attr("type","password");icon.removeClass("dashicons-hidden").addClass("dashicons-visibility")}});let nav=jQuery("#trustindex-plugin-settings-page .nav-tab-wrapper");if(nav.length){let width=nav.find(".nav-tab-right").outerWidth();nav.css("padding-right",parseInt(width+5)+"px")}jQuery(".ti-toggle-opacity").css("opacity",1);jQuery("#trustindex-plugin-settings-page .btn-toggle").on("click",function(g){g.preventDefault();jQuery(jQuery(this).attr("href")).toggle();return false});jQuery(".btn-copy2clipboard").click(function(g){g.preventDefault();let obj=jQuery(jQuery(this).attr("href"));let text=obj.html()?obj.html():obj.val();TI_copyTextToClipboard(text)});var a=function(){let style_id=jQuery("#ti-style-id").val();let box=jQuery("#ti-review-list").closest(".ti-preview-box");if(["8","9","10","11","12","20","22"].indexOf(style_id)!=-1&&!b){box.css("width","30%")}else{if(["6","7","24","25","26","27","28","29","35"].indexOf(style_id)!=-1&&!b){box.css("width","50%")}else{box.css("width","auto")}}box.css("width",box.width())};jQuery(".ti-checkbox:not(.disabled)").on("click",function(){let checkbox=jQuery(this).find("input[type=checkbox], input[type=radio]");checkbox.prop("checked",!checkbox.prop("checked")).trigger("change");return false});jQuery(".ti-select").each(function(){let el=jQuery(this);let selected=el.find("ul li.selected");if(selected.length==0){selected=el.find("ul li:first")}el.data("value",selected.data("value")).find("font").html(selected.html())});jQuery(document).on("click",".ti-select",function(){let el=jQuery(this);el.toggleClass("active");if(el.hasClass("active")){jQuery(window).unbind().on("click",function(g){if(!jQuery(g.target).is(el)&&jQuery(g.target).closest(".ti-select").length==0){el.removeClass("active");jQuery(window).unbind()}})}});jQuery(document).on("click",".ti-select li",function(){let el=jQuery(this);el.parent().parent().data("value",el.data("value")).trigger("change").find("font").html(el.html());el.parent().find("li").removeClass("selected");el.addClass("selected")});var b=false;var f=jQuery("#ti-review-list .ti-widget").clone();f.find(".ti-review-item").each(function(){let el=jQuery(this);let rating=el.find(".ti-stars .ti-star.f, .stars .ti-star.f").length;if(el.find(".ti-recommendation-icon.positive").length){rating=5}else{if(el.find(".ti-recommendation-icon.negative").length){rating=1}}if(el.find(".ti-polarity-icon.positive").length){rating=5}else{if(el.find(".ti-polarity-icon.neutral").length){rating=3}else{if(el.find(".ti-polarity-icon.negative").length){rating=1}}}if(el.find(".ti-rating-box").length){rating=Math.round(parseFloat(el.find(".ti-rating-box").text())/2)}let selector=".ti-review-content";if(el.find(".ti-review-content .ti-inner").length){selector=".ti-review-content .ti-inner"}else{if(el.find(".ti-review-text").length){selector=".ti-review-text"}}el.attr("data-rating",rating);el.attr("data-empty",el.find(selector).text().trim()==""?1:0)});var e=function(){let platform=(jQuery("#ti-filter #show-star").data("platform")||"google").ucfirst();let el=jQuery('<div class="ti-widget" style="display: none"><div class="source-'+platform+'"><span class="ti-star f"></span><span class="ti-star e"></span></div></div>');el.append("body");jQuery("body").append(el);jQuery("#ti-filter .ti-star.e").css("background",el.find(".ti-star.e").css("background"));jQuery("#ti-filter .ti-star.f").css("background",el.find(".ti-star.f").css("background"));el.remove()};e();var d=function(){let layout_id=jQuery("#ti-review-list .ti-widget").data("layout-id");return[11,12,20,22,24,25,26,27,28,29,35].indexOf(layout_id)!=-1};var c=function(g){let style_id=jQuery("#ti-style-id").val();let stars=(jQuery("#ti-filter #show-star").data("value")+"").split(",").map(function(h){return parseInt(h)});let show_only_ratings=jQuery("#ti-filter-only-ratings").prop("checked");if(!jQuery("#ti-filter").length){stars=[1,2,3,4,5];show_only_ratings=false}jQuery(".ti-widget .ti-reviews-container-wrapper .ti-review-item").remove();let widget=document.querySelector(".ti-widget");widget.replaceWith(widget.cloneNode(true));let results=0;f.find(".ti-review-item").each(function(){let el=jQuery(this);if(stars.indexOf(el.data("rating"))!==-1){if(show_only_ratings&&el.data("empty")){return}if(["8","9","10","18","33"].indexOf(style_id)!=-1&&results>4){return}let clone=el.clone();jQuery("#ti-review-list .ti-widget .ti-reviews-container-wrapper").append(clone);clone.hide();clone.fadeIn();results++}});if(typeof Trustindex!="undefined"&&Trustindex.intervalPointer){clearInterval(Trustindex.intervalPointer)}if(results==0&&!d()){jQuery("#ti-review-list").hide().next().fadeIn();b=true}else{jQuery("#ti-review-list").fadeIn().next().hide();b=false;if(g===undefined){let dot_container=jQuery("#ti-review-list .ti-widget .ti-controls-dots");if(dot_container.length){let dot=dot_container.children(":first").clone();if(dot.length){dot_container.html(" "+dot.removeAttr("data-pager-state")[0].outerHTML+" ")}}}if(typeof Trustindex!="undefined"){Trustindex.pager_inited=true;Trustindex.init_pager(document.querySelectorAll(".ti-widget"));Trustindex.resize_widgets()}}if(g!==true){jQuery.post("",{command:"save-filter",filter:JSON.stringify({stars:stars,"only-ratings":show_only_ratings})})}a()};jQuery("#ti-filter #show-star").on("change",c);jQuery("#ti-filter-only-ratings").on("change",function(g){g.preventDefault();c();return false});if(f.length){c(true);a()}jQuery("#ti-style-id, #ti-set-id, #ti-lang-id, #ti-dateformat-id, #ti-widget-options input[type=checkbox]:not(.no-form-update)").on("change",function(){let form=jQuery(this).closest("form");let data=form.serializeArray();form.find("input[type=checkbox]:not(.no-form-update)").each(function(){let checkbox=jQuery(this);if(!checkbox.prop("checked")&&checkbox.attr("name")){data.push({name:checkbox.attr("name"),value:0})}});jQuery("li.ti-preview-box").addClass("disabled");jQuery.ajax({url:form.attr("action"),type:"post",dataType:"application/json",data:data}).always(function(){location.reload(true)});return false});jQuery("input[name=layout-select]").on("change",function(g){g.preventDefault();let ids=(jQuery("input[name=layout-select]:checked").data("ids")+"").split(",");if(ids==""){jQuery(".ti-preview-boxes-container").find(".ti-full-width, .ti-half-width").fadeIn()}else{jQuery(".ti-preview-boxes-container").find(".ti-full-width, .ti-half-width").hide();ids.forEach(function(h){jQuery(".ti-preview-boxes-container").find('.ti-preview-boxes[data-layout-id="'+h+'"]').parent().fadeIn()})}return false});let is_stepping=false;jQuery(".ti-free-steps li.done, .ti-free-steps li.active").on("click",function(g){g.preventDefault();if(is_stepping){return false}is_stepping=true;window.location.href=jQuery(this).attr("href");return false});if(jQuery(".ti-free-steps li.current").length==0){jQuery(".ti-free-steps li.active:last").addClass("current")}jQuery(document).on("click",".btn-modal-close",function(g){g.preventDefault();jQuery(this).closest(".ti-modal").fadeOut()});jQuery(document).on("click",".ti-modal",function(g){if(g.target.nodeName!="A"){g.preventDefault();if(!jQuery(g.target).closest(".ti-modal-dialog").length){jQuery(this).fadeOut()}}});let highlight_modal=jQuery("#ti-highlight-modal");if(highlight_modal.length){let appendHiddenInputs=function(g){highlight_modal.find("input[type=hidden]").each(function(){let input=jQuery(this);g[input.attr("name")]=input.val()});return g};jQuery(document).on("click",".btn-highlight",function(g){g.preventDefault();let btn=jQuery(this);let review_box=btn.closest("tr").find(".ti-review-content");let raw_content=review_box.html();let content=raw_content.replace(/<mark class="ti-highlight">/g,"").replace(/<\/mark>/,"");highlight_modal.fadeIn();highlight_modal.find(".ti-highlight-content").html("<div class='raw-content'>"+raw_content+"</div><div class='selection-content'>"+content+"</div>");highlight_modal.find(".btn-highlight-confirm, .btn-highlight-remove").attr("href",btn.attr("href"));if(btn.hasClass("has-highlight")){highlight_modal.find(".btn-highlight-remove").show()}else{highlight_modal.find(".btn-highlight-remove").hide()}});jQuery(document).on("click",".btn-highlight-confirm",function(g){g.preventDefault();let btn=jQuery(this);let highlight_content=btn.closest(".ti-modal-content").find(".ti-highlight-content .selection-content");let data=TI_highlight_getSelection(highlight_content.get(0));if(data.start!==null){data.id=btn.attr("href");data["save-highlight"]=1;btn.css("pointer-events","none");btn.blur();btn.addClass("btn-disabled");TI_manage_dots(btn);btn.closest(".ti-modal").find(".btn-text").css("pointer-events","none");jQuery.ajax({method:"POST",url:window.location.href,data:appendHiddenInputs(data)}).always(function(){location.reload(true)})}});jQuery(document).on("click",".btn-highlight-remove",function(g){g.preventDefault();let btn=jQuery(this);let highlight_content=btn.closest(".ti-modal-content").find(".ti-highlight-content");let data=TI_highlight_getSelection(highlight_content.get(0));btn.css("pointer-events","none");btn.blur();btn.addClass("btn-disabled");TI_manage_dots(btn);btn.closest(".ti-modal").find(".btn-text").css("pointer-events","none");jQuery.ajax({method:"POST",url:window.location.href,data:appendHiddenInputs({id:btn.attr("href"),"save-highlight":1})}).always(function(){location.reload(true)})})}});function TI_manage_dots(a){let loading_text=a.data("loading-text");let num_of_dots=(a.html().match(new RegExp(/\./,"g"))||[]).length;let next_dots=[".","..","...",""];a.html(loading_text+next_dots[num_of_dots]);setTimeout(function(){TI_manage_dots(a)},1000)}function decodeHTMLEntities(a){let textArea=document.createElement("textarea");textArea.innerHTML=a;return textArea.value}function TI_copyTextToClipboard(c){c=decodeHTMLEntities(c);if(!navigator.clipboard){var b=document.createElement("textarea");b.value=c;b.style.position="fixed";document.body.appendChild(b);b.focus();b.select();try{var d=document.execCommand("copy")}catch(a){}document.body.removeChild(b);return}navigator.clipboard.writeText(c).then(function(){},function(e){})};
1
+ String.prototype.ucfirst=function(){return this.charAt(0).toUpperCase()+this.slice(1)};jQuery(document).ready(function(){jQuery(".ti-toggle-password").on("click",function(g){g.preventDefault();let icon=jQuery(this);let parent=icon.closest(".form-group, .ti-input-field");if(icon.hasClass("dashicons-visibility")){parent.find("input").attr("type","text");icon.removeClass("dashicons-visibility").addClass("dashicons-hidden")}else{parent.find("input").attr("type","password");icon.removeClass("dashicons-hidden").addClass("dashicons-visibility")}});let nav=jQuery("#trustindex-plugin-settings-page .nav-tab-wrapper");if(nav.length){let width=nav.find(".nav-tab-right").outerWidth();nav.css("padding-right",parseInt(width+5)+"px")}jQuery(".ti-toggle-opacity").css("opacity",1);jQuery("#trustindex-plugin-settings-page .btn-toggle").on("click",function(g){g.preventDefault();jQuery(jQuery(this).attr("href")).toggle();return false});jQuery(".btn-copy2clipboard").click(function(g){g.preventDefault();let obj=jQuery(jQuery(this).attr("href"));let text=obj.html()?obj.html():obj.val();TI_copyTextToClipboard(text)});var a=function(){let style_id=jQuery("#ti-style-id").val();let box=jQuery("#ti-review-list").closest(".ti-preview-box");if(["8","9","10","11","12","20","22"].indexOf(style_id)!=-1&&!b){box.css("width","30%")}else{if(["6","7","24","25","26","27","28","29","35"].indexOf(style_id)!=-1&&!b){box.css("width","50%")}else{box.css("width","auto")}}box.css("width",box.width())};jQuery(".ti-checkbox:not(.disabled)").on("click",function(){let checkbox=jQuery(this).find("input[type=checkbox], input[type=radio]");checkbox.prop("checked",!checkbox.prop("checked")).trigger("change");return false});jQuery(".ti-select").each(function(){let el=jQuery(this);let selected=el.find("ul li.selected");if(selected.length==0){selected=el.find("ul li:first")}el.data("value",selected.data("value")).find("font").html(selected.html())});jQuery(document).on("click",".ti-select",function(){let el=jQuery(this);el.toggleClass("active");if(el.hasClass("active")){jQuery(window).unbind().on("click",function(g){if(!jQuery(g.target).is(el)&&jQuery(g.target).closest(".ti-select").length==0){el.removeClass("active");jQuery(window).unbind()}})}});jQuery(document).on("click",".ti-select li",function(){let el=jQuery(this);el.parent().parent().data("value",el.data("value")).trigger("change").find("font").html(el.html());el.parent().find("li").removeClass("selected");el.addClass("selected")});var b=false;var f=jQuery("#ti-review-list .ti-widget").clone();f.find(".ti-review-item").each(function(){let el=jQuery(this);let rating=el.find(".ti-stars .ti-star.f, .stars .ti-star.f").length;if(el.find(".ti-recommendation-icon.positive").length){rating=5}else{if(el.find(".ti-recommendation-icon.negative").length){rating=1}}if(el.find(".ti-polarity-icon.positive").length){rating=5}else{if(el.find(".ti-polarity-icon.neutral").length){rating=3}else{if(el.find(".ti-polarity-icon.negative").length){rating=1}}}if(el.find(".ti-rating-box").length){rating=Math.round(parseFloat(el.find(".ti-rating-box").text())/2)}let selector=".ti-review-content";if(el.find(".ti-review-content .ti-inner").length){selector=".ti-review-content .ti-inner"}else{if(el.find(".ti-review-text").length){selector=".ti-review-text"}}el.attr("data-rating",rating);el.attr("data-empty",el.find(selector).text().trim()==""?1:0)});var e=function(){let platform=(jQuery("#ti-filter #show-star").data("platform")||"google").ucfirst();let el=jQuery('<div class="ti-widget" style="display: none"><div class="source-'+platform+'"><span class="ti-star f"></span><span class="ti-star e"></span></div></div>');el.append("body");jQuery("body").append(el);jQuery("#ti-filter .ti-star.e").css("background",el.find(".ti-star.e").css("background"));jQuery("#ti-filter .ti-star.f").css("background",el.find(".ti-star.f").css("background"));el.remove()};e();var d=function(){let layout_id=jQuery("#ti-review-list .ti-widget").data("layout-id");return[11,12,20,22,24,25,26,27,28,29,35].indexOf(layout_id)!=-1};var c=function(g){let style_id=jQuery("#ti-style-id").val();let stars=(jQuery("#ti-filter #show-star").data("value")+"").split(",").map(function(h){return parseInt(h)});let show_only_ratings=jQuery("#ti-filter-only-ratings").prop("checked");if(!jQuery("#ti-filter").length){stars=[1,2,3,4,5];show_only_ratings=false}jQuery(".ti-widget .ti-reviews-container-wrapper .ti-review-item").remove();let widget=document.querySelector(".ti-widget");widget.replaceWith(widget.cloneNode(true));let results=0;f.find(".ti-review-item").each(function(){let el=jQuery(this);if(stars.indexOf(el.data("rating"))!==-1){if(show_only_ratings&&el.data("empty")){return}if(["8","9","10","18","33"].indexOf(style_id)!=-1&&results>4){return}let clone=el.clone();jQuery("#ti-review-list .ti-widget .ti-reviews-container-wrapper").append(clone);clone.hide();clone.fadeIn();results++}});if(typeof Trustindex!="undefined"&&Trustindex.intervalPointer){clearInterval(Trustindex.intervalPointer)}if(results==0&&!d()){jQuery("#ti-review-list").hide().next().fadeIn();b=true}else{jQuery("#ti-review-list").fadeIn().next().hide();b=false;if(g===undefined){let dot_container=jQuery("#ti-review-list .ti-widget .ti-controls-dots");if(dot_container.length){let dot=dot_container.children(":first").clone();if(dot.length){dot_container.html(" "+dot.removeAttr("data-pager-state")[0].outerHTML+" ")}}}if(typeof Trustindex!="undefined"){Trustindex.pager_inited=true;Trustindex.init_pager(document.querySelectorAll(".ti-widget"));Trustindex.resize_widgets()}}if(g!==true){jQuery.post("",{command:"save-filter",filter:JSON.stringify({stars:stars,"only-ratings":show_only_ratings})})}a()};jQuery("#ti-filter #show-star").on("change",c);jQuery("#ti-filter-only-ratings").on("change",function(g){g.preventDefault();c();return false});if(f.length){c(true);a()}jQuery("#ti-style-id, #ti-set-id, #ti-lang-id, #ti-dateformat-id, #ti-widget-options input[type=checkbox]:not(.no-form-update)").on("change",function(){let form=jQuery(this).closest("form");let data=form.serializeArray();form.find("input[type=checkbox]:not(.no-form-update)").each(function(){let checkbox=jQuery(this);if(!checkbox.prop("checked")&&checkbox.attr("name")){data.push({name:checkbox.attr("name"),value:0})}});jQuery("li.ti-preview-box").addClass("disabled");jQuery.ajax({url:form.attr("action"),type:"post",dataType:"application/json",data:data}).always(function(){location.reload(true)});return false});jQuery("input[name=layout-select]").on("change",function(g){g.preventDefault();let ids=(jQuery("input[name=layout-select]:checked").data("ids")+"").split(",");if(ids==""){jQuery(".ti-preview-boxes-container").find(".ti-full-width, .ti-half-width").fadeIn()}else{jQuery(".ti-preview-boxes-container").find(".ti-full-width, .ti-half-width").hide();ids.forEach(function(h){jQuery(".ti-preview-boxes-container").find('.ti-preview-boxes[data-layout-id="'+h+'"]').parent().fadeIn()})}return false});let is_stepping=false;jQuery(".ti-free-steps li.done, .ti-free-steps li.active").on("click",function(g){g.preventDefault();if(is_stepping){return false}is_stepping=true;window.location.href=jQuery(this).attr("href");return false});if(jQuery(".ti-free-steps:not(.ti-setup-guide-steps) li.current").length==0){jQuery(".ti-free-steps:not(.ti-setup-guide-steps) li.active:last").addClass("current")}jQuery(document).on("click",".btn-modal-close",function(g){g.preventDefault();jQuery(this).closest(".ti-modal").fadeOut()});jQuery(document).on("click",".ti-modal",function(g){if(g.target.nodeName!="A"){g.preventDefault();if(!jQuery(g.target).closest(".ti-modal-dialog").length){jQuery(this).fadeOut()}}});let highlight_modal=jQuery("#ti-highlight-modal");if(highlight_modal.length){let appendHiddenInputs=function(g){highlight_modal.find("input[type=hidden]").each(function(){let input=jQuery(this);g[input.attr("name")]=input.val()});return g};jQuery(document).on("click",".btn-highlight",function(g){g.preventDefault();let btn=jQuery(this);let review_box=btn.closest("tr").find(".ti-review-content");let raw_content=review_box.html();let content=raw_content.replace(/<mark class="ti-highlight">/g,"").replace(/<\/mark>/,"");highlight_modal.fadeIn();highlight_modal.find(".ti-highlight-content").html("<div class='raw-content'>"+raw_content+"</div><div class='selection-content'>"+content+"</div>");highlight_modal.find(".btn-highlight-confirm, .btn-highlight-remove").attr("href",btn.attr("href"));if(btn.hasClass("has-highlight")){highlight_modal.find(".btn-highlight-remove").show()}else{highlight_modal.find(".btn-highlight-remove").hide()}});jQuery(document).on("click",".btn-highlight-confirm",function(g){g.preventDefault();let btn=jQuery(this);let highlight_content=btn.closest(".ti-modal-content").find(".ti-highlight-content .selection-content");let data=TI_highlight_getSelection(highlight_content.get(0));if(data.start!==null){data.id=btn.attr("href");data["save-highlight"]=1;btn.css("pointer-events","none");btn.blur();btn.addClass("btn-disabled");TI_manage_dots(btn);btn.closest(".ti-modal").find(".btn-text").css("pointer-events","none");jQuery.ajax({method:"POST",url:window.location.href,data:appendHiddenInputs(data)}).always(function(){location.reload(true)})}});jQuery(document).on("click",".btn-highlight-remove",function(g){g.preventDefault();let btn=jQuery(this);let highlight_content=btn.closest(".ti-modal-content").find(".ti-highlight-content");let data=TI_highlight_getSelection(highlight_content.get(0));btn.css("pointer-events","none");btn.blur();btn.addClass("btn-disabled");TI_manage_dots(btn);btn.closest(".ti-modal").find(".btn-text").css("pointer-events","none");jQuery.ajax({method:"POST",url:window.location.href,data:appendHiddenInputs({id:btn.attr("href"),"save-highlight":1})}).always(function(){location.reload(true)})})}jQuery(document).on("click","#ti-widget-nonce-notification .notice-dismiss",function(){let button=jQuery(this);if(!button.data("ajax-run")){button.data("ajax-run",1);jQuery.post("",{command:"save-widget-nonce-notice-hide"})}})});function TI_manage_dots(a){let loading_text=a.data("loading-text");let num_of_dots=(a.html().match(new RegExp(/\./,"g"))||[]).length;let next_dots=[".","..","...",""];a.html(loading_text+next_dots[num_of_dots]);setTimeout(function(){TI_manage_dots(a)},1000)}function decodeHTMLEntities(a){let textArea=document.createElement("textarea");textArea.innerHTML=a;return textArea.value}function TI_copyTextToClipboard(c){c=decodeHTMLEntities(c);if(!navigator.clipboard){var b=document.createElement("textarea");b.value=c;b.style.position="fixed";document.body.appendChild(b);b.focus();b.select();try{var d=document.execCommand("copy")}catch(a){}document.body.removeChild(b);return}navigator.clipboard.writeText(c).then(function(){},function(e){})};
static/js/admin-page-settings-connect.js CHANGED
@@ -1 +1 @@
1
- jQuery.fn.delayKeyup=function(e,b){var d=0;var c=jQuery(this);var a=c.val();c.on("input",function(f){if(a!=c.val()){a=c.val();clearTimeout(d);d=setTimeout(e,b)}});return jQuery(this)};var Trustindex_Autocomplete=null;jQuery(document).ready(function(){Trustindex_Autocomplete={box:jQuery("#trustindex-plugin-settings-page .autocomplete .results"),load:jQuery("#trustindex-plugin-settings-page .autocomplete .loading"),input:jQuery("#trustindex-plugin-settings-page .autocomplete input.name"),button:jQuery("#trustindex-plugin-settings-page .btn-search"),svg:{Hotels:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 298.666667h-341.333334v298.666666H128V213.333333H42.666667v640h85.333333v-128h768v128h85.333333v-384a170.666667 170.666667 0 0 0-170.666666-170.666666M298.666667 554.666667a128 128 0 0 0 128-128 128 128 0 0 0-128-128 128 128 0 0 0-128 128 128 128 0 0 0 128 128z" fill="" /></svg>',Restaurants:'<svg id="Layer_1" version="1.1" viewBox="0 0 30 30" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M23,19l-3.328-3.232C19.239,15.273,19,14.637,19,13.98V12c0-4.945,3.157-9.535,3.157-9.535L23,2.999V19z"/><circle cx="23" cy="3" r="1"/><path d="M24,3h-2l-1,10v13.5c0,0.828,0.672,1.5,1.5,1.5h0c0.828,0,1.5-0.672,1.5-1.5V3z"/><path d="M13.087,2.445C13.037,2.186,12.811,2,12.548,2C12.245,2,12,2.245,12,2.548v5.807C12,8.711,11.711,9,11.355,9 c-0.329,0-0.605-0.247-0.641-0.574l-0.66-5.939C10.023,2.21,9.789,2,9.509,2H9.5H9.491C9.211,2,8.977,2.21,8.946,2.488l-0.66,5.939 C8.25,8.753,7.974,9,7.645,9C7.289,9,7,8.711,7,8.355V2.548C7,2.245,6.755,2,6.452,2C6.189,2,5.963,2.186,5.913,2.445 C5.671,3.713,5,7.362,5,9c0,4,3,5,3,5v12.5C8,27.328,8.672,28,9.5,28s1.5-0.672,1.5-1.5V14c0,0,3-1,3-5 C14,7.362,13.329,3.713,13.087,2.445z"/></svg>',Attractions:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.333333 128.810667l43.008 0.149333c23.573333 0.085333 42.666667 19.413333 42.666667 42.816V213.333333H405.653333c0.298667-14.357333 0.106667-42.346667 0.106667-42.346666a42.197333 42.197333 0 0 1 42.56-42.496L490.666667 128.64V64a21.333333 21.333333 0 0 1 42.666666 0v64.810667zM726.677333 661.333333c85.482667 174.272 190.698667 277.333333 190.698667 277.333334H662.186667c-65.450667-148.181333-236.032-149.056-299.029334 0H105.088s105.173333-99.925333 191.146667-277.333334H234.666667a21.333333 21.333333 0 0 1 0-42.666666h554.666666a21.333333 21.333333 0 0 1 0 42.666666h-62.634666z m-103.872-362.666666c9.237333 102.464 34.346667 195.690667 66.304 277.333333H333.333333a1074.709333 1074.709333 0 0 0 66.986667-277.333333H362.666667a21.333333 21.333333 0 0 1 0-42.666667h298.666666a21.333333 21.333333 0 0 1 0 42.666667h-38.506666z" fill="#3D3D3D" /></svg>',LodgingBusiness:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 298.666667h-341.333334v298.666666H128V213.333333H42.666667v640h85.333333v-128h768v128h85.333333v-384a170.666667 170.666667 0 0 0-170.666666-170.666666M298.666667 554.666667a128 128 0 0 0 128-128 128 128 0 0 0-128-128 128 128 0 0 0-128 128 128 128 0 0 0 128 128z" fill="" /></svg>'},searching:false,cache:[],search:function(b){let query_term=Trustindex_Autocomplete.input.val();if(query_term.length<4){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("tooshorttext")+"</span>");Trustindex_Autocomplete.box.show();return false}if(Trustindex_Autocomplete.input.data("url")===undefined&&(query_term.substr(0,4)=="www."||query_term.substr(0,7)=="http://"||query_term.substr(0,8)=="https://")){Trustindex_Autocomplete.box.html("<span>This is an URL. "+Trustindex_Autocomplete.input.attr("placeholder")+"</span>");Trustindex_Autocomplete.box.show();return false}else{if(Trustindex_Autocomplete.input.data("url")===true&&(query_term.substr(0,4)=="www."||query_term.substr(0,7)=="http://"||query_term.substr(0,8)=="https://")&&Trustindex_Autocomplete.checkRegex&&!Trustindex_Autocomplete.checkRegex.test(query_term)){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("url-errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}}if(Trustindex_Autocomplete.searching){return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=query_term.trim();if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResults(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/searchPage",data:{q:query_term,platform:b},dataType:"jsonp",success:function(c){Trustindex_Autocomplete.cache[cache_term]=c;Trustindex_Autocomplete.showResults(c)}})},showResults:function(b){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(b.success&&b.result&&b.result.length){let html="";b.result.forEach(function(c){html+='<li class="result" data-page-id="'+c.page_id+'" data-name="'+c.name+'" data-type="'+c.type+'" data-url="'+c.url+'" data-address="'+c.address+'" data-avatar-url="'+(c.avatar_url||"")+'">'+(Trustindex_Autocomplete.svg[c.type]||"")+'<p class="title">'+c.name+'</p><p class="location">'+(c.address||c.url)+"</p></li>"});Trustindex_Autocomplete.box.html("<ul>"+html+"</ul>");Trustindex_Autocomplete.box.show()}else{if(b.success){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("noresultstext")+"</span>");Trustindex_Autocomplete.box.show()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show()}}},showResult:function(b,c){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(typeof c=="undefined"){c="errortext"}if(b.success&&b.result){let page_details={id:b.result.page_id,name:b.result.name,address:b.result.address,avatar_url:b.result.avatar_url};let form=jQuery("#submit-form");let div=form.find(".ti-selected-source");form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));div.find("img").attr("src",page_details.avatar_url);div.find("#label-noreg-page_name").html(page_details.name);if(page_details.address){div.find("#label-noreg-address").html(page_details.address+"<br />")}div.find("#label-noreg-url").html("<a target='_blank' href='"+b.result.url+"'>"+b.result.url+"</a>");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");div.fadeIn()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data(c)+"</span>");Trustindex_Autocomplete.box.show()}},check:function(){let input=jQuery("#trustindex-plugin-settings-page #page-link");if(!Trustindex_Autocomplete.checkRegex){return false}let m=Trustindex_Autocomplete.checkRegex.exec(input.val());if(!Trustindex_Autocomplete.checkRegexValid(m)){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}if(Trustindex_Autocomplete.searching){return false}let page_id=m[1];if(m[2]!==undefined&&m[2]){page_id+="|"+m[2]}if(page_id.trim()==""){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=page_id;if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResult(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/getPageDetails",data:{platform:jQuery("#submit-form").data("platform"),page_id:page_id},dataType:"jsonp",success:function(b){Trustindex_Autocomplete.cache[cache_term]=b;Trustindex_Autocomplete.showResult(b)}})},checkRegex:null,checkRegexValid:function(b){if(!b){return false}for(let i=0;i<b.length;i++){if(b[i]===""){return false}}return true}};if(Trustindex_Autocomplete.input.length){Trustindex_Autocomplete.input.delayKeyup(function(){Trustindex_Autocomplete.button.click()},650)}if(Trustindex_Autocomplete.button.length){Trustindex_Autocomplete.button.click(function(b){b.preventDefault();Trustindex_Autocomplete.search(Trustindex_Autocomplete.button.closest("form").data("platform"))})}jQuery(document).on("click","#trustindex-plugin-settings-page .autocomplete .results li[data-page-id]",function(){let selected_element=jQuery(this);let form=selected_element.closest("form");let div=form.find(".ti-selected-source");let page_details={id:selected_element.data("page-id"),name:selected_element.data("name"),address:selected_element.data("address"),avatar_url:selected_element.data("avatar-url")};form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));if(page_details.avatar_url){div.find("img").attr("src",page_details.avatar_url).show()}else{div.find("img").hide()}div.find("#label-noreg-page_name").html(selected_element.data("name"));div.find("#label-noreg-url").html("<a target='_blank' href='"+selected_element.data("url")+"'>"+selected_element.data("url")+"</a>");if(selected_element.data("address")){div.find("#label-noreg-address").html(selected_element.data("address")+"<br />")}Trustindex_Autocomplete.box.hide();div.fadeIn();Trustindex_Autocomplete.button.addClass("btn-default").removeClass("btn-primary")});jQuery("#trustindex-plugin-settings-page form:not([data-platform='facebook']) .btn-connect").click(function(b){let btn=jQuery(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);Trustindex_Autocomplete.button.css("pointer-events","none");jQuery("#trustindex-plugin-settings-page .btn-check").css("pointer-events","none")});jQuery("#trustindex-plugin-settings-page .btn-refresh").click(function(b){let btn=jQuery(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);jQuery("#trustindex-plugin-settings-page .btn").css("pointer-events","none")});jQuery("#trustindex-plugin-settings-page .btn-check").click(function(b){b.preventDefault();Trustindex_Autocomplete.check()});var a=[];jQuery("#ti-reg-email, #ti-reg-password").blur(function(){let email=jQuery("#ti-reg-email").val();if(jQuery.inArray(email,a)!=-1){jQuery("#txt-email-used").fadeIn();return false}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/userCheckEmail",data:{email:email,s:"wp"},dataType:"jsonp",success:function(b){if(b==-1){}else{if(b==0){jQuery("#txt-email-used").fadeOut()}else{let link=jQuery("#txt-email-used").find("a");link.html(link.html().replace("$email",email));jQuery("#txt-email-used").fadeIn();jQuery("#ti-reg-email").val("");a.push(email)}}}})});jQuery("#form-reg").submit(function(b){return !jQuery("#txt-email-used").is(":visible")})});
1
+ jQuery.fn.delayKeyup=function(e,b){var d=0;var c=jQuery(this);var a=c.val();c.on("input",function(f){if(a!=c.val()){a=c.val();clearTimeout(d);d=setTimeout(e,b)}});return jQuery(this)};var Trustindex_Autocomplete=null;jQuery(document).ready(function(){Trustindex_Autocomplete={box:jQuery("#trustindex-plugin-settings-page .autocomplete .results"),load:jQuery("#trustindex-plugin-settings-page .autocomplete .loading"),input:jQuery("#trustindex-plugin-settings-page .autocomplete input.name"),button:jQuery("#trustindex-plugin-settings-page .btn-search"),svg:{Hotels:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 298.666667h-341.333334v298.666666H128V213.333333H42.666667v640h85.333333v-128h768v128h85.333333v-384a170.666667 170.666667 0 0 0-170.666666-170.666666M298.666667 554.666667a128 128 0 0 0 128-128 128 128 0 0 0-128-128 128 128 0 0 0-128 128 128 128 0 0 0 128 128z" fill="" /></svg>',Restaurants:'<svg id="Layer_1" version="1.1" viewBox="0 0 30 30" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M23,19l-3.328-3.232C19.239,15.273,19,14.637,19,13.98V12c0-4.945,3.157-9.535,3.157-9.535L23,2.999V19z"/><circle cx="23" cy="3" r="1"/><path d="M24,3h-2l-1,10v13.5c0,0.828,0.672,1.5,1.5,1.5h0c0.828,0,1.5-0.672,1.5-1.5V3z"/><path d="M13.087,2.445C13.037,2.186,12.811,2,12.548,2C12.245,2,12,2.245,12,2.548v5.807C12,8.711,11.711,9,11.355,9 c-0.329,0-0.605-0.247-0.641-0.574l-0.66-5.939C10.023,2.21,9.789,2,9.509,2H9.5H9.491C9.211,2,8.977,2.21,8.946,2.488l-0.66,5.939 C8.25,8.753,7.974,9,7.645,9C7.289,9,7,8.711,7,8.355V2.548C7,2.245,6.755,2,6.452,2C6.189,2,5.963,2.186,5.913,2.445 C5.671,3.713,5,7.362,5,9c0,4,3,5,3,5v12.5C8,27.328,8.672,28,9.5,28s1.5-0.672,1.5-1.5V14c0,0,3-1,3-5 C14,7.362,13.329,3.713,13.087,2.445z"/></svg>',Attractions:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.333333 128.810667l43.008 0.149333c23.573333 0.085333 42.666667 19.413333 42.666667 42.816V213.333333H405.653333c0.298667-14.357333 0.106667-42.346667 0.106667-42.346666a42.197333 42.197333 0 0 1 42.56-42.496L490.666667 128.64V64a21.333333 21.333333 0 0 1 42.666666 0v64.810667zM726.677333 661.333333c85.482667 174.272 190.698667 277.333333 190.698667 277.333334H662.186667c-65.450667-148.181333-236.032-149.056-299.029334 0H105.088s105.173333-99.925333 191.146667-277.333334H234.666667a21.333333 21.333333 0 0 1 0-42.666666h554.666666a21.333333 21.333333 0 0 1 0 42.666666h-62.634666z m-103.872-362.666666c9.237333 102.464 34.346667 195.690667 66.304 277.333333H333.333333a1074.709333 1074.709333 0 0 0 66.986667-277.333333H362.666667a21.333333 21.333333 0 0 1 0-42.666667h298.666666a21.333333 21.333333 0 0 1 0 42.666667h-38.506666z" fill="#3D3D3D" /></svg>',LodgingBusiness:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 298.666667h-341.333334v298.666666H128V213.333333H42.666667v640h85.333333v-128h768v128h85.333333v-384a170.666667 170.666667 0 0 0-170.666666-170.666666M298.666667 554.666667a128 128 0 0 0 128-128 128 128 0 0 0-128-128 128 128 0 0 0-128 128 128 128 0 0 0 128 128z" fill="" /></svg>'},searching:false,cache:[],search:function(b){let query_term=Trustindex_Autocomplete.input.val();if(query_term.length<4){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("tooshorttext")+"</span>");Trustindex_Autocomplete.box.show();return false}if(Trustindex_Autocomplete.input.data("url")===undefined&&(query_term.substr(0,4)=="www."||query_term.substr(0,7)=="http://"||query_term.substr(0,8)=="https://")){Trustindex_Autocomplete.box.html("<span>This is an URL. "+Trustindex_Autocomplete.input.attr("placeholder")+"</span>");Trustindex_Autocomplete.box.show();return false}else{if(Trustindex_Autocomplete.input.data("url")===true&&(query_term.substr(0,4)=="www."||query_term.substr(0,7)=="http://"||query_term.substr(0,8)=="https://")&&Trustindex_Autocomplete.checkRegex&&!Trustindex_Autocomplete.checkRegex.test(query_term)){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("url-errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}}if(Trustindex_Autocomplete.searching){return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=query_term.trim();if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResults(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/searchPage",data:{q:query_term,platform:b},dataType:"jsonp",success:function(c){Trustindex_Autocomplete.cache[cache_term]=c;Trustindex_Autocomplete.showResults(c)}})},showResults:function(b){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(b.success&&b.result&&b.result.length){let html="";b.result.forEach(function(c){html+='<li class="result" data-page-id="'+c.page_id+'" data-name="'+c.name+'" data-type="'+c.type+'" data-url="'+c.url+'" data-address="'+c.address+'" data-avatar-url="'+(c.avatar_url||"")+'">'+(Trustindex_Autocomplete.svg[c.type]||"")+'<p class="title">'+c.name+'</p><p class="location">'+(c.address||c.url)+"</p></li>"});Trustindex_Autocomplete.box.html("<ul>"+html+"</ul>");Trustindex_Autocomplete.box.show()}else{if(b.success){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("noresultstext")+"</span>");Trustindex_Autocomplete.box.show()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show()}}},showResult:function(b,c){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(typeof c=="undefined"){c="errortext"}if(b.success&&b.result){let page_details={id:b.result.page_id,name:b.result.name,address:b.result.address,avatar_url:b.result.avatar_url};let form=jQuery("#submit-form");let div=form.find(".ti-selected-source");form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));div.find("img").attr("src",page_details.avatar_url);div.find("#label-noreg-page_name").html(page_details.name);if(page_details.address){div.find("#label-noreg-address").html(page_details.address+"<br />")}div.find("#label-noreg-url").html("<a target='_blank' href='"+b.result.url+"'>"+b.result.url+"</a>");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");div.fadeIn()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data(c)+"</span>");Trustindex_Autocomplete.box.show()}},check:function(){let input=jQuery("#trustindex-plugin-settings-page #page-link");if(!Trustindex_Autocomplete.checkRegex){return false}let m=Trustindex_Autocomplete.checkRegex.exec(input.val());if(!Trustindex_Autocomplete.checkRegexValid(m)){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}if(Trustindex_Autocomplete.searching){return false}let part1=m[1]||m[3];let part2=m[2]||m[4]||"";let page_id=part1;if(part2){page_id+="|"+part2}if(page_id.trim()==""){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=page_id;if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResult(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/getPageDetails",data:{platform:jQuery("#submit-form").data("platform"),page_id:page_id},dataType:"jsonp",success:function(b){Trustindex_Autocomplete.cache[cache_term]=b;Trustindex_Autocomplete.showResult(b)}})},checkRegex:null,checkRegexValid:function(b){if(!b){return false}for(let i=0;i<b.length;i++){if(b[i]===""){return false}}return true}};if(Trustindex_Autocomplete.input.length){Trustindex_Autocomplete.input.delayKeyup(function(){Trustindex_Autocomplete.button.click()},650)}if(Trustindex_Autocomplete.button.length){Trustindex_Autocomplete.button.click(function(b){b.preventDefault();Trustindex_Autocomplete.search(Trustindex_Autocomplete.button.closest("form").data("platform"))})}jQuery(document).on("click","#trustindex-plugin-settings-page .autocomplete .results li[data-page-id]",function(){let selected_element=jQuery(this);let form=selected_element.closest("form");let div=form.find(".ti-selected-source");let page_details={id:selected_element.data("page-id"),name:selected_element.data("name"),address:selected_element.data("address"),avatar_url:selected_element.data("avatar-url")};form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));if(page_details.avatar_url){div.find("img").attr("src",page_details.avatar_url).show()}else{div.find("img").hide()}div.find("#label-noreg-page_name").html(selected_element.data("name"));div.find("#label-noreg-url").html("<a target='_blank' href='"+selected_element.data("url")+"'>"+selected_element.data("url")+"</a>");if(selected_element.data("address")){div.find("#label-noreg-address").html(selected_element.data("address")+"<br />")}Trustindex_Autocomplete.box.hide();div.fadeIn();Trustindex_Autocomplete.button.addClass("btn-default").removeClass("btn-primary")});jQuery("#trustindex-plugin-settings-page form:not([data-platform='facebook']) .btn-connect").click(function(b){let btn=jQuery(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);Trustindex_Autocomplete.button.css("pointer-events","none");jQuery("#trustindex-plugin-settings-page .btn-check").css("pointer-events","none")});jQuery("#trustindex-plugin-settings-page .btn-refresh").click(function(b){let btn=jQuery(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);jQuery("#trustindex-plugin-settings-page .btn").css("pointer-events","none")});jQuery("#trustindex-plugin-settings-page .btn-check").click(function(b){b.preventDefault();Trustindex_Autocomplete.check()});var a=[];jQuery("#ti-reg-email, #ti-reg-password").blur(function(){let email=jQuery("#ti-reg-email").val();if(jQuery.inArray(email,a)!=-1){jQuery("#txt-email-used").fadeIn();return false}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/userCheckEmail",data:{email:email,s:"wp"},dataType:"jsonp",success:function(b){if(b==-1){}else{if(b==0){jQuery("#txt-email-used").fadeOut()}else{let link=jQuery("#txt-email-used").find("a");link.html(link.html().replace("$email",email));jQuery("#txt-email-used").fadeIn();jQuery("#ti-reg-email").val("");a.push(email)}}}})});jQuery("#form-reg").submit(function(b){return !jQuery("#txt-email-used").is(":visible")})});
tabs/demo_widgets.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ti-preview-boxes-container">
2
+ <?php foreach(TrustindexPlugin::$widget_templates['templates'] as $id => $template): ?>
3
+ <?php
4
+ $class_name = 'ti-full-width';
5
+ if(in_array($template['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
6
+ {
7
+ $class_name = 'ti-half-width';
8
+ }
9
+ if(!in_array($id, [ 17, 21 ]))
10
+ {
11
+ $random_set_id = array_rand(TrustindexPlugin::$widget_styles);
12
+ }
13
+ else
14
+ {
15
+ $random_set_id = 'light-background';
16
+ }
17
+ ?>
18
+ <div class="<?php echo esc_attr($class_name); ?>">
19
+ <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($id); ?>" data-set-id="<?php echo esc_attr($random_set_id); ?>">
20
+ <div class="ti-header">
21
+ <span class="ti-header-layout-text">
22
+ <?php echo TrustindexPlugin::___('More widget examples'); ?> -
23
+ <strong><?php echo esc_html(TrustindexPlugin::___($template['name'])); ?></strong>
24
+ <?php if(!in_array($id, [ 17, 21 ])): ?> (<?php echo esc_html(TrustindexPlugin::___(TrustindexPlugin::$widget_styles[$random_set_id])); ?>)<?php endif; ?>
25
+ </span>
26
+ </div>
27
+ <div class="preview">
28
+ <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $id, $random_set_id, true, true); ?>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <?php endforeach; ?>
33
+ </div>
tabs/setup_no_reg.php CHANGED
@@ -32,6 +32,14 @@
32
  </p>
33
  </div>
34
  <?php endif; ?>
 
 
 
 
 
 
 
 
35
  <?php
36
  $reviews = [];
37
  if($trustindex_pm_google->is_noreg_linked())
@@ -96,6 +104,7 @@ value=""
96
  <?php echo $trustindex_pm_google->get_trustindex_widget('2d9bf9019f8d93ad1430e9135'); ?>
97
  </div>
98
  </div>
 
99
  <?php elseif($current_step == 2 || !$style_id): ?>
100
  <h1 class="ti-free-title">
101
  2. <?php echo TrustindexPlugin::___('Select Layout'); ?>
@@ -107,39 +116,7 @@ value=""
107
  <?php echo TrustindexPlugin::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
108
  </p>
109
  </div>
110
- <div class="ti-preview-boxes-container">
111
- <?php foreach(TrustindexPlugin::$widget_templates['templates'] as $id => $template): ?>
112
- <?php
113
- $class_name = 'ti-full-width';
114
- if(in_array($template['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
115
- {
116
- $class_name = 'ti-half-width';
117
- }
118
- if(!in_array($id, [ 17, 21 ]))
119
- {
120
- $random_set_id = array_rand(TrustindexPlugin::$widget_styles);
121
- }
122
- else
123
- {
124
- $random_set_id = 'light-background';
125
- }
126
- ?>
127
- <div class="<?php echo esc_attr($class_name); ?>">
128
- <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($id); ?>" data-set-id="<?php echo esc_attr($random_set_id); ?>">
129
- <div class="ti-header">
130
- <span class="ti-header-layout-text">
131
- <?php echo TrustindexPlugin::___('More widget examples'); ?> -
132
- <strong><?php echo esc_html(TrustindexPlugin::___($template['name'])); ?></strong>
133
- <?php if(!in_array($id, [ 17, 21 ])): ?> (<?php echo esc_html(TrustindexPlugin::___(TrustindexPlugin::$widget_styles[$random_set_id])); ?>)<?php endif; ?>
134
- </span>
135
- </div>
136
- <div class="preview">
137
- <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $id, $random_set_id, true, true); ?>
138
- </div>
139
- </div>
140
- </div>
141
- <?php endforeach; ?>
142
- </div>
143
  <?php else: ?>
144
  <div class="ti-filter-row">
145
  <label><?php echo TrustindexPlugin::___('Layout'); ?>:</label>
32
  </p>
33
  </div>
34
  <?php endif; ?>
35
+ <?php if($show_nonce_notification): ?>
36
+ <div class="notice notice-warning is-dismissible" id="ti-widget-nonce-notification" style="margin: 0 0 15px 0">
37
+ <p>
38
+ <?php echo TrustindexPlugin::___("If the widgets are there, but still hidden:"); ?>
39
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=troubleshooting"><?php echo TrustindexPlugin::___("More info"); ?></a>
40
+ </p>
41
+ </div>
42
+ <?php endif; ?>
43
  <?php
44
  $reviews = [];
45
  if($trustindex_pm_google->is_noreg_linked())
104
  <?php echo $trustindex_pm_google->get_trustindex_widget('2d9bf9019f8d93ad1430e9135'); ?>
105
  </div>
106
  </div>
107
+
108
  <?php elseif($current_step == 2 || !$style_id): ?>
109
  <h1 class="ti-free-title">
110
  2. <?php echo TrustindexPlugin::___('Select Layout'); ?>
116
  <?php echo TrustindexPlugin::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
117
  </p>
118
  </div>
119
+ <?php include( plugin_dir_path(__FILE__ ) . "demo_widgets.php" ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  <?php else: ?>
121
  <div class="ti-filter-row">
122
  <label><?php echo TrustindexPlugin::___('Layout'); ?>:</label>
tabs/setup_no_reg_header.php CHANGED
@@ -1,7 +1,21 @@
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
  $ti_command = isset($_REQUEST['command']) ? sanitize_text_field($_REQUEST['command']) : null;
4
- if (!in_array($ti_command, array("save-page", "delete-page", "save-style", "save-filter", "save-set", "save-language", "save-dateformat", "save-options"))) { $ti_command = null; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  function trustindex_plugin_connect_page($page_details = null, $default_settings = true)
6
  {
7
  global $trustindex_pm_google;
@@ -250,6 +264,11 @@ delete_option( $trustindex_pm_google->get_option_name('review-content') );
250
  $trustindex_pm_google->noreg_save_css(true);
251
  exit;
252
  }
 
 
 
 
 
253
  $style_id = get_option( $trustindex_pm_google->get_option_name('style-id') );
254
  $scss_set = get_option( $trustindex_pm_google->get_option_name('scss-set') );
255
  $lang = get_option( $trustindex_pm_google->get_option_name('lang'), 'en');
@@ -371,4 +390,15 @@ case 'zillow':
371
  $example_url = 'https://www.zillow.com/profile/NealandNealTeam/#reviews';
372
  break;
373
  }
 
 
 
 
 
 
 
 
 
 
 
374
  ?>
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
  $ti_command = isset($_REQUEST['command']) ? sanitize_text_field($_REQUEST['command']) : null;
4
+ $ti_command_list = [
5
+ 'save-page',
6
+ 'delete-page',
7
+ 'save-style',
8
+ 'save-filter',
9
+ 'save-set',
10
+ 'save-language',
11
+ 'save-dateformat',
12
+ 'save-options',
13
+ 'save-widget-nonce-notice-hide'
14
+ ];
15
+ if(!in_array($ti_command, $ti_command_list))
16
+ {
17
+ $ti_command = null;
18
+ }
19
  function trustindex_plugin_connect_page($page_details = null, $default_settings = true)
20
  {
21
  global $trustindex_pm_google;
264
  $trustindex_pm_google->noreg_save_css(true);
265
  exit;
266
  }
267
+ elseif($ti_command == 'save-widget-nonce-notice-hide')
268
+ {
269
+ update_option( $trustindex_pm_google->get_option_name('widget-nonce-hidden-notification'), 1, false );
270
+ exit;
271
+ }
272
  $style_id = get_option( $trustindex_pm_google->get_option_name('style-id') );
273
  $scss_set = get_option( $trustindex_pm_google->get_option_name('scss-set') );
274
  $lang = get_option( $trustindex_pm_google->get_option_name('lang'), 'en');
390
  $example_url = 'https://www.zillow.com/profile/NealandNealTeam/#reviews';
391
  break;
392
  }
393
+ $installed_plugins = array_keys(get_plugins());
394
+ $show_nonce_notification = (
395
+ $scss_set
396
+ && !get_option($trustindex_pm_google->get_option_name('widget-nonce-hidden-notification'), 0)
397
+ && get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1)
398
+ && (
399
+ in_array('wp-super-cache/wp-super-cache.php', $installed_plugins)
400
+ || in_array('w3-total-cache/w3-total-cache.php', $installed_plugins)
401
+ || in_array('wp-rocket/wp-rocket.php', $installed_plugins)
402
+ )
403
+ );
404
  ?>
tabs/troubleshooting.php CHANGED
@@ -17,9 +17,16 @@ update_option('auto_update_plugins', $auto_updates, false);
17
  header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
18
  exit;
19
  }
 
 
 
 
 
 
20
  $yes_icon = '<span class="dashicons dashicons-yes-alt"></span>';
21
  $no_icon = '<span class="dashicons dashicons-dismiss"></span>';
22
- $plugin_updated = ($trustindex_pm_google->get_plugin_current_version() <= "7.2");
 
23
  ?>
24
  <div class="ti-box">
25
  <div class="ti-header"><?php echo TrustindexPlugin::___("Troubleshooting"); ?></div>
@@ -55,6 +62,32 @@ $plugin_updated = ($trustindex_pm_google->get_plugin_current_version() <= "7.2")
55
  </li>
56
  </ul>
57
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  </ul>
59
  </li>
60
  <li>
@@ -137,7 +170,7 @@ unset($option['reviews']);
137
  }
138
  echo esc_html(str_replace("\n", "\n\t\t", print_r($option, true)));
139
  }
140
- else if($opt_name == 'download-timestamp')
141
  {
142
  echo date('Y-m-d H:i:s', esc_html($option));
143
  }
17
  header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
18
  exit;
19
  }
20
+ if(isset($_GET['toggle_widget_nonce']))
21
+ {
22
+ update_option($trustindex_pm_google->get_option_name('widget-nonce'), intval($_GET['toggle_widget_nonce']), false);
23
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
24
+ exit;
25
+ }
26
  $yes_icon = '<span class="dashicons dashicons-yes-alt"></span>';
27
  $no_icon = '<span class="dashicons dashicons-dismiss"></span>';
28
+ $plugin_updated = ($trustindex_pm_google->get_plugin_current_version() <= "7.3");
29
+ $widget_nonce = get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1);
30
  ?>
31
  <div class="ti-box">
32
  <div class="ti-header"><?php echo TrustindexPlugin::___("Troubleshooting"); ?></div>
62
  </li>
63
  </ul>
64
  </li>
65
+ <li>
66
+ <?php echo TrustindexPlugin::___("If the widgets are there, but still hidden:"); ?>
67
+ <ul>
68
+ <li>
69
+ <span class="ti-checkbox row">
70
+ <input type="checkbox" id="ti-widget-nonce" value="1" <?php if($widget_nonce): ?>checked<?php endif;?> onchange="window.location.href = '?page=<?php echo sanitize_text_field($_GET['page']); ?>&tab=troubleshooting&toggle_widget_nonce=' + (this.checked ? 1 : 0)">
71
+ <label><?php echo TrustindexPlugin::___("Use 'nonce' for more secure AJAX (background) methods."); ?></label>
72
+ </span>
73
+ </li>
74
+ <li><a href="#" onclick="jQuery('#ti-nonce-list-wp-rocket').toggle(); return false;">WP Rocket</a>
75
+ <ol id="ti-nonce-list-wp-rocket" style="display: none; list-style: none">
76
+ <li><?php echo TrustindexPlugin::___('More info: %s', [ '<a href="https://docs.wp-rocket.me/article/975-nonces-and-cache-lifespan" target="_blank">https://docs.wp-rocket.me/article/975-nonces-and-cache-lifespan</a>' ]); ?></li>
77
+ </ol>
78
+ </li>
79
+ <li><a href="#" onclick="jQuery('#ti-nonce-list-wp-super-cache').toggle(); return false;">WP Super Cache</a>
80
+ <ol id="ti-nonce-list-wp-super-cache" style="display: none; list-style: none">
81
+ <li><?php echo TrustindexPlugin::___('Switch off the cache on the pages, you are using our free widgets.'); ?></li>
82
+ </ol>
83
+ </li>
84
+ <li><a href="#" onclick="jQuery('#ti-nonce-list-general-solution').toggle(); return false;">General solution</a>
85
+ <ol id="ti-nonce-list-general-solution" style="display: none; list-style: none">
86
+ <li><?php echo TrustindexPlugin::___('More info: %s', [ '<a href="https://docs.wp-rocket.me/article/975-nonces-and-cache-lifespan" target="_blank">https://docs.wp-rocket.me/article/975-nonces-and-cache-lifespan</a>' ]); ?></li>
87
+ </ol>
88
+ </li>
89
+ </ul>
90
+ </li>
91
  </ul>
92
  </li>
93
  <li>
170
  }
171
  echo esc_html(str_replace("\n", "\n\t\t", print_r($option, true)));
172
  }
173
+ else if($opt_name == 'download-timestamp' && $option)
174
  {
175
  echo date('Y-m-d H:i:s', esc_html($option));
176
  }
trustindex-plugin.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- /* GENERATED: 1634327371 */
3
  class TrustindexPlugin
4
  {
5
  private $plugin_file_path;
@@ -241,7 +241,9 @@ return [
241
  'widget-setted-up',
242
  'disable-font',
243
  'show-logos',
244
- 'show-stars'
 
 
245
  ];
246
  }
247
  public function get_platforms()
@@ -371,7 +373,7 @@ $chosed_platform_slug = $this->plugin_slugs[ $force_platform ];
371
  $current_platform_slug = $this->plugin_slugs[ $this->shortname ];
372
  $file_path = preg_replace('/\/[^\/]+\/trustindex-plugin\.class\.php/', "/$chosed_platform_slug/trustindex-plugin.class.php", $file_path);
373
  }
374
- $chosed_platform = new TrustindexPlugin($force_platform, $file_path, "do-not-care-7.2", "do-not-care-Widgets for Google Reviews", "do-not-care-Google");
375
  if(!$chosed_platform->is_noreg_linked() || !$chosed_platform->is_noreg_table_exists($force_platform))
376
  {
377
  return self::get_alertbox(
@@ -733,6 +735,7 @@ public static $widget_languages = [
733
  'sq' => 'Shqip',
734
  'af' => 'Afrikaans',
735
  'az' => 'Azərbaycan dili',
 
736
  ];
737
  public static $widget_dateformats = [ 'j. F, Y.', 'F j, Y.', 'Y.m.d.', 'Y-m-d', 'd/m/Y' ];
738
  private static $widget_rating_texts = array (
@@ -1072,6 +1075,14 @@ private static $widget_rating_texts = array (
1072
  3 => 'yaxşı',
1073
  4 => 'əla',
1074
  ),
 
 
 
 
 
 
 
 
1075
  );
1076
  private static $widget_recommendation_texts = array (
1077
  'en' =>
@@ -1284,6 +1295,11 @@ private static $widget_recommendation_texts = array (
1284
  'negative' => 'NOT_RECOMMEND_ICON tövsiyə etmir',
1285
  'positive' => 'RECOMMEND_ICON tövsiyə edir',
1286
  ),
 
 
 
 
 
1287
  );
1288
  private static $widget_verified_texts = array (
1289
  'en' => 'Verified',
@@ -1328,6 +1344,7 @@ private static $widget_verified_texts = array (
1328
  'sq' => 'Verifikuar',
1329
  'af' => 'Geverifieer',
1330
  'az' => 'Doğrulanmışdır',
 
1331
  );
1332
  private static $widget_month_names = array (
1333
  'en' =>
@@ -1960,6 +1977,21 @@ private static $widget_month_names = array (
1960
  10 => 'Noyabr',
1961
  11 => 'Dekabr',
1962
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1963
  );
1964
  private static $page_urls = array (
1965
  'facebook' => 'https://www.facebook.com/pg/%page_id%',
1
  <?php
2
+ /* GENERATED: 1634976944 */
3
  class TrustindexPlugin
4
  {
5
  private $plugin_file_path;
241
  'widget-setted-up',
242
  'disable-font',
243
  'show-logos',
244
+ 'show-stars',
245
+ 'widget-nonce',
246
+ 'widget-nonce-hidden-notification'
247
  ];
248
  }
249
  public function get_platforms()
373
  $current_platform_slug = $this->plugin_slugs[ $this->shortname ];
374
  $file_path = preg_replace('/\/[^\/]+\/trustindex-plugin\.class\.php/', "/$chosed_platform_slug/trustindex-plugin.class.php", $file_path);
375
  }
376
+ $chosed_platform = new TrustindexPlugin($force_platform, $file_path, "do-not-care-7.3", "do-not-care-Widgets for Google Reviews", "do-not-care-Google");
377
  if(!$chosed_platform->is_noreg_linked() || !$chosed_platform->is_noreg_table_exists($force_platform))
378
  {
379
  return self::get_alertbox(
735
  'sq' => 'Shqip',
736
  'af' => 'Afrikaans',
737
  'az' => 'Azərbaycan dili',
738
+ 'bn' => 'বাংলা',
739
  ];
740
  public static $widget_dateformats = [ 'j. F, Y.', 'F j, Y.', 'Y.m.d.', 'Y-m-d', 'd/m/Y' ];
741
  private static $widget_rating_texts = array (
1075
  3 => 'yaxşı',
1076
  4 => 'əla',
1077
  ),
1078
+ 'bn' =>
1079
+ array (
1080
+ 0 => 'দরিদ্র',
1081
+ 1 => 'গড়ের নিচে',
1082
+ 2 => 'গড়',
1083
+ 3 => 'ভাল',
1084
+ 4 => 'চমৎকার',
1085
+ ),
1086
  );
1087
  private static $widget_recommendation_texts = array (
1088
  'en' =>
1295
  'negative' => 'NOT_RECOMMEND_ICON tövsiyə etmir',
1296
  'positive' => 'RECOMMEND_ICON tövsiyə edir',
1297
  ),
1298
+ 'bn' =>
1299
+ array (
1300
+ 'negative' => 'NOT_RECOMMEND_ICON সুপারিশ করে না',
1301
+ 'positive' => 'RECOMMEND_ICON সুপারিশ করে',
1302
+ ),
1303
  );
1304
  private static $widget_verified_texts = array (
1305
  'en' => 'Verified',
1344
  'sq' => 'Verifikuar',
1345
  'af' => 'Geverifieer',
1346
  'az' => 'Doğrulanmışdır',
1347
+ 'bn' => 'যাচাই',
1348
  );
1349
  private static $widget_month_names = array (
1350
  'en' =>
1977
  10 => 'Noyabr',
1978
  11 => 'Dekabr',
1979
  ),
1980
+ 'bn' =>
1981
+ array (
1982
+ 0 => 'জানুয়ারি',
1983
+ 1 => 'ফেব্রুয়ারি',
1984
+ 2 => 'মার্চ',
1985
+ 3 => 'এপ্রিল',
1986
+ 4 => 'মে',
1987
+ 5 => 'জুন',
1988
+ 6 => 'জুলাই',
1989
+ 7 => 'আগস্ট',
1990
+ 8 => 'সেপ্টেম্বর',
1991
+ 9 => 'অক্টোবর',
1992
+ 10 => 'নভেম্বর',
1993
+ 11 => 'ডিসেম্বর',
1994
+ ),
1995
  );
1996
  private static $page_urls = array (
1997
  'facebook' => 'https://www.facebook.com/pg/%page_id%',
uninstall.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
  require_once plugin_dir_path( __FILE__ ) . 'plugin-load.php';
3
- $trustindex_pm_google = new TrustindexPlugin("google", __FILE__, "7.2", "Widgets for Google Reviews", "Google");
4
  $trustindex_pm_google->uninstall();
5
  ?>
1
  <?php
2
  require_once plugin_dir_path( __FILE__ ) . 'plugin-load.php';
3
+ $trustindex_pm_google = new TrustindexPlugin("google", __FILE__, "7.3", "Widgets for Google Reviews", "Google");
4
  $trustindex_pm_google->uninstall();
5
  ?>
wp-reviews-plugin-for-google.php CHANGED
@@ -9,7 +9,7 @@ Author: Trustindex.io <support@trustindex.io>
9
  Author URI: https://www.trustindex.io/
10
  Contributors: trustindex
11
  License: GPLv2 or later
12
- Version: 7.2
13
  Text Domain: wp-reviews-plugin-for-google
14
  Domain Path: /languages/
15
  Donate link: https://www.trustindex.io/prices/
@@ -25,7 +25,7 @@ $plugin_slug = $tmp[ count($tmp) - 2 ];
25
  if(1)
26
  {
27
  require_once plugin_dir_path( __FILE__ ) . 'plugin-load.php';
28
- $trustindex_pm_google = new TrustindexPlugin("google", __FILE__, "7.2", "Widgets for Google Reviews", "Google");
29
  }
30
  register_activation_hook(__FILE__, array($trustindex_pm_google, 'activate'));
31
  register_deactivation_hook(__FILE__, array($trustindex_pm_google, 'deactivate'));
@@ -45,18 +45,26 @@ if($trustindex_pm_google->is_noreg_linked() && $widget_css_google)
45
  add_action('wp_enqueue_scripts', function() {
46
  global $trustindex_pm_google;
47
  wp_enqueue_script('trustindex-frontend-js-google', $trustindex_pm_google->get_plugin_file_url('static/js/frontend.js'), [ 'jquery' ], false, true );
48
- wp_localize_script('trustindex-frontend-js-google', 'WidgetCssgoogle', [
49
  'ajaxurl' => admin_url('admin-ajax.php'),
50
- 'security' => wp_create_nonce('frontend-nonce-google'),
51
  'action' => 'widget_css_google',
52
  'selector' => '.ti-widget.ti-' . substr($trustindex_pm_google->shortname, 0, 4)
53
- ]);
 
 
 
 
 
54
  });
55
  add_action('wp_ajax_nopriv_widget_css_google', 'trustindex_widget_css_google');
56
  add_action('wp_ajax_widget_css_google', 'trustindex_widget_css_google');
57
  function trustindex_widget_css_google() {
 
58
  global $widget_css_google;
59
- check_ajax_referer('frontend-nonce-google', 'security');
 
 
 
60
  echo $widget_css_google;
61
  exit;
62
  }
9
  Author URI: https://www.trustindex.io/
10
  Contributors: trustindex
11
  License: GPLv2 or later
12
+ Version: 7.3
13
  Text Domain: wp-reviews-plugin-for-google
14
  Domain Path: /languages/
15
  Donate link: https://www.trustindex.io/prices/
25
  if(1)
26
  {
27
  require_once plugin_dir_path( __FILE__ ) . 'plugin-load.php';
28
+ $trustindex_pm_google = new TrustindexPlugin("google", __FILE__, "7.3", "Widgets for Google Reviews", "Google");
29
  }
30
  register_activation_hook(__FILE__, array($trustindex_pm_google, 'activate'));
31
  register_deactivation_hook(__FILE__, array($trustindex_pm_google, 'deactivate'));
45
  add_action('wp_enqueue_scripts', function() {
46
  global $trustindex_pm_google;
47
  wp_enqueue_script('trustindex-frontend-js-google', $trustindex_pm_google->get_plugin_file_url('static/js/frontend.js'), [ 'jquery' ], false, true );
48
+ $data = [
49
  'ajaxurl' => admin_url('admin-ajax.php'),
 
50
  'action' => 'widget_css_google',
51
  'selector' => '.ti-widget.ti-' . substr($trustindex_pm_google->shortname, 0, 4)
52
+ ];
53
+ if(get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1))
54
+ {
55
+ $data['security'] = wp_create_nonce('frontend-nonce-$platform_type');
56
+ }
57
+ wp_localize_script('trustindex-frontend-js-google', 'WidgetCssgoogle', $data);
58
  });
59
  add_action('wp_ajax_nopriv_widget_css_google', 'trustindex_widget_css_google');
60
  add_action('wp_ajax_widget_css_google', 'trustindex_widget_css_google');
61
  function trustindex_widget_css_google() {
62
+ global $trustindex_pm_google;
63
  global $widget_css_google;
64
+ if(get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1))
65
+ {
66
+ check_ajax_referer('frontend-nonce-$platform_type', 'security');
67
+ }
68
  echo $widget_css_google;
69
  exit;
70
  }