Widgets for Google Reviews - Version 7.9

Version Description

Download this release

Release Info

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

Code changes from version 7.8 to 7.9

Files changed (196) 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-bs_BA.mo +0 -0
  9. languages/trustindex-cs_CZ.mo +0 -0
  10. languages/trustindex-cy.mo +0 -0
  11. languages/trustindex-da_DK.mo +0 -0
  12. languages/trustindex-de_AT.mo +0 -0
  13. languages/trustindex-de_CH.mo +0 -0
  14. languages/trustindex-de_CH_informal.mo +0 -0
  15. languages/trustindex-de_DE.mo +0 -0
  16. languages/trustindex-de_DE_formal.mo +0 -0
  17. languages/trustindex-el.mo +0 -0
  18. languages/trustindex-es_AR.mo +0 -0
  19. languages/trustindex-es_CL.mo +0 -0
  20. languages/trustindex-es_CO.mo +0 -0
  21. languages/trustindex-es_CR.mo +0 -0
  22. languages/trustindex-es_ES.mo +0 -0
  23. languages/trustindex-es_GT.mo +0 -0
  24. languages/trustindex-es_MX.mo +0 -0
  25. languages/trustindex-es_PE.mo +0 -0
  26. languages/trustindex-es_PR.mo +0 -0
  27. languages/trustindex-es_UY.mo +0 -0
  28. languages/trustindex-es_VE.mo +0 -0
  29. languages/trustindex-et.mo +0 -0
  30. languages/trustindex-fa_AF.mo +0 -0
  31. languages/trustindex-fa_IR.mo +0 -0
  32. languages/trustindex-fi.mo +0 -0
  33. languages/trustindex-fr_BR.mo +0 -0
  34. languages/trustindex-fr_CA.mo +0 -0
  35. languages/trustindex-fr_FR.mo +0 -0
  36. languages/trustindex-gd.mo +0 -0
  37. languages/trustindex-gl_ES.mo +0 -0
  38. languages/trustindex-he_IL.mo +0 -0
  39. languages/trustindex-hi_IN.mo +0 -0
  40. languages/trustindex-hr.mo +0 -0
  41. languages/trustindex-hu_HU.mo +0 -0
  42. languages/trustindex-hy.mo +0 -0
  43. languages/trustindex-id_ID.mo +0 -0
  44. languages/trustindex-is_IS.mo +0 -0
  45. languages/trustindex-it_IT.mo +0 -0
  46. languages/trustindex-ja.mo +0 -0
  47. languages/trustindex-ko_KR.mo +0 -0
  48. languages/trustindex-lt_LT.mo +0 -0
  49. languages/trustindex-mk_MK.mo +0 -0
  50. languages/trustindex-ms_MY.mo +0 -0
  51. languages/trustindex-nb_NO.mo +0 -0
  52. languages/trustindex-nl_BE.mo +0 -0
  53. languages/trustindex-nl_NL.mo +0 -0
  54. languages/trustindex-nl_NL_formal.mo +0 -0
  55. languages/trustindex-nn_NO.mo +0 -0
  56. languages/trustindex-pl_PL.mo +0 -0
  57. languages/trustindex-pt_AO.mo +0 -0
  58. languages/trustindex-pt_BR.mo +0 -0
  59. languages/trustindex-pt_PT.mo +0 -0
  60. languages/trustindex-pt_PT_ao90.mo +0 -0
  61. languages/trustindex-ro_RO.mo +0 -0
  62. languages/trustindex-ru_RU.mo +0 -0
  63. languages/trustindex-sk_SK.mo +0 -0
  64. languages/trustindex-sl_SI.mo +0 -0
  65. languages/trustindex-sq.mo +0 -0
  66. languages/trustindex-sr_RS.mo +0 -0
  67. languages/trustindex-sv_SE.mo +0 -0
  68. languages/trustindex-th.mo +0 -0
  69. languages/trustindex-tr_TR.mo +0 -0
  70. languages/trustindex-uk.mo +0 -0
  71. languages/trustindex-vi.mo +0 -0
  72. languages/trustindex-zh_CN.mo +0 -0
  73. languages/trustindex-zh_HK.mo +0 -0
  74. languages/trustindex-zh_TW.mo +0 -0
  75. readme.txt +3 -3
  76. tabs/setup_no_reg.php +0 -16
  77. tabs/setup_no_reg_header.php +16 -17
  78. tabs/troubleshooting.php +16 -10
  79. trunk/languages/trustindex-af.mo +0 -0
  80. trunk/languages/trustindex-ar.mo +0 -0
  81. trunk/languages/trustindex-ary.mo +0 -0
  82. trunk/languages/trustindex-az.mo +0 -0
  83. trunk/languages/trustindex-azb.mo +0 -0
  84. trunk/languages/trustindex-bg_BG.mo +0 -0
  85. trunk/languages/trustindex-bn_BD.mo +0 -0
  86. trunk/languages/trustindex-bs_BA.mo +0 -0
  87. trunk/languages/trustindex-cs_CZ.mo +0 -0
  88. trunk/languages/trustindex-cy.mo +0 -0
  89. trunk/languages/trustindex-da_DK.mo +0 -0
  90. trunk/languages/trustindex-de_AT.mo +0 -0
  91. trunk/languages/trustindex-de_CH.mo +0 -0
  92. trunk/languages/trustindex-de_CH_informal.mo +0 -0
  93. trunk/languages/trustindex-de_DE.mo +0 -0
  94. trunk/languages/trustindex-de_DE_formal.mo +0 -0
  95. trunk/languages/trustindex-el.mo +0 -0
  96. trunk/languages/trustindex-es_AR.mo +0 -0
  97. trunk/languages/trustindex-es_CL.mo +0 -0
  98. trunk/languages/trustindex-es_CO.mo +0 -0
  99. trunk/languages/trustindex-es_CR.mo +0 -0
  100. trunk/languages/trustindex-es_ES.mo +0 -0
  101. trunk/languages/trustindex-es_GT.mo +0 -0
  102. trunk/languages/trustindex-es_MX.mo +0 -0
  103. trunk/languages/trustindex-es_PE.mo +0 -0
  104. trunk/languages/trustindex-es_PR.mo +0 -0
  105. trunk/languages/trustindex-es_UY.mo +0 -0
  106. trunk/languages/trustindex-es_VE.mo +0 -0
  107. trunk/languages/trustindex-et.mo +0 -0
  108. trunk/languages/trustindex-fa_AF.mo +0 -0
  109. trunk/languages/trustindex-fa_IR.mo +0 -0
  110. trunk/languages/trustindex-fi.mo +0 -0
  111. trunk/languages/trustindex-fr_BR.mo +0 -0
  112. trunk/languages/trustindex-fr_CA.mo +0 -0
  113. trunk/languages/trustindex-fr_FR.mo +0 -0
  114. trunk/languages/trustindex-gd.mo +0 -0
  115. trunk/languages/trustindex-gl_ES.mo +0 -0
  116. trunk/languages/trustindex-he_IL.mo +0 -0
  117. trunk/languages/trustindex-hi_IN.mo +0 -0
  118. trunk/languages/trustindex-hr.mo +0 -0
  119. trunk/languages/trustindex-hu_HU.mo +0 -0
  120. trunk/languages/trustindex-hy.mo +0 -0
  121. trunk/languages/trustindex-id_ID.mo +0 -0
  122. trunk/languages/trustindex-is_IS.mo +0 -0
  123. trunk/languages/trustindex-it_IT.mo +0 -0
  124. trunk/languages/trustindex-ja.mo +0 -0
  125. trunk/languages/trustindex-ko_KR.mo +0 -0
  126. trunk/languages/trustindex-lt_LT.mo +0 -0
  127. trunk/languages/trustindex-mk_MK.mo +0 -0
  128. trunk/languages/trustindex-ms_MY.mo +0 -0
  129. trunk/languages/trustindex-nb_NO.mo +0 -0
  130. trunk/languages/trustindex-nl_BE.mo +0 -0
  131. trunk/languages/trustindex-nl_NL.mo +0 -0
  132. trunk/languages/trustindex-nl_NL_formal.mo +0 -0
  133. trunk/languages/trustindex-nn_NO.mo +0 -0
  134. trunk/languages/trustindex-pl_PL.mo +0 -0
  135. trunk/languages/trustindex-pt_AO.mo +0 -0
  136. trunk/languages/trustindex-pt_BR.mo +0 -0
  137. trunk/languages/trustindex-pt_PT.mo +0 -0
  138. trunk/languages/trustindex-pt_PT_ao90.mo +0 -0
  139. trunk/languages/trustindex-ro_RO.mo +0 -0
  140. trunk/languages/trustindex-ru_RU.mo +0 -0
  141. trunk/languages/trustindex-sk_SK.mo +0 -0
  142. trunk/languages/trustindex-sl_SI.mo +0 -0
  143. trunk/languages/trustindex-sq.mo +0 -0
  144. trunk/languages/trustindex-sr_RS.mo +0 -0
  145. trunk/languages/trustindex-sv_SE.mo +0 -0
  146. trunk/languages/trustindex-th.mo +0 -0
  147. trunk/languages/trustindex-tr_TR.mo +0 -0
  148. trunk/languages/trustindex-uk.mo +0 -0
  149. trunk/languages/trustindex-vi.mo +0 -0
  150. trunk/languages/trustindex-zh_CN.mo +0 -0
  151. trunk/languages/trustindex-zh_HK.mo +0 -0
  152. trunk/languages/trustindex-zh_TW.mo +0 -0
  153. trunk/plugin-load.php +0 -24
  154. trunk/readme.txt +0 -228
  155. trunk/settings.php +0 -223
  156. trunk/static/block-editor/block-editor.js +0 -1
  157. trunk/static/block-editor/block-editor.php +0 -101
  158. trunk/static/css/admin-editor.css +0 -2
  159. trunk/static/css/admin-page-settings.css +0 -1
  160. trunk/static/css/admin-widget.css +0 -11
  161. trunk/static/img/check-icon.svg +0 -24
  162. trunk/static/img/help-where-is-id.jpg +0 -0
  163. trunk/static/img/no.png +0 -0
  164. trunk/static/img/platform/logo-dark.svg +0 -1
  165. trunk/static/img/platform/logo.svg +0 -1
  166. trunk/static/img/platforms.png +0 -0
  167. trunk/static/img/special_30.jpg +0 -0
  168. trunk/static/img/trustindex-sign-logo.png +0 -0
  169. trunk/static/img/trustindex.svg +0 -1
  170. trunk/static/img/yes.png +0 -0
  171. trunk/static/js/admin-editor.js +0 -1
  172. trunk/static/js/admin-page-settings-common.js +0 -1
  173. trunk/static/js/admin-page-settings-connect.js +0 -1
  174. trunk/static/js/admin-page-settings.js +0 -1
  175. trunk/static/js/admin-popup.js +0 -1
  176. trunk/static/js/admin-widget.js +0 -1
  177. trunk/static/js/frontend.js +0 -1
  178. trunk/tabs/demo_widgets.php +0 -33
  179. trunk/tabs/get_reviews.php +0 -35
  180. trunk/tabs/my_reviews.php +0 -182
  181. trunk/tabs/rate.php +0 -24
  182. trunk/tabs/setup_no_reg.php +0 -415
  183. trunk/tabs/setup_no_reg_header.php +0 -401
  184. trunk/tabs/setup_no_reg_platform.php +0 -18
  185. trunk/tabs/setup_trustindex.php +0 -36
  186. trunk/tabs/setup_trustindex_join.php +0 -180
  187. trunk/tabs/troubleshooting.php +0 -216
  188. trunk/tabs/woocommerce.php +0 -3
  189. trunk/trustindex-google-widget.class.php +0 -132
  190. trunk/trustindex-plugin.class.php +0 -3209
  191. trunk/uninstall.php +0 -5
  192. trunk/wp-reviews-plugin-for-google.php +0 -152
  193. trustindex-google-widget.class.php +1 -1
  194. trustindex-plugin.class.php +95 -15
  195. uninstall.php +1 -1
  196. wp-reviews-plugin-for-google.php +4 -33
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 CHANGED
Binary file
languages/trustindex-bs_BA.mo CHANGED
Binary file
languages/trustindex-cs_CZ.mo CHANGED
Binary file
languages/trustindex-cy.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-fa_AF.mo CHANGED
Binary file
languages/trustindex-fa_IR.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-gl_ES.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-hy.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
@@ -3,9 +3,9 @@ Contributors: trustindex
3
  Donate link: https://www.trustindex.io/prices/
4
  Tags: google, google places reviews, reviews, widget, google business, review, testimonial, testimonials, slider, rating, google my business, customer review
5
  Requires at least: 3.0.1
6
- Tested up to: 5.8
7
  Requires PHP: 5.2
8
- Stable tag: 7.8
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.8
18
 
19
  Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google Business reviews.
20
 
3
  Donate link: https://www.trustindex.io/prices/
4
  Tags: google, google places reviews, reviews, widget, google business, review, testimonial, testimonials, slider, rating, google my business, customer review
5
  Requires at least: 3.0.1
6
+ Tested up to: 5.8.2
7
  Requires PHP: 5.2
8
+ Stable tag: 7.9
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.9
18
 
19
  Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google Business reviews.
20
 
tabs/setup_no_reg.php CHANGED
@@ -32,22 +32,6 @@
32
  </p>
33
  </div>
34
  <?php endif; ?>
35
- <?php if($show_nonce_notification): ?>
36
- <div class="ti-notice notice-warning is-dismissible" 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
- <button type="button" class="notice-dismiss" data-command="save-widget-nonce-notice-hide"></button>
42
- </div>
43
- <?php endif; ?>
44
- <?php
45
- $reviews = [];
46
- if($trustindex_pm_google->is_noreg_linked())
47
- {
48
- $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
49
- }
50
- ?>
51
  <?php if($current_step == 1 || !$trustindex_pm_google->is_noreg_linked()): ?>
52
  <h1 class="ti-free-title">
53
  1. <?php echo TrustindexPlugin::___('Connect %s platform', [ 'Google' ]); ?>
32
  </p>
33
  </div>
34
  <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  <?php if($current_step == 1 || !$trustindex_pm_google->is_noreg_linked()): ?>
36
  <h1 class="ti-free-title">
37
  1. <?php echo TrustindexPlugin::___('Connect %s platform', [ 'Google' ]); ?>
tabs/setup_no_reg_header.php CHANGED
@@ -9,8 +9,7 @@ $ti_command_list = [
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
  {
@@ -131,6 +130,7 @@ delete_option($trustindex_pm_google->get_option_name('widget-setted-up'));
131
  }
132
  if($step < 4)
133
  {
 
134
  delete_option($trustindex_pm_google->get_option_name('scss-set'));
135
  if(in_array($style_id, [ 17, 21 ]))
136
  {
@@ -264,17 +264,27 @@ delete_option( $trustindex_pm_google->get_option_name('review-content') );
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');
275
  $dateformat = get_option( $trustindex_pm_google->get_option_name('dateformat'), 'Y-m-d' );
276
  $no_rating_text = get_option( $trustindex_pm_google->get_option_name('no-rating-text'));
277
- $filter = get_option( $trustindex_pm_google->get_option_name('filter'), [ 'stars' => [1, 2, 3, 4, 5], 'only-ratings' => true ] );
278
  $verified_icon = get_option( $trustindex_pm_google->get_option_name('verified-icon'), 0 );
279
  $enable_animation = get_option( $trustindex_pm_google->get_option_name('enable-animation'), 1 );
280
  $show_arrows = get_option( $trustindex_pm_google->get_option_name('show-arrows'), 1 );
@@ -387,15 +397,4 @@ case 'zillow':
387
  $example_url = 'https://www.zillow.com/profile/NealandNealTeam/#reviews';
388
  break;
389
  }
390
- $installed_plugins = array_keys(get_plugins());
391
- $show_nonce_notification = (
392
- $scss_set
393
- && !get_option($trustindex_pm_google->get_option_name('widget-nonce-hidden-notification'), 0)
394
- && get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1)
395
- && (
396
- in_array('wp-super-cache/wp-super-cache.php', $installed_plugins)
397
- || in_array('w3-total-cache/w3-total-cache.php', $installed_plugins)
398
- || in_array('wp-rocket/wp-rocket.php', $installed_plugins)
399
- )
400
- );
401
  ?>
9
  'save-set',
10
  'save-language',
11
  'save-dateformat',
12
+ 'save-options'
 
13
  ];
14
  if(!in_array($ti_command, $ti_command_list))
15
  {
130
  }
131
  if($step < 4)
132
  {
133
+ $style_id = get_option($trustindex_pm_google->get_option_name('style-id'));
134
  delete_option($trustindex_pm_google->get_option_name('scss-set'));
135
  if(in_array($style_id, [ 17, 21 ]))
136
  {
264
  $trustindex_pm_google->noreg_save_css(true);
265
  exit;
266
  }
267
+ $reviews = [];
268
+ $only_ratings_default = false;
269
+ if($trustindex_pm_google->is_noreg_linked())
270
  {
271
+ $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
272
+ $reviews_with_text = 0;
273
+ foreach($reviews as $r)
274
+ {
275
+ if($r->text)
276
+ {
277
+ $reviews_with_text++;
278
+ }
279
+ }
280
+ $only_ratings_default = $reviews_with_text >= 3;
281
  }
282
  $style_id = get_option( $trustindex_pm_google->get_option_name('style-id') );
283
  $scss_set = get_option( $trustindex_pm_google->get_option_name('scss-set') );
284
  $lang = get_option( $trustindex_pm_google->get_option_name('lang'), 'en');
285
  $dateformat = get_option( $trustindex_pm_google->get_option_name('dateformat'), 'Y-m-d' );
286
  $no_rating_text = get_option( $trustindex_pm_google->get_option_name('no-rating-text'));
287
+ $filter = get_option( $trustindex_pm_google->get_option_name('filter'), [ 'stars' => [1, 2, 3, 4, 5], 'only-ratings' => $only_ratings_default ] );
288
  $verified_icon = get_option( $trustindex_pm_google->get_option_name('verified-icon'), 0 );
289
  $enable_animation = get_option( $trustindex_pm_google->get_option_name('enable-animation'), 1 );
290
  $show_arrows = get_option( $trustindex_pm_google->get_option_name('show-arrows'), 1 );
397
  $example_url = 'https://www.zillow.com/profile/NealandNealTeam/#reviews';
398
  break;
399
  }
 
 
 
 
 
 
 
 
 
 
 
400
  ?>
tabs/troubleshooting.php CHANGED
@@ -17,16 +17,21 @@ 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
- 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.8");
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>
@@ -47,6 +52,13 @@ $widget_nonce = get_option($trustindex_pm_google->get_option_name('widget-nonce'
47
  <?php endif; ?>
48
  </li>
49
  <li>
 
 
 
 
 
 
 
50
  <?php echo TrustindexPlugin::___('If you are using cacher plugin, you should:'); ?>
51
  <ul>
52
  <li><?php echo TrustindexPlugin::___('clear the cache'); ?></li>
@@ -65,12 +77,6 @@ $widget_nonce = get_option($trustindex_pm_google->get_option_name('widget-nonce'
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>
17
  header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
18
  exit;
19
  }
20
+ if(isset($_GET['toggle_css_inline']))
21
  {
22
+ $v = intval($_GET['toggle_css_inline']);
23
+ update_option($trustindex_pm_google->get_option_name('load-css-inline'), $v, false);
24
+ if($v && is_file($trustindex_pm_google->getCssFile()))
25
+ {
26
+ unlink($trustindex_pm_google->getCssFile());
27
+ }
28
  header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
29
  exit;
30
  }
31
  $yes_icon = '<span class="dashicons dashicons-yes-alt"></span>';
32
  $no_icon = '<span class="dashicons dashicons-dismiss"></span>';
33
+ $plugin_updated = ($trustindex_pm_google->get_plugin_current_version() <= "7.9");
34
+ $css_inline = get_option($trustindex_pm_google->get_option_name('load-css-inline'), 0);
35
  ?>
36
  <div class="ti-box">
37
  <div class="ti-header"><?php echo TrustindexPlugin::___("Troubleshooting"); ?></div>
52
  <?php endif; ?>
53
  </li>
54
  <li>
55
+ <?php echo TrustindexPlugin::___("If CSS file could not saved:"); ?>
56
+ <span class="ti-checkbox row" style="margin-top: 5px">
57
+ <input type="checkbox" value="1" <?php if($css_inline): ?>checked<?php endif;?> onchange="window.location.href = '?page=<?php echo sanitize_text_field($_GET['page']); ?>&tab=troubleshooting&toggle_css_inline=' + (this.checked ? 1 : 0)">
58
+ <label><?php echo TrustindexPlugin::___("Enable CSS internal loading"); ?></label>
59
+ </span>
60
+ </li>
61
+ <li>
62
  <?php echo TrustindexPlugin::___('If you are using cacher plugin, you should:'); ?>
63
  <ul>
64
  <li><?php echo TrustindexPlugin::___('clear the cache'); ?></li>
77
  <li>
78
  <?php echo TrustindexPlugin::___("If the widgets are there, but still hidden:"); ?>
79
  <ul>
 
 
 
 
 
 
80
  <li><a href="#" onclick="jQuery('#ti-nonce-list-wp-rocket').toggle(); return false;">WP Rocket</a>
81
  <ol id="ti-nonce-list-wp-rocket" style="display: none; list-style: none">
82
  <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>
trunk/languages/trustindex-af.mo DELETED
Binary file
trunk/languages/trustindex-ar.mo DELETED
Binary file
trunk/languages/trustindex-ary.mo DELETED
Binary file
trunk/languages/trustindex-az.mo DELETED
Binary file
trunk/languages/trustindex-azb.mo DELETED
Binary file
trunk/languages/trustindex-bg_BG.mo DELETED
Binary file
trunk/languages/trustindex-bn_BD.mo DELETED
Binary file
trunk/languages/trustindex-bs_BA.mo DELETED
Binary file
trunk/languages/trustindex-cs_CZ.mo DELETED
Binary file
trunk/languages/trustindex-cy.mo DELETED
Binary file
trunk/languages/trustindex-da_DK.mo DELETED
Binary file
trunk/languages/trustindex-de_AT.mo DELETED
Binary file
trunk/languages/trustindex-de_CH.mo DELETED
Binary file
trunk/languages/trustindex-de_CH_informal.mo DELETED
Binary file
trunk/languages/trustindex-de_DE.mo DELETED
Binary file
trunk/languages/trustindex-de_DE_formal.mo DELETED
Binary file
trunk/languages/trustindex-el.mo DELETED
Binary file
trunk/languages/trustindex-es_AR.mo DELETED
Binary file
trunk/languages/trustindex-es_CL.mo DELETED
Binary file
trunk/languages/trustindex-es_CO.mo DELETED
Binary file
trunk/languages/trustindex-es_CR.mo DELETED
Binary file
trunk/languages/trustindex-es_ES.mo DELETED
Binary file
trunk/languages/trustindex-es_GT.mo DELETED
Binary file
trunk/languages/trustindex-es_MX.mo DELETED
Binary file
trunk/languages/trustindex-es_PE.mo DELETED
Binary file
trunk/languages/trustindex-es_PR.mo DELETED
Binary file
trunk/languages/trustindex-es_UY.mo DELETED
Binary file
trunk/languages/trustindex-es_VE.mo DELETED
Binary file
trunk/languages/trustindex-et.mo DELETED
Binary file
trunk/languages/trustindex-fa_AF.mo DELETED
Binary file
trunk/languages/trustindex-fa_IR.mo DELETED
Binary file
trunk/languages/trustindex-fi.mo DELETED
Binary file
trunk/languages/trustindex-fr_BR.mo DELETED
Binary file
trunk/languages/trustindex-fr_CA.mo DELETED
Binary file
trunk/languages/trustindex-fr_FR.mo DELETED
Binary file
trunk/languages/trustindex-gd.mo DELETED
Binary file
trunk/languages/trustindex-gl_ES.mo DELETED
Binary file
trunk/languages/trustindex-he_IL.mo DELETED
Binary file
trunk/languages/trustindex-hi_IN.mo DELETED
Binary file
trunk/languages/trustindex-hr.mo DELETED
Binary file
trunk/languages/trustindex-hu_HU.mo DELETED
Binary file
trunk/languages/trustindex-hy.mo DELETED
Binary file
trunk/languages/trustindex-id_ID.mo DELETED
Binary file
trunk/languages/trustindex-is_IS.mo DELETED
Binary file
trunk/languages/trustindex-it_IT.mo DELETED
Binary file
trunk/languages/trustindex-ja.mo DELETED
Binary file
trunk/languages/trustindex-ko_KR.mo DELETED
Binary file
trunk/languages/trustindex-lt_LT.mo DELETED
Binary file
trunk/languages/trustindex-mk_MK.mo DELETED
Binary file
trunk/languages/trustindex-ms_MY.mo DELETED
Binary file
trunk/languages/trustindex-nb_NO.mo DELETED
Binary file
trunk/languages/trustindex-nl_BE.mo DELETED
Binary file
trunk/languages/trustindex-nl_NL.mo DELETED
Binary file
trunk/languages/trustindex-nl_NL_formal.mo DELETED
Binary file
trunk/languages/trustindex-nn_NO.mo DELETED
Binary file
trunk/languages/trustindex-pl_PL.mo DELETED
Binary file
trunk/languages/trustindex-pt_AO.mo DELETED
Binary file
trunk/languages/trustindex-pt_BR.mo DELETED
Binary file
trunk/languages/trustindex-pt_PT.mo DELETED
Binary file
trunk/languages/trustindex-pt_PT_ao90.mo DELETED
Binary file
trunk/languages/trustindex-ro_RO.mo DELETED
Binary file
trunk/languages/trustindex-ru_RU.mo DELETED
Binary file
trunk/languages/trustindex-sk_SK.mo DELETED
Binary file
trunk/languages/trustindex-sl_SI.mo DELETED
Binary file
trunk/languages/trustindex-sq.mo DELETED
Binary file
trunk/languages/trustindex-sr_RS.mo DELETED
Binary file
trunk/languages/trustindex-sv_SE.mo DELETED
Binary file
trunk/languages/trustindex-th.mo DELETED
Binary file
trunk/languages/trustindex-tr_TR.mo DELETED
Binary file
trunk/languages/trustindex-uk.mo DELETED
Binary file
trunk/languages/trustindex-vi.mo DELETED
Binary file
trunk/languages/trustindex-zh_CN.mo DELETED
Binary file
trunk/languages/trustindex-zh_HK.mo DELETED
Binary file
trunk/languages/trustindex-zh_TW.mo DELETED
Binary file
trunk/plugin-load.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- defined('ABSPATH') or die('No script kiddies please!');
3
- if(!class_exists('TrustindexPlugin'))
4
- {
5
- $plugin_dirs = scandir(WP_PLUGIN_DIR);
6
- $ti_plugins = [];
7
- foreach($plugin_dirs as $dir)
8
- {
9
- $class_file = WP_PLUGIN_DIR . '/' . $dir . '/trustindex-plugin.class.php';
10
- if($dir == '.' || $dir == '..' || !is_dir(WP_PLUGIN_DIR . '/' . $dir) || !file_exists($class_file) || $dir == 'customer-reviews-for-woocommerce')
11
- {
12
- continue;
13
- }
14
- $second_line = array_slice(file($class_file), 1, 1)[0];
15
- $ti_plugins[$class_file] = (substr($second_line , 0, 14) == '/* GENERATED: ' ? (int)preg_replace('/[^\d]/m', '', $second_line) : 0);
16
- }
17
- $plugin_file = array_search(max($ti_plugins), $ti_plugins);
18
- if(empty($plugin_file))
19
- {
20
- $plugin_file = "trustindex-plugin.class.php";
21
- }
22
- require_once($plugin_file);
23
- }
24
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/readme.txt DELETED
@@ -1,228 +0,0 @@
1
- === Widgets for Google Reviews ===
2
- Contributors: trustindex
3
- Donate link: https://www.trustindex.io/prices/
4
- Tags: google, google places reviews, reviews, widget, google business, review, testimonial, testimonials, slider, rating, google my business, customer review
5
- Requires at least: 3.0.1
6
- Tested up to: 5.8
7
- Requires PHP: 5.2
8
- Stable tag: 7.8
9
- License: GPLv2 or later
10
- License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
- Plugin Name: Widgets for Google Reviews
12
- Plugin Title: Widgets for Google Reviews Plugin
13
- 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.8
18
-
19
- Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google Business reviews.
20
-
21
- == Description ==
22
-
23
- Display your **Google Reviews** for free with our responsive widgets in 2 minutes.
24
-
25
- The plugin displays your **Google Reviews** in amazing predesigned widgets. You can simply create and display your own widgets, and filter your reviews to build customers' trust and increase SEO.
26
-
27
- [vimeo https://player.vimeo.com/video/506419798]
28
-
29
- With Google reviews WordPress plugin, you can proudly display customer feedback on your business website. The widget comes in many eye-catching styles and designs, so you can choose the settings that best suit your company image. If you are growing your business or even if you’ve already established roots in your niche, a widget like this can further develop your online reputation and lead to more conversion.
30
-
31
- Without reviews, a business is left to fend for itself. Even if your company offers excellent products or streamlined services, you may always struggle to reach a broad audience if you don’t have consumers who would vouch for you. Consumers often make purchase decisions on the back of Google reviews, so don’t miss out on this free form of marketing that can skyrocket your sales and boost your online reputation.
32
-
33
- Our Google reviews plugin is straightforward to implement directly into your website, so you can focus your energy on other aspects of the business. All it takes is two minutes, and you’re all set up. Simply copy your business website’s link into the widget, then follow the simple process outlined in the video above to display it on your WordPress page.
34
-
35
- ### Google Reviews WordPress Plugin
36
-
37
- Many successful businesses use WordPress plugins to show off rave reviews left by customers, in the hope that it persuades other consumers to give them a shot. Unless you’re not interested in free marketing, displaying Google reviews for your business is a no-brainer.
38
-
39
- Google reviews, in particular, have a significant influence on consumer purchase decisions, given the massive popularity of the search engine and the number of people with Google accounts. Many consumers claim that Google is the first place they go to assess a business based on reviews, which makes Google reviews more reliable than those from other websites.
40
-
41
- You can leverage Google to catapult your business to further success if you try to secure as many four and five-star reviews as possible. The more reviews you have, the more prominent your business will become in a Google search, meaning more consumers will consider using your services.
42
-
43
- If you don’t yet have any Google reviews, there’s no need to panic; simply start requesting of your existing customers that they leave one when they get a chance. Get into the habit of soliciting reviews through email and SMS since by making it a regular practice you increase your chances of getting more of them.
44
-
45
- ### Free plugin features
46
-
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
54
- * Language support
55
- * Shortcode integration
56
- * Keep all reviews in a WordPress database
57
- * SEO boost
58
- * Dark website support
59
- * Use in any page builder: Gutenberg, Elementor, Page Origin, Beaver Builder, WPBakery, Divi, Classic, ...
60
- * Zero loading time
61
- * Use of assets stored in CDN
62
-
63
- ### Get more features with our professional review software
64
-
65
- [Create a free account for more features!](https://www.trustindex.io/ti-redirect.php?a=sys-wp&c=google.php-r1)
66
-
67
- With the professional package, you’ll be able to display reviews from many of the top review websites, including Facebook, Yelp, Tripadvisor, and Airbnb. You’ll also be able to edit the widget image with a wide range of options, so you can cater to your demographic and increase the likelihood of conversion.
68
-
69
- If you want to stand out from your competitors, a great way to do so is to make the most of the free marketing reviews can offer. The professional review management software gives you access to a whole host of tools that simplify the process, leaving you more time and energy for running the business.
70
-
71
- Here are the features included in the software:
72
-
73
- * Display all reviews from Google, Facebook, Yelp, Amazon, Tripadvisor, Booking.com, AirBnb, Hotels.com, ...
74
- * Display reviews from different platforms in a widget
75
- * Customizable design
76
- * Unlimited number of widgets
77
- * Management of multiple businesses
78
- * Option to hide a review or mark as spam
79
- * Professional review tagging system
80
- * Widgets are updated when you receive a new review
81
- * Widget link modification
82
- * Edit review order
83
- * Review shortening
84
- * Automated review invitation system
85
- * Review widgets for your email signatures
86
- * Generate amazing images from your reviews to Instagram, Facebook, Twitter, Pinterest
87
- * Shortcode & HTML/JavaScript support
88
- * Detailed statistics
89
- * Priority support
90
-
91
- [Create a free account for more features!](https://www.trustindex.io/ti-redirect.php?a=sys-wp&c=google.php-r2)
92
-
93
- == Screenshots ==
94
-
95
- 1. Sample widget - Slider (light background)
96
- 2. Sample widget - Grid (light background)
97
- 3. Sample widget - List (light background)
98
- 4. Connect platform easily
99
- 5. Select layouts easily
100
-
101
- == Additional free review plugins ==
102
-
103
- Why not display your other ratings, too? Check out our other free review plugins:
104
-
105
- * <a href="https://wordpress.org/plugins/review-widgets-for-airbnb/" target="_blank">Airbnb</a>
106
- * <a href="https://wordpress.org/plugins/widgets-for-aliexpress-reviews/" target="_blank">Aliexpress</a>
107
- * <a href="https://wordpress.org/plugins/widgets-for-alibaba-reviews/" target="_blank">Alibaba</a>
108
- * <a href="https://wordpress.org/plugins/review-widgets-for-amazon/" target="_blank">Amazon</a>
109
- * <a href="https://wordpress.org/plugins/review-widgets-for-booking-com/" target="_blank">Booking.com</a>
110
- * <a href="https://wordpress.org/plugins/review-widgets-for-capterra/" target="_blank">Capterra</a>
111
- * <a href="https://wordpress.org/plugins/widgets-for-ebay-reviews/" target="_blank">Ebay</a>
112
- * <a href="https://wordpress.org/plugins/review-widgets-for-expedia/" target="_blank">Expedia</a>
113
- * <a href="https://wordpress.org/plugins/free-facebook-reviews-and-recommendations-widgets/" target="_blank">Facebook</a>
114
- * <a href="https://wordpress.org/plugins/review-widgets-for-foursquare/" target="_blank">Foursquare</a>
115
- * <a href="https://wordpress.org/plugins/wp-reviews-plugin-for-google/" target="_blank">Google</a>
116
- * <a href="https://wordpress.org/plugins/review-widgets-for-hotels-com/" target="_blank">Hotels.com</a>
117
- * <a href="https://wordpress.org/plugins/reviews-widgets-for-opentable/" target="_blank">Opentable</a>
118
- * <a href="https://wordpress.org/plugins/widgets-for-sourceforge-reviews/" target="_blank">SourceForge</a>
119
- * <a href="https://wordpress.org/plugins/widgets-for-thumbtack-reviews/" target="_blank">Thumbtack</a>
120
- * <a href="https://wordpress.org/plugins/review-widgets-for-tripadvisor/" target="_blank">Tripadvisor</a>
121
- * <a href="https://wordpress.org/plugins/reviews-widgets-for-yelp/" target="_blank">Yelp</a>
122
- * <a href="https://wordpress.org/plugins/widgets-for-zillow-reviews/" target="_blank">Zillow</a>
123
- * <a href="https://wordpress.org/plugins/customer-reviews-for-woocommerce/" target="_blank">WooCommerce</a>
124
- * <a href="https://wordpress.org/plugins/reviews-widgets/" target="_blank">Wordpress</a>
125
-
126
- == Languages ==
127
-
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, Armenian, Azerbaijani, Bengali, Bosnian, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Korean, Lithuanian, Macedonian, Malay, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Scottish Gaelic, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukranian, Vietnamese, Welsh
132
-
133
- == Support ==
134
-
135
- If you have any issues at all setting up the Google Reviews WordPress Plugin for your business, you can contact our customer support team in various ways.
136
-
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 Reviews
141
- 2. You can find more info and Troubleshooting in the plugin's admin dashboard after install.
142
- 3. [Trustindex FAQ](https://www.trustindex.io/frequently-asked-questions/)
143
- 4. Check topics or ask a new question here: [Support Forum](https://wordpress.org/support/plugin/wp-reviews-plugin-for-google/)
144
- 5. If you still can't find the answer, feel free to email us: support@trustindex.io
145
-
146
- To find out more about who we are and what we do, here are some useful links:
147
-
148
- * [TrustIndex Website](https://www.trustindex.io/)
149
- * [Our Blog](https://www.trustindex.io/blog/)
150
-
151
- == Installation ==
152
-
153
- 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
154
- 2. Activate the plugin through the 'Plugins' screen in WordPress
155
- 3. Use the Trustindex.io menu item on the left to configure the plugin.
156
- 4. You can get premium features under the "Get more Features" tab!
157
-
158
- == Frequently Asked Questions ==
159
-
160
- = What is the Google reviews WordPress Plugin? =
161
-
162
- A Google Reviews WordPress Plugin is a tool that you can use to display customer reviews on your WordPress page or website. It can help you establish an online reputation and build customer loyalty and trust.
163
-
164
- = Can you use the plugin free without subscribing? =
165
-
166
- Yes, the Google Reviews Widget plugin is completely free to download for all users.
167
-
168
- = How can you get the widget’s code? =
169
-
170
- You will gain access to the widget’s code as soon as you’ve finished setting up the plugin. You are then free to use it across your company websites as you see fit.
171
-
172
- = What are the major features of the free plugin? =
173
-
174
- With the free plugin, you’ll have access to as many as 35 widget layouts and 16 predesigned styles. You’ll be able to display up to 10 Google reviews, support various languages, and filter the reviews according to criteria such as star rating and date.
175
-
176
- = Which website CMS or site builder are the widgets compatible with? =
177
-
178
- The widgets are compatible with just about every website CMS or site builder, including but not limited to Adobe Muse, Blogger, Elementor, HTML, and Squarespace.
179
-
180
- = How to embed Google reviews on your Website? =
181
-
182
- To embed Google reviews on your website, simply position the widget on the website by copying the html shortcode directly to the desired page.
183
-
184
- = How to display Google my Business reviews on your website? =
185
-
186
- To display Google my Business reviews on your website, you need to copy and paste your Google Place URL into the plugin. Then you can easily generate the widget.
187
-
188
- = How can you filter your Google Business reviews? =
189
-
190
- To filter Google Business reviews, you can use the ‘filter your ratings’ drop-down menu during the widget setup process.
191
-
192
- = Are the Google review widgets mobile responsive? =
193
-
194
- Yes, the Google review widgets will be responsive on all devices.
195
-
196
- = Can you display Google reviews in a slider widget? =
197
-
198
- Yes, absolutely! In the layout screen of the setup process, the first few options you’ll see are slider widgets.
199
-
200
- = Can you make modifications after the widget went live? =
201
-
202
- Yes, you can. If you need to make changes after publishing the widget, you can do so through the admin board.
203
-
204
- = Why are Google reviews important? =
205
-
206
- Google reviews are important because they lend credibility to your business and help you establish your reputation online, influencing consumer purchase decisions.
207
-
208
- = Are Google reviews more reliable than other reviews? =
209
-
210
- While it’s hard to say definitively, Google reviews are most likely the first source many consumers turn to for advice about a purchase decision.
211
-
212
- = How can you make the most out of Google reviews for your business? =
213
-
214
- To make the most out of Google reviews, display the widget somewhere prominent on your homepage so visitors can see upfront how impressive your customer service is.
215
-
216
- = Can your website visitors leave reviews in the widget? =
217
-
218
- Yes we have widgets with this option, should visitors wish to have their review displayed in the widget, they can click the CTA (Call To Action) button which will lead them to the relevant review page on Google.
219
-
220
- = What is the easiest way to collect Google reviews? =
221
-
222
- A good rule to follow to collect more Google reviews is: if you don’t ask, you don’t get.
223
-
224
- When you communicate with your clients, use this as an opportunity to insert a link to your Google review page or mention leaving a review, whether it’s in an email, an SMS, or an in-person interaction.
225
-
226
- == Changelog ==
227
-
228
- The change log and upgrade notices can be found here: [https://admin.trustindex.io/page/static/content/wp-changelog](https://admin.trustindex.io/page/static/content/wp-changelog)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/settings.php DELETED
@@ -1,223 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- if (!current_user_can('edit_pages'))
4
- {
5
- die('The account you\'re logged in to doesn\'t have permission to access this page.');
6
- }
7
- if(isset($_GET['rate_us']))
8
- {
9
- switch(sanitize_text_field($_GET['rate_us']))
10
- {
11
- case 'open':
12
- update_option($trustindex_pm_google->get_option_name('rate-us'), 'hide', false);
13
- $url = 'https://wordpress.org/support/plugin/'. $trustindex_pm_google->get_plugin_slug() . '/reviews/?rate=5#new-post';
14
- header('Location: '. $url);
15
- die;
16
- case 'later':
17
- $time = time() + (30 * 86400);
18
- update_option($trustindex_pm_google->get_option_name('rate-us'), $time, false);
19
- break;
20
- case 'hide':
21
- update_option($trustindex_pm_google->get_option_name('rate-us'), 'hide', false);
22
- break;
23
- }
24
- echo "<script type='text/javascript'>self.close();</script>";
25
- die;
26
- }
27
- if(isset($_GET['wc_notification']))
28
- {
29
- switch(sanitize_text_field($_GET['wc_notification']))
30
- {
31
- case 'open':
32
- update_option('trustindex-wc-notification', 'hide', false);
33
- $url = 'https://wordpress.org/plugins/customer-reviews-for-woocommerce/';
34
- header('Location: '. $url);
35
- die;
36
- case 'hide':
37
- update_option('trustindex-wc-notification', 'hide', false);
38
- break;
39
- }
40
- echo "<script type='text/javascript'>self.close();</script>";
41
- die;
42
- }
43
- if(isset($_GET['test_proxy']))
44
- {
45
- delete_option($trustindex_pm_google->get_option_name('proxy-check'));
46
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=' . sanitize_text_field($_GET['tab']));
47
- exit;
48
- }
49
- $tabs = [];
50
- if($trustindex_pm_google->is_trustindex_connected())
51
- {
52
- $default_tab = 'setup_trustindex_join';
53
- $tabs[ 'Trustindex admin' ] = "setup_trustindex_join";
54
- $tabs[ TrustindexPlugin::___("Free Widget Configurator") ] = "setup_no_reg";
55
- }
56
- else
57
- {
58
- $default_tab = 'setup_no_reg';
59
- $tabs[ TrustindexPlugin::___("Free Widget Configurator") ] = "setup_no_reg";
60
- }
61
- if($trustindex_pm_google->is_noreg_linked())
62
- {
63
- $tabs[ TrustindexPlugin::___("My Reviews") ] = "my_reviews";
64
- }
65
- $tabs[ TrustindexPlugin::___('Get Reviews') ] = "get_reviews";
66
- $tabs[ TrustindexPlugin::___('Rate Us') ] = "rate";
67
- if(!$trustindex_pm_google->is_trustindex_connected())
68
- {
69
- $tabs[ TrustindexPlugin::___('Get more Features') ] = "setup_trustindex";
70
- $tabs[ TrustindexPlugin::___('Log In') ] = "setup_trustindex_join";
71
- }
72
- $tabs[ TrustindexPlugin::___('Troubleshooting') ] = "troubleshooting";
73
- $selected_tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : null;
74
- $subtabs = null;
75
- $found = false;
76
- foreach($tabs as $tab)
77
- {
78
- if(is_array($tab))
79
- {
80
- if(array_search($selected_tab, $tab) !== FALSE)
81
- {
82
- $found = true;
83
- break;
84
- }
85
- }
86
- else
87
- {
88
- if($selected_tab == $tab)
89
- {
90
- $found = true;
91
- break;
92
- }
93
- }
94
- }
95
- if(!$found)
96
- {
97
- $selected_tab = $default_tab;
98
- }
99
- $http_blocked = false;
100
- if(defined('WP_HTTP_BLOCK_EXTERNAL') && WP_HTTP_BLOCK_EXTERNAL)
101
- {
102
- if(!defined('WP_ACCESSIBLE_HOSTS') || strpos(WP_ACCESSIBLE_HOSTS, '*.trustindex.io') === FALSE)
103
- {
104
- $http_blocked = true;
105
- }
106
- }
107
- $proxy = new WP_HTTP_Proxy();
108
- $proxy_check = true;
109
- if($proxy->is_enabled())
110
- {
111
- $opt_name = $trustindex_pm_google->get_option_name('proxy-check');
112
- $db_data = get_option($opt_name, "");
113
- if(!$db_data)
114
- {
115
- $response = wp_remote_post("https://admin.trustindex.io/" . "api/userCheckLoggedIn", [
116
- 'timeout' => '30',
117
- 'redirection' => '5',
118
- 'blocking' => true
119
- ]);
120
- if(is_wp_error($response))
121
- {
122
- $proxy_check = $response->get_error_message();
123
- update_option($opt_name, $response->get_error_message(), false);
124
- }
125
- else
126
- {
127
- update_option($opt_name, 1, false);
128
- }
129
- }
130
- else
131
- {
132
- if($db_data !== '1')
133
- {
134
- $proxy_check = $db_data;
135
- }
136
- }
137
- }
138
- ?>
139
- <div id="ti-assets-error" class="ti-notice notice-warning" style="display: none; margin-left: 0; margin-right: 0; padding-bottom: 9px">
140
- <p>
141
- <?php echo TrustindexPlugin::___("You got an error while trying to run this plugin. Please upgrade all the plugins from Trustindex and if the error still persist send the content of the webserver's error log and the content of the Troubleshooting tab to the support!"); ?>
142
- </p>
143
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=troubleshooting" class="button button-primary"><?php echo TrustindexPlugin::___("Troubleshooting") ;?></a>
144
- </div>
145
- <script type="text/javascript">
146
- window.onload = function() {
147
- let warning_box = document.getElementById("ti-assets-error");
148
- let link = document.head.querySelector('link[href*="static/css/admin-page-settings.css"]');
149
- if(typeof Trustindex_Autocomplete == "undefined" || typeof TI_copyTextToClipboard == "undefined" || !link || !Boolean(link.sheet))
150
- {
151
- warning_box.style.display = "block";
152
- }
153
- };
154
- </script>
155
- <div id="trustindex-plugin-settings-page" class="ti-toggle-opacity">
156
- <h1 class="ti-free-title">
157
- <?php echo TrustindexPlugin::___("Widgets for Google Reviews"); ?>
158
- <a href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-l" target="_blank" title="Trustindex" class="ti-pull-right">
159
- <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/trustindex.svg'); ?>" />
160
- </a>
161
- </h1>
162
- <div class="container_wrapper">
163
- <div class="container_cell" id="container-main">
164
- <?php if($http_blocked): ?>
165
- <div class="ti-box ti-notice-error">
166
- <p>
167
- <?php echo TrustindexPlugin::___("Your site cannot download our widget templates, because of your server settings not allowing that:"); ?><br /><a href="https://wordpress.org/support/article/editing-wp-config-php/#block-external-url-requests" target="_blank">https://wordpress.org/support/article/editing-wp-config-php/#block-external-url-requests</a><br /><br />
168
- <strong><?php echo TrustindexPlugin::___("Solution"); ?></strong><br />
169
- <?php echo TrustindexPlugin::___("a) You should define <strong>WP_HTTP_BLOCK_EXTERNAL</strong> as false"); ?><br />
170
- <?php echo TrustindexPlugin::___("b) or you should add Trustindex as an <strong>WP_ACCESSIBLE_HOSTS</strong>: \"*.trustindex.io\""); ?><br />
171
- </p>
172
- </div>
173
- <?php endif; ?>
174
- <?php if($proxy_check !== TRUE): ?>
175
- <div class="ti-box ti-notice-error">
176
- <p>
177
- <?php echo TrustindexPlugin::___("It seems you are using a proxy for HTTP requests but after a test request it returned a following error:"); ?><br />
178
- <strong><?php echo $proxy_check; ?></strong><br /><br />
179
- <?php echo TrustindexPlugin::___("Therefore, our plugin might not work properly. Please, contact your hosting support, they can resolve this easily."); ?>
180
- </p>
181
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=<?php echo esc_attr($_GET['tab']); ?>&test_proxy" class="btn-text btn-refresh" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Test again") ;?></a>
182
- </div>
183
- <?php endif; ?>
184
- <div class="nav-tab-wrapper">
185
- <?php foreach($tabs as $tab_name => $tab): ?>
186
- <?php
187
- $is_active = $selected_tab == $tab;
188
- $action = $tab;
189
- if(is_array($tab))
190
- {
191
- $is_active = array_search($selected_tab, $tab) !== FALSE;
192
- $action = array_shift(array_values($tab));
193
- if($is_active)
194
- {
195
- $subtabs = $tab;
196
- }
197
- }
198
- ?>
199
- <a
200
- id="link-tab-<?php echo esc_attr($action); ?>"
201
- class="nav-tab<?php if($is_active): ?> nav-tab-active<?php endif; ?><?php if($tab == 'troubleshooting'): ?> nav-tab-right<?php endif; ?>"
202
- href="<?php echo admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php&tab='. esc_attr($action)); ?>"
203
- ><?php echo esc_html($tab_name); ?></a>
204
- <?php endforeach; ?>
205
- </div>
206
- <?php if($subtabs): ?>
207
- <div class="nav-tab-wrapper sub-nav">
208
- <?php foreach($subtabs as $tab_name => $tab): ?>
209
- <a
210
- id="link-tab-<?php echo esc_attr($tab); ?>"
211
- class="nav-tab<?php if($selected_tab == $tab): ?> nav-tab-active<?php endif; ?>"
212
- href="<?php echo admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php&tab='. esc_attr($tab)); ?>"
213
- ><?php echo esc_html($tab_name); ?></a>
214
- <?php endforeach; ?>
215
- </div>
216
- <?php endif; ?>
217
- <div id="tab-<?php echo esc_attr($selected_tab); ?>">
218
- <?php include( plugin_dir_path(__FILE__ ) . "tabs/".$selected_tab.".php" ); ?>
219
- </div>
220
- </div>
221
-
222
- </div>
223
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/static/block-editor/block-editor.js DELETED
@@ -1 +0,0 @@
1
- !function(e){var t={};function n(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(l,i,function(t){return e[t]}.bind(null,i));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=window.wp.components},function(e,t,n){"use strict";n.r(t);var l=n(0),i=wp.blocks.registerBlockType,c=function(){return React.createElement(l.Icon,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},React.createElement("path",{fill:"none",d:"M-1-1h52v52H-1z"}),React.createElement("path",{d:"M-.043 29.977c0 11.016 8.97 19.968 19.936 19.968H29.96c11.065 0 19.936-8.952 19.936-19.968V19.975C49.896 8.958 40.925.007 29.96.007H19.893C8.828.007-.043 8.958-.043 19.975v10.002z",fillRule:"evenodd",clipRule:"evenodd",fill:"#2aa8d7"}),React.createElement("path",{d:"M23.854 24.574l10.098-10.098c.714-.743 1.938-.743 2.754 0l2.754 2.71a1.982 1.982 0 010 2.71L25.996 33.335c0 .037-.102.111-.102.148l-2.754 2.71c-.408.372-.918.557-1.326.557-.51 0-1.02-.185-1.326-.556l-2.754-2.71c0-.038-.102-.075-.102-.149l-7.038-7.054a1.982 1.982 0 010-2.71l2.754-2.71c.714-.742 1.938-.742 2.754 0l5.304 5.309.51.483 5.406 5.383-3.468-7.462z",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff"}))})};i("trustindex/block-selector",{title:"Trustindex",description:"Trustindex widget plugin",icon:c(),category:"widgets",attributes:{widget_id:{type:"string"},trustindex_widgets:{type:"object"},free_widgets:{type:"object"},setup_url:{type:"string"},selected_type:{type:"string",default:"admin"}},edit:function(e){var t=e.attributes,n=e.setAttributes;function i(e){"type-select"===e.target.id&&"custom-id"===e.target.selectedOptions[0].id?(n({selected_type:"custom"}),n({widget_id:""})):"type-select"===e.target.id?(n({widget_id:e.target.value}),e.target.value.length>=20?n({selected_type:"admin"}):n({selected_type:"free"})):n({widget_id:e.target.value})}return t.trustindex_widgets||wp.apiFetch({path:"trustindex/v1/setup-complete"}).then((function(e){e.result&&n({free_widgets:e.result}),e.setup_url&&n({setup_url:e.setup_url}),wp.apiFetch({path:"trustindex/v1/get-widgets"}).then((function(e){n({trustindex_widgets:e}),e&&e.length||"admin"!==t.selected_type||n({selected_type:"custom"}),e&&e.length&&!t.widget_id&&n({widget_id:e[0].widgets[0].id})}))})),t.trustindex_widgets?React.createElement("div",{className:"components-placeholder"},React.createElement("table",null,React.createElement("tr",null,React.createElement("td",null,React.createElement("span",{style:{fontSize:"32px"}},c()," Trustindex widget")),React.createElement("td",null)),React.createElement("tr",null,React.createElement("td",null,React.createElement("select",{id:"type-select",style:{fontSize:"13px",border:"1px solid",width:"100%"},onChange:i},React.createElement("optgroup",{label:"Trustindex widgets"},t.trustindex_widgets.length?t.trustindex_widgets[0].widgets.map((function(e){return React.createElement("option",{selected:t.widget_id===e.id,value:e.id},e.name)})):React.createElement("option",{disabled:!0}," No Trustindex account connected ")),React.createElement("optgroup",{label:"Custom widget"},React.createElement("option",{selected:"custom"===t.selected_type,value:t.widget_id,id:"custom-id"},"Custom widget id")),React.createElement("optgroup",{label:"Free widgets"},Object.keys(t.free_widgets).map((function(e){return React.createElement("option",{disabled:0===t.free_widgets[e],selected:e===t.widget_id,value:e},"Free "+e+" review widget"+(0===t.free_widgets[e]?" - not configured yet":""))}))))),React.createElement("td",{style:{fontSize:"15px"}},React.createElement("span",{style:{display:"flex",alignItems:"center",lineHeight:"16px"}},t.trustindex_widgets.length?"":React.createElement(l.Icon,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 130 130"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"#FF4141",d:"M61.44 0c33.933 0 61.439 27.507 61.439 61.439s-27.506 61.439-61.439 61.439C27.507 122.879 0 95.372 0 61.439S27.507 0 61.44 0zm12.011 39.151a7.011 7.011 0 019.986-.027c2.764 2.776 2.775 7.292.027 10.083L71.4 61.445l12.076 12.249c2.729 2.77 2.689 7.257-.08 10.022-2.773 2.765-7.23 2.758-9.955-.013L61.446 71.54 49.428 83.728a7.011 7.011 0 01-9.986.027c-2.763-2.776-2.776-7.293-.027-10.084L51.48 61.434 39.403 49.185c-2.728-2.769-2.689-7.256.082-10.022 2.772-2.765 7.229-2.758 9.953.013l11.997 12.165 12.016-12.19z"}))}),t.trustindex_widgets.length?"":React.createElement("span",{style:{marginLeft:"5px"}},"No Trustindex account connected. ",React.createElement("a",{target:"_blank",href:t.setup_url},"Solve"))))),React.createElement("tr",null,React.createElement("td",null,React.createElement("input",{onChange:i,value:t.widget_id,style:{border:"1px solid black",display:"custom"===t.selected_type?"inherit":"none"},class:"block-editor-plain-text blocks-shortcode__textarea",type:"text"}))))):React.createElement("div",{class:"components-placeholder"},"Loading...")},save:function(e){return e.attributes,null}})}]);
 
trunk/static/block-editor/block-editor.php DELETED
@@ -1,101 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
3
- class TrustindexGutenbergPlugin {
4
-
5
- public static $instance = null;
6
-
7
- function init() {
8
- add_action( 'enqueue_block_editor_assets', array( $this, 'gutenberg_enqueue_block_editor_assets' ) );
9
- add_action( 'init', array( $this, 'register_block' ) );
10
- }
11
-
12
- function gutenberg_enqueue_block_editor_assets() {
13
- wp_enqueue_script(
14
- 'gutenberg-ti',
15
- plugins_url( 'block-editor.js', __FILE__ ),
16
- array(
17
- 'wp-api-fetch',
18
- 'wp-components',
19
- 'wp-compose',
20
- 'wp-blocks',
21
- 'wp-element',
22
- 'wp-i18n'
23
- ),
24
- filemtime( plugin_dir_path( __FILE__ ) . 'block-editor.js' )
25
- );
26
- }
27
- function register_block() {
28
- register_block_type(
29
- 'trustindex/block-selector',
30
- array(
31
- 'render_callback' => array( $this, 'render_block' ),
32
- 'attributes' => array(
33
- 'widget_id' => array(
34
- 'type' => 'string'
35
- ),
36
- 'trustindex_widgets' => array(
37
- 'type' => 'object'
38
- ),
39
- 'free_widgets' => array(
40
- 'type' => 'object'
41
- ),
42
- 'custom_id' => array(
43
- 'type' => 'boolean'
44
- ),
45
- 'setup_url' => array(
46
- 'type' => 'string'
47
- )
48
- ),
49
- )
50
- );
51
- }
52
-
53
- function render_block( $attributes ) {
54
- if ($this->is_gutenberg_page())
55
- {
56
- return "";
57
- }
58
- if (isset($attributes['free_widgets'][$attributes['widget_id']]))
59
- {
60
- $short_code = "no-registration=" . $attributes['widget_id'];
61
- }
62
- else
63
- {
64
- $short_code = "data-widget-id=\"{$attributes['widget_id']}\"";
65
- }
66
- return "[trustindex {$short_code}]";
67
- }
68
- function is_gutenberg_page() {
69
- if ( function_exists( 'is_gutenberg_page' ) &&
70
- is_gutenberg_page()
71
- ) {
72
- return true;
73
- }
74
- if (function_exists('get_current_screen'))
75
- {
76
- $current_screen = get_current_screen();
77
- if ( method_exists( $current_screen, 'is_block_editor' ) &&
78
- $current_screen->is_block_editor()
79
- ) {
80
- return true;
81
- }
82
- }
83
- return false;
84
- }
85
-
86
- public static function instance() {
87
- if ( is_null( self::$instance ) ) {
88
- self::$instance = new self();
89
- self::$instance->init();
90
- }
91
- return self::$instance;
92
- }
93
-
94
- public function __clone() {
95
- _doing_it_wrong( __FUNCTION__, "Cheatin' huh?", '1.0.0' );
96
- }
97
-
98
- public function __wakeup() {
99
- _doing_it_wrong( __FUNCTION__, "Cheatin' huh?", '1.0.0' );
100
- }
101
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/static/css/admin-editor.css DELETED
@@ -1,2 +0,0 @@
1
- .dashicons, .dashicons-before:before { font-family: dashicons !important;}
2
- .text-danger { color: red !important; }
 
 
trunk/static/css/admin-page-settings.css DELETED
@@ -1 +0,0 @@
1
- @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&display=swap&subset=latin-ext');@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;900&display=swap');#trustindex-plugin-settings-page{max-width:1200px}#trustindex-plugin-settings-page.ti-toggle-opacity{opacity:0;transition:opacity 0.25s}#trustindex-plugin-settings-page h1{line-height:1.25em;color:#000;font-family:"Montserrat";font-weight:600;font-size:35px}#trustindex-plugin-settings-page h1 strong{font-weight:900}#trustindex-plugin-settings-page h1 img{height:23px}@media (max-width:767px){#trustindex-plugin-settings-page h1{font-size:21px}}#trustindex-plugin-settings-page h2{margin-top:40px;font-weight:700;font-size:16px;line-height:1.35em;font-family:'Open Sans', serif}#trustindex-plugin-settings-page h3{font-weight:700;font-size:20px;font-family:'Montserrat'}#trustindex-plugin-settings-page p{font-size:16px;font-family:'Open Sans', serif;font-weight:400;color:#5c666d}#trustindex-plugin-settings-page p.text-small{font-size:10px;margin:0}#trustindex-plugin-settings-page ol,#trustindex-plugin-settings-page ol li,#trustindex-plugin-settings-page ul,#trustindex-plugin-settings-page ul li{font-size:14px;font-family:'Open Sans', serif}#trustindex-plugin-settings-page li{margin-bottom:7px}#trustindex-plugin-settings-page strong{font-weight:700;color:#000}#trustindex-plugin-settings-page .container_wrapper{display:table;width:100%;table-layout:fixed}#trustindex-plugin-settings-page .container_cell{display:table-cell;margin:0px;padding:10px;vertical-align:top}#trustindex-plugin-settings-page #container-main{width:100%}#trustindex-plugin-settings-page #container-sidebar{width:261px;padding:100px 0 0 19px}#trustindex-plugin-settings-page #container-sidebar .sticky{position:fixed;top:200px}#trustindex-plugin-settings-page .maxwidth{max-width:1240px}#trustindex-plugin-settings-page .zoomable-pic{max-width:200px;cursor:pointer}#trustindex-plugin-settings-page .ti-check{margin-bottom:40px;margin-left:15px}#trustindex-plugin-settings-page .ti-check li{position:relative;margin-left:20px;margin-bottom:10px !important}#trustindex-plugin-settings-page .ti-check li:before{content:"";width:16px;height:16px;display:block;top:1px;left:-30px;position:absolute;background:url(../img/check-icon.svg);background-size:contain}#trustindex-plugin-settings-page .ti-left-label{font-weight:bold;font-size:14px;display:inline-block;margin-right:20px;line-height:44px;width:200px;text-align:right;cursor:unset}#trustindex-plugin-settings-page .ti-left-label span{line-height:1.3;display:inline-block;vertical-align:middle;padding:0}#trustindex-plugin-settings-page .ti-box{background:#fff;padding:70px;border-radius:4px;-webkit-box-shadow:10px 10px 39px 0px rgba(0, 0, 0, 0 0.05);-moz-box-shadow:10px 10px 39px 0px rgba(0, 0, 0, 0.05);box-shadow:10px 10px 39px 0px rgba(0, 0, 0, 0.05)}#trustindex-plugin-settings-page .ti-box h1{margin-top:0px;font-weight:700;margin-bottom:20px}@media (min-width:768px){#trustindex-plugin-settings-page .ti-box h1{font-size:40px}}#trustindex-plugin-settings-page .ti-box h2{margin-top:0px;margin-bottom:40px}#trustindex-plugin-settings-page .ti-box .ti-col-6 h2{max-width:450px;line-height:1.6em}#trustindex-plugin-settings-page .ti-box hr{border:none;height:0px;border-top:1px solid #ddd;margin-bottom:22px}@media (max-width:1200px){#trustindex-plugin-settings-page .ti-box{padding:15px}#trustindex-plugin-settings-page .ti-box hr{margin-left:-15px;margin-right:-15px;margin-bottom:30px}}#trustindex-plugin-settings-page .ti-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;box-sizing:border-box}#trustindex-plugin-settings-page .ti-col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:0 0 50%;box-sizing:border-box}@media (min-width:1200px){#trustindex-plugin-settings-page .ti-col-6:last-child{padding-left:100px}}#trustindex-plugin-settings-page .ti-col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:0 0 100%}#trustindex-plugin-settings-page .ti-col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}#trustindex-plugin-settings-page .ti-col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}@media (max-width:1200px){#trustindex-plugin-settings-page .ti-col-6,#trustindex-plugin-settings-page .ti-col-auto,#trustindex-plugin-settings-page .ti-col{-ms-flex:0 0 100%;flex:0 0 100%;max-width:0 0 100%}}#trustindex-plugin-settings-page .rate-us .rate-us-wrapper{font-size:18px}@media (min-width:1200px){#trustindex-plugin-settings-page .rate-us .rate-us-wrapper{text-align:right}#trustindex-plugin-settings-page .rate-us .rate-us-wrapper p{margin-bottom:10px !important;font-size:20px !important;margin-top:0px !important}}#trustindex-plugin-settings-page .ti-my-reviews .ti-user-avatar{width:30px;margin-bottom:-2px;border-radius:50%}#trustindex-plugin-settings-page .ti-my-reviews .ti-star{display:inline-block;width:17px}#trustindex-plugin-settings-page .ti-my-reviews .morecontent a{outline:0 !important;box-shadow:none !important}#trustindex-plugin-settings-page .ti-tooltip{position:relative;pointer-events:auto !important}#trustindex-plugin-settings-page .ti-tooltip .ti-tooltip-message{color:#fff;background-color:#3B404B;padding:0px 6px;border-radius:4px;font-size:11px;line-height:20px;font-weight:500;display:inline-block;width:auto !important;height:auto !important;position:absolute;right:100%;top:0;margin-right:25px;white-space:nowrap;opacity:0;transition:all 0.3s ease-in-out}#trustindex-plugin-settings-page .ti-tooltip .ti-tooltip-message:before{width:0;height:0;border-style:solid;border-width:5px 0 5px 5px;border-color:transparent transparent transparent #3B404B;content:"";position:absolute;right:-5px;top:50%;margin-top:-5px}#trustindex-plugin-settings-page .ti-tooltip:hover .ti-tooltip-message{opacity:1;margin-right:10px}#trustindex-plugin-settings-page .text-center{text-align:center}#trustindex-plugin-settings-page .ti-notice{background:#fff;border:1px solid #c3c4c7;border-left-width:4px;box-shadow:0 1px 1px rgba(0, 0, 0, 0.04);margin:5px 15px 2px;padding:1px 12px}#trustindex-plugin-settings-page .ti-notice.notice-info{border-left-color:#72aee6}#trustindex-plugin-settings-page .ti-notice.notice-error{border-left-color:#d63638}#trustindex-plugin-settings-page .ti-notice.notice-warning{border-left-color:#dba617}#trustindex-plugin-settings-page .ti-notice.notice-success{border-left-color:#00a32a}#trustindex-plugin-settings-page .ti-notice.is-dismissible{position:relative;padding-right:38px}#trustindex-plugin-settings-page .form-group{display:block;overflow:hidden;margin-top:20px;position:relative}#trustindex-plugin-settings-page .form-control{width:100%;margin:0;padding:6px 15px;border-radius:0.25rem;border:2px solid #ddd;background-color:#efefef}#trustindex-plugin-settings-page .input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}#trustindex-plugin-settings-page .input-group>.form-control{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}#trustindex-plugin-settings-page .input-group-prepend{margin-right:-1px}#trustindex-plugin-settings-page .input-group-append,#trustindex-plugin-settings-page .input-group-prepend{display:-webkit-box;display:-ms-flexbox;display:flex}#trustindex-plugin-settings-page .input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0.375rem 0.75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:0.25rem;border-top-right-radius:0;border-bottom-right-radius:0}#trustindex-plugin-settings-page .ti-checkbox{float:left;display:inline-block;margin-bottom:10px;margin-right:15px;white-space:nowrap;cursor:pointer;user-select:none}#trustindex-plugin-settings-page .ti-checkbox.row{float:initial;display:block}#trustindex-plugin-settings-page .ti-checkbox.disabled{cursor:default}#trustindex-plugin-settings-page .ti-checkbox.disabled label{color:rgba(68, 68, 68, 0.5);cursor:default !important}#trustindex-plugin-settings-page .ti-checkbox input,#trustindex-plugin-settings-page .ti-checkbox label{pointer-events:none}#trustindex-plugin-settings-page .ti-checkbox input{position:relative;top:2px;margin-right:10px}#trustindex-plugin-settings-page .ti-checkbox label{font-size:14px !important}#trustindex-plugin-settings-page .ti-checkbox span{width:16px;height:16px;display:inline-block;margin-right:1px}#trustindex-plugin-settings-page .ti-select{display:block;max-width:calc(25rem - 30px);margin:0;padding:8px 15px;border-radius:0.25rem;border:2px solid #ddd;background-color:#efefef;font-size:14px;line-height:2;color:#32373c;position:relative;cursor:pointer;user-select:none}#trustindex-plugin-settings-page .ti-select:after{content:'\203A';position:absolute;top:50%;right:9px;font-size:26px;z-index:1;transform:translateY(-50%) rotate(90deg)}#trustindex-plugin-settings-page .ti-select ul{display:none;position:absolute;z-index:1;left:-1px;top:100%;width:100%;margin:0;padding:0;list-style-type:none;background-color:#efefef;border:1px solid #ddd;border-top:0;border-bottom-left-radius:0.25rem;border-bottom-right-radius:0.25rem}#trustindex-plugin-settings-page .ti-select ul li{display:block;margin:0 !important;padding:5px 10px;border-top:1px solid #ccc;cursor:pointer;line-height:1.4;transition:all 0.3s}#trustindex-plugin-settings-page .ti-select ul li:hover{background:rgba(30, 144, 255, 0.3)}#trustindex-plugin-settings-page .ti-select ul li.selected{background:rgba(30, 144, 255, 0.6);pointer-events:none}#trustindex-plugin-settings-page .ti-select ul li li *{pointer-events:none}#trustindex-plugin-settings-page .ti-select .ti-star{position:relative;top:3px;width:16px;height:16px;display:inline-block;margin-right:1px}#trustindex-plugin-settings-page .ti-select.active{border-radius:0;border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}#trustindex-plugin-settings-page .ti-select.active ul{display:block}#trustindex-plugin-settings-page .ti-select.active:after{content:'\2039'}#trustindex-plugin-settings-page .ti-toggle-password{position:absolute;right:16px;bottom:15px;font-size:26px;cursor:pointer;z-index:1;opacity:0.7;transition:opacity 0.3s}#trustindex-plugin-settings-page .ti-toggle-password:hover{opacity:1}#trustindex-plugin-settings-page .btn{display:block;line-height:1.5;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:0.8rem 1.5rem;margin:20px auto 0px auto;width:fit-content;font-size:1.2rem;border-radius:0.25rem;-webkit-transition:all 0.2s ease-in-out;-o-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;font-weight:bold;text-decoration:none;cursor:pointer}#trustindex-plugin-settings-page .btn:hover{color:#fff;opacity:0.9}#trustindex-plugin-settings-page .btn-primary{background-color:#ee7321 !important;border-color:#ee7321 !important;font-family:"Montserrat";font-weight:700;color:white}#trustindex-plugin-settings-page .btn-danger{background-color:#d9534f !important;border-color:#d9534f !important;color:white}#trustindex-plugin-settings-page .btn-text{display:inline-block;color:#fff;text-decoration:none;border-radius:4px;background:#2AA8D7;font-family:"Montserrat";padding:10px 15px;margin:3px;font-weight:700;outline:0 !important}#trustindex-plugin-settings-page .btn-text:hover{background-color:#2187ad}#trustindex-plugin-settings-page .btn-disabled{background:#bdbec2 !important;border-color:#bdbec2 !important}#trustindex-plugin-settings-page .autocomplete{display:block;position:relative}#trustindex-plugin-settings-page .autocomplete .input{display:inline-block;vertical-align:top;margin-right:5px;position:relative}#trustindex-plugin-settings-page .autocomplete .input input[type=text]:focus{background:#e3f2f9;border:2px solid #2AA8D7;outline:0;box-shadow:unset !important}#trustindex-plugin-settings-page .autocomplete .info-text{padding:0;padding-top:5px;opacity:0.5}#trustindex-plugin-settings-page .autocomplete .loading{position:absolute;right:8px;top:14px;width:18px;z-index:1;display:none}#trustindex-plugin-settings-page .autocomplete .btn-text{font-size:14px !important;padding:6px 15px;line-height:2;border:2px solid #2AA8D7;outline:0 !important;display:inline-block;vertical-align:top;margin:0}#trustindex-plugin-settings-page .autocomplete span{display:block;padding:10px}#trustindex-plugin-settings-page .autocomplete span.error{color:#e33244}#trustindex-plugin-settings-page .autocomplete .results{position:absolute;top:46px;z-index:1;width:calc(100% - 2px);padding:0;margin:0;border-radius:0.25rem;border:1px solid #ddd;background:#fff;display:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#trustindex-plugin-settings-page .autocomplete .results:after,#trustindex-plugin-settings-page .autocomplete .results:before{bottom:100%;left:32px;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}#trustindex-plugin-settings-page .autocomplete .results:after{border-color:rgba(255, 255, 255, 0);border-bottom-color:#fff;border-width:8px;margin-left:-8px}#trustindex-plugin-settings-page .autocomplete .results:before{border-color:rgba(221, 221, 221, 0);border-bottom-color:#ddd;border-width:9px;margin-left:-9px}#trustindex-plugin-settings-page .autocomplete .results ul{display:block;max-height:300px;overflow:auto;list-style-type:none;margin:0;padding:0}#trustindex-plugin-settings-page .autocomplete .results li{display:block;padding:5px 10px;margin:0;border-bottom:1px solid grey;cursor:pointer;transition:all 0.25s}#trustindex-plugin-settings-page .autocomplete .results li:last-of-type{border-bottom:0}#trustindex-plugin-settings-page .autocomplete .results li:hover{background:rgba(0, 100, 255, 0.1)}#trustindex-plugin-settings-page .autocomplete .results li svg{width:40px;height:40px;position:relative;top:3px;margin-right:10px;float:left}#trustindex-plugin-settings-page .autocomplete .results li img{width:44px;height:44px;margin-right:10px;float:left;border-radius:50%;box-shadow:0 0 2px black}#trustindex-plugin-settings-page .autocomplete .results li .title{margin:0;margin-bottom:5px;font-size:14px;color:#000;pointer-events:none}#trustindex-plugin-settings-page .autocomplete .results li .location{margin:0;font-size:12px;color:#888;pointer-events:none}#trustindex-plugin-settings-page .nav-tab-wrapper{margin-bottom:0;border:0;padding-right:100px;position:relative}#trustindex-plugin-settings-page .nav-tab{background-color:#f9f9f9;border:0;box-shadow:0 0 0px black !important;border-top:4px solid #f9f9f9;padding:12px 15px;margin-left:0;margin-right:0.35em}#trustindex-plugin-settings-page .nav-tab:last-child{margin-right:0}@media (max-width:1099px){#trustindex-plugin-settings-page .nav-tab{margin-bottom:0.35em}}#trustindex-plugin-settings-page .nav-tab-active{background-color:#fff !important;border-color:#2aa9d6}#trustindex-plugin-settings-page .nav-tab-right{position:absolute;right:0;bottom:0}#trustindex-plugin-settings-page .ti-free-steps{margin-top:0;background:#fff;font-size:14px;display:flex;justify-content:space-between;position:relative;padding:5px 0}#trustindex-plugin-settings-page .ti-free-steps li{list-style:none;padding:20px 0;display:inline-block;color:#afb2b8;margin-bottom:0;white-space:nowrap}#trustindex-plugin-settings-page .ti-free-steps li:first-child{padding-left:20px}#trustindex-plugin-settings-page .ti-free-steps li:last-child{padding-right:20px}#trustindex-plugin-settings-page .ti-free-steps li>span{display:inline-block;width:20px;height:20px;line-height:20px;text-align:center;background:#bdbec2;color:white;margin-right:7px;font-size:11px;border-radius:4px;font-weight:normal}#trustindex-plugin-settings-page .ti-free-steps li.current{font-weight:bold;pointer-events:none}#trustindex-plugin-settings-page .ti-free-steps li.active,#trustindex-plugin-settings-page .ti-free-steps li.done{color:black;cursor:pointer}#trustindex-plugin-settings-page .ti-free-steps li.active>span{background:#2aa8d8;box-shadow:0 0 3px #2aa8d8}#trustindex-plugin-settings-page .ti-free-steps li.done>span{background:#4db594;color:transparent;position:relative}#trustindex-plugin-settings-page .ti-free-steps li.done>span:after{content:'\2713';color:white;margin-left:-7px;font-weight:bold}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow{position:relative;display:inline-block;padding:0;padding-top:25px}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:before,#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:after{content:'';background:#d8d8d8;position:relative;width:11px;height:3px;display:block;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);border-radius:2px}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:after{-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);top:4px}@media (max-width:1240px){#trustindex-plugin-settings-page .ti-free-steps{flex-wrap:wrap}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(4){width:100%;opacity:0;padding-top:0;margin-top:-6px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(3){padding-right:20px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(5){padding-left:20px}}@media (max-width:600px){#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(2),#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(6){width:100%;opacity:0;padding-top:0;margin-top:-6px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(1),#trustindex-plugin-settings-page .ti-free-steps li:nth-child(5){padding-right:20px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(3),#trustindex-plugin-settings-page .ti-free-steps li:nth-child(7){padding-left:20px;padding-right:0}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(4){width:unset;opacity:unset;padding-top:25px;margin-top:unset}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(5){padding-left:0}}#trustindex-plugin-settings-page .ti-free-title{font-size:25px !important;font-weight:bold !important;padding:0 20px;margin:25px 0 !important}#trustindex-plugin-settings-page .ti-back-icon{color:#5d6268;float:right;font-size:14px;font-weight:bold;position:relative;cursor:pointer;text-decoration:none;box-shadow:0 0 0px black !important;text-shadow:none !important}#trustindex-plugin-settings-page .ti-back-icon:before,#trustindex-plugin-settings-page .ti-back-icon:after{content:'';background:#d8d8d8;position:absolute;left:-18px;top:11px;width:9px;height:3px;display:block;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);border-radius:2px}#trustindex-plugin-settings-page .ti-back-icon:after{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);margin-top:4px}#trustindex-plugin-settings-page .ti-box{background:white;padding:25px;border-radius:4px;margin-bottom:1em}#trustindex-plugin-settings-page .ti-box .btn-text{margin-left:0;font-size:13px}#trustindex-plugin-settings-page .ti-box>.ti-header{font-size:18px;font-weight:600;border-bottom:1px solid #e0e0e0;margin-bottom:20px;padding-bottom:10px;color:inherit}#trustindex-plugin-settings-page .ti-box>.ti-header span,#trustindex-plugin-settings-page .ti-box>.ti-header strong{color:inherit}#trustindex-plugin-settings-page .ti-box>.ti-header .btn-text{margin:0;padding:5px 15px;margin-top:-5px}#trustindex-plugin-settings-page .ti-box>.ti-footer{border-top:1px solid #e0e0e0;margin-top:20px;padding-top:20px}#trustindex-plugin-settings-page .ti-box .preview{float:unset;box-sizing:border-box}#trustindex-plugin-settings-page .ti-box img{max-width:100%}#trustindex-plugin-settings-page .ti-box.ti-notice-error{border-left:4px solid red;border-top-left-radius:0;border-bottom-left-radius:0}#trustindex-plugin-settings-page .ti-box.ti-notice-warning{border-left:4px solid #ffb900;border-top-left-radius:0;border-bottom-left-radius:0}#trustindex-plugin-settings-page .ti-preview-boxes-container{display:flex;flex-wrap:wrap;margin:0 -10px;box-sizing:border-box}#trustindex-plugin-settings-page .ti-preview-boxes-container .ti-full-width{flex:0 0 100%;max-width:100%;padding-left:10px;padding-right:10px;box-sizing:inherit;margin-bottom:20px}#trustindex-plugin-settings-page .ti-preview-boxes-container .ti-half-width{flex:0 0 50%;max-width:50%;padding-left:10px;padding-right:10px;margin-left:auto;margin-right:auto;box-sizing:inherit;margin-bottom:20px}#trustindex-plugin-settings-page .ti-preview-boxes-container .ti-preview-boxes{height:100%}#trustindex-plugin-settings-page .ti-header-layout-text{font-weight:normal;font-size:85%}#trustindex-plugin-settings-page .ti-pull-right{float:right}#trustindex-plugin-settings-page .ti-pull-right+.ti-pull-right{margin-right:20px}#trustindex-plugin-settings-page .ti-left-block,#trustindex-plugin-settings-page .ti-right-block{display:inline-block !important;float:left;vertical-align:top;width:calc(50% - 15px) !important;margin:0 !important}#trustindex-plugin-settings-page .ti-left-block .form-control,#trustindex-plugin-settings-page .ti-right-block .form-control{max-width:400px}#trustindex-plugin-settings-page .ti-right-block{float:right}#trustindex-plugin-settings-page .ti-input-row{margin-bottom:1.33em}#trustindex-plugin-settings-page .ti-input-row:last-child{margin:0}#trustindex-plugin-settings-page .ti-input-row label{display:block;font-size:15px;font-weight:600;font-family:inherit;cursor:unset;color:inherit;margin-bottom:0.5em}#trustindex-plugin-settings-page #ti-widget-options{margin-top:25px}#trustindex-plugin-settings-page .ti-preview-box{padding:10px 0}#trustindex-plugin-settings-page .code-shortcode{display:inline-block;padding:10px;border-radius:0.25rem;border:2px solid #dcdce4;background:#f1f1f1}#trustindex-plugin-settings-page .code-shortcode+a{position:relative;top:1px}#trustindex-plugin-settings-page .ti-seo-list{margin:20px 0;counter-reset:li;padding-left:35px}#trustindex-plugin-settings-page .ti-seo-list li{position:relative;list-style:none;margin:0;margin-bottom:25px;counter-increment:li}#trustindex-plugin-settings-page .ti-seo-list li:before{content:counter(li);position:absolute;left:-35px;top:0;display:inline-block;width:20px;height:20px;line-height:20px;text-align:center;background:#4db594;color:white;font-size:11px;border-radius:4px;font-weight:normal}#trustindex-plugin-settings-page .ti-filter-row{font-size:14px;display:block;padding:20px 25px;background:#f7f7f7;margin-bottom:10px;border-radius:4px}#trustindex-plugin-settings-page .ti-filter-row>label{margin-right:15px}#trustindex-plugin-settings-page .ti-filter-row .ti-checkbox{float:unset;width:auto;margin-bottom:0}#trustindex-plugin-settings-page .ti-filter-row .ti-checkbox input{margin-right:3px}#trustindex-plugin-settings-page .ti-source-box{display:block;border:1px solid #dddddf;box-shadow:2px 2px 5px rgba(0, 0, 0, 0.1);background:white;padding:15px;padding-right:175px;position:relative;border-radius:4px;margin-bottom:20px}#trustindex-plugin-settings-page .ti-source-box img{float:left;border-radius:50%;width:50px;height:50px;margin-right:10px;object-fit:cover;object-position:top}#trustindex-plugin-settings-page .ti-source-box .ti-source-info{display:inline-block;word-wrap:break-word;max-width:calc(100% - 70px)}#trustindex-plugin-settings-page .ti-source-box .btn-text{position:absolute;right:15px;top:50%;transform:translateY(-50%);margin:0;font-size:13px}#trustindex-plugin-settings-page .ti-selected-source{margin-top:15px;display:none}#trustindex-plugin-settings-page .ti-selected-source .ti-left-label{vertical-align:top;line-height:unset;padding-top:10px;float:left}#trustindex-plugin-settings-page .ti-selected-source .ti-source-box{display:inline-block;width:550px;margin-bottom:0;float:left}#trustindex-plugin-settings-page .ti-selected-source .ti-source-box+.ti-source-box{margin-left:220px;margin-top:20px}#trustindex-plugin-settings-page #ti-widget-options .ti-checkbox{margin-bottom:5px}#trustindex-plugin-settings-page .ti-highlight-content{display:block;margin-top:10px;padding:10px 20px;background:#eee;position:relative}#trustindex-plugin-settings-page .ti-highlight-content .selection-content{position:relative;z-index:1}#trustindex-plugin-settings-page .ti-highlight-content .raw-content{position:absolute;color:transparent;width:calc(100% - 40px);z-index:0}#trustindex-plugin-settings-page .ti-highlight-content .raw-content mark{color:transparent !important;background:#fbe049 !important}#trustindex-plugin-settings-page .ti-my-reviews mark.ti-highlight{padding:0 1px;background:#4682B4;color:white}#trustindex-plugin-settings-page .ti-prokontra-good svg,#trustindex-plugin-settings-page .ti-prokontra-bad svg{width:18px;height:18px;display:inline-block;vertical-align:sub;position:relative;top:-1px}#trustindex-plugin-settings-page .ti-prokontra-good svg{fill:#0ab21b}#trustindex-plugin-settings-page .ti-prokontra-bad svg{fill:#383838}#trustindex-plugin-settings-page .ti-prokontra-good:after,#trustindex-plugin-settings-page .ti-prokontra-bad:after{content:'\a0\b7\a0'}#trustindex-plugin-settings-page .ti-special-offer{width:40%;margin:10px 0}#trustindex-plugin-settings-page .ti-special-offer img{float:left;width:100px;border:0;margin-right:15px;margin-top:2px}#trustindex-plugin-settings-page .ti-special-offer p{font-size:14px}#trustindex-plugin-settings-page .ti-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:5;display:none;overflow-x:hidden;overflow-y:auto;outline:0;background:rgba(0, 0, 0, 0.5)}#trustindex-plugin-settings-page .ti-modal .ti-modal-dialog{position:relative;width:auto;margin:30px auto;margin-top:50px;max-width:800px}#trustindex-plugin-settings-page .ti-modal .ti-modal-content{position:relative;display:flex;flex-direction:column;background-color:white;background-clip:padding-box;border:1px solid rgba(0, 0, 0, 0.2);border-radius:4px;outline:0}#trustindex-plugin-settings-page .ti-modal .ti-modal-header{display:flex;align-items:center;justify-content:space-between;padding:15px;border-bottom:1px solid #e0e0e0;font-size:18px;font-weight:600}#trustindex-plugin-settings-page .ti-modal .ti-modal-title{margin-bottom:0;line-height:1.5}#trustindex-plugin-settings-page .ti-modal .ti-modal-body{position:relative;flex:1 1 auto;padding:15px}#trustindex-plugin-settings-page .ti-modal .ti-modal-footer{display:flex;align-items:center;justify-content:flex-end;padding:15px;border-top:1px solid #e0e0e0}#trustindex-plugin-settings-page .ti-modal .ti-modal-footer>:not(:first-child){margin-left:0.25rem}#trustindex-plugin-settings-page .ti-modal .ti-modal-footer>:not(:last-child){margin-right:0.25rem}#trustindex-plugin-settings-page .troubleshooting-checklist{list-style:decimal;padding-left:25px}#trustindex-plugin-settings-page .troubleshooting-checklist .dashicons{position:relative;top:-1px;margin:0 3px}#trustindex-plugin-settings-page .troubleshooting-checklist .dashicons.dashicons-yes-alt{color:green}#trustindex-plugin-settings-page .troubleshooting-checklist .dashicons.dashicons-dismiss{color:red}#trustindex-plugin-settings-page .troubleshooting-checklist ul{list-style:disc;margin:15px 0;padding-left:30px}#trustindex-plugin-settings-page .troubleshooting-checklist ul li:last-child{margin-bottom:0}#trustindex-plugin-settings-page .troubleshooting-checklist .ti-notice{margin-left:0;padding-left:8px}#trustindex-plugin-settings-page .troubleshooting-checklist .ti-notice p{margin:0.1em 0;font-size:13px}#trustindex-plugin-settings-page .troubleshooting-checklist a{text-decoration:none}#trustindex-plugin-settings-page .ti-troubleshooting-info{width:calc(100% - 50px);height:200px;resize:none;outline:0 !important;box-shadow:none !important;border:1px solid #7e8993 !important;margin:0 25px}#trustindex-plugin-settings-page .ti-troubleshooting-info+.btn-text{margin-top:10px;margin-right:25px}
 
trunk/static/css/admin-widget.css DELETED
@@ -1,11 +0,0 @@
1
- .text-danger { color: red; }
2
- .text-success { color: green; }
3
-
4
- .trustindex-widget-admin .block-help-template { display: none; }
5
- .trustindex-widget-admin .help-block { position: absolute; background: white;padding: 10px; border: 1px solid blue; z-index: 10; }
6
- .trustindex-widget-admin .help-block p { margin-top: 0px; }
7
- .trustindex-widget-admin .help-block .dashicons-dismiss { float: right; cursor: pointer; }
8
- .trustindex-widget-admin .btn-insert-tooltip { cursor: pointer; }
9
- .trustindex-widget-admin label .dashicons { float: right; }
10
-
11
- .trustindex-widget-admin .btn-copy-widget-id { text-decoration: none; }
 
 
 
 
 
 
 
 
 
 
 
trunk/static/img/check-icon.svg DELETED
@@ -1,24 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg width="100%" height="100%" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
- <g transform="matrix(1,0,0,1,-1456.05,-2718.07)">
5
- <g transform="matrix(1,0,0,1,590,2240)">
6
- <g transform="matrix(0.294981,0,0,0.294647,734.474,739.255)">
7
- <g transform="matrix(-1.68585,-8.1708e-16,1.50946e-16,-1.68585,675.316,-776.864)">
8
- <path d="M136,48.2C136,42.019 130.987,37 124.813,37L119.187,37C113.013,37 108,42.019 108,48.2L108,53.8C108,59.981 113.013,65 119.187,65L124.813,65C130.987,65 136,59.981 136,53.8L136,48.2Z" style="fill:rgb(18,180,131);"/>
9
- </g>
10
- <g transform="matrix(1.20778,0,0,1.21145,-96.4528,-133.436)">
11
- <g transform="matrix(0.369289,0.369289,-0.707107,0.707107,-157.84,-315.308)">
12
- <path d="M469.642,-641.5C469.642,-642.328 468.355,-643 466.769,-643L445.872,-643C444.287,-643 443,-642.328 443,-641.5L443,-638.5C443,-637.672 444.287,-637 445.872,-637L466.769,-637C468.355,-637 469.642,-637.672 469.642,-638.5L469.642,-641.5Z" style="fill:white;"/>
13
- </g>
14
- <g transform="matrix(0.556965,-0.556965,0.707107,0.707107,669.792,104.902)">
15
- <path d="M469.642,-641.5C469.642,-642.328 468.788,-643 467.737,-643L444.904,-643C443.853,-643 443,-642.328 443,-641.5L443,-638.5C443,-637.672 443.853,-637 444.904,-637L467.737,-637C468.788,-637 469.642,-637.672 469.642,-638.5L469.642,-641.5Z" style="fill:white;"/>
16
- </g>
17
- </g>
18
- <g transform="matrix(3.39005,0,0,3.39389,-4489.47,-10110.6)">
19
- <path d="M1460.69,2724.11L1463.59,2727L1462.15,2723.07L1460.69,2724.11" style="fill:rgb(18,180,131);"/>
20
- </g>
21
- </g>
22
- </g>
23
- </g>
24
- </svg>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/static/img/help-where-is-id.jpg DELETED
Binary file
trunk/static/img/no.png DELETED
Binary file
trunk/static/img/platform/logo-dark.svg DELETED
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 255.2 80.3" style="enable-background:new 0 0 255.2 80.3;" xml:space="preserve"><style type="text/css">.st0{fill:#4285F4;}.st1{fill:#EA4335;}.st2{fill:#FBBC05;}.st3{fill:#34A853;}</style><g id="XMLID_11_"><path id="XMLID_10_" class="st0" d="M31.9,28.6v8.6h20.5c-0.6,4.8-2.2,8.3-4.7,10.8c-3,3-7.7,6.3-15.8,6.3 c-12.6,0-22.5-10.2-22.5-22.8S19.2,8.6,31.9,8.6c6.8,0,11.8,2.7,15.5,6.1l6-6C48.3,3.8,41.4,0,31.9,0C14.6,0,0,14.1,0,31.4 s14.6,31.4,31.9,31.4c9.4,0,16.4-3.1,21.9-8.8c5.7-5.7,7.4-13.6,7.4-20.1c0-2-0.1-3.8-0.5-5.4L31.9,28.6L31.9,28.6z"/><path id="XMLID_24_" class="st1" d="M86.9,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C107.2,30.1,98.1,21.6,86.9,21.6z M86.9,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3s11.4,5,11.4,12.3 C98.3,49.1,93,54.2,86.9,54.2z"/><path id="XMLID_21_" class="st0" d="M186.6,26.1h-0.3c-2-2.4-5.8-4.5-10.7-4.5c-10.1,0-19,8.8-19,20.3c0,11.4,8.8,20.3,19,20.3 c4.9,0,8.7-2.2,10.7-4.6h0.3v2.8c0,7.7-4.2,11.9-10.8,11.9c-5.4,0-8.8-3.9-10.2-7.2l-7.7,3.2c2.2,5.4,8.1,12,18,12 c10.4,0,19.3-6.1,19.3-21.1V22.7h-8.4v3.4H186.6z M176.4,54.2c-6.1,0-10.8-5.2-10.8-12.3c0-7.2,4.7-12.3,10.8-12.3 s10.8,5.2,10.8,12.4C187.3,49,182.5,54.2,176.4,54.2z"/><path id="XMLID_18_" class="st2" d="M132.3,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C152.6,30.1,143.5,21.6,132.3,21.6z M132.3,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3c6.1,0,11.4,5,11.4,12.3 C143.7,49.1,138.4,54.2,132.3,54.2z"/><path id="XMLID_3_" class="st3" d="M202.1,0.8h8.8v61.3h-8.8V0.8z"/><path id="XMLID_14_" class="st1" d="M237.9,54.2c-4.5,0-7.7-2.1-9.8-6.1l27.1-11.2l-0.9-2.3c-1.7-4.5-6.8-12.9-17.3-12.9 c-10.4,0-19.1,8.2-19.1,20.3c0,11.4,8.6,20.3,20.1,20.3c9.3,0,14.7-5.7,16.9-9l-6.9-4.6C245.6,51.9,242.4,54.2,237.9,54.2 L237.9,54.2z M237.3,29.2c3.6,0,6.7,1.9,7.7,4.5l-18.3,7.6C226.6,32.7,232.7,29.2,237.3,29.2z"/></g></svg>
 
trunk/static/img/platform/logo.svg DELETED
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 255.2 80.3" style="enable-background:new 0 0 255.2 80.3;" xml:space="preserve"><style type="text/css">.st0{fill:#4285F4;}.st1{fill:#EA4335;}.st2{fill:#FBBC05;}.st3{fill:#34A853;}</style><g id="XMLID_11_"><path id="XMLID_10_" class="st0" d="M31.9,28.6v8.6h20.5c-0.6,4.8-2.2,8.3-4.7,10.8c-3,3-7.7,6.3-15.8,6.3 c-12.6,0-22.5-10.2-22.5-22.8S19.2,8.6,31.9,8.6c6.8,0,11.8,2.7,15.5,6.1l6-6C48.3,3.8,41.4,0,31.9,0C14.6,0,0,14.1,0,31.4 s14.6,31.4,31.9,31.4c9.4,0,16.4-3.1,21.9-8.8c5.7-5.7,7.4-13.6,7.4-20.1c0-2-0.1-3.8-0.5-5.4H31.9z"/><path id="XMLID_24_" class="st1" d="M86.9,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C107.2,30.1,98.1,21.6,86.9,21.6z M86.9,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3c6.1,0,11.4,5,11.4,12.3 C98.3,49.1,93,54.2,86.9,54.2z"/><path id="XMLID_21_" class="st0" d="M186.6,26.1h-0.3c-2-2.4-5.8-4.5-10.7-4.5c-10.1,0-19,8.8-19,20.3c0,11.4,8.8,20.3,19,20.3 c4.9,0,8.7-2.2,10.7-4.6h0.3v2.8c0,7.7-4.2,11.9-10.8,11.9c-5.4,0-8.8-3.9-10.2-7.2l-7.7,3.2c2.2,5.4,8.1,12,18,12 c10.4,0,19.3-6.1,19.3-21.1V22.7h-8.4V26.1z M176.4,54.2c-6.1,0-10.8-5.2-10.8-12.3c0-7.2,4.7-12.3,10.8-12.3 c6.1,0,10.8,5.2,10.8,12.4C187.3,49,182.5,54.2,176.4,54.2z"/><path id="XMLID_18_" class="st2" d="M132.3,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C152.6,30.1,143.5,21.6,132.3,21.6z M132.3,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3c6.1,0,11.4,5,11.4,12.3 C143.7,49.1,138.4,54.2,132.3,54.2z"/><path id="XMLID_3_" class="st3" d="M202.1,0.8h8.8v61.3h-8.8V0.8z"/><path id="XMLID_14_" class="st1" d="M237.9,54.2c-4.5,0-7.7-2.1-9.8-6.1l27.1-11.2l-0.9-2.3c-1.7-4.5-6.8-12.9-17.3-12.9 c-10.4,0-19.1,8.2-19.1,20.3c0,11.4,8.6,20.3,20.1,20.3c9.3,0,14.7-5.7,16.9-9l-6.9-4.6C245.6,51.9,242.4,54.2,237.9,54.2 L237.9,54.2z M237.3,29.2c3.6,0,6.7,1.9,7.7,4.5l-18.3,7.6C226.6,32.7,232.7,29.2,237.3,29.2z"/></g></svg>
 
trunk/static/img/platforms.png DELETED
Binary file
trunk/static/img/special_30.jpg DELETED
Binary file
trunk/static/img/trustindex-sign-logo.png DELETED
Binary file
trunk/static/img/trustindex.svg DELETED
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 680 114" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M158.022,37.168l-22.876,0l-0,-13.481l62.296,0l0,13.481l-22.876,0l0,58.007l-16.544,0l0,-58.007Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M217.357,47.483c1.94,-2.655 4.493,-4.698 7.761,-6.025c3.166,-1.328 6.945,-2.043 11.132,-2.043l0,14.706c-1.736,-0.102 -2.962,-0.204 -3.575,-0.204c-4.595,-0 -8.17,1.225 -10.722,3.778c-2.554,2.553 -3.881,6.434 -3.881,11.54l-0,25.94l-15.932,0l0,-54.943l15.217,0l-0,7.251Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M298.444,40.232l0,54.943l-15.114,0l-0,-6.536c-2.145,2.349 -4.596,4.187 -7.558,5.413c-2.961,1.328 -6.127,1.94 -9.497,1.94c-7.251,0 -12.97,-2.042 -17.157,-6.229c-4.187,-4.188 -6.332,-10.315 -6.332,-18.485l-0,-31.046l15.932,0l-0,28.697c-0,8.885 3.676,13.276 11.131,13.276c3.779,0 6.843,-1.225 9.191,-3.778c2.349,-2.451 3.472,-6.128 3.472,-11.03l0,-27.165l15.932,0Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M328.673,95.992c-4.596,0 -8.987,-0.612 -13.378,-1.736c-4.392,-1.123 -7.864,-2.451 -10.417,-4.187l5.31,-11.438c2.452,1.532 5.413,2.859 8.885,3.779c3.472,1.021 6.843,1.531 10.213,1.531c6.74,0 10.11,-1.633 10.11,-5.004c0,-1.532 -0.919,-2.655 -2.757,-3.37c-1.839,-0.715 -4.698,-1.225 -8.477,-1.736c-4.493,-0.715 -8.17,-1.43 -11.131,-2.349c-2.962,-0.919 -5.413,-2.451 -7.558,-4.697c-2.246,-2.247 -3.268,-5.413 -3.268,-9.6c0,-3.472 1.022,-6.536 3.064,-9.294c1.941,-2.655 4.902,-4.697 8.783,-6.229c3.779,-1.532 8.374,-2.247 13.583,-2.247c3.88,0 7.761,0.408 11.642,1.225c3.778,0.92 6.944,2.043 9.498,3.575l-5.311,11.336c-4.8,-2.758 -10.11,-4.085 -15.829,-4.085c-3.37,-0 -5.924,0.51 -7.66,1.429c-1.736,0.92 -2.553,2.145 -2.553,3.677c0,1.736 0.919,2.859 2.758,3.574c1.838,0.715 4.8,1.328 8.782,1.941c4.494,0.715 8.17,1.532 11.03,2.348c2.859,0.92 5.31,2.452 7.455,4.698c2.145,2.247 3.166,5.413 3.166,9.396c-0,3.37 -1.021,6.434 -3.064,9.089c-2.042,2.655 -5.004,4.698 -8.885,6.127c-3.983,1.533 -8.578,2.247 -13.991,2.247Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M396.791,92.52c-1.532,1.123 -3.473,2.043 -5.719,2.553c-2.349,0.613 -4.698,0.919 -7.251,0.919c-6.536,0 -11.541,-1.634 -15.217,-5.004c-3.472,-3.37 -5.31,-8.272 -5.31,-14.706l-0,-22.569l-8.477,-0l0,-12.255l8.477,-0l-0,-13.379l15.931,0l0,13.379l13.685,-0l0,12.255l-13.685,-0l0,22.365c0,2.349 0.613,4.085 1.838,5.31c1.124,1.328 2.86,1.941 5.004,1.941c2.554,-0 4.698,-0.715 6.434,-2.043l4.29,11.234Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M402.715,40.232l15.931,0l-0,54.943l-15.931,0l-0,-54.943Zm7.965,-7.66c-2.961,0 -5.31,-0.817 -7.148,-2.552c-1.839,-1.737 -2.758,-3.779 -2.758,-6.333c0,-2.552 0.919,-4.595 2.758,-6.331c1.838,-1.736 4.187,-2.553 7.148,-2.553c2.962,-0 5.311,0.817 7.149,2.451c1.838,1.634 2.759,3.676 2.759,6.127c-0,2.656 -0.921,4.8 -2.759,6.536c-1.838,1.736 -4.187,2.655 -7.149,2.655Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M463.788,39.415c6.841,0 12.354,2.043 16.541,6.128c4.188,4.085 6.229,10.11 6.229,18.178l0,31.454l-15.929,0l0,-29.003c0,-4.392 -0.921,-7.66 -2.862,-9.805c-1.938,-2.144 -4.696,-3.165 -8.271,-3.165c-3.983,-0 -7.25,1.225 -9.6,3.676c-2.35,2.553 -3.575,6.23 -3.575,11.132l-0,27.165l-15.929,0l-0,-54.943l15.216,0l0,6.434c2.142,-2.349 4.696,-4.085 7.863,-5.413c3.167,-1.225 6.537,-1.838 10.317,-1.838Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M553.858,19.398l0,75.777l-15.216,0l-0,-6.332c-3.984,4.8 -9.7,7.149 -17.154,7.149c-5.209,0 -9.909,-1.123 -13.992,-3.472c-4.188,-2.349 -7.558,-5.617 -9.909,-9.906c-2.345,-4.289 -3.575,-9.294 -3.575,-14.91c0,-5.617 1.23,-10.622 3.575,-14.911c2.351,-4.289 5.721,-7.557 9.909,-9.906c4.083,-2.349 8.783,-3.472 13.992,-3.472c7.045,0 12.458,2.247 16.441,6.638l0,-26.655l15.929,0Zm-29.616,63.522c3.983,0 7.354,-1.43 10.008,-4.187c2.658,-2.757 3.983,-6.434 3.983,-11.029c0,-4.596 -1.325,-8.273 -3.983,-11.132c-2.654,-2.757 -6.025,-4.085 -10.008,-4.085c-4.084,0 -7.455,1.328 -10.109,4.085c-2.654,2.859 -3.983,6.536 -3.983,11.132c0,4.595 1.329,8.272 3.983,11.029c2.654,2.757 6.025,4.187 10.109,4.187Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M619.321,67.908c-0,0.204 -0.1,1.634 -0.304,4.289l-41.567,0c0.717,3.37 2.554,6.128 5.313,8.068c2.754,1.94 6.229,2.962 10.416,2.962c2.858,-0 5.413,-0.409 7.658,-1.328c2.146,-0.817 4.188,-2.145 6.125,-3.983l8.48,9.192c-5.209,5.922 -12.767,8.884 -22.671,8.884c-6.234,0 -11.646,-1.225 -16.446,-3.676c-4.796,-2.349 -8.475,-5.719 -11.029,-10.008c-2.55,-4.29 -3.879,-9.192 -3.879,-14.604c-0,-5.413 1.329,-10.213 3.879,-14.502c2.554,-4.392 6.025,-7.762 10.416,-10.111c4.496,-2.451 9.5,-3.676 15.013,-3.676c5.412,0 10.212,1.123 14.604,3.472c4.392,2.349 7.763,5.617 10.317,10.008c2.45,4.29 3.675,9.294 3.675,15.013Zm-28.492,-16.442c-3.575,-0 -6.637,1.021 -9.087,3.064c-2.455,2.042 -3.984,4.799 -4.496,8.374l27.062,-0c-0.508,-3.473 -2.041,-6.23 -4.491,-8.374c-2.45,-2.043 -5.413,-3.064 -8.988,-3.064Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M661.804,95.175l-12.05,-16.85l-12.458,16.85l-17.363,0l21.142,-27.676l-20.425,-27.267l17.871,0l11.641,16.033l11.951,-16.033l16.954,0l-20.425,26.859l21.241,28.084l-18.079,0Z" style="fill:#3b404b;fill-rule:nonzero;"/><g><circle cx="56.942" cy="56.942" r="56.942" style="fill:#2aa8d7;"/><path d="M54.686,55.275l21.292,-21.347c1.585,-1.585 4.157,-1.585 5.742,0l5.743,5.763c1.586,1.585 1.586,4.176 -0,5.761l-28.396,28.423c-0.081,0.116 -0.17,0.232 -0.263,0.31l-5.746,5.761c-0.793,0.774 -1.841,1.199 -2.885,1.199c-1.044,0 -2.088,-0.425 -2.885,-1.199l-5.743,-5.761c-0.092,-0.078 -0.181,-0.194 -0.262,-0.31l-14.862,-14.888c-1.585,-1.586 -1.585,-4.138 0,-5.723l5.743,-5.762c1.586,-1.586 4.161,-1.586 5.746,-0l11.254,11.253l1.016,1.006l11.505,11.407l-6.999,-15.893Z" style="fill:#fff;"/></g></g></svg>
 
trunk/static/img/yes.png DELETED
Binary file
trunk/static/js/admin-editor.js DELETED
@@ -1 +0,0 @@
1
- (function(){tinymce.create("tinymce.plugins.trustindex",{init:function(a,b){let jq_url=(typeof ajax_object!="undefined"?ajax_object.ajax_url:window.ajaxurl||null);if(!jq_url){return}a.addButton("trustindex",{title:"Add Trustindex widget shortcode",cmd:"add-trustindex-widget",image:b+"/../img/trustindex-sign-logo.png",text:""});a.addCommand("add-trustindex-widget",function(){jQuery.get(jq_url+"?action=list_trustindex_widgets",function(c){a.windowManager.open({title:"Please add an Trustindex widget ID!",body:[{type:"container",name:"container",label:"",html:c},{type:"textbox",name:"widget-id",placeholder:"Trustindex widget ID",multiline:false,minWidth:200}],onsubmit:function(f){var d=f.data["widget-id"];if(d.length<10){alert("Trustindex ID is missing or too short. Please check, mayba a copy-paste error!");return false}else{a.execCommand("mceInsertContent",0,'[trustindex data-widget-id="'+d+'"]')}}})});jQuery("body").on("click",".btn-copy-widget-id",function(c){let selected_class="text-danger";c.preventDefault();let link=jQuery(this);let id=link.data("ti-id");link.closest(".mce-form").find("input").val(id).trigger("change");link.closest(".mce-form").find(".btn-copy-widget-id."+selected_class).each(function(d,e){jQuery(e).removeClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-admin-post")});link.addClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-yes")})})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Trustindex Buttons",author:"Trustindex.io - Velvel ltd[www.velvel.hu]",authorurl:"https://www.trustindex.io/",infourl:"https://www.trustindex.io/",version:"1.1"}}});tinymce.PluginManager.add("trustindex",tinymce.plugins.trustindex)})();
 
trunk/static/js/admin-page-settings-common.js DELETED
@@ -1 +0,0 @@
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-notice.is-dismissible .notice-dismiss",function(){let button=jQuery(this);let container=button.closest(".ti-notice");container.fadeOut(200);if(button.data("command")&&!button.data("ajax-run")){button.data("ajax-run",1);jQuery.post("",{command:button.data("command")})}})});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){})};
 
trunk/static/js/admin-page-settings-connect.js DELETED
@@ -1 +0,0 @@
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")})});
 
trunk/static/js/admin-page-settings.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(){Trustindex_Autocomplete.check=function(){let value=jQuery("#trustindex-plugin-settings-page #page-link").val().trim();if(Trustindex_Autocomplete.searching){return false}if(value.substr(0,4)=="www."||value.substr(0,7)=="http://"||value.substr(0,8)=="https://"){if(!/^(www\.|https?:\/\/)(www\.)?google\.[^\/]+\/(search|maps)/gm.test(value)&&!/^(www\.|https?:\/\/)(www\.)?g\.page\/[^\/]+\/(?:review|share)/gm.test(value)){Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data("errortext-search")+"</span>");Trustindex_Autocomplete.box.show();return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=value;if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResult(Trustindex_Autocomplete.cache[cache_term],"errortext-search")},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/findPlaceId",data:{url:value},dataType:"jsonp",success:function(a){Trustindex_Autocomplete.cache[cache_term]=a;Trustindex_Autocomplete.showResult(a,"errortext-search")}})}else{if(!/([A-Z][a-zA-Z0-9_-]+)/gm.test(value)){Trustindex_Autocomplete.box.html('<span class="error">'+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=value;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:"google",page_id:value},dataType:"jsonp",success:function(a){Trustindex_Autocomplete.cache[cache_term]=a;Trustindex_Autocomplete.showResult(a)}})}};Trustindex_Autocomplete.showResult=function(a,b){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(typeof b=="undefined"){b="errortext"}if(a.success&&a.result){let page_details={id:a.result.page_id,name:a.result.name,address:a.result.address,avatar_url:a.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(".ti-source-box:not(.ti-original-source-box)").remove();div.find("img").attr("src",page_details.avatar_url);div.find("#label-noreg-page_name, .label-noreg-page_name").html(page_details.name);if(page_details.address){div.find("#label-noreg-address, .label-noreg-address").html(page_details.address+"<br />")}div.find("#label-noreg-url, .label-noreg-url").html("<a target='_blank' href='"+a.result.url+"'>"+a.result.url+"</a>");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");div.fadeIn();div.find(".ti-source-box").show()}else{if(typeof a.possible_places!="undefined"){let form=jQuery("#submit-form");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");let source_div=form.find(".ti-selected-source");let source_row=source_div.find(".ti-original-source-box");source_div.find(".ti-source-box:not(.ti-original-source-box)").remove();source_row.find('[id|="label-noreg"]').each(function(){let el=jQuery(this);if(!el.attr("id")){return}el.attr("class",el.attr("id"));el.attr("id","")});a.possible_places.forEach(function(c){let div=source_row.clone().removeClass("ti-original-source-box");div.find("img").attr("src",c.avatar_url);div.find(".label-noreg-page_name").html(c.name);div.find(".label-noreg-url").html("<a target='_blank' href='"+c.url+"'>"+c.url+"</a>");div.find(".btn-connect").removeClass("btn-connect").addClass("btn-place-choose").attr("href",c.url);source_row.before(div);div.show()});source_row.hide();source_div.fadeIn()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data(b)+"</span>");Trustindex_Autocomplete.box.show()}}};jQuery(document).on("click","#trustindex-plugin-settings-page .btn-place-choose",function(a){a.preventDefault();let btn=jQuery(this);btn.css("pointer-events","none").addClass("btn-disabled").blur();TI_manage_dots(btn);Trustindex_Autocomplete.button.css("pointer-events","none");jQuery("#trustindex-plugin-settings-page .btn-text").css("pointer-events","none");jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/findPlaceId",data:{url:btn.attr("href")},dataType:"jsonp",success:function(b){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");form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));form.submit()}else{location.reload()}}})})});
 
trunk/static/js/admin-popup.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(){let popupPosition=function(){let pad=jQuery("#wpcontent").css("padding-left");jQuery(".trustindex-popup").css({right:pad,"margin-left":pad})};popupPosition();jQuery(window).resize(popupPosition);jQuery(document).on("click","a.trustindex-rateus",function(a){let link=jQuery(this),closeButton=link.closest(".notice").find(".notice-dismiss"),url=link.attr("href");closeButton.click();if(link.attr("target")===undefined){a.preventDefault();jQuery.get(url);return false}})});
 
trunk/static/js/admin-widget.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(){let wp_content=jQuery("#wpbody-content").length?jQuery("#wpbody-content"):jQuery("body");wp_content.on("click",".btn-insert-tooltip",function(a){a.preventDefault();jQuery(this).closest("label").after(jQuery(".block-help-template:last").clone().removeAttr("id").removeClass("block-help-template"))});wp_content.on("click",".dashicons-dismiss",function(a){a.preventDefault();jQuery(this).closest(".help-block").remove()});wp_content.on("click",".btn-copy-widget-id",function(a){a.preventDefault();let link=jQuery(this);link.closest("form").find(".form-control").val(link.data("ti-id")).trigger("change");TImanageCopyLinks(link.closest("form"),link)});wp_content.on("blur",".trustindex-widget-admin .form-control",function(){let input=jQuery(this);if(input.attr("required")!="required"||input.val()){input.prev().removeClass("text-danger")}else{input.prev().addClass("text-danger")}TImanageCopyLinks(input.closest("form"),input.closest("form").find("[data-ti-id='"+input.val()+"']"))})});function TImanageCopyLinks(b,a){let selected_class="text-danger";b.find(".btn-copy-widget-id."+selected_class).each(function(c,d){jQuery(d).removeClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-admin-post")});if(a){a.addClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-yes")}};
 
trunk/static/js/frontend.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(a){let widget=a(WidgetCssgoogle.selector);if(widget.length){if(!a(WidgetCssgoogle.link_selector).length){a.post(WidgetCssgoogle.ajaxurl,{action:WidgetCssgoogle.action,security:WidgetCssgoogle.security},function(b){a("head").append('<style type="text/css">'+b+"</style>");widget.show();if(typeof Trustindex!="undefined"){Trustindex.resize_widgets()}})}else{widget.show()}}});
 
trunk/tabs/demo_widgets.php DELETED
@@ -1,33 +0,0 @@
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>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/get_reviews.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- ?>
4
- <div class="ti-box">
5
- <div class="ti-header"><?php echo TrustindexPlugin::___('Want more %s reviews?', [ 'Google' ]); ?></div>
6
- <?php if($trustindex_pm_google->shortname == "google"): ?>
7
- <p><?php echo TrustindexPlugin::___("Get 100+ REAL Google reviews, with only 3 minutes of work, without developer knowledge..."); ?></p>
8
- <a href="https://wordpress.trustindex.io/collect-google-reviews/?source=wpcs-google" target="_blank" class="btn-text"><?php echo TrustindexPlugin::___("DOWNLOAD OUR FREE GUIDE"); ?></a>
9
- <?php else: ?>
10
- <p><?php echo TrustindexPlugin::___("Get 100+ REAL Customer reviews, with only 3 minutes of work, without developer knowledge..."); ?></p>
11
- <a href="https://wordpress.trustindex.io/collect-reviews/?source=wpcs-google" target="_blank" class="btn-text"><?php echo TrustindexPlugin::___("DOWNLOAD OUR FREE GUIDE"); ?></a>
12
- <?php endif; ?>
13
- </div>
14
- <?php if(class_exists('Woocommerce')): ?>
15
- <div class="ti-box">
16
- <div class="ti-header"><?php echo TrustindexPlugin::___('Get new features for your WooCommerce shop'); ?></div>
17
- <?php if(!class_exists('TrustindexWoocommercePlugin')): ?>
18
- <p><?php echo TrustindexPlugin::___("Download our new <a href='%s' target='_blank'>%s</a> plugin and get features for free!", [ 'https://wordpress.org/plugins/customer-reviews-for-woocommerce/', TrustindexPlugin::___('Customer Reviews for WooCommerce') ]); ?></p>
19
- <?php endif; ?>
20
- <ul class="ti-check" style="margin-bottom: 20px">
21
- <li><?php echo TrustindexPlugin::___('set up Trustindex company profile and get high quality backlink'); ?></li>
22
- <li><?php echo TrustindexPlugin::___('set up review-collector campaigns to get new ratings / reviews / recommendations automatically'); ?></li>
23
- <li><?php echo TrustindexPlugin::___('show customer reviews in fancy widgets'); ?></li>
24
- </ul>
25
- <?php if(class_exists('TrustindexWoocommercePlugin')): ?>
26
- <a href="?page=customer-reviews-for-woocommerce%2Fsettings.php" class="btn-text">
27
- <?php echo TrustindexPlugin::___("Get Reviews"); ?>
28
- </a>
29
- <?php else: ?>
30
- <a href="https://wordpress.org/plugins/customer-reviews-for-woocommerce/" target="_blank" class="btn-text">
31
- <?php echo TrustindexPlugin::___("Download plugin"); ?>
32
- </a>
33
- <?php endif; ?>
34
- </div>
35
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/my_reviews.php DELETED
@@ -1,182 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- if(isset($_COOKIE['ti-success']))
4
- {
5
- $ti_success = sanitize_text_field($_COOKIE['ti-success']);
6
- setcookie('ti-success', '', time() - 60, "/");
7
- if($ti_success == 'reviews-loaded')
8
- {
9
- update_option( $trustindex_pm_google->get_option_name('download-timestamp') , time() + (86400 * 2), false);
10
- }
11
- }
12
- if(isset($_POST['save-highlight']))
13
- {
14
- check_admin_referer( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_highlight_save' );
15
- $id = null;
16
- $start = null;
17
- $length = null;
18
- if(isset($_POST['id']))
19
- {
20
- $id = intval(sanitize_text_field($_POST['id']));
21
- }
22
- if(isset($_POST['start']))
23
- {
24
- $start = sanitize_text_field($_POST['start']);
25
- }
26
- if(isset($_POST['length']))
27
- {
28
- $length = sanitize_text_field($_POST['length']);
29
- }
30
- if($id)
31
- {
32
- $highlight = "";
33
- if(!is_null($start))
34
- {
35
- $highlight = $start . ',' . $length;
36
- }
37
- $wpdb->query("UPDATE `". $trustindex_pm_google->get_noreg_tablename() ."` SET highlight = '$highlight' WHERE id = '$id'");
38
- }
39
- exit;
40
- }
41
- $reviews = [];
42
- if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
43
- {
44
- $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
45
- }
46
- function trustindex_plugin_write_rating_stars($score)
47
- {
48
- global $trustindex_pm_google;
49
- if($trustindex_pm_google->is_ten_scale_rating_platform())
50
- {
51
- return '<div class="ti-rating-box">'. $trustindex_pm_google->formatTenRating($score) .'</div>';
52
- }
53
- $text = "";
54
- $link = "https://cdn.trustindex.io/assets/platform/".ucfirst("google")."/star/";
55
- if(!is_numeric($score))
56
- {
57
- return $text;
58
- }
59
- for ($si = 1; $si <= $score; $si++)
60
- {
61
- $text .= '<img src="'. $link .'f.svg" class="ti-star" />';
62
- }
63
- $fractional = $score - floor($score);
64
- if( 0.25 <= $fractional )
65
- {
66
- if ( $fractional < 0.75 )
67
- {
68
- $text .= '<img src="'. $link .'h.svg" class="ti-star" />';
69
- }
70
- else
71
- {
72
- $text .= '<img src="'. $link .'f.svg" class="ti-star" />';
73
- }
74
- $si++;
75
- }
76
- for (; $si <= 5; $si++)
77
- {
78
- $text .= '<img src="'. $link .'e.svg" class="ti-star" />';
79
- }
80
- return $text;
81
- }
82
- wp_enqueue_style('trustindex-widget-css', 'https://cdn.trustindex.io/assets/widget-presetted-css/4-light-background.css');
83
- wp_enqueue_script('trustindex-review-js', 'https://cdn.trustindex.io/assets/js/trustindex-review.js', [], false, true);
84
- wp_add_inline_script('trustindex-review-js', '
85
- jQuery(".ti-review-content").TI_shorten({
86
- "showLines": 2,
87
- "lessText": "'. TrustindexPlugin::___("Show less") .'",
88
- "moreText": "'. TrustindexPlugin::___("Show more") .'",
89
- });
90
- jQuery(".ti-review-content").TI_format();
91
- ');
92
- $download_timestamp = get_option($trustindex_pm_google->get_option_name('download-timestamp'), time() - 1);
93
- ?>
94
- <?php if(!$trustindex_pm_google->is_noreg_linked()): ?>
95
- <div class="ti-notice notice-warning" style="margin-left: 0">
96
- <p><?php echo TrustindexPlugin::___("Connect your %s platform to download reviews.", ["Google"]); ?></p>
97
- </div>
98
- <?php else: ?>
99
- <?php if($trustindex_pm_google->is_trustindex_connected() && in_array($selected_tab, [ 'setup_no_reg', 'my_reviews' ])): ?>
100
- <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
101
- <p>
102
- <?php echo TrustindexPlugin::___("You have connected your Trustindex account, so you can find premium functionality under the \"%s\" tab. You no longer need this tab unless you choose the limited but forever free mode.", ["Trustindex admin"]); ?>
103
- </p>
104
- </div>
105
- <?php endif; ?>
106
- <div class="ti-box">
107
- <div class="ti-header"><?php echo TrustindexPlugin::___("My Reviews"); ?></div>
108
- <?php if($download_timestamp < time()): ?>
109
- <div class="tablenav top" style="margin-bottom: 15px">
110
- <div class="alignleft actions">
111
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&refresh&my_reviews" class="btn-text btn-refresh btn-download-reviews" style="margin-left: 0" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>" data-delay=10><?php echo TrustindexPlugin::___("Download new reviews") ;?></a>
112
- </div>
113
- </div>
114
- <?php endif; ?>
115
- <?php if(isset($ti_success) && $ti_success == "reviews-loaded"): ?>
116
- <div class="ti-notice notice-success is-dismissible" style="margin: 0 0 15px 0">
117
- <p><?php echo TrustindexPlugin::___("New reviews loaded!"); ?></p>
118
- <button type="button" class="notice-dismiss"></button>
119
- </div>
120
- <?php endif; ?>
121
- <?php if(!$trustindex_pm_google->is_trustindex_connected() && $download_timestamp < time()): ?>
122
- <div class="ti-notice notice-error" style="margin: 0 0 15px 0">
123
- <p>
124
- <?php echo TrustindexPlugin::___("Don't want to waste your time by updating your reviews every week? <a href='%s' target='_blank'>Create a free Trustindex account! »</a>", [ 'https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-l' ]); ?>
125
- </p>
126
- </div>
127
- <?php endif; ?>
128
- <?php if(!count($reviews)): ?>
129
- <div class="ti-notice notice-warning" style="margin-left: 0">
130
- <p><?php echo TrustindexPlugin::___("You had no reviews at the time of last review downloading."); ?></p>
131
- </div>
132
- <?php else: ?>
133
- <table class="wp-list-table widefat fixed striped table-view-list ti-my-reviews ti-widget">
134
- <thead>
135
- <tr>
136
- <th class="text-center"><?php echo TrustindexPlugin::___("Reviewer"); ?></th>
137
- <th class="text-center" style="width: 90px;"><?php echo TrustindexPlugin::___("Rating"); ?></th>
138
- <th class="text-center"><?php echo TrustindexPlugin::___("Date"); ?></th>
139
- <th style="width: 48%"><?php echo TrustindexPlugin::___("Text"); ?></th>
140
- <th></th>
141
- </tr>
142
- </thead>
143
- <tbody>
144
- <?php foreach ($reviews as $review): ?>
145
- <tr data-id="<?php echo esc_attr($review->id); ?>">
146
- <td class="text-center">
147
- <img src="<?php echo esc_url($review->user_photo); ?>" class="ti-user-avatar" /><br />
148
- <?php echo esc_html($review->user); ?>
149
- </td>
150
- <td class="text-center source-<?php echo ucfirst("google") ?>"><?php echo trustindex_plugin_write_rating_stars($review->rating); ?></td>
151
- <td class="text-center"><?php echo esc_html($review->date); ?></td>
152
- <td><div class="ti-review-content"><?php echo $trustindex_pm_google->getReviewHtml($review); ?></div></td>
153
- <td>
154
- <a href="<?php echo esc_attr($review->id); ?>" class="btn-text btn-highlight<?php if(isset($review->highlight) && $review->highlight): ?> has-highlight<?php endif; ?>" style="margin-left: 0"><?php echo TrustindexPlugin::___("Highlight text") ;?></a>
155
- </td>
156
- </tr>
157
- <?php endforeach; ?>
158
- </tbody>
159
- </table>
160
- <?php endif; ?>
161
- </div>
162
- <!-- Modal -->
163
- <div class="ti-modal" id="ti-highlight-modal">
164
- <?php wp_nonce_field( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_highlight_save' ); ?>
165
- <div class="ti-modal-dialog">
166
- <div class="ti-modal-content">
167
- <div class="ti-modal-header">
168
- <span class="ti-modal-title"><?php echo TrustindexPlugin::___("Highlight text") ;?></span>
169
- </div>
170
- <div class="ti-modal-body">
171
- <?php echo TrustindexPlugin::___("Just select the text you want to highlight") ;?>:
172
- <div class="ti-highlight-content"></div>
173
- </div>
174
- <div class="ti-modal-footer">
175
- <a href="#" class="btn-text btn-modal-close"><?php echo TrustindexPlugin::___("Back") ;?></a>
176
- <a href="#" class="btn-text btn-primary btn-highlight-confirm" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Save") ;?></a>
177
- <a href="#" class="btn-text btn-danger btn-highlight-remove" style="position: absolute; left: 15px" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Remove highlight") ;?></a>
178
- </div>
179
- </div>
180
- </div>
181
- </div>
182
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/rate.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- wp_enqueue_script('trustindex-js', 'https://cdn.trustindex.io/loader.js', [], false, true);
4
- ?>
5
- <div class="ti-box rate-us en">
6
- <div class="ti-box-head">
7
- <div class="ti-row">
8
- <div class="ti-col">
9
- <h1><?php echo TrustindexPlugin::___('Please help us by reviewing our Plugin.'); ?></h1>
10
- <p><?php echo TrustindexPlugin::___("We've spent a lot of time developing this software. If you use the free version, you can still support us by leaving a review!"); ?></p>
11
- <p><?php echo TrustindexPlugin::___('Thank you in advance!'); ?></p>
12
- </div>
13
- <div class="ti-col-auto rate-us-wrapper">
14
- <a class="btn-text btn-lg" href="https://wordpress.org/support/plugin/<?php echo $trustindex_pm_google->get_plugin_slug(); ?>/reviews/?rate=5#new-post" target="_blank"><?php echo TrustindexPlugin::___('Click here to rate us!'); ?></a>
15
- </div>
16
- </div>
17
- </div>
18
- <hr>
19
- <div class="ti-row">
20
- <div class="ti-col-12">
21
- <div src='https://cdn.trustindex.io/loader.js?c1c627610fde227dfc5bbac1ec'></div>
22
- </div>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/setup_no_reg.php DELETED
@@ -1,415 +0,0 @@
1
- <?php include( plugin_dir_path(__FILE__ ) . "setup_no_reg_header.php" ); ?>
2
- <ul class="ti-free-steps">
3
- <li class="<?php echo !$trustindex_pm_google->is_noreg_linked() ? "active" : "done"; ?><?php if($current_step == 1): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=1">
4
- <span>1</span>
5
- <?php echo TrustindexPlugin::___('Connect %s platform', [ 'Google' ]); ?>
6
- </li>
7
- <span class="ti-free-arrow"></span>
8
- <li class="<?php echo $style_id ? "done" : ($trustindex_pm_google->is_noreg_linked() ? "active" : ""); ?><?php if($current_step == 2): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=2">
9
- <span>2</span>
10
- <?php echo TrustindexPlugin::___('Select Layout'); ?>
11
- </li>
12
- <span class="ti-free-arrow"></span>
13
- <li class="<?php echo $scss_set ? "done" : ($style_id ? "active" : ""); ?><?php if($current_step == 3): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=3">
14
- <span>3</span>
15
- <?php echo TrustindexPlugin::___('Select Style'); ?>
16
- </li>
17
- <span class="ti-free-arrow"></span>
18
- <li class="<?php echo $widget_setted_up ? "done" : ($scss_set ? "active" : ""); ?><?php if($current_step == 4): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=4">
19
- <span>4</span>
20
- <?php echo TrustindexPlugin::___('Set up widget'); ?>
21
- </li>
22
- <span class="ti-free-arrow"></span>
23
- <li class="<?php echo $widget_setted_up ? "active" : ""; ?><?php if($current_step == 5): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=5">
24
- <span>5</span>
25
- <?php echo TrustindexPlugin::___('Insert code'); ?>
26
- </li>
27
- </ul>
28
- <?php if($trustindex_pm_google->is_trustindex_connected() && in_array($selected_tab, [ 'setup_no_reg', 'my_reviews' ])): ?>
29
- <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
30
- <p>
31
- <?php echo TrustindexPlugin::___("You have connected your Trustindex account, so you can find premium functionality under the \"%s\" tab. You no longer need this tab unless you choose the limited but forever free mode.", ["Trustindex admin"]); ?>
32
- </p>
33
- </div>
34
- <?php endif; ?>
35
- <?php if($show_nonce_notification): ?>
36
- <div class="ti-notice notice-warning is-dismissible" 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
- <button type="button" class="notice-dismiss" data-command="save-widget-nonce-notice-hide"></button>
42
- </div>
43
- <?php endif; ?>
44
- <?php
45
- $reviews = [];
46
- if($trustindex_pm_google->is_noreg_linked())
47
- {
48
- $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
49
- }
50
- ?>
51
- <?php if($current_step == 1 || !$trustindex_pm_google->is_noreg_linked()): ?>
52
- <h1 class="ti-free-title">
53
- 1. <?php echo TrustindexPlugin::___('Connect %s platform', [ 'Google' ]); ?>
54
- </h1>
55
- <?php if($trustindex_pm_google->is_noreg_linked()): ?>
56
- <?php $page_details = get_option($trustindex_pm_google->get_option_name('page-details')); ?>
57
- <div class="ti-source-box">
58
- <?php if(isset($page_details['avatar_url'])): ?>
59
- <img src="<?php echo esc_url($page_details['avatar_url']); ?>" />
60
- <?php endif; ?>
61
- <div class="ti-source-info">
62
- <strong><?php echo esc_html($page_details['name']); ?></strong><br />
63
- <?php if ($page_details['address']): ?>
64
- <?php echo esc_html($page_details['address']); ?><br />
65
- <?php endif; ?>
66
- <a href="<?php echo esc_url($trustindex_pm_google->getPageUrl()); ?>" target="_blank"><?php echo esc_url($trustindex_pm_google->getPageUrl()); ?></a>
67
- </div>
68
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&command=delete-page"><button class="btn btn-text"><?php echo TrustindexPlugin::___("Disconnect") ;?></button></a>
69
- <div class="clear"></div>
70
- </div>
71
- <?php else: ?>
72
- <div class="ti-box">
73
- <form method="post" action="" data-platform="google" id="submit-form">
74
- <input type="hidden" name="command" value="save-page" />
75
- <?php wp_nonce_field( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_save' ); ?>
76
- <input type="hidden"
77
- name="page_details"
78
- class="form-control"
79
- required="required"
80
- id="ti-noreg-page_details"
81
- value=""
82
- />
83
- <div class="autocomplete">
84
- <?php include( plugin_dir_path(__FILE__ ) . "setup_no_reg_platform.php" ); ?>
85
- </div>
86
- <div class="ti-selected-source">
87
- <label class="ti-left-label"><?php echo TrustindexPlugin::___("Source"); ?>:</label>
88
- <div class="ti-source-box ti-original-source-box">
89
- <img />
90
- <div class="ti-source-info">
91
- <strong id="label-noreg-page_name"></strong><br />
92
- <span id="label-noreg-address"></span>
93
- <span id="label-noreg-url"></span>
94
- </div>
95
- <button class="btn btn-text btn-connect" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Connect") ;?></button>
96
- </div>
97
- <div class="clear"></div>
98
- </div>
99
- </form>
100
- </div>
101
- <?php endif; ?>
102
- <div class="ti-box">
103
- <div class="ti-header"><?php echo TrustindexPlugin::___('See a %s Widget example below:', [ 'Google Reviews' ]); ?></div>
104
- <div class="ti-preview-box">
105
- <?php echo $trustindex_pm_google->get_trustindex_widget('2d9bf9019f8d93ad1430e9135'); ?>
106
- </div>
107
- </div>
108
- <?php include( plugin_dir_path(__FILE__ ) . "demo_widgets.php" ); ?>
109
- <?php elseif($current_step == 2 || !$style_id): ?>
110
- <h1 class="ti-free-title">
111
- 2. <?php echo TrustindexPlugin::___('Select Layout'); ?>
112
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=1" class="ti-back-icon"><?php echo TrustindexPlugin::___('Back'); ?></a>
113
- </h1>
114
- <?php if(!count($reviews)): ?>
115
- <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
116
- <p>
117
- <?php echo TrustindexPlugin::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
118
- </p>
119
- </div>
120
- <?php endif; ?>
121
- <div class="ti-filter-row">
122
- <label><?php echo TrustindexPlugin::___('Layout'); ?>:</label>
123
- <span class="ti-checkbox">
124
- <input type="radio" name="layout-select" value="" data-ids="" checked>
125
- <label><?php echo TrustindexPlugin::___('All'); ?></label>
126
- </span>
127
- <?php foreach(TrustindexPlugin::$widget_templates['categories'] as $category => $ids): ?>
128
- <span class="ti-checkbox">
129
- <input type="radio" name="layout-select" value="<?php echo esc_attr($category); ?>" data-ids="<?php echo esc_attr($ids); ?>">
130
- <label><?php echo esc_html(TrustindexPlugin::___(ucfirst($category))); ?></label>
131
- </span>
132
- <?php endforeach; ?>
133
- </div>
134
- <div class="ti-preview-boxes-container">
135
- <?php foreach(TrustindexPlugin::$widget_templates['templates'] as $id => $template): ?>
136
- <?php
137
- $class_name = 'ti-full-width';
138
- if(in_array($template['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
139
- {
140
- $class_name = 'ti-half-width';
141
- }
142
- ?>
143
- <div class="<?php echo esc_attr($class_name); ?>">
144
- <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($id); ?>" data-set-id="light-background">
145
- <div class="ti-header">
146
- <span class="ti-header-layout-text">
147
- <?php echo TrustindexPlugin::___('Layout'); ?>:
148
- <strong><?php echo esc_html(TrustindexPlugin::___($template['name'])); ?></strong>
149
- </span>
150
- <a href="?page=<?php echo $_GET['page']; ?>&tab=setup_no_reg&command=save-style&style_id=<?php echo esc_attr(urlencode($id)); ?>" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Select") ;?></a>
151
- <div class="clear"></div>
152
- </div>
153
- <div class="preview">
154
- <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $id, 'light-background', true, true); ?>
155
- </div>
156
- </div>
157
- </div>
158
- <?php endforeach; ?>
159
- </div>
160
- <?php elseif($current_step == 3 || !$scss_set): ?>
161
- <h1 class="ti-free-title">
162
- 3. <?php echo TrustindexPlugin::___('Select Style'); ?>
163
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=2" class="ti-back-icon"><?php echo TrustindexPlugin::___('Back'); ?></a>
164
- </h1>
165
- <?php if(!count($reviews)): ?>
166
- <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
167
- <p>
168
- <?php echo TrustindexPlugin::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
169
- </p>
170
- </div>
171
- <?php endif; ?>
172
- <?php
173
- $class_name = 'ti-full-width';
174
- if(in_array(TrustindexPlugin::$widget_templates['templates'][$style_id]['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
175
- {
176
- $class_name = 'ti-half-width';
177
- }
178
- ?>
179
- <div class="ti-preview-boxes-container">
180
- <?php foreach(TrustindexPlugin::$widget_styles as $id => $name): ?>
181
- <div class="<?php echo esc_attr($class_name); ?>">
182
- <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($style_id); ?>" data-set-id="<?php echo esc_attr($id); ?>">
183
- <div class="ti-header">
184
- <span class="ti-header-layout-text">
185
- <?php echo TrustindexPlugin::___('Style'); ?>:
186
- <strong><?php echo TrustindexPlugin::___($name); ?></strong>
187
- </span>
188
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&command=save-set&set_id=<?php echo esc_attr(urlencode($id)); ?>" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Select") ;?></a>
189
- <div class="clear"></div>
190
- </div>
191
- <div class="preview">
192
- <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $style_id, $id, true, true); ?>
193
- </div>
194
- </div>
195
- </div>
196
- <?php endforeach; ?>
197
- </div>
198
- <?php elseif($current_step == 4 || !$widget_setted_up): ?>
199
- <?php
200
- $widget_type = TrustindexPlugin::$widget_templates[ 'templates' ][ $style_id ]['type'];
201
- $widget_has_reviews = !in_array($widget_type, [ 'button', 'badge' ]) || in_array($style_id, [ 23, 30, 32 ]);
202
- ?>
203
- <h1 class="ti-free-title">
204
- 4. <?php echo TrustindexPlugin::___('Set up widget'); ?>
205
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=3" class="ti-back-icon"><?php echo TrustindexPlugin::___('Back'); ?></a>
206
- </h1>
207
- <?php if(!count($reviews)): ?>
208
- <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
209
- <p>
210
- <?php echo TrustindexPlugin::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
211
- </p>
212
- </div>
213
- <?php endif; ?>
214
- <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($style_id); ?>" data-set-id="<?php echo esc_attr($scss_set); ?>">
215
- <div class="ti-header">
216
- <?php echo TrustindexPlugin::___('Widget Preview'); ?>
217
- <?php if(!in_array($style_id, [ 17, 21 ])): ?>
218
- <span class="ti-header-layout-text ti-pull-right">
219
- <?php echo TrustindexPlugin::___('Style'); ?>:
220
- <strong><?php echo esc_html(TrustindexPlugin::___(TrustindexPlugin::$widget_styles[$scss_set])); ?></strong>
221
- </span>
222
- <?php endif; ?>
223
- <span class="ti-header-layout-text ti-pull-right">
224
- <?php echo TrustindexPlugin::___('Layout'); ?>:
225
- <strong><?php echo esc_html(TrustindexPlugin::___(TrustindexPlugin::$widget_templates['templates'][$style_id]['name'])); ?></strong>
226
- </span>
227
- </div>
228
- <div class="preview">
229
- <div id="ti-review-list"><?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, null, null, false, true); ?></div>
230
- <div style="display: none; text-align: center">
231
- <?php echo TrustindexPlugin::___("You do not have reviews with the current filters. <br />Change your filters if you would like to display reviews on your page!"); ?>
232
- </div>
233
- </div>
234
- </div>
235
- <div class="ti-box">
236
- <div class="ti-header"><?php echo TrustindexPlugin::___('Widget Settings'); ?></div>
237
- <div class="ti-left-block">
238
- <?php if($widget_has_reviews): ?>
239
- <div id="ti-filter" class="ti-input-row">
240
- <label><?php echo TrustindexPlugin::___('Filter your ratings'); ?></label>
241
- <div class="ti-select" id="show-star" data-platform="google">
242
- <font></font>
243
- <ul>
244
- <li data-value="1,2,3,4,5" <?php echo count($filter['stars']) > 2 ? 'class="selected"' : ''; ?>><?php echo TrustindexPlugin::___('Show all'); ?></li>
245
- <li data-value="4,5" <?php echo count($filter['stars']) == 2 ? 'class="selected"' : ''; ?>>
246
-
247
- &starf;&starf;&starf;&starf; - &starf;&starf;&starf;&starf;&starf;
248
- </li>
249
- <li data-value="5" <?php echo count($filter['stars']) == 1 ? 'class="selected"' : ''; ?>>
250
- <?php echo TrustindexPlugin::___('only'); ?> &starf;&starf;&starf;&starf;&starf;
251
- </li>
252
- </ul>
253
- </div>
254
- </div>
255
- <?php endif; ?>
256
- <div class="ti-input-row">
257
- <label><?php echo TrustindexPlugin::___('Select language'); ?></label>
258
- <form method="post" action="">
259
- <input type="hidden" name="command" value="save-language" />
260
- <?php wp_nonce_field( 'save-language_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_language' ); ?>
261
- <select class="form-control" name="lang" id="ti-lang-id">
262
- <?php foreach(TrustindexPlugin::$widget_languages as $id => $name): ?>
263
- <option value="<?php echo esc_attr($id); ?>" <?php echo $lang == $id ? 'selected' : ''; ?>><?php echo esc_html($name); ?></option>
264
- <?php endforeach; ?>
265
- </select>
266
- </form>
267
- </div>
268
- <?php if($widget_has_reviews): ?>
269
- <div class="ti-input-row">
270
- <label><?php echo TrustindexPlugin::___('Select date format'); ?></label>
271
- <form method="post" action="">
272
- <input type="hidden" name="command" value="save-dateformat" />
273
- <?php wp_nonce_field( 'save-dateformat_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_dateformat' ); ?>
274
- <select class="form-control" name="dateformat" id="ti-dateformat-id">
275
- <?php foreach(TrustindexPlugin::$widget_dateformats as $format): ?>
276
- <option value="<?php echo esc_attr($format); ?>" <?php echo $dateformat == $format ? 'selected' : ''; ?>><?php echo date($format); ?></option>
277
- <?php endforeach; ?>
278
- </select>
279
- </form>
280
- </div>
281
- <?php endif; ?>
282
- </div>
283
- <div class="ti-right-block">
284
- <form method="post" action="" id="ti-widget-options">
285
- <input type="hidden" name="command" value="save-options" />
286
- <?php wp_nonce_field( 'save-options_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_options' ); ?>
287
- <?php if($widget_has_reviews): ?>
288
- <span class="ti-checkbox row">
289
- <input type="checkbox" id="ti-filter-only-ratings" class="no-form-update" name="only-ratings" value="1" <?php if($filter['only-ratings']): ?>checked<?php endif;?>>
290
- <label><?php echo TrustindexPlugin::___("Hide reviews without comments"); ?></label>
291
- </span>
292
- <?php endif; ?>
293
- <?php if(!in_array($style_id, [ 17, 18, 21, 24, 25, 26, 27, 28, 29, 30, 35 ])): ?>
294
- <span class="ti-checkbox row">
295
- <input type="checkbox" name="no-rating-text" value="1" <?php if($no_rating_text): ?>checked<?php endif;?>>
296
- <label><?php echo TrustindexPlugin::___("Hide rating text"); ?></label>
297
- </span>
298
- <?php endif; ?>
299
- <?php if($widget_has_reviews): ?>
300
- <span class="ti-checkbox row">
301
- <input type="checkbox" name="verified-icon" value="1" <?php if($verified_icon): ?>checked<?php endif;?>>
302
- <label><?php echo TrustindexPlugin::___("Show verified review icon"); ?></label>
303
- </span>
304
- <?php endif; ?>
305
- <?php if(in_array($widget_type, [ 'slider', 'sidebar' ]) && !in_array($style_id, [ 8, 9, 10, 18, 19 ])): ?>
306
- <span class="ti-checkbox row">
307
- <input type="checkbox" name="show-arrows" value="1" <?php if($show_arrows): ?>checked<?php endif;?>>
308
- <label><?php echo TrustindexPlugin::___("Show navigation arrows"); ?></label>
309
- </span>
310
- <?php endif; ?>
311
- <?php if($widget_has_reviews): ?>
312
- <span class="ti-checkbox row">
313
- <input type="checkbox" name="show-reviewers-photo" value="1" <?php if($show_reviewers_photo): ?>checked<?php endif;?>>
314
- <label><?php echo TrustindexPlugin::___("Show reviewers' photo"); ?></label>
315
- </span>
316
- <span class="ti-checkbox row disabled">
317
- <input type="checkbox" value="1" disabled>
318
- <label class="ti-tooltip">
319
- <?php echo TrustindexPlugin::___("Show reviewers' photos locally, from a single image (less requests)"); ?>
320
- <span class="ti-tooltip-message"><?php echo TrustindexPlugin::___("Paid package feature"); ?></span>
321
- </label>
322
- </span>
323
- <?php endif; ?>
324
- <span class="ti-checkbox row">
325
- <input type="checkbox" name="enable-animation" value="1" <?php if($enable_animation): ?>checked<?php endif;?>>
326
- <label><?php echo TrustindexPlugin::___("Enable mouseover animation"); ?></label>
327
- </span>
328
- <span class="ti-checkbox row">
329
- <input type="checkbox" name="disable-font" value="1" <?php if($disable_font): ?>checked<?php endif;?>>
330
- <label><?php echo TrustindexPlugin::___("Use site's font"); ?></label>
331
- </span>
332
- <?php if($widget_has_reviews): ?>
333
- <span class="ti-checkbox row">
334
- <input type="checkbox" name="show-logos" value="1" <?php if($show_logos): ?>checked<?php endif;?>>
335
- <label><?php echo TrustindexPlugin::___("Show platform logos"); ?></label>
336
- </span>
337
- <?php if(!$trustindex_pm_google->is_ten_scale_rating_platform()): ?>
338
- <span class="ti-checkbox row">
339
- <input type="checkbox" name="show-stars" value="1" <?php if($show_stars): ?>checked<?php endif;?>>
340
- <label><?php echo TrustindexPlugin::___("Show platform stars"); ?></label>
341
- </span>
342
- <?php endif; ?>
343
- <?php endif; ?>
344
- </form>
345
- </div>
346
- <div class="clear"></div>
347
- <div class="ti-footer">
348
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&setup_widget" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___("Save and get code") ;?></a>
349
- <div class="clear"></div>
350
- </div>
351
- </div>
352
- <?php else: ?>
353
- <h1 class="ti-free-title">
354
- 5. <?php echo TrustindexPlugin::___('Insert code'); ?>
355
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=4" class="ti-back-icon"><?php echo TrustindexPlugin::___('Back'); ?></a>
356
- </h1>
357
- <?php if(!count($reviews)): ?>
358
- <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
359
- <p>
360
- <?php echo TrustindexPlugin::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
361
- </p>
362
- </div>
363
- <?php endif; ?>
364
- <div class="ti-box">
365
- <div class="ti-header"><?php echo TrustindexPlugin::___('Insert this shortcode into your website'); ?></div>
366
- <div class="ti-input-row" style="margin-bottom: 2px">
367
- <label>Shortcode</label>
368
- <code class="code-shortcode">[<?php echo $trustindex_pm_google->get_shortcode_name(); ?> no-registration=google]</code>
369
- <a href=".code-shortcode" class="btn-text btn-copy2clipboard"><?php echo TrustindexPlugin::___("Copy to clipboard") ;?></a>
370
- </div>
371
- <?php echo TrustindexPlugin::___('Copy and paste this shortcode into post, page or widget.'); ?>
372
- </div>
373
- <h1 class="ti-free-title"><?php echo TrustindexPlugin::___("Want to get more customers?"); ?></h1>
374
- <div class="ti-box">
375
- <div class="ti-header"><?php echo TrustindexPlugin::___('Increase SEO, trust and sales using customer reviews.'); ?></div>
376
- <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-1" target="_blank"><?php echo TrustindexPlugin::___('Create a Free Account for More Features'); ?></a>
377
- <div class="ti-notice notice-success ti-special-offer">
378
- <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/special_30.jpg'); ?>">
379
- <p><?php echo TrustindexPlugin::___('Now we offer you a 30%% discount off your subscription! Create your free account and benefit from the onboarding discount now!'); ?></p>
380
- <div class="clear"></div>
381
- </div>
382
- <ul class="ti-seo-list">
383
- <li>
384
- <strong><?php echo TrustindexPlugin::___("%d Review Platforms", [ 58 ]); ?></strong><br />
385
- <?php echo TrustindexPlugin::___("Add more reviews to your widget from %s, etc. to enjoy more trust, and to keep customers on your site.", [ 'Google, Facebook, Yelp, Amazon, Tripadvisor, Booking.com, Airbnb, Hotels.com, Capterra, Foursquare, Opentable' ]); ?><br />
386
- <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/platforms.png'); ?>" alt="" style="margin-top: 5px" />
387
- </li>
388
- <li>
389
- <strong><?php echo TrustindexPlugin::___("Create Unlimited Number of Widgets"); ?></strong><br />
390
- <?php echo TrustindexPlugin::___("Use the widgets matching your page the best to build trust."); ?>
391
- </li>
392
- <li>
393
- <strong><?php echo TrustindexPlugin::___("Mix Reviews"); ?></strong><br />
394
- <?php echo TrustindexPlugin::___("You can mix your reviews from different platforms and display them in 1 review widget."); ?>
395
- </li>
396
- <li>
397
- <strong><?php echo TrustindexPlugin::___("Get More Reviews!"); ?></strong><br />
398
- <?php echo TrustindexPlugin::___("Use our Review Invitation System to collect hundreds of new reviews. Become impossible to resist!"); ?>
399
- </li>
400
- <li>
401
- <strong><?php echo TrustindexPlugin::___("Manage Reviews"); ?></strong><br />
402
- <?php echo TrustindexPlugin::___("Turn on email alert to ALL new reviews, so that you can manage them quickly."); ?>
403
- </li>
404
- <li>
405
- <strong><?php echo TrustindexPlugin::___("Automatically update with NEW reviews"); ?></strong><br />
406
- <?php echo TrustindexPlugin::___("Wordpress cannot update reviews, but Trustindex can! As soon as you get a new review, Trustindex Business can automatically add it to your website. Customers love fresh reviews!"); ?>
407
- </li>
408
- <li>
409
- <strong><?php echo TrustindexPlugin::___("Display UNLIMITED number of reviews"); ?></strong><br />
410
- <?php echo TrustindexPlugin::___("You can test Trustindex with 10 reviews in the free version. Upgrade to Business to display ALL the reviews received. Be the undisputed customer choice in your industry!"); ?>
411
- </li>
412
- </ul>
413
- <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-2" target="_blank"><?php echo TrustindexPlugin::___('Create a Free Account for More Features'); ?></a>
414
- </div>
415
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/setup_no_reg_header.php DELETED
@@ -1,401 +0,0 @@
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;
22
- global $wpdb;
23
- if(!$page_details)
24
- {
25
- return false;
26
- }
27
- if (!isset($page_details['rating_number']) || !isset($page_details['avatar_url']) || empty($page_details['avatar_url']))
28
- {
29
- $response = $trustindex_pm_google->download_noreg_details($page_details);
30
- if ($response['success'])
31
- {
32
- if(!isset($page_details['rating_number'])) $page_details['rating_number'] = $response['result']['reviews']['count'];
33
- if(!isset($page_details['rating_score'])) $page_details['rating_score'] = $response['result']['reviews']['score'];
34
- if(!isset($page_details['avatar_url']) || empty($page_details['avatar_url'])) $page_details['avatar_url'] = $response['result']['avatar_url'];
35
- }
36
- }
37
- $reviews = null;
38
- if(isset($page_details['reviews']))
39
- {
40
- $reviews = $page_details['reviews'];
41
- unset($page_details['reviews']);
42
- }
43
- update_option( $trustindex_pm_google->get_option_name('page-details') , $page_details, false );
44
- $GLOBALS['wp_object_cache']->delete( $trustindex_pm_google->get_option_name('page-details'), 'options' );
45
- $dbtable = $trustindex_pm_google->get_noreg_tablename();
46
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
47
- $sql = "CREATE TABLE IF NOT EXISTS $dbtable (
48
- id TINYINT(1) NOT NULL AUTO_INCREMENT,
49
- user VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci,
50
- user_photo TEXT,
51
- text TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
52
- rating DECIMAL(3,1),
53
- highlight VARCHAR(11),
54
- date DATE,
55
- PRIMARY KEY (id)
56
- );";
57
- dbDelta($sql);
58
- if(!$trustindex_pm_google->is_noreg_table_exists())
59
- {
60
- delete_option( $trustindex_pm_google->get_option_name('page-details') );
61
- echo '
62
- <div class="ti-notice notice-error" style="margin: 25px 0 0 0">
63
- <p>
64
- '. TrustindexPlugin::___('We can not create MySQL table for the reviews!') .'
65
- </p>
66
- </div>';
67
- exit;
68
- }
69
- $wpdb->query("TRUNCATE $dbtable;");
70
- if(!$reviews)
71
- {
72
- $reviews = $trustindex_pm_google->download_noreg_reviews($page_details, null);
73
- $reviews = $reviews['success'] ? $reviews['result'] : [];
74
- }
75
- foreach($reviews as $row)
76
- {
77
- $date = isset($row['created_at']) ? $row['created_at'] : (isset($row['date']) ? $row['date'] : '');
78
- $wpdb->insert($dbtable, [
79
- 'user' => $row['reviewer']['name'],
80
- 'user_photo' => $row['reviewer']['avatar_url'],
81
- 'text' => $row['text'],
82
- 'rating' => $row['rating'] ? $row['rating'] : 5,
83
- 'date' => substr($date, 0, 10)
84
- ]);
85
- }
86
- if($default_settings)
87
- {
88
- $lang = strtolower(substr(get_locale(), 0, 2));
89
- if(!isset(TrustindexPlugin::$widget_languages[$lang]))
90
- {
91
- $lang = 'en';
92
- }
93
- update_option( $trustindex_pm_google->get_option_name('lang') , $lang, false );
94
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
95
- }
96
- else
97
- {
98
- $trustindex_pm_google->noreg_save_css(true);
99
- }
100
- }
101
- function trustindex_plugin_disconnect_page($settings_delete = true)
102
- {
103
- global $trustindex_pm_google;
104
- global $wpdb;
105
- delete_option( $trustindex_pm_google->get_option_name('page-details') );
106
- delete_option( $trustindex_pm_google->get_option_name('review-content') );
107
- delete_option( $trustindex_pm_google->get_option_name('css-content') );
108
- if($settings_delete)
109
- {
110
- delete_option( $trustindex_pm_google->get_option_name('style-id') );
111
- delete_option( $trustindex_pm_google->get_option_name('scss-set') );
112
- delete_option( $trustindex_pm_google->get_option_name('filter') );
113
- delete_option( $trustindex_pm_google->get_option_name('lang') );
114
- delete_option( $trustindex_pm_google->get_option_name('dateformat') );
115
- delete_option( $trustindex_pm_google->get_option_name('no-rating-text') );
116
- delete_option( $trustindex_pm_google->get_option_name('verified-icon') );
117
- delete_option( $trustindex_pm_google->get_option_name('enable-animation') );
118
- delete_option( $trustindex_pm_google->get_option_name('show-arrows') );
119
- delete_option( $trustindex_pm_google->get_option_name('show-reviewers-photo') );
120
- delete_option( $trustindex_pm_google->get_option_name('widget-setted-up') );
121
- }
122
- $dbtable = $trustindex_pm_google->get_noreg_tablename();
123
- $wpdb->query("TRUNCATE $dbtable;");
124
- }
125
- function trustindex_plugin_change_step($step = 5)
126
- {
127
- global $trustindex_pm_google;
128
- if($step < 5)
129
- {
130
- delete_option($trustindex_pm_google->get_option_name('widget-setted-up'));
131
- }
132
- if($step < 4)
133
- {
134
- delete_option($trustindex_pm_google->get_option_name('scss-set'));
135
- if(in_array($style_id, [ 17, 21 ]))
136
- {
137
- $step--;
138
- }
139
- }
140
- if($step < 3)
141
- {
142
- delete_option($trustindex_pm_google->get_option_name('style-id'));
143
- }
144
- if($step < 2)
145
- {
146
- trustindex_plugin_disconnect_page();
147
- }
148
- }
149
- if($ti_command == 'save-page')
150
- {
151
- check_admin_referer( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_save' );
152
- $page_details = isset($_POST['page_details']) ? wp_kses_post($_POST['page_details']) : null;
153
- $page_details = json_decode(stripcslashes($page_details), true);
154
-
155
- trustindex_plugin_connect_page($page_details);
156
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
157
- exit;
158
- }
159
- elseif($ti_command == 'delete-page')
160
- {
161
- trustindex_plugin_disconnect_page();
162
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
163
- exit;
164
- }
165
- elseif($ti_command == 'save-style')
166
- {
167
- $style_id = sanitize_text_field($_REQUEST['style_id']);
168
- update_option( $trustindex_pm_google->get_option_name('style-id') , $style_id, false );
169
- delete_option( $trustindex_pm_google->get_option_name('review-content') );
170
- trustindex_plugin_change_step(3);
171
- if(in_array($style_id, [ 17, 21 ]))
172
- {
173
- $trustindex_pm_google->noreg_save_css();
174
- }
175
- if(isset($_GET['style_id']))
176
- {
177
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
178
- }
179
- exit;
180
- }
181
- elseif($ti_command == 'save-set')
182
- {
183
- update_option( $trustindex_pm_google->get_option_name('scss-set') , sanitize_text_field($_REQUEST['set_id']), false );
184
- trustindex_plugin_change_step(4);
185
- $trustindex_pm_google->noreg_save_css(true);
186
- if(isset($_GET['set_id']))
187
- {
188
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
189
- }
190
- exit;
191
- }
192
- elseif($ti_command == 'save-filter')
193
- {
194
- $filter = isset($_POST['filter']) ? sanitize_text_field($_POST['filter']) : null;
195
- $filter = json_decode(stripcslashes($filter), true);
196
- update_option( $trustindex_pm_google->get_option_name('filter') , $filter, false );
197
- exit;
198
- }
199
- elseif($ti_command == 'save-language')
200
- {
201
- check_admin_referer( 'save-language_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_language' );
202
- update_option( $trustindex_pm_google->get_option_name('lang') , sanitize_text_field($_POST['lang']), false );
203
- delete_option( $trustindex_pm_google->get_option_name('review-content') );
204
- exit;
205
- }
206
- elseif($ti_command == 'save-dateformat')
207
- {
208
- check_admin_referer( 'save-dateformat_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_dateformat' );
209
- update_option( $trustindex_pm_google->get_option_name('dateformat') , sanitize_text_field($_POST['dateformat']), false );
210
- exit;
211
- }
212
- elseif($ti_command == 'save-options')
213
- {
214
- check_admin_referer( 'save-options_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_options' );
215
- $r = 0;
216
- if(isset($_POST['verified-icon']))
217
- {
218
- $r = sanitize_text_field($_POST['verified-icon']);
219
- }
220
- update_option( $trustindex_pm_google->get_option_name('verified-icon') , $r, false );
221
- $r = 1;
222
- if(isset($_POST['enable-animation']))
223
- {
224
- $r = sanitize_text_field($_POST['enable-animation']);
225
- }
226
- update_option( $trustindex_pm_google->get_option_name('enable-animation') , $r, false );
227
- $r = 1;
228
- if(isset($_POST['show-arrows']))
229
- {
230
- $r = sanitize_text_field($_POST['show-arrows']);
231
- }
232
- update_option( $trustindex_pm_google->get_option_name('show-arrows') , $r, false );
233
- $r = 1;
234
- if(isset($_POST['show-reviewers-photo']))
235
- {
236
- $r = sanitize_text_field($_POST['show-reviewers-photo']);
237
- }
238
- update_option( $trustindex_pm_google->get_option_name('show-reviewers-photo') , $r, false );
239
- $r = 0;
240
- if(isset($_POST['no-rating-text']))
241
- {
242
- $r = sanitize_text_field($_POST['no-rating-text']);
243
- }
244
- update_option( $trustindex_pm_google->get_option_name('no-rating-text') , $r, false );
245
- $r = 0;
246
- if(isset($_POST['disable-font']))
247
- {
248
- $r = sanitize_text_field($_POST['disable-font']);
249
- }
250
- update_option( $trustindex_pm_google->get_option_name('disable-font') , $r, false );
251
- $r = 1;
252
- if(isset($_POST['show-logos']))
253
- {
254
- $r = sanitize_text_field($_POST['show-logos']);
255
- }
256
- update_option( $trustindex_pm_google->get_option_name('show-logos') , $r, false );
257
- $r = 1;
258
- if(isset($_POST['show-stars']))
259
- {
260
- $r = sanitize_text_field($_POST['show-stars']);
261
- }
262
- update_option( $trustindex_pm_google->get_option_name('show-stars') , $r, false );
263
- delete_option( $trustindex_pm_google->get_option_name('review-content') );
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');
275
- $dateformat = get_option( $trustindex_pm_google->get_option_name('dateformat'), 'Y-m-d' );
276
- $no_rating_text = get_option( $trustindex_pm_google->get_option_name('no-rating-text'));
277
- $filter = get_option( $trustindex_pm_google->get_option_name('filter'), [ 'stars' => [1, 2, 3, 4, 5], 'only-ratings' => true ] );
278
- $verified_icon = get_option( $trustindex_pm_google->get_option_name('verified-icon'), 0 );
279
- $enable_animation = get_option( $trustindex_pm_google->get_option_name('enable-animation'), 1 );
280
- $show_arrows = get_option( $trustindex_pm_google->get_option_name('show-arrows'), 1 );
281
- $show_reviewers_photo = get_option( $trustindex_pm_google->get_option_name('show-reviewers-photo'), 1 );
282
- $widget_setted_up = get_option( $trustindex_pm_google->get_option_name('widget-setted-up'), 0);
283
- $disable_font = get_option( $trustindex_pm_google->get_option_name('disable-font'), 0 );
284
- $show_logos = get_option( $trustindex_pm_google->get_option_name('show-logos'), 1 );
285
- $show_stars = get_option( $trustindex_pm_google->get_option_name('show-stars'), 1 );
286
- if(is_null($no_rating_text) && $style_id)
287
- {
288
- $no_rating_text = in_array($style_id, [ 15, 19 ]) ? 1 : 0;
289
- }
290
- $need_to_refresh = false;
291
- if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_ten_scale_rating_platform())
292
- {
293
- $fields = $wpdb->get_results('SHOW FIELDS FROM `'. $trustindex_pm_google->get_noreg_tablename() .'` WHERE Field = "rating"');
294
- if($fields && isset($fields[0]) && isset($fields[0]->Type))
295
- {
296
- if($fields[0]->Type == 'tinyint(1)')
297
- {
298
- $wpdb->query('ALTER TABLE `'. $trustindex_pm_google->get_noreg_tablename() .'` CHANGE `rating` `rating` DECIMAL(3,1) NULL DEFAULT NULL');
299
- $need_to_refresh = true;
300
- }
301
- }
302
- }
303
- if(isset($_GET['refresh']) || $need_to_refresh)
304
- {
305
- $page_details = get_option( $trustindex_pm_google->get_option_name('page-details') );
306
- $tmp = $trustindex_pm_google->download_noreg_details($page_details);
307
- $page_details['rating_number'] = $tmp['reviews']['count'];
308
- $page_details['rating_score'] = $tmp['reviews']['score'];
309
- $page_details['avatar_url'] = $tmp['avatar_url'];
310
- trustindex_plugin_disconnect_page(false);
311
- trustindex_plugin_connect_page($page_details, false);
312
- if(isset($_GET['my_reviews']))
313
- {
314
- setcookie('ti-success', 'reviews-loaded', time() + 60, "/");
315
- }
316
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . (isset($_GET['my_reviews']) ? '&tab=my_reviews' : '&tab=setup_no_reg'));
317
- exit;
318
- }
319
- if(isset($_GET['recreate']))
320
- {
321
- $trustindex_pm_google->uninstall();
322
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
323
- exit;
324
- }
325
- if(isset($_GET['setup_widget']))
326
- {
327
- update_option( $trustindex_pm_google->get_option_name('widget-setted-up') , 1, false );
328
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
329
- exit;
330
- }
331
- $current_step = isset($_GET['step']) ? intval(sanitize_text_field($_GET['step'])) : 0;
332
- if($current_step == 3 && in_array($style_id, [ 17, 21 ]))
333
- {
334
- $current_step = 4;
335
- }
336
- if(!$trustindex_pm_google->is_noreg_linked())
337
- {
338
- $style_id = null;
339
- $scss_set = null;
340
- $widget_setted_up = null;
341
- }
342
- wp_enqueue_style("trustindex-widget-preview-css", "https://cdn.trustindex.io/assets/ti-preview-box.css");
343
- $example = 'HairPalace';
344
- $example_url = null;
345
- switch("google")
346
- {
347
- case 'airbnb':
348
- $example_url = 'https://www.airbnb.com/rooms/2861469';
349
- break;
350
- case 'amazon':
351
- $example_url = 'https://www.amazon.com/sp?seller=A2VE8XCDXE9M4H';
352
- break;
353
- case 'booking':
354
- $example_url = 'https://www.booking.com/hotel/us/four-seasons-san-francisco.html';
355
- break;
356
- case 'capterra':
357
- $example_url = 'https://www.capterra.com/p/192416/MicroStation';
358
- break;
359
- case 'foursquare':
360
- $example_url = 'https://foursquare.com/v/lands-end-lookout/4f839a12e4b049ff96c6b29a';
361
- break;
362
- case 'hotels':
363
- $example_url = 'https://www.hotels.com/ho108742';
364
- break;
365
- case 'opentable':
366
- $example_url = 'https://www.opentable.com/r/historic-johns-grill-san-francisco';
367
- break;
368
- case 'szallashu':
369
- $example_url = 'https://revngo.com/ramada-by-wyndham-city-center-hotel-budapest';
370
- break;
371
- case 'thumbtack':
372
- $example_url = 'https://www.thumbtack.com/ca/san-francisco/handyman/steve-switchenko-installations-handyman-services/service/246750705829561442';
373
- break;
374
- case 'tripadvisor':
375
- $example_url = 'https://www.tripadvisor.com/Restaurant_Review-g186338-d5122082-Reviews-Alexander_The_Great-London_England.html';
376
- break;
377
- case 'trustpilot':
378
- $example_url = 'https://www.trustpilot.com/review/generalitravelinsurance.com';
379
- break;
380
- case 'expedia':
381
- $example_url = 'https://www.expedia.com/London-Hotels-The-Hayden-Pub-Rooms.h39457643.Hotel-Information';
382
- break;
383
- case 'google':
384
- $example = 'ChIJ9TmAVZfbQUcROoTJtH8TuFU';
385
- break;
386
- case 'zillow':
387
- $example_url = 'https://www.zillow.com/profile/NealandNealTeam/#reviews';
388
- break;
389
- }
390
- $installed_plugins = array_keys(get_plugins());
391
- $show_nonce_notification = (
392
- $scss_set
393
- && !get_option($trustindex_pm_google->get_option_name('widget-nonce-hidden-notification'), 0)
394
- && get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1)
395
- && (
396
- in_array('wp-super-cache/wp-super-cache.php', $installed_plugins)
397
- || in_array('w3-total-cache/w3-total-cache.php', $installed_plugins)
398
- || in_array('wp-rocket/wp-rocket.php', $installed_plugins)
399
- )
400
- );
401
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/setup_no_reg_platform.php DELETED
@@ -1,18 +0,0 @@
1
- <label class="ti-left-label"><?php echo TrustindexPlugin::___("Google Place ID or URL"); ?>:</label>
2
- <div class="input">
3
- <input class="form-control"
4
- placeholder="<?php echo TrustindexPlugin::___("e.g.:") . ' ' . esc_attr($example); ?>"
5
- id="page-link"
6
- type="text" required="required"
7
- />
8
- <span class="info-text">
9
- <?php echo TrustindexPlugin::___("Type your business/company's Place ID or your Google Search/Google Maps URL"); ?><br />
10
- <?php echo TrustindexPlugin::___("For example: <a href='%s' target='_blank'>illustration</a>, <a href='%s' target='_blank'>illustration</a>", [ 'https://cdn.trustindex.io/' . 'assets/img/trustindex-google-search-1.jpg', 'https://cdn.trustindex.io/' . 'assets/img/trustindex-google-search-2.jpg' ]); ?>
11
- </span>
12
- <img class="loading" src="<?php echo admin_url('images/loading.gif'); ?>" />
13
- <div class="results"
14
- data-errortext="<?php echo TrustindexPlugin::___("Please add your Place ID again: this is not a valid %s page.", [ "Google" ]); ?>"
15
- data-errortext-search="<?php echo TrustindexPlugin::___("Please give us that URL where you can see your business profile in Google Search or in Google Maps!"); ?>"
16
- ></div>
17
- </div>
18
- <button class="btn btn-text btn-check"><?php echo TrustindexPlugin::___("Check") ;?></button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/setup_trustindex.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- wp_enqueue_script('trustindex-js', 'https://cdn.trustindex.io/loader.js', [], false, true);
4
- ?>
5
- <div id="tab-setup_trustindex">
6
- <div class="ti-box">
7
- <div class="ti-row">
8
- <div class="ti-col-6">
9
- <h1><?php echo TrustindexPlugin::___('Skyrocket Your Sales with Customer Reviews'); ?></h1>
10
- <h2>
11
- <?php echo TrustindexPlugin::___('%d+ WordPress websites use Trustindex to embed reviews fast and easily.', [ 30.000 ]); ?><br />
12
- <?php echo TrustindexPlugin::___('Increase SEO, trust and sales using customer reviews.'); ?>
13
- </h2>
14
- <h3><?php echo TrustindexPlugin::___('Top Features'); ?></h3>
15
- <ul class="ti-check">
16
- <li><?php echo TrustindexPlugin::___("%d Review Platforms", [ 58 ]); ?></li>
17
- <li><?php echo TrustindexPlugin::___('Create Unlimited Number of Widgets'); ?></li>
18
- <li><?php echo TrustindexPlugin::___('Mix Reviews from Different Platforms'); ?></li>
19
- <li><?php echo TrustindexPlugin::___('Get More Reviews!'); ?></li>
20
- <li><?php echo TrustindexPlugin::___('Manage All Reviews in 1 Place'); ?></li>
21
- <li><?php echo TrustindexPlugin::___('Automatically update with NEW reviews'); ?></li>
22
- <li><?php echo TrustindexPlugin::___('Display UNLIMITED number of reviews'); ?></li>
23
- </ul>
24
- </div>
25
- <div class="ti-col-6">
26
- <div src='https://cdn.trustindex.io/loader.js?76afafc10ad42261d7587d98bf'></div>
27
- </div>
28
- </div>
29
- <a class="btn-text btn-lg arrow-btn" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-3" target="_blank"><?php echo TrustindexPlugin::___('Create a Free Trustindex Account for More Features'); ?></a>
30
- <div class="ti-notice notice-success ti-special-offer">
31
- <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/special_30.jpg'); ?>">
32
- <p><?php echo TrustindexPlugin::___('Now we offer you a 30%% discount off your subscription! Create your free account and benefit from the onboarding discount now!'); ?></p>
33
- <div class="clear"></div>
34
- </div>
35
- </div>
36
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/setup_trustindex_join.php DELETED
@@ -1,180 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- $ti_success = "";
4
- if(isset($_COOKIE['ti-success']))
5
- {
6
- $ti_success = sanitize_text_field($_COOKIE['ti-success']);
7
- setcookie('ti-success', '', time() - 60, "/");
8
- }
9
- $ti_error = null;
10
- $ti_command = isset($_POST['command']) ? sanitize_text_field($_POST['command']) : null;
11
- if (!in_array($ti_command, array("connect", "disconnect"))) { $ti_command = null; }
12
- if ($ti_command == "connect")
13
- {
14
- check_admin_referer( 'connect-reg_'.$trustindex_pm_google->get_plugin_slug());
15
- $sanitized_email = sanitize_email($_POST['email']);
16
- $sanitized_password = stripslashes(sanitize_text_field(htmlentities($_POST['password'], ENT_QUOTES)));
17
- if (
18
- $sanitized_email
19
- && $sanitized_password
20
- )
21
- {
22
- $server_output = $trustindex_pm_google->connect_trustindex_api(
23
- array(
24
- "signin" => array(
25
- "username" => $sanitized_email,
26
- "password" => html_entity_decode($sanitized_password),
27
- ),
28
- "callback" => bin2hex(openssl_random_pseudo_bytes(10))
29
- ),
30
- "connect"
31
- );
32
- if ($server_output['success'])
33
- {
34
- setcookie('ti-success', 'connected', time() + 60, "/");
35
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=' . sanitize_text_field($_GET['tab']));
36
- exit;
37
- }
38
- else
39
- {
40
- $ti_error = TrustindexPlugin::___('Wrong e-mail or password!');
41
- }
42
- }
43
- else
44
- {
45
- $ti_error = TrustindexPlugin::___('You must provide a password and a valid e-mail!');
46
- }
47
- }
48
- elseif ($ti_command == "disconnect")
49
- {
50
- check_admin_referer( 'disconnect-reg_'.$trustindex_pm_google->get_plugin_slug());
51
- delete_option($trustindex_pm_google->get_option_name("subscription-id"));
52
- setcookie('ti-success', 'disconnected', time() + 60, "/");
53
- header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=' . sanitize_text_field($_GET['tab']));
54
- exit;
55
- }
56
- $trustindex_subscription_id = $trustindex_pm_google->is_trustindex_connected();
57
- $widget_number = $trustindex_pm_google->get_trustindex_widget_number();
58
- ?>
59
- <?php if ($ti_success == "connected"): ?>
60
- <?php echo TrustindexPlugin::get_noticebox("success", TrustindexPlugin::___('Trustindex account successfully connected!')); ?>
61
- <?php elseif ($ti_success == "disconnected"): ?>
62
- <?php echo TrustindexPlugin::get_noticebox("success", TrustindexPlugin::___('Trustindex account successfully disconnected!')); ?>
63
- <?php endif; ?>
64
- <?php if ($ti_error): ?>
65
- <?php echo TrustindexPlugin::get_noticebox("error", $ti_error); ?>
66
- <?php endif; ?>
67
- <div class="ti-box">
68
- <div class="ti-header"><?php echo TrustindexPlugin::___('Connect your Trustindex account'); ?></div>
69
- <p><strong><?php echo TrustindexPlugin::___('You can connect your %s with your Trustindex account, and can display your widgets easier.', [ 'Widgets for Google Reviews' ]); ?></strong></p>
70
- <?php if ($trustindex_subscription_id): ?>
71
- <?php
72
- $ti_widgets = $trustindex_pm_google->get_trustindex_widgets();
73
- $ti_package = is_array($ti_widgets) && $ti_widgets && isset($ti_widgets[0]['package']) ? $ti_widgets[0]['package'] : null;
74
- ?>
75
- <p>
76
- <?php echo TrustindexPlugin::___("Your %s is connected.", [ TrustindexPlugin::___('Trustindex account') ]); ?><br />
77
- - <?php echo TrustindexPlugin::___('Your subscription ID:'); ?> <strong><?php echo esc_html($trustindex_subscription_id); ?></strong><br />
78
- <?php if ($ti_package): ?>
79
- - <?php echo TrustindexPlugin::___('Your package:'); ?> <strong><?php echo esc_html(TrustindexPlugin::___($ti_package)); ?></strong>
80
- <?php endif; ?>
81
- </p>
82
- <?php if ($ti_package == "free"): ?>
83
- <?php echo TrustindexPlugin::get_noticebox("error", TrustindexPlugin::___('Once the trial period has expired, the widgets will not appear. You can subscribe or switch back the the "%s" tab', [ TrustindexPlugin::___('Free Widget Configurator') ])); ?>
84
- <?php elseif ($ti_package == "trial"): ?>
85
- <?php echo TrustindexPlugin::get_noticebox("warning", TrustindexPlugin::___('Once the trial period has expired, the widgets will not appear. You can subscribe or switch back the the "%s" tab', [ TrustindexPlugin::___('Free Widget Configurator') ])); ?>
86
- <?php endif; ?>
87
- <form method="post" action="">
88
- <input type="hidden" name="command" value="disconnect" />
89
- <?php wp_nonce_field( 'disconnect-reg_'.$trustindex_pm_google->get_plugin_slug() ); ?>
90
- <div class="text-center">
91
- <button class="btn btn-text" type="submit" style="margin-top: 20px; margin-bottom: 0"><?php echo TrustindexPlugin::___("Disconnect"); ?></button>
92
- </div>
93
- </form>
94
- <?php else: ?>
95
- <div class="ti-row">
96
- <form id="form-connect" class="box-content ti-col-6" method="post" action="">
97
- <input type="hidden" name="command" value="connect" />
98
- <?php wp_nonce_field( 'connect-reg_'.$trustindex_pm_google->get_plugin_slug() ); ?>
99
- <div class="form-group">
100
- <label for="ti-reg-email2">E-mail</label>
101
- <input type="email"
102
- placeholder="E-mail"
103
- name="email"
104
- class="form-control"
105
- required="required"
106
- id="ti-reg-email2"
107
- value="<?php echo esc_attr($current_user->user_email); ?>"
108
- />
109
- </div>
110
- <div class="form-group">
111
- <label for="ti-reg-password2"><?php echo TrustindexPlugin::___('Password'); ?></label>
112
- <input type="password"
113
- placeholder="<?php echo TrustindexPlugin::___('Password'); ?>"
114
- name="password"
115
- class="form-control"
116
- required="required"
117
- id="ti-reg-password2"
118
- />
119
- <span class="dashicons dashicons-visibility ti-toggle-password"></span>
120
- </div>
121
- <button type="submit" class="btn btn-primary" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>"><?php echo TrustindexPlugin::___('CONNECT ACCOUNT');?></button>
122
- <br />
123
- <p class="text-center">
124
- <a class="btn-text" href="<?php echo 'https://admin.trustindex.io/'; ?>forgot-password" target="_blank"><?php echo TrustindexPlugin::___('Have you forgotten your password?'); ?></a>
125
- <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-4" target="_blank"><?php echo TrustindexPlugin::___('Create a new Trustindex account');?></a>
126
- </p>
127
- </form>
128
- <div class="ti-col-6"></div>
129
- </div>
130
- <?php endif; ?>
131
- </div>
132
- <?php if($trustindex_subscription_id): ?>
133
- <div class="ti-box disabled">
134
- <div class="ti-header"><?php echo TrustindexPlugin::___("Manage your Trustindex account"); ?></div>
135
- <a class="btn-text" href="<?php echo 'https://admin.trustindex.io/'; ?>widget" target="_blank" <?php if ($ti_success == "connected"): ?>data-autoclick="true"<?php endif; ?>><?php echo TrustindexPlugin::___("Go to Trustindex's admin!"); ?></a>
136
- <?php if ($ti_success == "connected"): ?>
137
- <?php echo TrustindexPlugin::get_noticebox("success", TrustindexPlugin::___('We will redirect you to the admin panel automatically in some seconds...')); ?>
138
- <?php endif; ?>
139
- </div>
140
- <div class="ti-box">
141
- <div class="ti-header"><?php echo TrustindexPlugin::___("Insert your widget into your wordpress site using shortcode"); ?></div>
142
- <?php if($trustindex_subscription_id): ?>
143
- <?php if($widget_number): ?>
144
- <p>
145
- <?php echo TrustindexPlugin::___('You have got %d widgets saved in Trustindex admin.', array($widget_number)); ?>
146
- </p>
147
- <?php foreach ($ti_widgets as $wc_i => $wc): ?>
148
- <p><strong><?php echo esc_html($wc['name']); ?>:</strong></p>
149
- <?php if ($wc['widgets']): ?>
150
- <ul>
151
- <?php foreach ($wc['widgets'] as $wi_num => $w): ?>
152
- <li>
153
- <?php echo esc_html($wi_num+1); ?>.
154
- <a href=".ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>" class="btn-toggle" data-ti-id="<?php echo esc_attr($w['id']); ?>">
155
- <?php echo esc_html($w['name']); ?>
156
- </a>
157
- <div style="display: none;" class="ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>">
158
- <code class="code-ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>">[<?php echo $trustindex_pm_google->get_shortcode_name(); ?> data-widget-id="<?php echo esc_attr($w['id']); ?>"]</code>
159
- <a href=".code-ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>" class="btn-text btn-copy2clipboard"><?php echo TrustindexPlugin::___("Copy to clipboard") ;?></a>
160
- <br />
161
- <br />
162
- </div>
163
- </li>
164
- <?php endforeach; ?>
165
- </ul>
166
- <?php else: ?>
167
- -
168
- <?php endif; ?>
169
- <?php endforeach; ?>
170
- <?php else: ?>
171
- <div style="margin: 0 -15px">
172
- <?php echo TrustindexPlugin::get_noticebox("warning", "You have no widgets saved!"); ?>
173
- </div>
174
- <?php endif; ?>
175
- <p>
176
- <a class="btn-text" href="<?php echo 'https://admin.trustindex.io/'; ?>widget" target="_blank"><?php echo TrustindexPlugin::___("Create more!"); ?></a>
177
- </p>
178
- <?php endif; ?>
179
- </div>
180
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/troubleshooting.php DELETED
@@ -1,216 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- $reviews = [];
4
- if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
5
- {
6
- $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
7
- }
8
- $auto_updates = get_option('auto_update_plugins', []);
9
- $plugin_slug = "wp-reviews-plugin-for-google/wp-reviews-plugin-for-google.php";
10
- if(isset($_GET['auto_update']))
11
- {
12
- if(!in_array($plugin_slug, $auto_updates))
13
- {
14
- array_push($auto_updates, $plugin_slug);
15
- update_option('auto_update_plugins', $auto_updates, false);
16
- }
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.8");
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>
33
- <p><strong><?php echo TrustindexPlugin::___('If you have any problem, you should try these steps:'); ?></strong></p>
34
- <ul class="troubleshooting-checklist">
35
- <li>
36
- <?php echo TrustindexPlugin::___('Use the latest version:') .' '. ($plugin_updated ? $yes_icon : $no_icon); ?>
37
- <?php if(!$plugin_updated): ?>
38
- <a href="/wp-admin/plugins.php"><?php echo TrustindexPlugin::___("Update"); ?></a>
39
- <?php endif; ?>
40
- <br />
41
- <?php echo TrustindexPlugin::___('Use automatic plugin update:') .' '. (in_array($plugin_slug, $auto_updates) ? $yes_icon : $no_icon); ?>
42
- <?php if(!in_array($plugin_slug, $auto_updates)): ?>
43
- <a href="?page=<?php echo sanitize_text_field($_GET['page']); ?>&tab=troubleshooting&auto_update"><?php echo TrustindexPlugin::___("Enable"); ?></a>
44
- <div class="notice notice-warning">
45
- <p><?php echo TrustindexPlugin::___("You should enable it, to get new features and fixes automatically, right after they published!"); ?></p>
46
- </div>
47
- <?php endif; ?>
48
- </li>
49
- <li>
50
- <?php echo TrustindexPlugin::___('If you are using cacher plugin, you should:'); ?>
51
- <ul>
52
- <li><?php echo TrustindexPlugin::___('clear the cache'); ?></li>
53
- <li><?php echo TrustindexPlugin::___("exclude Trustindex's JS file:"); ?> <strong><?php echo 'https://cdn.trustindex.io/'; ?>loader.js</strong>
54
- <ul>
55
- <li><a href="#" onclick="jQuery('#list-wp-rocket').toggle(); return false;">WP Rocket</a>
56
- <ol id="list-wp-rocket" style="display: none;">
57
- <li><?php echo TrustindexPlugin::___('Navigate to'); ?> "Settings" > "WP Rocket menu" > "File optimization"</li>
58
- <li><?php echo TrustindexPlugin::___('Scroll to'); ?> "Excluded Javascript files"</li>
59
- <li><?php echo TrustindexPlugin::___('In a new line, add'); ?> https://cdn.trustindex.io/*</li>
60
- <li><?php echo TrustindexPlugin::___('Save'); ?></li>
61
- </ol>
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>
94
- <?php
95
- $plugin_url = 'https://wordpress.org/support/plugin/' . $trustindex_pm_google->get_plugin_slug();
96
- $screenshot_url = 'https://snipboard.io';
97
- $screencast_url = 'https://streamable.com/upload-video';
98
- $pastebin_url = 'https://pastebin.com';
99
- echo TrustindexPlugin::___("If the problem/question still exists, please create an issue here: %s", [ '<a href="'. $plugin_url .'" target="_blank">'. $plugin_url .'</a>' ]);
100
- ?>
101
- <br />
102
- <?php echo TrustindexPlugin::___('Please help us with some information:'); ?>
103
- <ul>
104
- <li><?php echo TrustindexPlugin::___('Describe your problem'); ?></li>
105
- <li><?php echo TrustindexPlugin::___('You can share a screenshot with %s', [ '<a href="'. $screenshot_url .'" target="_blank">'. $screenshot_url .'</a>' ]); ?></li>
106
- <li><?php echo TrustindexPlugin::___('You can share a screencast video with %s', [ '<a href="'. $screencast_url .'" target="_blank">'. $screencast_url .'</a>' ]); ?></li>
107
- <li><?php echo TrustindexPlugin::___('If you have an (webserver) error log, you can copy it to the issue, or link it with %s', [ '<a href="'. $pastebin_url .'" target="_blank">'. $pastebin_url .'</a>' ]); ?></li>
108
- <li><?php echo TrustindexPlugin::___('And include the information below:'); ?></li>
109
- </ul>
110
- </li>
111
- </ul>
112
- <?php
113
- $dir = __DIR__ . '/../wp-reviews-plugin-for-google.php';
114
- $plugin_data = get_plugin_data( $dir );
115
- ?>
116
- <?php
117
- $memory_limit = "N/A";
118
- if(ini_get('memory_limit'))
119
- {
120
- $memory_limit = filter_var(ini_get('memory_limit'), FILTER_SANITIZE_STRING);
121
- }
122
- $upload_max = "N/A";
123
- if (ini_get('upload_max_filesize'))
124
- {
125
- $upload_max = filter_var(ini_get('upload_max_filesize'), FILTER_SANITIZE_STRING);
126
- }
127
- $post_max = "N/A";
128
- if (ini_get('post_max_size'))
129
- {
130
- $post_max = filter_var(ini_get('post_max_size'), FILTER_SANITIZE_STRING);
131
- }
132
- $max_execute = "N/A";
133
- if (ini_get('max_execution_time'))
134
- {
135
- $max_execute = filter_var(ini_get('max_execution_time'));
136
- }
137
- ?>
138
- <textarea class="ti-troubleshooting-info" readonly>
139
- URL: <?php echo esc_url(get_option('siteurl')) ."\n"; ?>
140
- MySQL Version: <?php echo esc_html($wpdb->db_version()) ."\n"; ?>
141
- WP Table Prefix: <?php echo esc_html($wpdb->prefix) ."\n"; ?>
142
- WP Version: <?php echo esc_html($wp_version) ."\n"; ?>
143
- Server Name: <?php echo esc_html($_SERVER['SERVER_NAME']) ."\n"; ?>
144
- Cookie Domain: <?php $cookieDomain = parse_url(strtolower(get_bloginfo('wpurl'))); echo esc_html($cookieDomain['host']) ."\n"; ?>
145
- CURL Library Present: <?php echo (function_exists('curl_init') ? "Yes" : "No") ."\n\n"; ?>
146
- PHP Info: <?php echo "\n\t"; ?>
147
- Version: <?php echo esc_html(phpversion()) ."\n\t"; ?>
148
- Memory Usage: <?php echo round(memory_get_usage() / 1024 / 1024, 2) . "MB\n\t"; ?>
149
- Memory Limit : <?php echo esc_html($memory_limit) . "\n\t"; ?>
150
- Max Upload Size : <?php echo esc_html($upload_max) . "\n\t"; ?>
151
- Max Post Size : <?php echo esc_html($post_max) . "\n\t"; ?>
152
- Allow URL fopen : <?php echo (ini_get('allow_url_fopen') ? "On" : "Off") . "\n\t"; ?>
153
- Allow URL Include : <?php echo (ini_get('allow_url_include') ? "On" : "Off") . "\n\t"; ?>
154
- Display Errors : <?php echo (ini_get('display_errors') ? "On" : "Off") . "\n\t"; ?>
155
- Max Script Execution Time : <?php echo esc_html($max_execute) . " seconds\n\n"; ?>
156
- Plugin: <?php echo esc_html($plugin_data['Name']) ."\n"; ?>
157
- Plugin Version: <?php echo esc_html($plugin_data['Version']) ."\n"; ?>
158
- Options: <?php foreach ($trustindex_pm_google->get_option_names() as $opt_name) {
159
- if($opt_name == "css-content")
160
- {
161
- continue;
162
- }
163
- $option = get_option($trustindex_pm_google->get_option_name( $opt_name ));
164
- echo "\n\t". esc_html($opt_name) .": ";
165
- if($opt_name == "page-details" || is_array($option))
166
- {
167
- if(isset($option['reviews']))
168
- {
169
- unset($option['reviews']);
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
- }
177
- else
178
- {
179
- echo esc_html($option);
180
- }
181
- }
182
- echo "\n\n"; ?>
183
- Reviews: <?php echo esc_html(str_replace("\n", "\n\t", print_r($reviews, true))) ."\n\n\t"; ?>
184
- CSS: <?php echo esc_html(get_option($trustindex_pm_google->get_option_name('css-content'))) ."\n\n"; ?>
185
- Active Theme: <?php
186
- if (!function_exists('wp_get_theme'))
187
- {
188
- $theme = get_theme(get_current_theme());
189
- echo esc_html($theme['Name'] . ' ' . $theme['Version']);
190
- }
191
- else
192
- {
193
- $theme = wp_get_theme();
194
- echo esc_html($theme->Name . ' ' . $theme->Version);
195
- }
196
- echo "\n"; ?>
197
- Plugins: <?php foreach (get_plugins() as $key => $plugin) {
198
- echo "\n\t". esc_html($plugin['Name'].' ('.$plugin['Version'] . (is_plugin_active($key) ? ' - active' : '') . ')');
199
- } ?>
200
- </textarea>
201
- <a href=".ti-troubleshooting-info" class="btn-text btn-copy2clipboard ti-pull-right"><?php echo TrustindexPlugin::___("Copy to clipboard"); ?></a>
202
- <div class="clear"></div>
203
- </div>
204
- <div class="ti-box">
205
- <div class="ti-header"><?php echo TrustindexPlugin::___("Re-create plugin"); ?></div>
206
- <p><?php echo TrustindexPlugin::___('Re-create the database tables of the plugin.<br />Please note: this removes all settings and reviews.'); ?></p>
207
- <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&recreate" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin::___("Loading") ;?>" style="margin-left: 0"><?php echo TrustindexPlugin::___("Re-create plugin"); ?></a>
208
- <div class="clear"></div>
209
- </div>
210
- <div class="ti-box">
211
- <div class="ti-header"><?php echo TrustindexPlugin::___("Translation"); ?></div>
212
- <p>
213
- <?php echo TrustindexPlugin::___('If you notice an incorrect translation in the plugin text, please report it here:'); ?>
214
- <a href="mailto:support@trustindex.io">support@trustindex.io</a>
215
- </p>
216
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/tabs/woocommerce.php DELETED
@@ -1,3 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- ?>
 
 
 
trunk/trustindex-google-widget.class.php DELETED
@@ -1,132 +0,0 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
- class TrustindexWidget_google extends WP_Widget {
4
- private $widget_fields = array(
5
- 'ti-widget-ID' => array('default' => '', 'required' => true,
6
- 'placeholder' => 'eg.: 478dcc2136263f2b3a3726ff', 'name' => 'Trustindex Widget ID',
7
- 'help' => null,
8
- 'help-icon' => '<span class="dashicons dashicons-editor-help btn-insert-tooltip"></span>'
9
- ),
10
- );
11
- private $errors = array();
12
- public function __construct()
13
- {
14
- parent::__construct(
15
- 'trustindex_google_widget',
16
- 'Review Widgets for Google',
17
- array(
18
- 'classname' => 'trustindex-widget',
19
- 'description' => 'Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.'
20
- )
21
- );
22
- }
23
- function widget($args, $instance)
24
- {
25
- global $wpdb;
26
- global $trustindex_pm_google;
27
- if ($trustindex_pm_google->is_enabled())
28
- {
29
- extract($args);
30
- echo $before_widget;
31
- $was_error = false;
32
- foreach ($this->widget_fields as $fname => $fparams)
33
- {
34
- if($fparams['required'] && (!isset($instance[$fname]) || $instance[$fname] == ""))
35
- {
36
- $was_error = true;
37
- break;
38
- }
39
- }
40
- if(!$was_error && $instance['ti-widget-ID'])
41
- {
42
- echo $trustindex_pm_google->get_trustindex_widget($instance['ti-widget-ID']);
43
- }
44
- elseif($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
45
- {
46
- echo $trustindex_pm_google->get_noreg_list_reviews();
47
- }
48
- else
49
- {
50
- echo TrustindexPlugin::get_alertbox(
51
- "error",
52
- " in <strong>".TrustindexPlugin::___('Widgets for Google Reviews')."</strong> plugin<br /><br />"
53
- .TrustindexPlugin::___('Please fill out <strong>all the required fields</strong> in the <a href="%s">widget settings</a> page', [admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php')]),
54
- false
55
- );
56
- }
57
- echo $after_widget;
58
- }
59
- else
60
- {
61
- }
62
- }
63
- function form($instance)
64
- {
65
- global $wp_version;
66
- global $trustindex_pm_google;
67
- $ti_widgets = $trustindex_pm_google->get_trustindex_widgets();
68
- $selected_widget_id = isset($instance['ti-widget-ID']) ? esc_attr($instance['ti-widget-ID']) : $this->widget_fields['ti-widget-ID']['default'];
69
- ?>
70
- <div class="trustindex-widget-admin">
71
- <?php if ($trustindex_pm_google->is_trustindex_connected()): ?>
72
- <?php if ($ti_widgets): ?>
73
- <h2><?php echo TrustindexPlugin::___('Your saved widgets'); ?></h2>
74
- <?php foreach ($ti_widgets as $wc): ?>
75
- <p><strong><?php echo esc_html($wc['name']); ?>:</strong></p>
76
- <p>
77
- <?php foreach ($wc['widgets'] as $w): ?>
78
- <a href="#" class="btn-copy-widget-id <?php if($selected_widget_id == $w['id']): ?>text-danger<?php endif; ?>" data-ti-id="<?php echo esc_attr($w['id']); ?>">
79
- <span class="dashicons <?php if($selected_widget_id == $w['id']): ?>dashicons-yes<?php else: ?>dashicons-admin-post<?php endif; ?>"></span>
80
- <?php echo esc_html($w['name']); ?>
81
- </a><br />
82
- <?php endforeach; ?>
83
- </p>
84
- <?php endforeach; ?>
85
- <?php else: ?>
86
- <?php echo TrustindexPlugin::get_alertbox("warning",
87
- TrustindexPlugin::___("You have no widget saved!") . " "
88
- . "<a target='_blank' href='" . "https://admin.trustindex.io/" . "widget'>". TrustindexPlugin::___("Let's go, create amazing widgets for free!")."</a>"
89
- ); ?>
90
- <?php endif; ?>
91
- <?php foreach ($this->widget_fields as $fname => $fparams): ?>
92
- <div class="form-group">
93
- <div class="col-sm-12">
94
- <label class="<?php if (isset($this->errors[$fname])):?>text-danger<?php endif; ?>">
95
- <?php echo TrustindexPlugin::___($fparams['name']); ?> <?php if ($fparams['required']): ?><strong class="text-danger">*</strong><?php endif; ?>
96
- <?php if ($fparams['help-icon']): ?>
97
- <?php echo TrustindexPlugin::___($fparams['help-icon']); ?>
98
- <?php endif; ?>
99
- </label>
100
- <input type="text"
101
- placeholder="<?php echo TrustindexPlugin::___($fparams['placeholder']); ?>"
102
- id="<?php echo $this->get_field_id($fname); ?>"
103
- name="<?php echo $this->get_field_name($fname); ?>"
104
- value="<?php echo isset($instance[$fname]) ? esc_attr($instance[$fname]) : $fparams['default']; ?>"
105
- class="form-control"
106
- <?php if ($fparams['required']): ?>required="required"<?php endif; ?>
107
- />
108
- <?php if ($fparams['help']): ?>
109
- <small class="text-muted"><?php echo TrustindexPlugin::___($fparams['help']); ?></small>
110
- <?php endif; ?>
111
- </div>
112
- </div>
113
- <?php endforeach; ?>
114
- <div class="help-block block-help-template">
115
- <span class="dashicons dashicons-dismiss"></span>
116
- <p>
117
- Check our portal, <a href="<?php echo 'https://admin.trustindex.io/'; ?>widget" target="_blank">list your widgets</a> and find IDs in the first colums.
118
- </p>
119
- <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/help-where-is-id.jpg'); ?>" alt="ID column here: <?php echo 'https://admin.trustindex.io/'; ?>widget" />
120
- </div>
121
- <?php else: ?>
122
- <?php echo TrustindexPlugin::get_alertbox("warning",
123
- TrustindexPlugin::___("You have not set up your Trustindex account yet!") . " " .
124
- TrustindexPlugin::___("You can only list 10 reviews without it.") . "<br>"
125
- . TrustindexPlugin::___("Go to <a href='%s'>plugin setup page</a> to complete the one-step setup guide and enjoy the full functionalization!", [ admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php&tab=setup_trustindex') ])
126
- ); ?>
127
- <?php endif; ?>
128
- </div>
129
- <?php
130
- }
131
- }
132
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/trustindex-plugin.class.php DELETED
@@ -1,3209 +0,0 @@
1
- <?php
2
- /* GENERATED: 1641596010 */
3
- class TrustindexPlugin
4
- {
5
- private $plugin_file_path;
6
- private $plugin_name;
7
- private $platform_name;
8
- public $shortname;
9
- private $version;
10
- public function __construct($shortname, $plugin_file_path, $version, $plugin_name, $platform_name)
11
- {
12
- $this->shortname = $shortname;
13
- $this->plugin_file_path = $plugin_file_path;
14
- $this->version = $version;
15
- $this->plugin_name = $plugin_name;
16
- $this->platform_name = $platform_name;
17
- }
18
- public function getShortName()
19
- {
20
- return $this->shortname;
21
- }
22
-
23
-
24
- public function get_plugin_dir()
25
- {
26
- return plugin_dir_path($this->plugin_file_path);
27
- }
28
- public function get_plugin_file_url($file, $add_versioning = true)
29
- {
30
- $url = plugins_url($file, $this->plugin_file_path);
31
- if ($add_versioning)
32
- {
33
- $append_mark = strpos($url, "?") === FALSE ? "?" : "&";
34
- $url .= $append_mark . 'ver=' . $this->version;
35
- }
36
- return $url;
37
- }
38
- public function get_plugin_slug()
39
- {
40
- return basename($this->get_plugin_dir());
41
- }
42
-
43
- /* I18N
44
- * make sure you do not use any translatable string function calls before the call to our ‘load_plugin_textdomain’
45
- */
46
- public function loadI18N()
47
- {
48
- load_plugin_textdomain('trustindex', false, $this->get_plugin_slug() . '/languages');
49
- }
50
- public static function ___($text, $params = null)
51
- {
52
- if (!is_array($params))
53
- {
54
- $params = func_get_args();
55
- $params = array_slice($params, 1);
56
- }
57
- return vsprintf(__($text, 'trustindex'), $params);
58
- }
59
-
60
-
61
- public function output_buffer()
62
- {
63
- ob_start();
64
- }
65
-
66
-
67
- public function uninstall()
68
- {
69
- foreach ($this->get_option_names() as $opt_name)
70
- {
71
- delete_option($this->get_option_name($opt_name));
72
- }
73
- global $wpdb;
74
- $dbtable = $this->get_noreg_tablename();
75
- $wpdb->query( "DROP TABLE IF EXISTS $dbtable" );
76
- }
77
-
78
-
79
- public function activate()
80
- {
81
- if ($this->is_need_update())
82
- {
83
- add_option($this->get_option_name('active'), '1');
84
- update_option($this->get_option_name('version'), $this->version);
85
- }
86
- }
87
- public function deactivate()
88
- {
89
- }
90
- public function is_enabled()
91
- {
92
- $active = get_option($this->get_option_name('active'));
93
- if (empty($active) || $active === '0')
94
- {
95
- return false;
96
- }
97
- return true;
98
- }
99
- public function is_need_update()
100
- {
101
- $version = (string)get_option($this->get_option_name('version'));
102
- if (!$version)
103
- {
104
- $version = '0';
105
- }
106
- if (version_compare($version, $this->version, '<'))
107
- {
108
- return true;
109
- }
110
- return false;
111
- }
112
-
113
- public function add_setting_menu()
114
- {
115
- global $menu, $submenu;
116
- $permission = 'edit_pages';
117
- $settings_page_url = $this->get_plugin_slug() . "/settings.php";
118
- $settings_page_title = $this->platform_name . ' ';
119
- if(function_exists('mb_strtolower'))
120
- {
121
- $settings_page_title .= mb_strtolower(TrustindexPlugin::___('Reviews'));
122
- }
123
- else
124
- {
125
- $settings_page_title .= strtolower(TrustindexPlugin::___('Reviews'));
126
- }
127
- $top_menu = false;
128
- foreach($menu as $key => $item)
129
- {
130
- if($item[0] == 'Trustindex.io')
131
- {
132
- $top_menu = $item;
133
- break;
134
- }
135
- }
136
- if($top_menu === false)
137
- {
138
- add_menu_page(
139
- $settings_page_title,
140
- 'Trustindex.io',
141
- $permission,
142
- $settings_page_url,
143
- '',
144
- $this->get_plugin_file_url('static/img/trustindex-sign-logo.png')
145
- );
146
- }
147
- else
148
- {
149
- if(!isset($submenu[$top_menu[2]]))
150
- {
151
- add_submenu_page(
152
- $top_menu[2],
153
- 'Trustindex.io',
154
- $top_menu[3],
155
- $permission,
156
- $top_menu[2]
157
- );
158
- }
159
- add_submenu_page(
160
- $top_menu[2],
161
- 'Trustindex.io',
162
- $settings_page_title,
163
- $permission,
164
- $settings_page_url
165
- );
166
- }
167
- }
168
- public function add_plugin_action_links($links, $file)
169
- {
170
- $plugin_file = basename($this->plugin_file_path);
171
- if (basename($file) == $plugin_file)
172
- {
173
- $new_item2 = '<a target="_blank" href="https://www.trustindex.io" target="_blank">by <span style="background-color: #4067af; color: white; font-weight: bold; padding: 1px 8px;">Trustindex.io</span></a>';
174
- $new_item1 = '<a href="' . admin_url('admin.php?page=' . $this->get_plugin_slug() . '/settings.php') . '">' . TrustindexPlugin::___('Settings') . '</a>';
175
- array_unshift($links, $new_item2, $new_item1);
176
- }
177
- return $links;
178
- }
179
- public function add_plugin_meta_links( $meta, $file )
180
- {
181
- $plugin_file = basename($this->plugin_file_path);
182
- if (basename($file) == $plugin_file)
183
- {
184
- $meta[] = "<a href='http://wordpress.org/support/view/plugin-reviews/".$this->get_plugin_slug()."' target='_blank' rel='noopener noreferrer' title='" . TrustindexPlugin::___( 'Rate our plugin') . ': '.$this->plugin_name . "'>" . TrustindexPlugin::___('Rate our plugin') . '</a>';
185
- }
186
- return $meta;
187
- }
188
-
189
-
190
- public function init_widget()
191
- {
192
- if (!class_exists('TrustindexWidget_'.$this->shortname))
193
- {
194
- require $this->get_plugin_dir() . 'trustindex-'.$this->shortname.'-widget.class.php';
195
- }
196
- }
197
- public function register_widget()
198
- {
199
- return register_widget('TrustindexWidget_'.$this->shortname);
200
- }
201
-
202
-
203
- public function get_option_name($opt_name)
204
- {
205
- if (!in_array($opt_name, $this->get_option_names()))
206
- {
207
- echo "Option not registered in plugin (Trustindex class)";
208
- }
209
- if(in_array($opt_name, [ 'subscription-id', 'proxy-check' ]))
210
- {
211
- return "trustindex-".$opt_name;
212
- }
213
- else
214
- {
215
- return "trustindex-".$this->shortname."-".$opt_name;
216
- }
217
- }
218
- public function get_option_names()
219
- {
220
- return [
221
- 'active',
222
- 'version',
223
- 'page-details',
224
- 'subscription-id',
225
- 'proxy-check',
226
- 'style-id',
227
- 'review-content',
228
- 'filter',
229
- 'scss-set',
230
- 'css-content',
231
- 'lang',
232
- 'no-rating-text',
233
- 'dateformat',
234
- 'rate-us',
235
- 'verified-icon',
236
- 'enable-animation',
237
- 'show-arrows',
238
- 'content-saved-to',
239
- 'show-reviewers-photo',
240
- 'download-timestamp',
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()
250
- {
251
- return array (
252
- 0 => 'facebook',
253
- 1 => 'google',
254
- 2 => 'tripadvisor',
255
- 3 => 'yelp',
256
- 4 => 'booking',
257
- 5 => 'amazon',
258
- 6 => 'arukereso',
259
- 7 => 'airbnb',
260
- 8 => 'hotels',
261
- 9 => 'opentable',
262
- 10 => 'foursquare',
263
- 11 => 'capterra',
264
- 12 => 'szallashu',
265
- 13 => 'thumbtack',
266
- 14 => 'expedia',
267
- 15 => 'zillow',
268
- 16 => 'wordpressPlugin',
269
- 17 => 'aliexpress',
270
- 18 => 'alibaba',
271
- 19 => 'sourceForge',
272
- 20 => 'ebay',
273
- );
274
- }
275
- private $plugin_slugs = array (
276
- 'facebook' => 'free-facebook-reviews-and-recommendations-widgets',
277
- 'google' => 'wp-reviews-plugin-for-google',
278
- 'tripadvisor' => 'review-widgets-for-tripadvisor',
279
- 'yelp' => 'reviews-widgets-for-yelp',
280
- 'booking' => 'review-widgets-for-booking-com',
281
- 'amazon' => 'review-widgets-for-amazon',
282
- 'arukereso' => 'review-widgets-for-arukereso',
283
- 'airbnb' => 'review-widgets-for-airbnb',
284
- 'hotels' => 'review-widgets-for-hotels-com',
285
- 'opentable' => 'review-widgets-for-opentable',
286
- 'foursquare' => 'review-widgets-for-foursquare',
287
- 'capterra' => 'review-widgets-for-capterra',
288
- 'szallashu' => 'review-widgets-for-szallas-hu',
289
- 'thumbtack' => 'widgets-for-thumbtack-reviews',
290
- 'expedia' => 'widgets-for-expedia-reviews',
291
- 'zillow' => 'widgets-for-zillow-reviews',
292
- 'wordpressPlugin' => 'reviews-widgets',
293
- 'aliexpress' => 'widgets-for-aliexpress-reviews',
294
- 'alibaba' => 'widgets-for-alibaba-reviews',
295
- 'sourceForge' => 'widgets-for-sourceforge-reviews',
296
- 'ebay' => 'widgets-for-ebay-reviews',
297
- );
298
- public function get_plugin_slugs()
299
- {
300
- return array_values($this->plugin_slugs);
301
- }
302
-
303
-
304
- public static function get_noticebox($type, $message)
305
- {
306
- return '<div class="ti-notice notice-'.$type.' is-dismissible"><p>'.TrustindexPlugin::___($message).'</p><button type="button" class="notice-dismiss"></button></div>';
307
- }
308
- public static function get_alertbox($type, $content, $newline_content = true)
309
- {
310
- $types = array(
311
- "warning" => array(
312
- "css" => "color: #856404; background-color: #fff3cd; border-color: #ffeeba;",
313
- "icon" => "dashicons-warning"
314
- ),
315
- "info" => array(
316
- "css" => "color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb;",
317
- "icon" => "dashicons-info"
318
- ),
319
- "error" => array(
320
- "css" => "color: #721c24; background-color: #f8d7da; border-color: #f5c6cb;",
321
- "icon" => "dashicons-info"
322
- )
323
- );
324
- return "<div style='margin:20px 0px; padding:10px; " . $types[$type]['css'] . " border-radius: 5px;'>"
325
- . "<span class='dashicons " . $types[$type]['icon'] . "'></span> <strong>" . strtoupper(TrustindexPlugin::___($type)) . "</strong>"
326
- . ($newline_content ? "<br />" : "")
327
- . $content
328
- . "</div>";
329
- }
330
-
331
-
332
- public function get_trustindex_widget($ti_id)
333
- {
334
- wp_enqueue_script('trustindex-js', 'https://cdn.trustindex.io/loader.js', [], false, true);
335
- return "<div src='https://cdn.trustindex.io/loader.js?" . $ti_id . "'></div>";
336
- }
337
- public function get_shortcode_name()
338
- {
339
- return 'trustindex';
340
- }
341
- public function init_shortcode()
342
- {
343
- if (!shortcode_exists($this->get_shortcode_name()))
344
- {
345
- add_shortcode( $this->get_shortcode_name(), [$this, 'shortcode_func'] );
346
- }
347
- }
348
- public function shortcode_func($atts)
349
- {
350
- $atts = shortcode_atts(
351
- array(
352
- 'data-widget-id' => null,
353
- 'no-registration' => null
354
- ),
355
- $atts
356
- );
357
- if (isset($atts["data-widget-id"]) && $atts["data-widget-id"])
358
- {
359
- return $this->get_trustindex_widget($atts["data-widget-id"]);
360
- }
361
- else if (isset($atts["no-registration"]) && $atts["no-registration"])
362
- {
363
- $force_platform = $atts["no-registration"];
364
- if(substr($force_platform, 0, 5) != 'trust' && substr($force_platform, -4) != 'ilot' && !in_array($force_platform, $this->get_platforms()))
365
- {
366
- $av_platforms = $this->get_platforms();
367
- $force_platform = $av_platforms[0];
368
- }
369
- $file_path = __FILE__;
370
- if(isset($this->plugin_slugs[ $force_platform ]))
371
- {
372
- $chosed_platform_slug = $this->plugin_slugs[ $force_platform ];
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.8", "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(
380
- "error",
381
- " @ <strong>Trustindex plugin</strong><br /><br />"
382
- .TrustindexPlugin::___('You have to connect your business (%s)!', [$force_platform]),
383
- false
384
- );
385
- }
386
- else
387
- {
388
- return $chosed_platform->get_noreg_list_reviews($force_platform);
389
- }
390
- }
391
- else
392
- {
393
- return self::get_alertbox(
394
- "error",
395
- " @ <strong>Trustindex plugin</strong><br /><br />"
396
- .TrustindexPlugin::___('Your shortcode is deficient: Trustindex Widget ID is empty! Example: ') . '<br /><code>['.$this->get_shortcode_name().' data-widget-id="478dcc2136263f2b3a3726ff"]</code>',
397
- false
398
- );
399
- }
400
- }
401
-
402
- /* WITHOUT REG MODE HELPERS
403
- *
404
- * @force_platform - default ($this->shortname) platform name can be overriden, because of the general shortcode.
405
- * (For example: if Yelp plugin loaded first --> yelp plugin will load the widget, other Trustindex plugins will not load shortcode.
406
- * But Yelp plugins's shortcode should be able to operate other platforms' (ie.: Google) shortcodes, too. )
407
- */
408
- public function is_noreg_linked()
409
- {
410
- $page_details = get_option($this->get_option_name('page-details'));
411
- return $page_details && !empty($page_details);
412
- }
413
- public function get_noreg_tablename($force_platform = null)
414
- {
415
- global $wpdb;
416
- $force_platform = $force_platform ? $force_platform : $this->shortname;
417
- return $wpdb->prefix ."trustindex_".$force_platform."_reviews";
418
- }
419
- public function is_noreg_table_exists($force_platform = null)
420
- {
421
- global $wpdb;
422
- $dbtable = $this->get_noreg_tablename($force_platform);
423
- return ($wpdb->get_var("SHOW TABLES LIKE '$dbtable'") == $dbtable);
424
- }
425
- public function noreg_save_css($set_change = false)
426
- {
427
- $style_id = (int)get_option($this->get_option_name('style-id'), 4);
428
- $set_id = get_option($this->get_option_name('scss-set'));
429
- $args = array(
430
- 'timeout' => '20',
431
- 'redirection' => '5',
432
- 'blocking' => true
433
- );
434
- add_filter( 'https_ssl_verify', '__return_false' );
435
- add_filter( 'block_local_requests', '__return_false' );
436
- $params = [
437
- 'platform' => $this->shortname,
438
- 'layout_id' => $style_id,
439
- 'overrides' => [
440
- 'nav' => get_option($this->get_option_name('show-arrows'), 1) ? true : false,
441
- 'hover-anim' => get_option($this->get_option_name('enable-animation'), 1) ? true : false,
442
- 'enable-font' => get_option($this->get_option_name('disable-font'), 0) ? false : true,
443
- ]
444
- ];
445
- if($set_change)
446
- {
447
- $params['set_id'] = $set_id;
448
- }
449
- $url = 'https://admin.trustindex.io/' . 'api/getLayoutScss?' . http_build_query($params);
450
- $server_output = $this->post_request($url, [
451
- 'timeout' => '20',
452
- 'redirection' => '5',
453
- 'blocking' => true
454
- ]);
455
- if($server_output[0] !== '[' && $server_output[0] !== '{')
456
- {
457
- $server_output = substr($server_output, strpos($server_output, '('));
458
- $server_output = trim($server_output,'();');
459
- }
460
- $server_output = json_decode($server_output, true);
461
- if(!$set_change)
462
- {
463
- update_option($this->get_option_name('scss-set'), $server_output['default'], false);
464
- }
465
- if($server_output['css'])
466
- {
467
- if($style_id == 17 || $style_id == 21)
468
- {
469
- $server_output['css'] .= '.ti-preview-box { position: initial !important }';
470
- }
471
- update_option($this->get_option_name('css-content'), $server_output['css'], false);
472
- }
473
- return $content;
474
- }
475
- public function plugin_loaded()
476
- {
477
- global $wpdb;
478
- $version = $this->version;
479
-
480
- if($this->is_noreg_table_exists())
481
- {
482
- $db_table_name = $this->get_noreg_tablename();
483
-
484
- if($version >= 6.3 && count($wpdb->get_results("SHOW COLUMNS FROM $db_table_name LIKE 'highlight'")) == 0)
485
- {
486
- $wpdb->query("ALTER TABLE $db_table_name ADD highlight VARCHAR(11) NULL AFTER rating");
487
- }
488
- }
489
- if($this->is_noreg_linked() && get_option( $this->get_option_name('review-content') ))
490
- {
491
- $content_version = get_option( $this->get_option_name('content-saved-to') );
492
- if(!$content_version || $content_version != $version)
493
- {
494
- update_option( $this->get_option_name('content-saved-to'), $version, false );
495
- delete_option( $this->get_option_name('review-content') );
496
- $this->noreg_save_css(true);
497
- }
498
- }
499
- $this->loadI18N();
500
- if ( !class_exists('TrustindexGutenbergPlugin') && function_exists( 'register_block_type' ) )
501
- {
502
- require_once dirname( __FILE__ ) . '/static/block-editor/block-editor.php';
503
- TrustindexGutenbergPlugin::instance();
504
- }
505
- }
506
- public static $widget_templates = array (
507
- 'categories' =>
508
- array (
509
- 'slider' => '4,5,13,15,19,34',
510
- 'sidebar' => '6,7,8,9,10,18',
511
- 'list' => '33',
512
- 'grid' => '16,31',
513
- 'badge' => '11,12,20,22,23',
514
- 'button' => '24,25,26,27,28,29,30,32,35',
515
- 'floating' => '17,21',
516
- 'popup' => '23,30,32',
517
- ),
518
- 'templates' =>
519
- array (
520
- 4 =>
521
- array (
522
- 'name' => 'Slider I.',
523
- 'type' => 'slider',
524
- ),
525
- 15 =>
526
- array (
527
- 'name' => 'Slider II.',
528
- 'type' => 'slider',
529
- ),
530
- 5 =>
531
- array (
532
- 'name' => 'Slider III. - with badge',
533
- 'type' => 'slider',
534
- ),
535
- 34 =>
536
- array (
537
- 'name' => 'Slider III. - with badge II.',
538
- 'type' => 'slider',
539
- ),
540
- 13 =>
541
- array (
542
- 'name' => 'Slider III. - with company header',
543
- 'type' => 'slider',
544
- ),
545
- 19 =>
546
- array (
547
- 'name' => 'Slider IV.',
548
- 'type' => 'slider',
549
- ),
550
- 33 =>
551
- array (
552
- 'name' => 'List I.',
553
- 'type' => 'list',
554
- ),
555
- 16 =>
556
- array (
557
- 'name' => 'Grid',
558
- 'type' => 'grid',
559
- ),
560
- 31 =>
561
- array (
562
- 'name' => 'Mansonry grid',
563
- 'type' => 'grid',
564
- ),
565
- 6 =>
566
- array (
567
- 'name' => 'Sidebar slider I.',
568
- 'type' => 'sidebar',
569
- ),
570
- 7 =>
571
- array (
572
- 'name' => 'Sidebar slider II.',
573
- 'type' => 'sidebar',
574
- ),
575
- 8 =>
576
- array (
577
- 'name' => 'Full sidebar I.',
578
- 'type' => 'sidebar',
579
- ),
580
- 18 =>
581
- array (
582
- 'name' => 'Full sidebar I. - without header',
583
- 'type' => 'sidebar',
584
- ),
585
- 9 =>
586
- array (
587
- 'name' => 'Full sidebar II.',
588
- 'type' => 'sidebar',
589
- ),
590
- 10 =>
591
- array (
592
- 'name' => 'Full sidebar III.',
593
- 'type' => 'sidebar',
594
- ),
595
- 24 =>
596
- array (
597
- 'name' => 'Button I.',
598
- 'type' => 'button',
599
- ),
600
- 25 =>
601
- array (
602
- 'name' => 'Button II.',
603
- 'type' => 'button',
604
- ),
605
- 26 =>
606
- array (
607
- 'name' => 'Button III.',
608
- 'type' => 'button',
609
- ),
610
- 27 =>
611
- array (
612
- 'name' => 'Button IV.',
613
- 'type' => 'button',
614
- ),
615
- 28 =>
616
- array (
617
- 'name' => 'Button V.',
618
- 'type' => 'button',
619
- ),
620
- 29 =>
621
- array (
622
- 'name' => 'Button VI.',
623
- 'type' => 'button',
624
- ),
625
- 30 =>
626
- array (
627
- 'name' => 'Button VII. - with dropdown',
628
- 'type' => 'button',
629
- ),
630
- 35 =>
631
- array (
632
- 'name' => 'Button VII.',
633
- 'type' => 'button',
634
- ),
635
- 32 =>
636
- array (
637
- 'name' => 'Button VII. - with popup',
638
- 'type' => 'button',
639
- ),
640
- 22 =>
641
- array (
642
- 'name' => 'Company badge I.',
643
- 'type' => 'badge',
644
- ),
645
- 23 =>
646
- array (
647
- 'name' => 'Company badge I. - with popup',
648
- 'type' => 'badge',
649
- ),
650
- 11 =>
651
- array (
652
- 'name' => 'HTML badge I.',
653
- 'type' => 'badge',
654
- ),
655
- 12 =>
656
- array (
657
- 'name' => 'HTML badge II.',
658
- 'type' => 'badge',
659
- ),
660
- 20 =>
661
- array (
662
- 'name' => 'HTML badge III.',
663
- 'type' => 'badge',
664
- ),
665
- 17 =>
666
- array (
667
- 'name' => 'Floating',
668
- 'type' => 'floating',
669
- ),
670
- 21 =>
671
- array (
672
- 'name' => 'Floating II.',
673
- 'type' => 'floating',
674
- ),
675
- ),
676
- );
677
- public static $widget_styles = array (
678
- 'light-background' => 'Light background',
679
- 'ligth-border' => 'Light border',
680
- 'drop-shadow' => 'Drop shadow',
681
- 'light-minimal' => 'Minimal',
682
- 'soft' => 'Soft',
683
- 'light-clean' => 'Light clean',
684
- 'light-square' => 'Clean dark',
685
- 'light-background-border' => 'Light background border',
686
- 'blue' => 'Blue',
687
- 'light-background-image' => 'Light background image',
688
- 'dark-background' => 'Dark background',
689
- 'dark-minimal' => 'Minimal dark',
690
- 'dark-border' => 'Dark border',
691
- 'light-contrast' => 'Light contrast',
692
- 'dark-contrast' => 'Dark contrast',
693
- 'dark-background-image' => 'Dark background image',
694
- );
695
- public static $widget_languages = [
696
- 'ar' => "العربية",
697
- 'zh' => "汉语",
698
- 'cs' => "Čeština",
699
- 'da' => "Dansk",
700
- 'nl' => "Nederlands",
701
- 'en' => "English",
702
- 'et' => "Eestlane",
703
- 'fi' => "Suomi",
704
- 'fr' => "Français",
705
- 'de' => "Deutsch",
706
- 'el' => "Ελληνικά",
707
- 'hi' => "हिन्दी",
708
- 'hu' => "Magyar",
709
- 'it' => "Italiano",
710
- 'no' => "Norsk",
711
- 'pl' => "Polski",
712
- 'pt' => "Português",
713
- 'ro' => "Română",
714
- 'ru' => "Русский",
715
- 'sk' => "Slovenčina",
716
- 'es' => "Español",
717
- 'sv' => "Svenska",
718
- 'tr' => "Türkçe",
719
- 'gd' => 'Gàidhlig na h-Alba',
720
- 'hr' => 'Hrvatski',
721
- 'id' => 'Bahasa Indonesia',
722
- 'is' => 'Íslensku',
723
- 'he' => 'עִברִית',
724
- 'ja' => '日本',
725
- 'ko' => '한국어',
726
- 'lt' => 'Lietuvių',
727
- 'ms' => 'Bahasa Melayu',
728
- 'sl' => 'Slovenščina',
729
- 'sr' => 'Српски',
730
- 'th' => 'ไทย',
731
- 'uk' => 'Українська',
732
- 'vi' => 'Tiếng Việt',
733
- 'mk' => 'Македонски',
734
- 'bg' => 'български',
735
- 'sq' => 'Shqip',
736
- 'af' => 'Afrikaans',
737
- 'az' => 'Azərbaycan dili',
738
- 'bn' => 'বাংলা',
739
- 'bs' => 'Bosanski',
740
- 'cy' => 'Cymraeg',
741
- 'fa' => 'فارسی',
742
- 'gl' => 'Galego',
743
- 'hy' => 'հայերեն',
744
- ];
745
- public static $widget_dateformats = [ 'j. F, Y.', 'F j, Y.', 'Y.m.d.', 'Y-m-d', 'd/m/Y' ];
746
- private static $widget_rating_texts = array (
747
- 'en' =>
748
- array (
749
- 0 => 'poor',
750
- 1 => 'below average',
751
- 2 => 'average',
752
- 3 => 'good',
753
- 4 => 'excellent',
754
- ),
755
- 'fr' =>
756
- array (
757
- 0 => 'faible',
758
- 1 => 'moyenne basse',
759
- 2 => 'moyenne',
760
- 3 => 'bien',
761
- 4 => 'excellent',
762
- ),
763
- 'de' =>
764
- array (
765
- 0 => 'Schwach',
766
- 1 => 'Unterdurchschnittlich',
767
- 2 => 'Durchschnittlich',
768
- 3 => 'Gut',
769
- 4 => 'Ausgezeichnet',
770
- ),
771
- 'es' =>
772
- array (
773
- 0 => 'Flojo',
774
- 1 => 'Por debajo de lo regular',
775
- 2 => 'Regular',
776
- 3 => 'Bueno',
777
- 4 => 'Excelente',
778
- ),
779
- 'ar' =>
780
- array (
781
- 0 => 'فيعض',
782
- 1 => 'طسوتملا تحت',
783
- 2 => 'طسوتم',
784
- 3 => 'ديج',
785
- 4 => 'زاتمم',
786
- ),
787
- 'cs' =>
788
- array (
789
- 0 => 'Slabý',
790
- 1 => 'Podprůměrný',
791
- 2 => 'Průměrný',
792
- 3 => 'Dobrý',
793
- 4 => 'Vynikající',
794
- ),
795
- 'da' =>
796
- array (
797
- 0 => 'Svag',
798
- 1 => 'Under gennemsnitlig',
799
- 2 => 'Gennemsnitlig',
800
- 3 => 'God',
801
- 4 => 'Fremragende',
802
- ),
803
- 'et' =>
804
- array (
805
- 0 => 'halb',
806
- 1 => 'alla keskmise',
807
- 2 => 'keskmine',
808
- 3 => 'hea',
809
- 4 => 'suurepärane',
810
- ),
811
- 'el' =>
812
- array (
813
- 0 => 'Χαμηλή',
814
- 1 => 'Κάτω από τον μέσο όρο',
815
- 2 => 'Μέτρια',
816
- 3 => 'Καλή',
817
- 4 => 'Άριστη',
818
- ),
819
- 'fi' =>
820
- array (
821
- 0 => 'Heikko',
822
- 1 => 'Keskitasoa alhaisempi',
823
- 2 => 'Keskitasoinen',
824
- 3 => 'Hyvä',
825
- 4 => 'Erinomainen',
826
- ),
827
- 'hi' =>
828
- array (
829
- 0 => 'कमज़ोर',
830
- 1 => 'औसत से कम ',
831
- 2 => 'औसत ',
832
- 3 => 'अच्छा ',
833
- 4 => 'अति उत्कृष्ट ',
834
- ),
835
- 'hu' =>
836
- array (
837
- 0 => 'Gyenge',
838
- 1 => 'Átlag alatti',
839
- 2 => 'Átlagos',
840
- 3 => 'Jó',
841
- 4 => 'Kiváló',
842
- ),
843
- 'it' =>
844
- array (
845
- 0 => 'Scarso',
846
- 1 => 'Sotto la media',
847
- 2 => 'Medio',
848
- 3 => 'Buono',
849
- 4 => 'Eccellente',
850
- ),
851
- 'ja' =>
852
- array (
853
- 0 => '悪い',
854
- 1 => '平均以下の',
855
- 2 => '平均',
856
- 3 => '良い',
857
- 4 => '優れた',
858
- ),
859
- 'nl' =>
860
- array (
861
- 0 => 'Zwak',
862
- 1 => 'Onder gemiddeld',
863
- 2 => 'Gemiddeld',
864
- 3 => 'Goed',
865
- 4 => 'Uitstekend',
866
- ),
867
- 'no' =>
868
- array (
869
- 0 => 'Dårlig',
870
- 1 => 'Utilstrekkelig',
871
- 2 => 'Gjennomsnittlig',
872
- 3 => 'Bra',
873
- 4 => 'Utmerket',
874
- ),
875
- 'pl' =>
876
- array (
877
- 0 => 'Słaba',
878
- 1 => 'Poniżej średniej',
879
- 2 => 'Średnia',
880
- 3 => 'Dobra',
881
- 4 => 'Doskonała',
882
- ),
883
- 'pt' =>
884
- array (
885
- 0 => 'Fraco',
886
- 1 => 'Inferior ao médio',
887
- 2 => 'Medíocre',
888
- 3 => 'Bom',
889
- 4 => 'Excelente',
890
- ),
891
- 'ro' =>
892
- array (
893
- 0 => 'Slab',
894
- 1 => 'Sub nivel mediu',
895
- 2 => 'Mediu',
896
- 3 => 'Bun',
897
- 4 => 'Excelent',
898
- ),
899
- 'ru' =>
900
- array (
901
- 0 => 'Слабо',
902
- 1 => 'Ниже среднего',
903
- 2 => 'Средний',
904
- 3 => 'Хорошо',
905
- 4 => 'Отлично',
906
- ),
907
- 'sl' =>
908
- array (
909
- 0 => 'slabo',
910
- 1 => 'pod povprečjem',
911
- 2 => 'povprečno',
912
- 3 => 'dobro',
913
- 4 => 'odlično',
914
- ),
915
- 'sk' =>
916
- array (
917
- 0 => 'Slabé',
918
- 1 => 'Podpriemerné',
919
- 2 => 'Priemerné',
920
- 3 => 'Dobré',
921
- 4 => 'Vynikajúce',
922
- ),
923
- 'sv' =>
924
- array (
925
- 0 => 'Dålig',
926
- 1 => 'Under genomsnittet',
927
- 2 => 'Genomsnittlig',
928
- 3 => 'Bra',
929
- 4 => 'Utmärkt',
930
- ),
931
- 'tr' =>
932
- array (
933
- 0 => 'Zayıf',
934
- 1 => 'Ortanın altıi',
935
- 2 => 'Orta',
936
- 3 => 'İyi',
937
- 4 => 'Mükemmel',
938
- ),
939
- 'uk' =>
940
- array (
941
- 0 => 'погано',
942
- 1 => 'нижче середнього',
943
- 2 => 'середній',
944
- 3 => 'добре',
945
- 4 => 'відмінно',
946
- ),
947
- 'zh' =>
948
- array (
949
- 0 => '差',
950
- 1 => '不如一般',
951
- 2 => '一般',
952
- 3 => '好',
953
- 4 => '非常好',
954
- ),
955
- 'gd' =>
956
- array (
957
- 0 => 'bochd',
958
- 1 => 'nas ìsle na a ’chuibheasachd',
959
- 2 => 'cuibheasach',
960
- 3 => 'math',
961
- 4 => 'sgoinneil',
962
- ),
963
- 'hr' =>
964
- array (
965
- 0 => 'slabo',
966
- 1 => 'ispod prosjeka',
967
- 2 => 'prosjed',
968
- 3 => 'dobro',
969
- 4 => 'odličan',
970
- ),
971
- 'id' =>
972
- array (
973
- 0 => 'miskin',
974
- 1 => 'dibawah rata-rata',
975
- 2 => 'rata-rata',
976
- 3 => 'bagus',
977
- 4 => 'bagus sekali',
978
- ),
979
- 'is' =>
980
- array (
981
- 0 => 'fátækur',
982
- 1 => 'fyrir neðan meðallag',
983
- 2 => 'að meðaltali',
984
- 3 => 'góður',
985
- 4 => 'Æðislegt',
986
- ),
987
- 'he' =>
988
- array (
989
- 0 => 'עני',
990
- 1 => 'מתחת לממוצע',
991
- 2 => 'מְמוּצָע',
992
- 3 => 'טוֹב',
993
- 4 => 'מְעוּלֶה',
994
- ),
995
- 'ko' =>
996
- array (
997
- 0 => '가난한',
998
- 1 => '평균 이하',
999
- 2 => '평균',
1000
- 3 => '좋은',
1001
- 4 => '훌륭한',
1002
- ),
1003
- 'lt' =>
1004
- array (
1005
- 0 => 'vargšas',
1006
- 1 => 'žemiau vidurkio',
1007
- 2 => 'vidurkis',
1008
- 3 => 'gerai',
1009
- 4 => 'puikus',
1010
- ),
1011
- 'ms' =>
1012
- array (
1013
- 0 => 'miskin',
1014
- 1 => 'bawah purata',
1015
- 2 => 'purata',
1016
- 3 => 'baik',
1017
- 4 => 'cemerlang',
1018
- ),
1019
- 'sr' =>
1020
- array (
1021
- 0 => 'Слабо',
1022
- 1 => 'Испод просека',
1023
- 2 => 'Просек',
1024
- 3 => 'Добро',
1025
- 4 => 'Oдлично',
1026
- ),
1027
- 'th' =>
1028
- array (
1029
- 0 => 'ยากจน',
1030
- 1 => 'ต่ำกว่าค่าเฉลี่ย',
1031
- 2 => 'เฉลี่ย',
1032
- 3 => 'ดี',
1033
- 4 => 'ยอดเยี่ยม',
1034
- ),
1035
- 'vi' =>
1036
- array (
1037
- 0 => 'nghèo nàn',
1038
- 1 => 'dưới mức trung bình',
1039
- 2 => 'Trung bình',
1040
- 3 => 'tốt',
1041
- 4 => 'thông minh',
1042
- ),
1043
- 'mk' =>
1044
- array (
1045
- 0 => 'Сиромашен',
1046
- 1 => 'под просек',
1047
- 2 => 'просек',
1048
- 3 => 'Добро',
1049
- 4 => 'одлично',
1050
- ),
1051
- 'bg' =>
1052
- array (
1053
- 0 => 'беден',
1054
- 1 => 'под средното',
1055
- 2 => 'средно аритметично',
1056
- 3 => 'добре',
1057
- 4 => 'отлично',
1058
- ),
1059
- 'sq' =>
1060
- array (
1061
- 0 => 'i varfer',
1062
- 1 => 'nën mesataren',
1063
- 2 => 'mesatare',
1064
- 3 => 'mire',
1065
- 4 => 'e shkëlqyeshme',
1066
- ),
1067
- 'af' =>
1068
- array (
1069
- 0 => 'arm',
1070
- 1 => 'onder gemiddeld',
1071
- 2 => 'gemiddeld',
1072
- 3 => 'goed',
1073
- 4 => 'uitstekend',
1074
- ),
1075
- 'az' =>
1076
- array (
1077
- 0 => 'kasıb',
1078
- 1 => 'ortalamadan aşağı',
1079
- 2 => 'orta',
1080
- 3 => 'yaxşı',
1081
- 4 => 'əla',
1082
- ),
1083
- 'bn' =>
1084
- array (
1085
- 0 => 'দরিদ্র',
1086
- 1 => 'গড়ের নিচে',
1087
- 2 => 'গড়',
1088
- 3 => 'ভাল',
1089
- 4 => 'চমৎকার',
1090
- ),
1091
- 'bs' =>
1092
- array (
1093
- 0 => 'jadan',
1094
- 1 => 'ispod prosjeka',
1095
- 2 => 'prosjek',
1096
- 3 => 'dobro',
1097
- 4 => 'odličan',
1098
- ),
1099
- 'cy' =>
1100
- array (
1101
- 0 => 'gwael',
1102
- 1 => 'islaw\'r cyfartaledd',
1103
- 2 => 'cyffredin',
1104
- 3 => 'da',
1105
- 4 => 'rhagorol',
1106
- ),
1107
- 'fa' =>
1108
- array (
1109
- 0 => 'فقیر',
1110
- 1 => 'زیر میانگین',
1111
- 2 => 'میانگین',
1112
- 3 => 'خوب',
1113
- 4 => 'عالی',
1114
- ),
1115
- 'gl' =>
1116
- array (
1117
- 0 => 'pobre',
1118
- 1 => 'por debaixo da media',
1119
- 2 => 'media',
1120
- 3 => 'bo',
1121
- 4 => 'excelente',
1122
- ),
1123
- 'hy' =>
1124
- array (
1125
- 0 => 'աղքատ',
1126
- 1 => 'միջինից ցածր',
1127
- 2 => 'միջին',
1128
- 3 => 'լավ',
1129
- 4 => 'գերազանց',
1130
- ),
1131
- );
1132
- private static $widget_recommendation_texts = array (
1133
- 'en' =>
1134
- array (
1135
- 'negative' => 'NOT_RECOMMEND_ICON not recommends',
1136
- 'positive' => 'RECOMMEND_ICON recommends',
1137
- ),
1138
- 'fr' =>
1139
- array (
1140
- 'negative' => 'NOT_RECOMMEND_ICON ne recommande pas',
1141
- 'positive' => 'RECOMMEND_ICON recommande',
1142
- ),
1143
- 'de' =>
1144
- array (
1145
- 'negative' => 'NOT_RECOMMEND_ICON wird nicht empfohlen',
1146
- 'positive' => 'RECOMMEND_ICON empfiehlt',
1147
- ),
1148
- 'es' =>
1149
- array (
1150
- 'negative' => 'NOT_RECOMMEND_ICON no recomienda',
1151
- 'positive' => 'RECOMMEND_ICON recomienda',
1152
- ),
1153
- 'ar' =>
1154
- array (
1155
- 'negative' => 'لا توصي NOT_RECOMMEND_ICON',
1156
- 'positive' => 'توصي RECOMMEND_ICON',
1157
- ),
1158
- 'cs' =>
1159
- array (
1160
- 'negative' => 'NOT_RECOMMEND_ICON nedoporučuje',
1161
- 'positive' => 'RECOMMEND_ICON doporučuje',
1162
- ),
1163
- 'da' =>
1164
- array (
1165
- 'negative' => 'NOT_RECOMMEND_ICON anbefaler ikke',
1166
- 'positive' => 'RECOMMEND_ICON anbefaler',
1167
- ),
1168
- 'et' =>
1169
- array (
1170
- 'negative' => 'NOT_RECOMMEND_ICON ei soovita',
1171
- 'positive' => 'RECOMMEND_ICON soovitab',
1172
- ),
1173
- 'el' =>
1174
- array (
1175
- 'negative' => 'NOT_RECOMMEND_ICON δεν συνιστά',
1176
- 'positive' => 'RECOMMEND_ICON συνιστά',
1177
- ),
1178
- 'fi' =>
1179
- array (
1180
- 'negative' => 'NOT_RECOMMEND_ICON ei suosittele',
1181
- 'positive' => 'RECOMMEND_ICON suosittelee',
1182
- ),
1183
- 'hi' =>
1184
- array (
1185
- 'negative' => 'NOT_RECOMMEND_ICON अनुशंसा नहीं करता है',
1186
- 'positive' => 'RECOMMEND_ICON अनुशंसा करता है',
1187
- ),
1188
- 'hu' =>
1189
- array (
1190
- 'negative' => 'NOT_RECOMMEND_ICON nem ajánlja',
1191
- 'positive' => 'RECOMMEND_ICON ajánlja',
1192
- ),
1193
- 'it' =>
1194
- array (
1195
- 'negative' => 'NOT_RECOMMEND_ICON non lo consiglia',
1196
- 'positive' => 'RECOMMEND_ICON consiglia',
1197
- ),
1198
- 'ja' =>
1199
- array (
1200
- 'negative' => 'NOT_RECOMMEND_ICON おすすめできない',
1201
- 'positive' => 'RECOMMEND_ICON おすすめ',
1202
- ),
1203
- 'nl' =>
1204
- array (
1205
- 'negative' => 'NOT_RECOMMEND_ICON raadt niet aan',
1206
- 'positive' => 'RECOMMEND_ICON raadt aan',
1207
- ),
1208
- 'no' =>
1209
- array (
1210
- 'negative' => 'NOT_RECOMMEND_ICON anbefaler ikke',
1211
- 'positive' => 'RECOMMEND_ICON anbefaler',
1212
- ),
1213
- 'pl' =>
1214
- array (
1215
- 'negative' => 'NOT_RECOMMEND_ICON nie poleca',
1216
- 'positive' => 'RECOMMEND_ICON poleca',
1217
- ),
1218
- 'pt' =>
1219
- array (
1220
- 'negative' => 'NOT_RECOMMEND_ICON não recomenda',
1221
- 'positive' => 'RECOMMEND_ICON recomenda',
1222
- ),
1223
- 'ro' =>
1224
- array (
1225
- 'negative' => 'NOT_RECOMMEND_ICON nu recomandă',
1226
- 'positive' => 'RECOMMEND_ICON recomandă',
1227
- ),
1228
- 'ru' =>
1229
- array (
1230
- 'negative' => 'NOT_RECOMMEND_ICON не рекомендует',
1231
- 'positive' => 'RECOMMEND_ICON рекомендует',
1232
- ),
1233
- 'sl' =>
1234
- array (
1235
- 'negative' => 'NOT_RECOMMEND_ICON ne priporoča',
1236
- 'positive' => 'RECOMMEND_ICON priporoča',
1237
- ),
1238
- 'sk' =>
1239
- array (
1240
- 'negative' => 'NOT_RECOMMEND_ICON neodporúča',
1241
- 'positive' => 'RECOMMEND_ICON odporúča',
1242
- ),
1243
- 'sv' =>
1244
- array (
1245
- 'negative' => 'NOT_RECOMMEND_ICON rekommenderar inte',
1246
- 'positive' => 'RECOMMEND_ICON rekommenderar',
1247
- ),
1248
- 'tr' =>
1249
- array (
1250
- 'negative' => 'NOT_RECOMMEND_ICON önerilmez',
1251
- 'positive' => 'RECOMMEND_ICON önerir',
1252
- ),
1253
- 'uk' =>
1254
- array (
1255
- 'negative' => 'NOT_RECOMMEND_ICON не рекомендує',
1256
- 'positive' => 'RECOMMEND_ICON рекомендує',
1257
- ),
1258
- 'zh' =>
1259
- array (
1260
- 'negative' => 'NOT_RECOMMEND_ICON 不推荐',
1261
- 'positive' => 'RECOMMEND_ICON 推荐',
1262
- ),
1263
- 'gd' =>
1264
- array (
1265
- 'negative' => 'NOT_RECOMMEND_ICON no moladh',
1266
- 'positive' => 'RECOMMEND_ICON a ’moladh',
1267
- ),
1268
- 'hr' =>
1269
- array (
1270
- 'negative' => 'NOT_RECOMMEND_ICON ne preporučuje',
1271
- 'positive' => 'RECOMMEND_ICON preporučuje',
1272
- ),
1273
- 'id' =>
1274
- array (
1275
- 'negative' => 'NOT_RECOMMEND_ICON tidak merekomendasikan',
1276
- 'positive' => 'RECOMMEND_ICON merekomendasikan',
1277
- ),
1278
- 'is' =>
1279
- array (
1280
- 'negative' => 'NOT_RECOMMEND_ICON mælir ekki með',
1281
- 'positive' => 'RECOMMEND_ICON mælir með',
1282
- ),
1283
- 'he' =>
1284
- array (
1285
- 'negative' => 'NOT_RECOMMEND_ICON לא ממליץ',
1286
- 'positive' => 'RECOMMEND_ICON ממליץ',
1287
- ),
1288
- 'ko' =>
1289
- array (
1290
- 'negative' => 'NOT_RECOMMEND_ICON 권장하지 않음',
1291
- 'positive' => 'RECOMMEND_ICON 추천',
1292
- ),
1293
- 'lt' =>
1294
- array (
1295
- 'negative' => 'NOT_RECOMMEND_ICON nerekomenduoja',
1296
- 'positive' => 'RECOMMEND_ICON rekomenduoja',
1297
- ),
1298
- 'ms' =>
1299
- array (
1300
- 'negative' => 'NOT_RECOMMEND_ICON tidak mengesyorkan',
1301
- 'positive' => 'RECOMMEND_ICON mengesyorkan',
1302
- ),
1303
- 'sr' =>
1304
- array (
1305
- 'negative' => 'NOT_RECOMMEND_ICON не препоручује',
1306
- 'positive' => 'RECOMMEND_ICON препоручује',
1307
- ),
1308
- 'th' =>
1309
- array (
1310
- 'negative' => 'NOT_RECOMMEND_ICON ไม่แนะนำ',
1311
- 'positive' => 'RECOMMEND_ICON แนะนำ',
1312
- ),
1313
- 'vi' =>
1314
- array (
1315
- 'negative' => 'NOT_RECOMMEND_ICON không được đề xuất',
1316
- 'positive' => 'RECOMMEND_ICON đề xuất',
1317
- ),
1318
- 'mk' =>
1319
- array (
1320
- 'negative' => 'NOT_RECOMMEND_ICON не препорачува',
1321
- 'positive' => 'RECOMMEND_ICON препорачува',
1322
- ),
1323
- 'bg' =>
1324
- array (
1325
- 'negative' => 'NOT_RECOMMEND_ICON не препоръчва',
1326
- 'positive' => 'RECOMMEND_ICON препоръчва',
1327
- ),
1328
- 'sq' =>
1329
- array (
1330
- 'negative' => 'NOT_RECOMMEND_ICON nuk rekomandon',
1331
- 'positive' => 'RECOMMEND_ICON rekomandon',
1332
- ),
1333
- 'af' =>
1334
- array (
1335
- 'negative' => 'NOT_RECOMMEND_ICON beveel nie aan',
1336
- 'positive' => 'RECOMMEND_ICON beveel aan',
1337
- ),
1338
- 'az' =>
1339
- array (
1340
- 'negative' => 'NOT_RECOMMEND_ICON tövsiyə etmir',
1341
- 'positive' => 'RECOMMEND_ICON tövsiyə edir',
1342
- ),
1343
- 'bn' =>
1344
- array (
1345
- 'negative' => 'NOT_RECOMMEND_ICON সুপারিশ করে না',
1346
- 'positive' => 'RECOMMEND_ICON সুপারিশ করে',
1347
- ),
1348
- 'bs' =>
1349
- array (
1350
- 'negative' => 'NOT_RECOMMEND_ICON ne preporučuje',
1351
- 'positive' => 'RECOMMEND_ICON preporučuje',
1352
- ),
1353
- 'cy' =>
1354
- array (
1355
- 'negative' => 'NOT_RECOMMEND_ICON ddim yn argymell',
1356
- 'positive' => 'RECOMMEND_ICON yn argymell',
1357
- ),
1358
- 'fa' =>
1359
- array (
1360
- 'negative' => 'NOT_RECOMMEND_ICON توصیه نمی کند',
1361
- 'positive' => 'RECOMMEND_ICON توصیه می‌کند',
1362
- ),
1363
- 'gl' =>
1364
- array (
1365
- 'negative' => 'NOT_RECOMMEND_ICON non recomendado',
1366
- 'positive' => 'RECOMMEND_ICON recomenda',
1367
- ),
1368
- 'hy' =>
1369
- array (
1370
- 'negative' => 'NOT_RECOMMEND_ICON-ը խորհուրդ չի տալիս',
1371
- 'positive' => 'RECOMMEND_ICON խորհուրդ է տալիս',
1372
- ),
1373
- );
1374
- private static $widget_verified_texts = array (
1375
- 'en' => 'Verified',
1376
- 'fr' => 'vérifié',
1377
- 'de' => 'Verifizierte',
1378
- 'es' => 'Verificada',
1379
- 'ar' => 'تم التحقق',
1380
- 'cs' => 'Ověřená',
1381
- 'da' => 'Bekræftet',
1382
- 'et' => 'Kinnitatud',
1383
- 'el' => 'επαληθεύτηκε',
1384
- 'fi' => 'Vahvistettu',
1385
- 'hi' => 'सत्यापित',
1386
- 'hu' => 'Hitelesített',
1387
- 'it' => 'Verificata',
1388
- 'ja' => '確認済み',
1389
- 'nl' => 'Geverifieerde',
1390
- 'no' => 'Bekreftet',
1391
- 'pl' => 'Zweryfikowana',
1392
- 'pt' => 'Verificada',
1393
- 'ro' => 'Verificată',
1394
- 'ru' => 'Проверенный',
1395
- 'sl' => 'Preverjeno',
1396
- 'sk' => 'Overená',
1397
- 'sv' => 'Verifierad',
1398
- 'tr' => 'Doğrulanmış',
1399
- 'uk' => 'Перевірено',
1400
- 'zh' => '已验证',
1401
- 'gd' => 'Dearbhaichte',
1402
- 'hr' => 'Potvrđen',
1403
- 'id' => 'Diverifikasi',
1404
- 'is' => 'Staðfesting',
1405
- 'he' => 'מְאוּמָת',
1406
- 'ko' => '검증 된',
1407
- 'lt' => 'Patvirtinta',
1408
- 'ms' => 'Disahkan',
1409
- 'sr' => 'Проверено',
1410
- 'th' => 'ตรวจสอบแล้ว',
1411
- 'vi' => 'Đã xác minh',
1412
- 'mk' => 'Потврдена',
1413
- 'bg' => 'Проверени',
1414
- 'sq' => 'Verifikuar',
1415
- 'af' => 'Geverifieer',
1416
- 'az' => 'Doğrulanmışdır',
1417
- 'bn' => 'যাচাই',
1418
- 'bs' => 'Provjereno',
1419
- 'cy' => 'Wedi\'i ddilysu',
1420
- 'fa' => 'تأیید شده',
1421
- 'gl' => 'Verificado',
1422
- 'hy' => 'Ստուգված',
1423
- );
1424
- private static $widget_month_names = array (
1425
- 'en' =>
1426
- array (
1427
- 0 => 'January',
1428
- 1 => 'February',
1429
- 2 => 'March',
1430
- 3 => 'April',
1431
- 4 => 'May',
1432
- 5 => 'June',
1433
- 6 => 'July',
1434
- 7 => 'August',
1435
- 8 => 'September',
1436
- 9 => 'October',
1437
- 10 => 'November',
1438
- 11 => 'December',
1439
- ),
1440
- 'et' =>
1441
- array (
1442
- 0 => 'jaanuar',
1443
- 1 => 'veebruar',
1444
- 2 => 'märts',
1445
- 3 => 'aprill',
1446
- 4 => 'mai',
1447
- 5 => 'juuni',
1448
- 6 => 'juuli',
1449
- 7 => 'august',
1450
- 8 => 'september',
1451
- 9 => 'oktoober',
1452
- 10 => 'november',
1453
- 11 => 'detsember',
1454
- ),
1455
- 'ar' =>
1456
- array (
1457
- 0 => 'يناير',
1458
- 1 => 'فبراير',
1459
- 2 => 'مارس',
1460
- 3 => 'أبريل',
1461
- 4 => 'مايو',
1462
- 5 => 'يونيو',
1463
- 6 => 'يوليه',
1464
- 7 => 'أغسطس',
1465
- 8 => 'سبتمبر',
1466
- 9 => 'أكتوبر',
1467
- 10 => 'نوفمبر',
1468
- 11 => 'ديسمبر',
1469
- ),
1470
- 'zh' =>
1471
- array (
1472
- 0 => '一月',
1473
- 1 => '二月',
1474
- 2 => '三月',
1475
- 3 => '四月',
1476
- 4 => '五月',
1477
- 5 => '六月',
1478
- 6 => '七月',
1479
- 7 => '八月',
1480
- 8 => '九月',
1481
- 9 => '十月',
1482
- 10 => '十一月',
1483
- 11 => '十二月',
1484
- ),
1485
- 'cs' =>
1486
- array (
1487
- 0 => 'Leden',
1488
- 1 => 'Únor',
1489
- 2 => 'Březen',
1490
- 3 => 'Duben',
1491
- 4 => 'Květen',
1492
- 5 => 'Červen',
1493
- 6 => 'Červenec',
1494
- 7 => 'Srpen',
1495
- 8 => 'Září',
1496
- 9 => 'Říjen',
1497
- 10 => 'Listopad',
1498
- 11 => 'Prosinec',
1499
- ),
1500
- 'da' =>
1501
- array (
1502
- 0 => 'Januar',
1503
- 1 => 'Februar',
1504
- 2 => 'Marts',
1505
- 3 => 'April',
1506
- 4 => 'Maj',
1507
- 5 => 'Juni',
1508
- 6 => 'Juli',
1509
- 7 => 'August',
1510
- 8 => 'September',
1511
- 9 => 'Oktober',
1512
- 10 => 'November',
1513
- 11 => 'December',
1514
- ),
1515
- 'nl' =>
1516
- array (
1517
- 0 => 'Januari',
1518
- 1 => 'Februari',
1519
- 2 => 'Maart',
1520
- 3 => 'April',
1521
- 4 => 'Mei',
1522
- 5 => 'Juni',
1523
- 6 => 'Juli',
1524
- 7 => 'Augustus',
1525
- 8 => 'September',
1526
- 9 => 'Oktober',
1527
- 10 => 'November',
1528
- 11 => 'December',
1529
- ),
1530
- 'fi' =>
1531
- array (
1532
- 0 => 'Tammikuu',
1533
- 1 => 'Helmikuu',
1534
- 2 => 'Maaliskuu',
1535
- 3 => 'Huhtikuu',
1536
- 4 => 'Toukokuu',
1537
- 5 => 'Kesäkuu',
1538
- 6 => 'Heinäkuu',
1539
- 7 => 'Elokuu',
1540
- 8 => 'Syyskuu',
1541
- 9 => 'Lokakuu',
1542
- 10 => 'Marraskuu',
1543
- 11 => 'Joulukuu',
1544
- ),
1545
- 'fr' =>
1546
- array (
1547
- 0 => 'Janvier',
1548
- 1 => 'Février',
1549
- 2 => 'Mars',
1550
- 3 => 'Avril',
1551
- 4 => 'Mai',
1552
- 5 => 'Juin',
1553
- 6 => 'Juillet',
1554
- 7 => 'Août',
1555
- 8 => 'Septembre',
1556
- 9 => 'Octobre',
1557
- 10 => 'Novembre',
1558
- 11 => 'Décembre',
1559
- ),
1560
- 'de' =>
1561
- array (
1562
- 0 => 'Januar',
1563
- 1 => 'Februar',
1564
- 2 => 'März',
1565
- 3 => 'April',
1566
- 4 => 'Mai',
1567
- 5 => 'Juni',
1568
- 6 => 'Juli',
1569
- 7 => 'August',
1570
- 8 => 'September',
1571
- 9 => 'Oktober',
1572
- 10 => 'November',
1573
- 11 => 'Dezember',
1574
- ),
1575
- 'el' =>
1576
- array (
1577
- 0 => 'Iανουάριος',
1578
- 1 => 'Φεβρουάριος',
1579
- 2 => 'Μάρτιος',
1580
- 3 => 'Aρίλιος',
1581
- 4 => 'Μάιος',
1582
- 5 => 'Iούνιος',
1583
- 6 => 'Iούλιος',
1584
- 7 => 'Αύγουστος',
1585
- 8 => 'Σεπτέμβριος',
1586
- 9 => 'Oκτώβριος',
1587
- 10 => 'Νοέμβριος',
1588
- 11 => 'Δεκέμβριος',
1589
- ),
1590
- 'he' =>
1591
- array (
1592
- 0 => 'ינואר',
1593
- 1 => 'פברואר',
1594
- 2 => 'מרץ',
1595
- 3 => 'אפריל',
1596
- 4 => 'מאי',
1597
- 5 => 'יוני',
1598
- 6 => 'יולי',
1599
- 7 => 'אוגוסט',
1600
- 8 => 'ספטמבר',
1601
- 9 => 'אוקטובר',
1602
- 10 => 'נובמבר',
1603
- 11 => 'דצמבר',
1604
- ),
1605
- 'hi' =>
1606
- array (
1607
- 0 => 'जनवरी',
1608
- 1 => 'फ़रवरी',
1609
- 2 => 'मार्च',
1610
- 3 => 'अप्रैल',
1611
- 4 => 'मई',
1612
- 5 => 'जून',
1613
- 6 => 'जुलाई',
1614
- 7 => 'अगस्त',
1615
- 8 => 'सितंबर',
1616
- 9 => 'अक्टूबर',
1617
- 10 => 'नवंबर',
1618
- 11 => 'दिसंबर',
1619
- ),
1620
- 'hu' =>
1621
- array (
1622
- 0 => 'Január',
1623
- 1 => 'Február',
1624
- 2 => 'Március',
1625
- 3 => 'Április',
1626
- 4 => 'Május',
1627
- 5 => 'Június',
1628
- 6 => 'Július',
1629
- 7 => 'Augusztus',
1630
- 8 => 'Szeptember',
1631
- 9 => 'Október',
1632
- 10 => 'November',
1633
- 11 => 'December',
1634
- ),
1635
- 'it' =>
1636
- array (
1637
- 0 => 'Gennaio',
1638
- 1 => 'Febbraio',
1639
- 2 => 'Marzo',
1640
- 3 => 'Aprile',
1641
- 4 => 'Maggio',
1642
- 5 => 'Giugno',
1643
- 6 => 'Luglio',
1644
- 7 => 'Agosto',
1645
- 8 => 'Settembre',
1646
- 9 => 'Ottobre',
1647
- 10 => 'Novembre',
1648
- 11 => 'Dicembre',
1649
- ),
1650
- 'ja' =>
1651
- array (
1652
- 0 => '1月',
1653
- 1 => '2月',
1654
- 2 => '3月',
1655
- 3 => '4月',
1656
- 4 => '5月',
1657
- 5 => '6月',
1658
- 6 => '7月',
1659
- 7 => '8月',
1660
- 8 => '9月',
1661
- 9 => '10月',
1662
- 10 => '11月',
1663
- 11 => '12月',
1664
- ),
1665
- 'no' =>
1666
- array (
1667
- 0 => 'Januar',
1668
- 1 => 'Februar',
1669
- 2 => 'Mars',
1670
- 3 => 'April',
1671
- 4 => 'Mai',
1672
- 5 => 'Juni',
1673
- 6 => 'Juli',
1674
- 7 => 'August',
1675
- 8 => 'September',
1676
- 9 => 'Oktober',
1677
- 10 => 'November',
1678
- 11 => 'Desember',
1679
- ),
1680
- 'pl' =>
1681
- array (
1682
- 0 => 'Styczeń',
1683
- 1 => 'Luty',
1684
- 2 => 'Marzec',
1685
- 3 => 'Kwiecień',
1686
- 4 => 'Maj',
1687
- 5 => 'Czerwiec',
1688
- 6 => 'Lipiec',
1689
- 7 => 'Sierpień',
1690
- 8 => 'Wrzesień',
1691
- 9 => 'Październik',
1692
- 10 => 'Listopad',
1693
- 11 => 'Grudzień',
1694
- ),
1695
- 'pt' =>
1696
- array (
1697
- 0 => 'Janeiro',
1698
- 1 => 'Fevereiro',
1699
- 2 => 'Março',
1700
- 3 => 'Abril',
1701
- 4 => 'Maio',
1702
- 5 => 'Junho',
1703
- 6 => 'Julho',
1704
- 7 => 'Agosto',
1705
- 8 => 'Setembro',
1706
- 9 => 'Outubro',
1707
- 10 => 'Novembro',
1708
- 11 => 'Dezembro',
1709
- ),
1710
- 'ro' =>
1711
- array (
1712
- 0 => 'Ianuarie',
1713
- 1 => 'Februarie',
1714
- 2 => 'Martie',
1715
- 3 => 'Aprilie',
1716
- 4 => 'Mai',
1717
- 5 => 'Iunie',
1718
- 6 => 'Iulie',
1719
- 7 => 'August',
1720
- 8 => 'Septembrie',
1721
- 9 => 'Octombrie',
1722
- 10 => 'Noiembrie',
1723
- 11 => 'Decembrie',
1724
- ),
1725
- 'ru' =>
1726
- array (
1727
- 0 => 'январь',
1728
- 1 => 'февраль',
1729
- 2 => 'март',
1730
- 3 => 'апрель',
1731
- 4 => 'май',
1732
- 5 => 'июнь',
1733
- 6 => 'июль',
1734
- 7 => 'август',
1735
- 8 => 'сентябрь',
1736
- 9 => 'октябрь',
1737
- 10 => 'ноябрь',
1738
- 11 => 'декабрь',
1739
- ),
1740
- 'sk' =>
1741
- array (
1742
- 0 => 'Január',
1743
- 1 => 'Február',
1744
- 2 => 'Marec',
1745
- 3 => 'Apríl',
1746
- 4 => 'Máj',
1747
- 5 => 'Jún',
1748
- 6 => 'Júl',
1749
- 7 => 'August',
1750
- 8 => 'September',
1751
- 9 => 'Október',
1752
- 10 => 'November',
1753
- 11 => 'December',
1754
- ),
1755
- 'sl' =>
1756
- array (
1757
- 0 => 'Januar',
1758
- 1 => 'Februar',
1759
- 2 => 'Marec',
1760
- 3 => 'April',
1761
- 4 => 'Maj',
1762
- 5 => 'Junij',
1763
- 6 => 'Julij',
1764
- 7 => 'Avgust',
1765
- 8 => 'September',
1766
- 9 => 'Oktober',
1767
- 10 => 'November',
1768
- 11 => 'December',
1769
- ),
1770
- 'es' =>
1771
- array (
1772
- 0 => 'Enero',
1773
- 1 => 'Febrero',
1774
- 2 => 'Marzo',
1775
- 3 => 'Abril',
1776
- 4 => 'Mayo',
1777
- 5 => 'Junio',
1778
- 6 => 'Julio',
1779
- 7 => 'Agosto',
1780
- 8 => 'Septiembre',
1781
- 9 => 'Octubre',
1782
- 10 => 'Noviembre',
1783
- 11 => 'Diciembre',
1784
- ),
1785
- 'sv' =>
1786
- array (
1787
- 0 => 'Januari',
1788
- 1 => 'Februari',
1789
- 2 => 'Mars',
1790
- 3 => 'April',
1791
- 4 => 'Maj',
1792
- 5 => 'Juni',
1793
- 6 => 'Juli',
1794
- 7 => 'Augusti',
1795
- 8 => 'September',
1796
- 9 => 'Oktober',
1797
- 10 => 'November',
1798
- 11 => 'December',
1799
- ),
1800
- 'tr' =>
1801
- array (
1802
- 0 => 'Ocak',
1803
- 1 => 'Şubat',
1804
- 2 => 'Mart',
1805
- 3 => 'Nisan',
1806
- 4 => 'Mayis',
1807
- 5 => 'Haziran',
1808
- 6 => 'Temmuz',
1809
- 7 => 'Ağustos',
1810
- 8 => 'Eylül',
1811
- 9 => 'Ekim',
1812
- 10 => 'Kasım',
1813
- 11 => 'Aralık',
1814
- ),
1815
- 'uk' =>
1816
- array (
1817
- 0 => 'Січня',
1818
- 1 => 'Лютий',
1819
- 2 => 'Березень',
1820
- 3 => 'квітень',
1821
- 4 => 'травень',
1822
- 5 => 'червень',
1823
- 6 => 'липень',
1824
- 7 => 'серпень',
1825
- 8 => 'вересень',
1826
- 9 => 'жовтень',
1827
- 10 => 'листопад',
1828
- 11 => 'грудень',
1829
- ),
1830
- 'gd' =>
1831
- array (
1832
- 0 => 'am Faoilleach',
1833
- 1 => 'an Gearran',
1834
- 2 => 'am Màrt',
1835
- 3 => 'an Giblean',
1836
- 4 => 'an Cèitean',
1837
- 5 => 'an t-Ògmhios',
1838
- 6 => 'an t-luchar',
1839
- 7 => 'an Lùnastal',
1840
- 8 => 'an t-Sultain',
1841
- 9 => 'an Dàmhair',
1842
- 10 => 'an t-Samhain',
1843
- 11 => 'an Dùbhlachd',
1844
- ),
1845
- 'hr' =>
1846
- array (
1847
- 0 => 'Siječanj',
1848
- 1 => 'Veljača',
1849
- 2 => 'Ožujak',
1850
- 3 => 'Travanj',
1851
- 4 => 'Svibanj',
1852
- 5 => 'Lipanj',
1853
- 6 => 'Srpanj',
1854
- 7 => 'Kolovoz',
1855
- 8 => 'Rujan',
1856
- 9 => 'Listopad',
1857
- 10 => 'Studeni',
1858
- 11 => 'Prosinac',
1859
- ),
1860
- 'id' =>
1861
- array (
1862
- 0 => 'Januari',
1863
- 1 => 'Februari',
1864
- 2 => 'Maret',
1865
- 3 => 'April',
1866
- 4 => 'Mei',
1867
- 5 => 'Juni',
1868
- 6 => 'Juli',
1869
- 7 => 'Agustus',
1870
- 8 => 'September',
1871
- 9 => 'Oktober',
1872
- 10 => 'November',
1873
- 11 => 'Desember',
1874
- ),
1875
- 'is' =>
1876
- array (
1877
- 0 => 'Janúar',
1878
- 1 => 'Febrúar',
1879
- 2 => 'Mars',
1880
- 3 => 'April',
1881
- 4 => 'Maí',
1882
- 5 => 'Júní',
1883
- 6 => 'Júlí',
1884
- 7 => 'Ágúst',
1885
- 8 => 'September',
1886
- 9 => 'Október',
1887
- 10 => 'Nóvember',
1888
- 11 => 'Desember',
1889
- ),
1890
- 'ko' =>
1891
- array (
1892
- 0 => '일월',
1893
- 1 => '이월',
1894
- 2 => '삼월',
1895
- 3 => '사월',
1896
- 4 => '오월',
1897
- 5 => '유월',
1898
- 6 => '칠월',
1899
- 7 => '팔월',
1900
- 8 => '구월',
1901
- 9 => '시월',
1902
- 10 => '십일월',
1903
- 11 => '십이월',
1904
- ),
1905
- 'lt' =>
1906
- array (
1907
- 0 => 'Sausis',
1908
- 1 => 'Vasaris',
1909
- 2 => 'Kovas',
1910
- 3 => 'Balandis',
1911
- 4 => 'Gegužė',
1912
- 5 => 'Birželis',
1913
- 6 => 'Liepa',
1914
- 7 => 'Rugpjūtis',
1915
- 8 => 'Rugsėjis',
1916
- 9 => 'Spalis',
1917
- 10 => 'Lapkritis',
1918
- 11 => 'Gruodis',
1919
- ),
1920
- 'ms' =>
1921
- array (
1922
- 0 => 'Januari',
1923
- 1 => 'Februari',
1924
- 2 => 'Mac',
1925
- 3 => 'April',
1926
- 4 => 'Mei',
1927
- 5 => 'Jun',
1928
- 6 => 'Julai',
1929
- 7 => 'Ogos',
1930
- 8 => 'September',
1931
- 9 => 'Oktober',
1932
- 10 => 'November',
1933
- 11 => 'Disember',
1934
- ),
1935
- 'sr' =>
1936
- array (
1937
- 0 => 'Јануар',
1938
- 1 => 'Фебруар',
1939
- 2 => 'Март',
1940
- 3 => 'Април',
1941
- 4 => 'Mај',
1942
- 5 => 'Јуни',
1943
- 6 => 'Јул',
1944
- 7 => 'Август',
1945
- 8 => 'Cептембар',
1946
- 9 => 'Октобар',
1947
- 10 => 'Новембар',
1948
- 11 => 'Децембар',
1949
- ),
1950
- 'th' =>
1951
- array (
1952
- 0 => 'มกราคม',
1953
- 1 => 'กุมภาพันธ์',
1954
- 2 => 'มีนาคม',
1955
- 3 => 'เมษายน',
1956
- 4 => 'พฤษภาคม',
1957
- 5 => 'มิถุนายน',
1958
- 6 => 'กรกฎาคม',
1959
- 7 => 'สิงหาคม',
1960
- 8 => 'กันยายน',
1961
- 9 => 'ตุลาคม',
1962
- 10 => 'พฤศจิกายน',
1963
- 11 => 'ธันวาคม',
1964
- ),
1965
- 'vi' =>
1966
- array (
1967
- 0 => 'tháng một',
1968
- 1 => 'tháng hai',
1969
- 2 => 'tháng ba',
1970
- 3 => 'tháng tư',
1971
- 4 => 'tháng năm',
1972
- 5 => 'tháng sáu',
1973
- 6 => 'tháng bảy',
1974
- 7 => 'tháng tám',
1975
- 8 => 'tháng chín',
1976
- 9 => 'tháng mười',
1977
- 10 => 'tháng mười một',
1978
- 11 => 'tháng mười hai',
1979
- ),
1980
- 'mk' =>
1981
- array (
1982
- 0 => 'Jануари',
1983
- 1 => 'февруари',
1984
- 2 => 'март',
1985
- 3 => 'април',
1986
- 4 => 'мај',
1987
- 5 => 'јуни',
1988
- 6 => 'јули',
1989
- 7 => 'август',
1990
- 8 => 'септември',
1991
- 9 => 'октомври',
1992
- 10 => 'ноември',
1993
- 11 => 'декември',
1994
- ),
1995
- 'bg' =>
1996
- array (
1997
- 0 => 'Януари',
1998
- 1 => 'февруари',
1999
- 2 => 'Март',
2000
- 3 => 'Aприл',
2001
- 4 => 'май',
2002
- 5 => 'юни',
2003
- 6 => 'юли',
2004
- 7 => 'Август',
2005
- 8 => 'Септември',
2006
- 9 => 'Октомври',
2007
- 10 => 'Ноември',
2008
- 11 => 'Декември',
2009
- ),
2010
- 'sq' =>
2011
- array (
2012
- 0 => 'Janar',
2013
- 1 => 'Shkurt',
2014
- 2 => 'Mars',
2015
- 3 => 'Prill',
2016
- 4 => 'Maj',
2017
- 5 => 'Qershor',
2018
- 6 => 'Korrik',
2019
- 7 => 'Gusht',
2020
- 8 => 'Shtator',
2021
- 9 => 'Tetor',
2022
- 10 => 'Nëntor',
2023
- 11 => 'Dhjetor',
2024
- ),
2025
- 'af' =>
2026
- array (
2027
- 0 => 'Januarie',
2028
- 1 => 'Februarie',
2029
- 2 => 'Maart',
2030
- 3 => 'April',
2031
- 4 => 'Mei',
2032
- 5 => 'Junie',
2033
- 6 => 'Julie',
2034
- 7 => 'Augustus',
2035
- 8 => 'September',
2036
- 9 => 'Oktober',
2037
- 10 => 'November',
2038
- 11 => 'Desember',
2039
- ),
2040
- 'az' =>
2041
- array (
2042
- 0 => 'Yanvar',
2043
- 1 => 'Fevral',
2044
- 2 => 'Mart',
2045
- 3 => 'Aprel',
2046
- 4 => 'May',
2047
- 5 => 'İyun',
2048
- 6 => 'İyul',
2049
- 7 => 'Avqust',
2050
- 8 => 'Sentyabr',
2051
- 9 => 'Oktyabr',
2052
- 10 => 'Noyabr',
2053
- 11 => 'Dekabr',
2054
- ),
2055
- 'bn' =>
2056
- array (
2057
- 0 => 'জানুয়ারি',
2058
- 1 => 'ফেব্রুয়ারি',
2059
- 2 => 'মার্চ',
2060
- 3 => 'এপ্রিল',
2061
- 4 => 'মে',
2062
- 5 => 'জুন',
2063
- 6 => 'জুলাই',
2064
- 7 => 'আগস্ট',
2065
- 8 => 'সেপ্টেম্বর',
2066
- 9 => 'অক্টোবর',
2067
- 10 => 'নভেম্বর',
2068
- 11 => 'ডিসেম্বর',
2069
- ),
2070
- 'bs' =>
2071
- array (
2072
- 0 => 'Januar',
2073
- 1 => 'Februar',
2074
- 2 => 'Mart',
2075
- 3 => 'April',
2076
- 4 => 'Maj',
2077
- 5 => 'Jun',
2078
- 6 => 'Jul',
2079
- 7 => 'Avgust',
2080
- 8 => 'Septembar',
2081
- 9 => 'Oktobar',
2082
- 10 => 'Novembar',
2083
- 11 => 'Decembar',
2084
- ),
2085
- 'cy' =>
2086
- array (
2087
- 0 => 'Ionawr',
2088
- 1 => 'Chwefror',
2089
- 2 => 'Mawrth',
2090
- 3 => 'Ebrill',
2091
- 4 => 'Mai',
2092
- 5 => 'Mehefin',
2093
- 6 => 'Gorffennaf',
2094
- 7 => 'Awst',
2095
- 8 => 'Medi',
2096
- 9 => 'Hydref',
2097
- 10 => 'Tachwedd',
2098
- 11 => 'Rhagfyr',
2099
- ),
2100
- 'fa' =>
2101
- array (
2102
- 0 => 'ژانویه',
2103
- 1 => 'فوریه',
2104
- 2 => 'مارس',
2105
- 3 => 'آوریل',
2106
- 4 => 'ممکن است',
2107
- 5 => 'ژوئن',
2108
- 6 => 'جولای',
2109
- 7 => 'اوت',
2110
- 8 => 'سپتامبر',
2111
- 9 => 'اکتبر',
2112
- 10 => 'نوامبر',
2113
- 11 => 'دسامبر',
2114
- ),
2115
- 'gl' =>
2116
- array (
2117
- 0 => 'Xaneiro',
2118
- 1 => 'Febreiro',
2119
- 2 => 'Marzo',
2120
- 3 => 'Abril',
2121
- 4 => 'Maio',
2122
- 5 => 'Xuño',
2123
- 6 => 'Xullo',
2124
- 7 => 'Agosto',
2125
- 8 => 'Setembro',
2126
- 9 => 'Outubro',
2127
- 10 => 'Novembro',
2128
- 11 => 'Decembro',
2129
- ),
2130
- 'hy' =>
2131
- array (
2132
- 0 => 'Հունվար',
2133
- 1 => 'փետրվար',
2134
- 2 => 'մարտ',
2135
- 3 => 'ապրիլ',
2136
- 4 => 'մայիս',
2137
- 5 => 'հունիս',
2138
- 6 => 'հուլիս',
2139
- 7 => 'օգոստոս',
2140
- 8 => 'սեպտեմբեր',
2141
- 9 => 'հոկտեմբեր',
2142
- 10 => 'նոյեմբեր',
2143
- 11 => 'դեկտեմբեր',
2144
- ),
2145
- );
2146
- private static $page_urls = array (
2147
- 'facebook' => 'https://www.facebook.com/pg/%page_id%',
2148
- 'google' => 'https://www.google.com/maps/search/?api=1&query=Google&query_place_id=%page_id%',
2149
- 'tripadvisor' => 'https://www.tripadvisor.com/%page_id%',
2150
- 'yelp' => 'https://www.yelp.com/biz/%25page_id%25',
2151
- 'booking' => 'https://www.booking.com/hotel/%page_id%',
2152
- 'amazon' => 'https://www.amazon.%domain%/sp?seller=%page_id%',
2153
- 'arukereso' => 'https://www.arukereso.hu/stores/%page_id%/#velemenyek',
2154
- 'airbnb' => 'https://www.airbnb.com/rooms/%page_id%',
2155
- 'hotels' => 'https://hotels.com/%page_id%',
2156
- 'opentable' => 'https://www.opentable.com/%page_id%',
2157
- 'foursquare' => 'https://foursquare.com/v/%25page_id%25',
2158
- 'capterra' => 'https://www.capterra.com/p/%page_id%/reviews',
2159
- 'szallashu' => 'https://szallas.hu/%page_id%?#rating',
2160
- 'thumbtack' => 'https://www.thumbtack.com/%page_id%',
2161
- 'expedia' => 'https://www.expedia.com/%page_id%',
2162
- 'zillow' => 'https://www.zillow.com/profile/%page_id%/#reviews',
2163
- 'wordpressPlugin' => 'https://www.wordpress.org/plugins/%page_id%',
2164
- 'aliexpress' => 'https://www.aliexpress.com/store/%page_id%',
2165
- 'alibaba' => 'https://%page_id%.en.alibaba.com',
2166
- 'sourceForge' => 'https://sourceforge.net/software/product/%page_id%/',
2167
- 'ebay' => 'https://www.ebay.com/fdbk/feedback_profile/%page_id%',
2168
- );
2169
- public function getPageUrl()
2170
- {
2171
- if(!isset(self::$page_urls[ $this->shortname ]))
2172
- {
2173
- return "";
2174
- }
2175
- $page_details = get_option($this->get_option_name('page-details'));
2176
- if(!$page_details)
2177
- {
2178
- return "";
2179
- }
2180
- $page_id = $page_details['id'];
2181
- $domain = "";
2182
- if($this->shortname == "amazon" || $this->shortname == "arukereso")
2183
- {
2184
- $tmp = explode('|', $page_id);
2185
- $domain = $tmp[0];
2186
- if(isset($tmp[1]))
2187
- {
2188
- $page_id = $tmp[1];
2189
- }
2190
- else
2191
- {
2192
- $domain = 'com';
2193
- }
2194
- }
2195
- $url = str_replace([ '%domain%', '%page_id%', '%25page_id%25' ], [ $domain, $page_id, $page_id ], self::$page_urls[ $this->shortname ]);
2196
- if($this->shortname == "airbnb")
2197
- {
2198
- $url = str_replace('rooms/experiences/', 'experiences/', $url);
2199
- }
2200
- if($this->shortname == "amazon" && strpos($page_id, '/') !== false)
2201
- {
2202
- $url = str_replace('sp?seller=', '', $url);
2203
- }
2204
- return $url;
2205
- }
2206
- public function getReviewHtml($review)
2207
- {
2208
- $html = preg_replace('/\r\n|\r|\n/', "\n", html_entity_decode($review->text, ENT_HTML5 | ENT_QUOTES));
2209
- if(isset($review->highlight) && $review->highlight)
2210
- {
2211
- $tmp = explode(',', $review->highlight);
2212
- $start = (int)$tmp[0];
2213
- $length = (int)$tmp[1];
2214
- $html = mb_substr($html, 0, $start) . '<mark class="ti-highlight">' . mb_substr($html, $start, $length) . '</mark>' . mb_substr($html, $start + $length, mb_strlen($html));
2215
- /* format <mark></mark> tags in other tags
2216
- * like:
2217
- * <strong><mark>...</strong>...</mark>....
2218
- * to:
2219
- * <strong><mark>...</mark></strong><mark>...</mark>....
2220
- */
2221
- preg_match('/<mark class="ti-highlight">(.*)<\/mark>/Us', $html, $matches);
2222
- if(isset($matches[1]))
2223
- {
2224
- $replaced_content = preg_replace('/(<\/?[^>]+>)/U', '</mark>$1<mark class="ti-highlight">', $matches[1]);
2225
- $html = str_replace($matches[0], '<mark class="ti-highlight">' . $replaced_content . '</mark>', $html);
2226
- }
2227
- }
2228
- return $html;
2229
- }
2230
- private $preview_content = null;
2231
- private $template_cache = null;
2232
- public function get_noreg_list_reviews($force_platform = null, $list_all = false, $default_style_id = 4, $default_set_id = 'light-background', $only_preview = false, $default_reviews = false)
2233
- {
2234
- global $wpdb;
2235
- $dbtable = $this->get_noreg_tablename($force_platform);
2236
- $page_details = get_option($this->get_option_name('page-details'));
2237
- $style_id = (int)get_option($this->get_option_name('style-id'), 4);
2238
- $content = get_option($this->get_option_name('review-content'));
2239
- $lang = get_option($this->get_option_name('lang'), 'en');
2240
- $dateformat = get_option($this->get_option_name('dateformat'), 'Y-m-d');
2241
- $no_rating_text = get_option($this->get_option_name('no-rating-text'));
2242
- $verified_icon = get_option($this->get_option_name('verified-icon'), 0);
2243
- $show_reviewers_photo = get_option($this->get_option_name('show-reviewers-photo'), 1);
2244
- $set_id = get_option($this->get_option_name('scss-set'), 'light-background');
2245
- $show_logos = get_option($this->get_option_name('show-logos'), 1);
2246
- $show_stars = get_option($this->get_option_name('show-stars'), 1);
2247
- $need_to_parse = true;
2248
- if($only_preview)
2249
- {
2250
- $content = false;
2251
- $style_id = $default_style_id;
2252
- $set_id = $default_set_id;
2253
- $show_logos = 1;
2254
- $show_stars = 1;
2255
- $show_reviewers_photo = 1;
2256
- if($this->preview_content && $this->preview_content['id'] == $style_id)
2257
- {
2258
- $content = $this->preview_content['content'];
2259
- $need_to_parse = false;
2260
- }
2261
- }
2262
- if(is_null($no_rating_text))
2263
- {
2264
- $no_rating_text = in_array($style_id, [ 15, 19 ]) ? 1 : 0;
2265
- }
2266
- $sql_rating_field = 'rating';
2267
- if($this->is_ten_scale_rating_platform())
2268
- {
2269
- $sql_rating_field = 'ROUND(rating / 2, 0)';
2270
- }
2271
- $sql = "SELECT *, rating as original_rating, $sql_rating_field as rating FROM $dbtable ";
2272
- $filter = get_option($this->get_option_name('filter'));
2273
- if(!$list_all && $filter)
2274
- {
2275
- if(count($filter['stars']) == 0)
2276
- {
2277
- $sql .= "WHERE 0 ";
2278
- }
2279
- else
2280
- {
2281
- $sql .= "WHERE ($sql_rating_field IN (". implode(',', $filter['stars']) .")";
2282
- if(in_array(5, $filter['stars']))
2283
- {
2284
- $sql .= ' or rating IS NULL';
2285
- }
2286
- $sql .= ') ';
2287
- if($filter['only-ratings'])
2288
- {
2289
- $sql .= "and text != '' ";
2290
- }
2291
- }
2292
- }
2293
- $sql .= "ORDER BY date DESC";
2294
- if($only_preview || !$list_all)
2295
- {
2296
- switch($style_id)
2297
- {
2298
- case 16:
2299
- case 31:
2300
- $sql .= " LIMIT 9";
2301
- break;
2302
- default:
2303
- $sql .= " LIMIT 10";
2304
- break;
2305
- }
2306
- }
2307
- $reviews = $wpdb->get_results($sql);
2308
- if(!count($reviews) && $default_reviews)
2309
- {
2310
- $lang = substr(get_locale(), 0, 2);
2311
- if(!isset(self::$widget_languages[$lang]))
2312
- {
2313
- $lang = 'en';
2314
- }
2315
- if(!isset($page_details['avatar_url']))
2316
- {
2317
- $page_details['avatar_url'] = 'https://cdn.trustindex.io/companies/default_avatar.jpg';
2318
- }
2319
- $rating_num = 5;
2320
- if(in_array($style_id, [ 16, 31 ]))
2321
- {
2322
- $rating_num = 9;
2323
- }
2324
- else if(in_array(self::$widget_templates[ 'templates' ][ $style_id ]['type'], [ 'sidebar', 'list' ]))
2325
- {
2326
- $rating_num = 3;
2327
- }
2328
- $page_details['rating_number'] = $rating_num;
2329
- if($this->is_ten_scale_rating_platform())
2330
- {
2331
- $page_details['rating_score'] = number_format(rand(80, 100) / 10, 1);
2332
- }
2333
- else
2334
- {
2335
- $page_details['rating_score'] = rand(4, 5);
2336
- }
2337
- $reviews = $this->getRandomReviews($rating_num);
2338
- }
2339
- if(!count($reviews))
2340
- {
2341
- return self::get_alertbox(
2342
- "error",
2343
- '<br />' . self::___('There are no reviews on your %s platform.', [ ucfirst($this->shortname) ]),
2344
- false
2345
- );
2346
- }
2347
- $script_name = 'trustindex-js';
2348
- if(!wp_script_is($script_name, 'enqueued'))
2349
- {
2350
- wp_enqueue_script($script_name, 'https://cdn.trustindex.io/loader.js', [], false, true);
2351
- }
2352
- $scripts = wp_scripts();
2353
- if(isset($scripts->registered[ $script_name ]) && !isset($scripts->registered[ $script_name ]->extra['after']))
2354
- {
2355
- wp_add_inline_script($script_name, '(function ti_init() {
2356
- if(typeof Trustindex == "undefined"){setTimeout(ti_init, 1985);return false;}
2357
- if(typeof Trustindex.pager_inited != "undefined"){return false;}
2358
- Trustindex.init_pager(document.querySelectorAll(".ti-widget"));
2359
- })();');
2360
- }
2361
- if($content === false || empty($content) || (strpos($content, '<!-- R-LIST -->') === false && $need_to_parse))
2362
- {
2363
- if(!$this->template_cache)
2364
- {
2365
- add_action('http_api_curl', function( $handle ){
2366
- curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
2367
- curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
2368
- }, 10);
2369
- $response = wp_remote_get("https://cdn.trustindex.io/widget-assets/template/$lang.json");
2370
- if(is_wp_error($response))
2371
- {
2372
- echo $this->get_alertbox('error', '<br />' .$this->___('Could not download the template for the widget.<br />Please reload the page.<br />If the problem persists, please write an email to support@trustindex.io.'));
2373
- die;
2374
- }
2375
- $this->template_cache = json_decode($response['body'], true);
2376
- }
2377
- $content = $this->template_cache[$style_id];
2378
- if(!$only_preview)
2379
- {
2380
- update_option($this->get_option_name('review-content'), $content, false);
2381
- }
2382
- }
2383
- if($need_to_parse)
2384
- {
2385
- $content = $this->parse_noreg_list_reviews([
2386
- 'content' => $content,
2387
- 'reviews' => $reviews,
2388
- 'page_details' => $page_details,
2389
- 'style_id' => $style_id,
2390
- 'set_id' => $set_id,
2391
- 'no_rating_text' => $no_rating_text,
2392
- 'dateformat' => $dateformat,
2393
- 'language' => $lang,
2394
- 'verified_icon' => $verified_icon,
2395
- 'show_reviewers_photo' => $show_reviewers_photo
2396
- ]);
2397
- $this->preview_content = [
2398
- 'id' => $style_id,
2399
- 'content' => $content
2400
- ];
2401
- }
2402
- $content = preg_replace('/data-set[_-]id=[\'"][^\'"]*[\'"]/m', 'data-set-id="'. $set_id .'"', $content);
2403
- $class_appends = [];
2404
- if(!$show_logos)
2405
- {
2406
- array_push($class_appends, 'ti-no-logo');
2407
- }
2408
- if(!$show_stars)
2409
- {
2410
- array_push($class_appends, 'ti-no-stars');
2411
- }
2412
- $free_css_class = 'ti-' . substr($this->shortname, 0, 4);
2413
- if($only_preview)
2414
- {
2415
- wp_enqueue_style("trustindex-widget-css-". $this->shortname ."-". $style_id . "-". $set_id, "https://cdn.trustindex.io/assets/widget-presetted-css/". $style_id ."-". $set_id .".css");
2416
- }
2417
- else
2418
- {
2419
- $widget_css = get_option($this->get_option_name('css-content'));
2420
- if(!$widget_css)
2421
- {
2422
- wp_enqueue_style("trustindex-widget-css-" . $this->shortname, "https://cdn.trustindex.io/widget-assets/css/". $style_id ."-blue.css");
2423
- }
2424
- else
2425
- {
2426
- array_push($class_appends, $free_css_class);
2427
- }
2428
- }
2429
- if($class_appends)
2430
- {
2431
- $content = str_replace('class="ti-widget" data-layout-id=', 'class="ti-widget '. implode(' ', $class_appends) .'" data-layout-id=', $content);
2432
- if(!wp_style_is('ti-widget-css-' . $this->shortname, 'registered'))
2433
- {
2434
- $content .= '<style type="text/css">'. $widget_css .'</style>';
2435
- }
2436
- else
2437
- {
2438
- wp_enqueue_style('ti-widget-css-' . $this->shortname);
2439
- if(in_array($free_css_class, $class_appends) && wp_script_is('trustindex-frontend-js-' . $this->shortname, 'enqueued'))
2440
- {
2441
- $content = str_replace(' class="ti-widget ', ' style="display: none" class="ti-widget ', $content);
2442
- }
2443
- }
2444
- }
2445
- return $content;
2446
- }
2447
- public function parse_noreg_list_reviews($array = [])
2448
- {
2449
- preg_match('/<!-- R-LIST -->(.*)<!-- R-LIST -->/', $array['content'], $matches);
2450
- if(isset($matches[1]))
2451
- {
2452
- $reviewContent = "";
2453
- if($array['reviews'] && count($array['reviews'])) foreach($array['reviews'] as $r)
2454
- {
2455
- $date = "&nbsp;";
2456
- if($r->date && $r->date != '0000-00-00')
2457
- {
2458
- $date = str_replace(self::$widget_month_names['en'], self::$widget_month_names[$array['language']], date($array['dateformat'], strtotime($r->date)));
2459
- }
2460
- $rating_content = $this->get_rating_stars($r->rating);
2461
- if($this->shortname == 'facebook' && in_array($r->rating, [ 1, 5 ]))
2462
- {
2463
- if($r->rating == 1)
2464
- {
2465
- $rating_content = self::$widget_recommendation_texts[ $array['language'] ]['negative'];
2466
- }
2467
- else
2468
- {
2469
- $rating_content = self::$widget_recommendation_texts[ $array['language'] ]['positive'];
2470
- }
2471
- $r_text = trim(str_replace([ 'NOT_RECOMMEND_ICON', 'RECOMMEND_ICON' ], '', $rating_content));
2472
- $rating_content = '<span class="ti-recommendation">'. str_replace([
2473
- 'NOT_RECOMMEND_ICON',
2474
- 'RECOMMEND_ICON',
2475
- ' ' . $r_text,
2476
- $r_text . ' '
2477
- ], [
2478
- '<span class="ti-recommendation-icon negative"></span>',
2479
- '<span class="ti-recommendation-icon positive"></span>',
2480
- '<span class="ti-recommendation-title">'. $r_text .'</span>',
2481
- '<span class="ti-recommendation-title">'. $r_text .'</span>'
2482
- ], $rating_content) .'</span>';
2483
- $rating_content .= '<span class="ti-dummy-stars">';
2484
- for($si = 1; $si <= 5; $si++)
2485
- {
2486
- $rating_content .= '<span class="ti-star '. ($si == 1 || $r->rating == 5 ? 'f' : 'e') .'"></span>';
2487
- }
2488
- $rating_content .= '</span>';
2489
- }
2490
- else if($this->shortname == 'ebay' && in_array($r->rating, [ 1, 3, 5 ]))
2491
- {
2492
- if($r->rating == 1)
2493
- {
2494
- $polarity = 'negative';
2495
- }
2496
- else if($r->rating == 3)
2497
- {
2498
- $polarity = 'neutral';
2499
- }
2500
- else
2501
- {
2502
- $polarity = 'positive';
2503
- }
2504
- $rating_content = '<span class="ti-polarity"><span class="ti-polarity-icon ' . $polarity . '"></span></span>';
2505
- }
2506
- else if($this->is_ten_scale_rating_platform())
2507
- {
2508
- $rating_content = '<div class="ti-rating-box">'. $this->formatTenRating($r->original_rating) .'</div>';
2509
- }
2510
- if($array['verified_icon'])
2511
- {
2512
- if($array['style_id'] == 21)
2513
- {
2514
- $rating_content .= '</div><div class="ti-logo-text"><span class="ti-verified-review"><span class="ti-verified-tooltip">'. self::$widget_verified_texts[ $array['language'] ] .'</span></span><span class="ti-logo-title">Trustindex</span></div><div>';
2515
- }
2516
- else
2517
- {
2518
- $rating_content .= '<span class="ti-verified-review"><span class="ti-verified-tooltip">'. self::$widget_verified_texts[ $array['language'] ] .'</span></span>';
2519
- }
2520
- }
2521
- $platform_name = ucfirst($this->getShortName());
2522
- if($platform_name == 'Szallashu')
2523
- {
2524
- $tmp = explode('/', $array['page_details']['id']);
2525
- $platform_name .= '" data-domain="' . $tmp[0];
2526
- }
2527
- if(!$array['show_reviewers_photo'])
2528
- {
2529
- $matches[1] = str_replace('<div class="ti-profile-img"> <img src="%reviewer_photo%" alt="%reviewer_name%" /> </div>', '', $matches[1]);
2530
- }
2531
- $reviewContent .= str_replace([
2532
- '%platform%',
2533
- '%reviewer_photo%',
2534
- '%reviewer_name%',
2535
- '%created_at%',
2536
- '%text%',
2537
- '<span class="ti-star f"></span><span class="ti-star f"></span><span class="ti-star f"></span><span class="ti-star f"></span><span class="ti-star f"></span>'
2538
- ], [
2539
- $platform_name,
2540
- $r->user_photo,
2541
- $r->user,
2542
- $date,
2543
- $this->getReviewHtml($r),
2544
- $rating_content
2545
- ], $matches[1]);
2546
- $reviewContent = str_replace('<div></div>', '', $reviewContent);
2547
- }
2548
- $array['content'] = str_replace($matches[0], $reviewContent, $array['content']);
2549
- }
2550
- $rating_count = $array['page_details']['rating_number'];
2551
- $rating_score = $array['page_details']['rating_score'];
2552
- if(empty($rating_count))
2553
- {
2554
- $rating_count = count($array['reviews']);
2555
- }
2556
- if(empty($rating_score))
2557
- {
2558
- $rating_sum = 0.0;
2559
- foreach($array['reviews'] as $review)
2560
- {
2561
- $rating_sum += (float)$review->rating;
2562
- }
2563
- $c = count($array['reviews']);
2564
- $rating_score = $c ? $rating_sum / $c : 0;
2565
- }
2566
- $array['content'] = str_replace([
2567
- '%platform%',
2568
- '%site_name%',
2569
- "RATING_NUMBER",
2570
- "RATING_SCORE",
2571
- "RATING_SCALE",
2572
- "RATING_TEXT",
2573
- "PLATFORM_URL_LOGO",
2574
- "PLATFORM_NAME",
2575
- '<span class="ti-star e"></span><span class="ti-star e"></span><span class="ti-star e"></span><span class="ti-star e"></span><span class="ti-star e"></span>',
2576
- 'PLATFORM_SMALL_LOGO'
2577
- ], [
2578
- ucfirst($this->getShortName()),
2579
- $array['page_details']['name'],
2580
- $rating_count,
2581
- $rating_score,
2582
- $this->is_ten_scale_rating_platform() ? 10 : 5,
2583
- $this->get_rating_text($rating_score, $array['language']),
2584
- $array['page_details']['avatar_url'],
2585
- $this->get_platform_name($this->getShortName(), $array['page_details']['id']),
2586
- $this->is_ten_scale_rating_platform() ? "<div class='ti-rating-box'>". $this->formatTenRating($rating_score) ."</div>" : $this->get_rating_stars($rating_score),
2587
- '<div class="ti-small-logo"><img src="'. $this->get_plugin_file_url('static/img/platform/logo.svg') . '" alt="'. ucfirst($this->getShortName()) .'"></div>',
2588
- ], $array['content']);
2589
- if($this->isDarkLogo($array['style_id'], $array['set_id']))
2590
- {
2591
- $array['content'] = str_replace('img/platform/logo', 'img/platform/logo-dark', $array['content']);
2592
- $array['content'] = str_replace('platform/'. ucfirst($this->getShortName()) .'/logo', 'platform/'. ucfirst($this->getShortName()) .'/logo-dark', $array['content']);
2593
- }
2594
- if($this->is_ten_scale_rating_platform() && $array['style_id'] == 11)
2595
- {
2596
- $array['content'] = str_replace('<span class="ti-rating">'. $rating_score .'</span> ', '', $array['content']);
2597
- }
2598
- if($this->shortname == 'szallashu' || $this->shortname == 'arukereso')
2599
- {
2600
- $split = '/';
2601
- $replace_hu = false;
2602
- if($this->shortname == 'arukereso')
2603
- {
2604
- $split = '|';
2605
- $replace_hu = true;
2606
- }
2607
- $tmp = explode($split, $array['page_details']['id']);
2608
- $array['content'] = str_replace([ 'img/platform/logo.svg', 'img/platform/logo-dark.svg' ], [ 'img/platform/logo-'. $tmp[0] .'.svg', 'img/platform/logo-'. $tmp[0] .'-dark.svg' ], $array['content']);
2609
- $array['content'] = str_replace([ 'platform/'. ucfirst($this->getShortName()) .'/logo.svg', 'platform/'. ucfirst($this->getShortName()) .'/logo-dark.svg' ], [ 'platform/'. ucfirst($this->shortname) .'/logo-'. $tmp[0] .'.svg', 'platform/'. ucfirst($this->shortname) .'/logo-'. $tmp[0] .'-dark.svg' ], $array['content']);
2610
- if($replace_hu)
2611
- {
2612
- $array['content'] = str_replace('img/platform/logo-hu', 'img/platform/logo', $array['content']);
2613
- $array['content'] = str_replace('platform/'. ucfirst($this->getShortName()) .'/logo-hu', 'platform/'. ucfirst($this->getShortName()) .'/logo', $array['content']);
2614
- }
2615
- }
2616
- if(in_array($array['style_id'], [24, 25, 26, 27, 28, 29, 35]))
2617
- {
2618
- $array['content'] = str_replace('%footer_link%', $this->getPageUrl(), $array['content']);
2619
- }
2620
- else
2621
- {
2622
- $array['content'] = preg_replace('/<a href=[\'"]%footer_link%[\'"][^>]*>(.+)<\/a>/mU', '$1', $array['content']);
2623
- }
2624
- if($array['no_rating_text'])
2625
- {
2626
- if(in_array($array['style_id'], [6, 7]))
2627
- {
2628
- $array['content'] = preg_replace('/<div class="ti-footer">.*<\/div>/mU', '<div class="ti-footer"></div>', $array['content']);
2629
- }
2630
- else if(in_array($array['style_id'], [31, 33]))
2631
- {
2632
- $array['content'] = preg_replace('/<div class="ti-header source-.*<\/div>\s?<div class="ti-reviews-container">/mU', '<div class="ti-reviews-container">', $array['content']);
2633
- }
2634
- else if($array['style_id'] == 11)
2635
- {
2636
- $array['content'] = preg_replace('/<div class="ti-text">.*<\/div>/mU', '', $array['content']);
2637
- }
2638
- else
2639
- {
2640
- $array['content'] = preg_replace('/<div class="ti-rating-text">.*<\/div>/mU', '', $array['content']);
2641
- }
2642
- }
2643
- preg_match('/src="([^"]+logo[^\.]*\.svg)"/m', $array['content'], $matches);
2644
- if(isset($matches[1]) && !empty($matches[1]))
2645
- {
2646
- $array['content'] = str_replace($matches[0], $matches[0] . ' width="150" height="25"', $array['content']);
2647
- }
2648
- return $array['content'];
2649
- }
2650
- public function isDarkLogo($layout_id, $color_schema)
2651
- {
2652
- if(in_array($layout_id, [ 5, 9, 31, 34, 33 ]))
2653
- {
2654
- return substr($color_schema, 0, 5) == 'dark-';
2655
- }
2656
- switch($color_schema)
2657
- {
2658
- case 'light-contrast':
2659
- case 'dark-background':
2660
- case 'dark-border':
2661
- return true;
2662
- }
2663
- return false;
2664
- }
2665
- public function get_platform_name($type, $id = "")
2666
- {
2667
- $text = ucfirst($type);
2668
- if($text == "Szallashu")
2669
- {
2670
- $domains = [
2671
- 'cz' => 'Hotely.cz',
2672
- 'hu' => 'Szallas.hu',
2673
- 'ro' => 'Hotelguru.ro',
2674
- 'com' => 'Revngo.com',
2675
- 'pl' => 'Noclegi.pl'
2676
- ];
2677
- $tmp = explode('/', $id);
2678
- if(isset($domains[ $tmp[0] ]))
2679
- {
2680
- $text = $domains[ $tmp[0] ];
2681
- }
2682
- }
2683
- else if($text == "Arukereso")
2684
- {
2685
- $domains = [
2686
- 'hu' => 'Árukereső.hu',
2687
- 'bg' => 'Pazaruvaj.com',
2688
- 'ro' => 'Compari.ro'
2689
- ];
2690
- $tmp = explode('|', $id);
2691
- if(isset($domains[ $tmp[0] ]))
2692
- {
2693
- $text = $domains[ $tmp[0] ];
2694
- }
2695
- }
2696
- else if($text == "WordpressPlugin")
2697
- {
2698
- $text = "Wordpress Plugin";
2699
- }
2700
- return $text;
2701
- }
2702
- public function get_rating_text($rating, $lang = "en")
2703
- {
2704
- $texts = self::$widget_rating_texts[$lang];
2705
- $rating = round($rating);
2706
- if($rating < 1) $rating = 1;
2707
- elseif($rating > 5) $rating = 5;
2708
- if(function_exists('mb_strtoupper'))
2709
- {
2710
- return mb_strtoupper($texts[$rating - 1]);
2711
- }
2712
- else
2713
- {
2714
- return strtoupper($texts[$rating - 1]);
2715
- }
2716
- }
2717
- public function get_rating_stars($rating_score)
2718
- {
2719
- $text = "";
2720
- if(!is_numeric($rating_score))
2721
- {
2722
- return $text;
2723
- }
2724
- for ($si = 1; $si <= $rating_score; $si++)
2725
- {
2726
- $text .= '<span class="ti-star f"></span>';
2727
- }
2728
- $fractional = $rating_score - floor($rating_score);
2729
- if( 0.25 <= $fractional )
2730
- {
2731
- if ( $fractional < 0.75 )
2732
- {
2733
- $text .= '<span class="ti-star h"></span>';
2734
- }
2735
- else
2736
- {
2737
- $text .= '<span class="ti-star f"></span>';
2738
- }
2739
- $si++;
2740
- }
2741
- for (; $si <= 5; $si++)
2742
- {
2743
- $text .= '<span class="ti-star e"></span>';
2744
- }
2745
- return $text;
2746
- }
2747
- private function getRandomReviews($count = 9)
2748
- {
2749
- $random_texts = [
2750
- 'Works very well, does the job, very easy to set up.',
2751
- 'O plugin excede expectativas! Com ele, é possível acrescentar as avaliações do Google ao site com um design altamente customizável e configuração em poucos cliques.',
2752
- '<strong>I have been using this firm for many...</strong><br />I have been using this firm for many years now for my office supplies and I find them excellent. Deliveries 99% next day. Stock excellent. Problem solving excellent. Prices excellent. Keep up the good service',
2753
- 'Very good! We ordered the breaded mushrooms as a appetizer, wish I had some now!<br /><br />I ordered the slow cooked beef and Guinness stew form dinner and my boyfriend got the bangers and mash, both were delicious! And it was so nice to have a hearty warm meal with it being chilly outside.<br /><br />Would definitely recommend to friends and family visiting and I would come back myself as well',
2754
- 'Was so impressed with the facilities. Everything very seamlessly integrated, no snags in decor etc. Loved the ambient lighting - everything was on a dimmer! Bed was very comfy, and bathroom beautifully presented! Staff were more than helpful, with the hotel boasting an extremely up-market feel for the price! Highly recommended',
2755
- 'Smooth online transaction. very professional and reputable with solid communication',
2756
- 'Good selection. Reasonable prices. Easy to use website. Prompt delivery.',
2757
- 'Wonderful products, great service.',
2758
- 'As always very pleased with the service and the packaging! I have yet to try all the different aromas but I’m sure they will be good as usual.'
2759
- ];
2760
- $reviews = [];
2761
- for($i = 0; $i < $count; $i++)
2762
- {
2763
- shuffle($random_texts);
2764
- $text = array_pop($random_texts);
2765
- $r = new stdClass();
2766
- $r->id = $i;
2767
- $r->user = self::___('Reviewer') .' '. ($i + 1);
2768
- $r->user_photo = 'https://cdn.trustindex.io/assets/default-avatar/noprofile-01.svg';
2769
- $r->text = $text;
2770
- $r->original_rating = $i == max(0, $count-2) ? 4 : 5;
2771
- $r->rating = $r->original_rating;
2772
- $r->highlight = null;
2773
- $r->date = date('Y-m-d');
2774
- if($this->is_ten_scale_rating_platform())
2775
- {
2776
- $r->original_rating = number_format($i == max(0, $count-2) ? 8 : 10, 1);
2777
- $r->rating = round($r->original_rating / 2);
2778
- }
2779
- $reviews[] = $r;
2780
- }
2781
- return $reviews;
2782
- }
2783
- public function download_noreg_reviews($page_details, $force_platform = null)
2784
- {
2785
- $force_platform = $force_platform ? $force_platform : $this->getShortName();
2786
- $url = "https://admin.trustindex.io/" . "api/getPromoReviews?platform=".$force_platform."&page_id=" . $page_details['id'];
2787
- if($force_platform == 'facebook')
2788
- {
2789
- $url .= '&access_token='. $page_details['access_token'];
2790
- }
2791
- if(!isset($page_details['id']) && !trim($page_details['id']))
2792
- {
2793
- return [ 'success' => false ];
2794
- }
2795
- $server_output = $this->post_request($url, [
2796
- 'body' => [ 'wp_info' => $this->get_wp_details() ],
2797
- 'timeout' => '30',
2798
- 'redirection' => '5',
2799
- 'blocking' => true
2800
- ]);
2801
- if($server_output[0] !== '[' && $server_output[0] !== '{')
2802
- {
2803
- $server_output = substr($server_output, strpos($server_output, '('));
2804
- $server_output = trim($server_output,'();');
2805
- }
2806
- $server_output = json_decode($server_output, true);
2807
- return $server_output;
2808
- }
2809
- public function download_noreg_details($page_details, $force_platform = null)
2810
- {
2811
- if(!isset($page_details['id']) || empty(trim($page_details['id'])))
2812
- {
2813
- return null;
2814
- }
2815
- $force_platform = $force_platform ? $force_platform : $this->getShortName();
2816
- $url = "https://admin.trustindex.io/" . "api/getPageDetails?platform=".$force_platform."&page_id=" . $page_details['id'];
2817
- if($force_platform == "facebook")
2818
- {
2819
- $url .= "&access_token=". $page_details['access_token'];
2820
- }
2821
- $server_output = $this->post_request($url, [
2822
- 'timeout' => '20',
2823
- 'redirection' => '5',
2824
- 'blocking' => true
2825
- ]);
2826
- if($server_output[0] !== '[' && $server_output[0] !== '{')
2827
- {
2828
- $server_output = substr($server_output, strpos($server_output, '('));
2829
- $server_output = trim($server_output,'();');
2830
- }
2831
- $server_output = json_decode($server_output, true);
2832
- return $server_output;
2833
- }
2834
- public function get_plugin_current_version()
2835
- {
2836
- add_action('http_api_curl', function( $handle ){
2837
- curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
2838
- curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
2839
- }, 10);
2840
- $response = wp_remote_get('https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]='. $this->get_plugin_slug());
2841
- $json = json_decode($response['body'], true);
2842
- if(!$json && !isset($json['version']))
2843
- {
2844
- return false;
2845
- }
2846
- return $json['version'];
2847
- }
2848
-
2849
-
2850
- private function post_request($url, $args)
2851
- {
2852
- $response = wp_remote_post($url, $args);
2853
- if(is_wp_error($response))
2854
- {
2855
- echo $this->get_alertbox('error', '<br />Error with wp_remote_post, error message: <br /><b>'. $response->get_error_message() .'</b>');
2856
- die;
2857
- }
2858
- return wp_remote_retrieve_body($response);
2859
- }
2860
-
2861
-
2862
- public function is_trustindex_connected()
2863
- {
2864
- return get_option($this->get_option_name("subscription-id"));
2865
- }
2866
- public function get_trustindex_widget_number()
2867
- {
2868
- $widgets = $this->get_trustindex_widgets();
2869
- $number = 0;
2870
- foreach ($widgets as $wc)
2871
- {
2872
- $number += count($wc['widgets']);
2873
- }
2874
- return $number;
2875
- }
2876
- public function get_trustindex_widgets()
2877
- {
2878
- $widgets = array();
2879
- $trustindex_subscription_id = $this->is_trustindex_connected();
2880
- if ($trustindex_subscription_id)
2881
- {
2882
- $widgets = wp_remote_get("https://admin.trustindex.io/" . "api/getWidgets?subscription_id=".$trustindex_subscription_id);
2883
- if ($widgets)
2884
- {
2885
- $widgets = json_decode($widgets['body'], true);
2886
- }
2887
- }
2888
- return $widgets;
2889
- }
2890
- public function connect_trustindex_api($post_data, $mode = "new")
2891
- {
2892
- $url = "https://admin.trustindex.io/" . "api/connectApi";
2893
- $post_data['wp_info'] = $this->get_wp_details();
2894
- $server_output = $this->post_request($url, [
2895
- 'body' => $post_data,
2896
- 'timeout' => '5',
2897
- 'redirection' => '5',
2898
- 'blocking' => true
2899
- ]);
2900
- if($server_output[0] !== '[' && $server_output[0] !== '{')
2901
- {
2902
- $server_output = substr($server_output, strpos($server_output, '('));
2903
- $server_output = trim($server_output,'();');
2904
- }
2905
- $server_output = json_decode($server_output, true);
2906
- if ($server_output['success'])
2907
- {
2908
- update_option( $this->get_option_name("subscription-id"), $server_output["subscription_id"]);
2909
- $GLOBALS['wp_object_cache']->delete( $this->get_option_name('subscription-id'), 'options' );
2910
- }
2911
- return $server_output;
2912
- }
2913
-
2914
-
2915
- public function register_tinymce_features()
2916
- {
2917
- if ( ! has_filter( "mce_external_plugins", "add_tinymce_buttons" ) )
2918
- {
2919
- add_filter( "mce_external_plugins", [$this, "add_tinymce_buttons"] );
2920
- add_filter( "mce_buttons", [$this, "register_tinymce_buttons"] );
2921
- }
2922
- }
2923
- public function add_tinymce_buttons( $plugin_array )
2924
- {
2925
- $plugin_name = 'trustindex';
2926
- if (!isset($plugin_array[$plugin_name]))
2927
- {
2928
- $plugin_array[$plugin_name] = $this->get_plugin_file_url('static/js/admin-editor.js');
2929
- }
2930
- wp_localize_script( 'jquery', 'ajax_object', array(
2931
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
2932
- ));
2933
- return $plugin_array;
2934
- }
2935
- public function register_tinymce_buttons( $buttons )
2936
- {
2937
- $button_name = 'trustindex';
2938
- if (!in_array($button_name, $buttons))
2939
- {
2940
- array_push( $buttons, $button_name );
2941
- }
2942
- return $buttons;
2943
- }
2944
-
2945
-
2946
- public function list_trustindex_widgets_ajax()
2947
- {
2948
- $ti_widgets = $this->get_trustindex_widgets();
2949
- if ($this->is_trustindex_connected()): ?>
2950
- <?php if ($ti_widgets): ?>
2951
- <h2><?php echo TrustindexPlugin::___('Your saved widgets'); ?></h2>
2952
- <?php foreach ($ti_widgets as $wc): ?>
2953
- <p><strong><?php echo esc_html($wc['name']); ?>:</strong></p>
2954
- <p>
2955
- <?php foreach ($wc['widgets'] as $w): ?>
2956
- <a href="#" class="btn-copy-widget-id" data-ti-id="<?php echo esc_attr($w['id']); ?>">
2957
- <span class="dashicons dashicons-admin-post"></span>
2958
- <?php echo esc_html($w['name']); ?>
2959
- </a><br />
2960
- <?php endforeach; ?>
2961
- </p>
2962
- <?php endforeach; ?>
2963
- <?php else: ?>
2964
- <?php echo self::get_alertbox("warning",
2965
- TrustindexPlugin::___("You have no widget saved!") . " "
2966
- . "<a target='_blank' href='" . "https://admin.trustindex.io/" . "widget'>". TrustindexPlugin::___("Let's go, create amazing widgets for free!")."</a>"
2967
- ); ?>
2968
- <?php endif; ?>
2969
- <?php else: ?>
2970
- <?php echo self::get_alertbox("warning",
2971
- TrustindexPlugin::___("You have not set up your Trustindex account yet!") . " "
2972
- . TrustindexPlugin::___("Go to <a href='%s'>plugin setup page</a> to complete the one-step setup guide and enjoy the full functionalization!", [ admin_url('admin.php?page='.$this->get_plugin_slug().'/settings.php&tab=setup_trustindex_join') ])
2973
- ); ?>
2974
- <?php endif;
2975
- wp_die();
2976
- }
2977
- public function trustindex_add_scripts($hook)
2978
- {
2979
- if ($hook === 'widgets.php')
2980
- {
2981
- wp_enqueue_script('trustindex_script', $this->get_plugin_file_url('static/js/admin-widget.js'));
2982
- wp_enqueue_style('trustindex_style', $this->get_plugin_file_url('static/css/admin-widget.css'));
2983
- }
2984
- elseif ($hook === 'post.php')
2985
- {
2986
- wp_enqueue_style('trustindex_editor_style', $this->get_plugin_file_url('static/css/admin-editor.css'));
2987
- }
2988
- else
2989
- {
2990
- $tmp = explode('/', $this->plugin_file_path);
2991
- $plugin_slug = preg_replace('/\.php$/', '', array_pop($tmp));
2992
- $tmp = explode('/', $hook);
2993
- $current_slug = array_shift($tmp);
2994
- if($plugin_slug == $current_slug)
2995
- {
2996
- if(file_exists($this->get_plugin_dir() . 'static/css/admin-page-settings.css'))
2997
- {
2998
- wp_enqueue_style('trustindex_settings_style_'. $this->shortname, $this->get_plugin_file_url('static/css/admin-page-settings.css'));
2999
- }
3000
- if(file_exists($this->get_plugin_dir() . 'static/js/admin-page-settings-common.js'))
3001
- {
3002
- wp_enqueue_script('trustindex_settings_script_common_'. $this->shortname, $this->get_plugin_file_url('static/js/admin-page-settings-common.js'));
3003
- }
3004
- if(file_exists($this->get_plugin_dir() . 'static/js/admin-page-settings-connect.js'))
3005
- {
3006
- wp_enqueue_script('trustindex_settings_script_connect_'. $this->shortname, $this->get_plugin_file_url('static/js/admin-page-settings-connect.js'));
3007
- }
3008
- if(file_exists($this->get_plugin_dir() . 'static/js/admin-page-settings.js'))
3009
- {
3010
- wp_enqueue_script('trustindex_settings_script_'. $this->shortname, $this->get_plugin_file_url('static/js/admin-page-settings.js') );
3011
- }
3012
- }
3013
- }
3014
- wp_register_script('trustindex_admin_popup', $this->get_plugin_file_url('static/js/admin-popup.js') );
3015
- wp_enqueue_script('trustindex_admin_popup');
3016
- }
3017
- public function add_noreg_css_head()
3018
- {
3019
- if($this->is_noreg_linked())
3020
- {
3021
- $widget_css = get_option($this->get_option_name('css-content'));
3022
- if($widget_css)
3023
- {
3024
- echo '<style type="text/css">'. html_entity_decode(str_replace('&#039;', "'", esc_html($widget_css))) .'</style>';
3025
- }
3026
- }
3027
- }
3028
- public function add_noreg_css_head_admin()
3029
- {
3030
- $tmp = explode('/', $this->plugin_file_path);
3031
- $plugin_slug = preg_replace('/\.php$/', '', array_pop($tmp));
3032
- $page = sanitize_text_field(isset($_GET['page']) ? $_GET['page'] : "");
3033
- $current_slug = explode('/', $page)[0];
3034
- if($plugin_slug == $current_slug)
3035
- {
3036
- $widget_css = get_option($this->get_option_name('css-content'));
3037
- if($widget_css)
3038
- {
3039
- echo '<style type="text/css">'. html_entity_decode(str_replace('&#039;', "'", esc_html($widget_css))) .'</style>';
3040
- }
3041
- }
3042
- }
3043
-
3044
-
3045
- public function get_plugin_details( $plugin_slug = null )
3046
- {
3047
- if (!$plugin_slug)
3048
- {
3049
- $plugin_slug = $this->get_plugin_slug();
3050
- }
3051
- $plugin_return = false;
3052
- $wp_repo_plugins= '';
3053
- $wp_response= '';
3054
- $wp_version = get_bloginfo('version');
3055
- if ( $plugin_slug && $wp_version > 3.8 )
3056
- {
3057
- $args = array(
3058
- 'author' => 'Trustindex.io',
3059
- 'fields' => array(
3060
- 'downloaded'=> true,
3061
- 'active_installs'=> true,
3062
- 'ratings'=> true
3063
- )
3064
- );
3065
- $wp_response = wp_remote_post(
3066
- 'http://api.wordpress.org/plugins/info/1.0/',
3067
- array(
3068
- 'body' => array(
3069
- 'action'=> 'query_plugins',
3070
- 'request' => serialize( (object) $args )
3071
- )
3072
- )
3073
- );
3074
- if ( ! is_wp_error( $wp_response ) )
3075
- {
3076
- $wp_repo_response = unserialize( wp_remote_retrieve_body( $wp_response ) );
3077
- $wp_repo_plugins= $wp_repo_response->plugins;
3078
- }
3079
- if ( $wp_repo_plugins )
3080
- {
3081
- foreach ( $wp_repo_plugins as $plugin_details )
3082
- {
3083
- if ( $plugin_slug == $plugin_details->slug )
3084
- {
3085
- $plugin_return = $plugin_details;
3086
- }
3087
- }
3088
- }
3089
- }
3090
- return $plugin_return;
3091
- }
3092
- public function get_wp_details()
3093
- {
3094
- $data = [
3095
- 'domain' => $_SERVER['SERVER_NAME'],
3096
- 'current_theme' => [ 'slug' => get_template() ],
3097
- 'themes' => [],
3098
- 'plugins' => []
3099
- ];
3100
- if(function_exists('wp_get_theme'))
3101
- {
3102
- $theme = wp_get_theme();
3103
- }
3104
- else
3105
- {
3106
- $theme = get_theme(get_current_theme());
3107
- }
3108
- $data['current_theme']['name'] = $theme['Name'];
3109
- $data['current_theme']['author'] = strip_tags($theme['Author']);
3110
- $data['current_theme']['version'] = $theme['Version'];
3111
- if(function_exists('wp_get_themes'))
3112
- {
3113
- $themes = wp_get_themes();
3114
- }
3115
- else
3116
- {
3117
- $themes = get_themes();
3118
- }
3119
- if($themes)
3120
- {
3121
- foreach($themes as $slug => $theme)
3122
- {
3123
- $data['themes'][] = [
3124
- 'slug' => $theme['Template'],
3125
- 'name' => $theme['Name'],
3126
- 'author' => strip_tags($theme['Author']),
3127
- 'version' => $theme['Version']
3128
- ];
3129
- }
3130
- }
3131
- if(!function_exists('get_plugins'))
3132
- {
3133
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
3134
- }
3135
- $plugins = get_plugins();
3136
- if($plugins)
3137
- {
3138
- foreach($plugins as $slug => $plugin)
3139
- {
3140
- $data['plugins'][] = [
3141
- 'slug' => explode('/', $slug)[0],
3142
- 'name' => $plugin['Name'],
3143
- 'author' => strip_tags($plugin['Author']),
3144
- 'version' => $plugin['Version']
3145
- ];
3146
- }
3147
- }
3148
- return json_encode($data);
3149
- }
3150
-
3151
-
3152
- public function is_ten_scale_rating_platform()
3153
- {
3154
- return in_array($this->shortname, [ 'booking', 'hotels', 'foursquare', 'szallashu' ]);
3155
- }
3156
- public function formatTenRating($rating)
3157
- {
3158
- if($rating == 10)
3159
- {
3160
- $rating = '10';
3161
- }
3162
- if($this->shortname == "booking")
3163
- {
3164
- $rating = str_replace('.', ',', $rating);
3165
- }
3166
- return $rating;
3167
- }
3168
- public function register_block_editor()
3169
- {
3170
- if(!class_exists('WP_Block_Type_Registry'))
3171
- {
3172
- return;
3173
- }
3174
- if(!WP_Block_Type_Registry::get_instance()->is_registered('trustindex/block-selector'))
3175
- {
3176
- wp_register_script('trustindex-block-editor', $this->get_plugin_file_url('static/block-editor/block-editor.js'), [ 'wp-blocks', 'wp-editor' ], true);
3177
- register_block_type('trustindex/block-selector', [ 'editor_script' => 'trustindex-block-editor' ]);
3178
- }
3179
- }
3180
- function is_widget_setted_up() {
3181
- $result = [];
3182
- $active_plugins = get_option( 'active_plugins' );
3183
- $platforms = $this->get_platforms();
3184
- foreach ($this->get_plugin_slugs() as $index => $plugin_slug)
3185
- {
3186
- if (in_array($plugin_slug."/".$plugin_slug.".php", $active_plugins))
3187
- {
3188
- $active_plugin_slug = $plugin_slug;
3189
- $result[$platforms[$index]] = get_option("trustindex-".$platforms[$index]."-widget-setted-up", 0);
3190
- }
3191
- }
3192
- return array(
3193
- 'result' => $result,
3194
- 'setup_url' => admin_url('admin.php?page='.$active_plugin_slug.'/settings.php&tab=setup_trustindex_join')
3195
- );
3196
- }
3197
- function init_restapi() {
3198
- register_rest_route( 'trustindex/v1', '/get-widgets', array(
3199
- 'methods' => 'GET',
3200
- 'callback' => array($this, 'get_trustindex_widgets'),
3201
- 'permission_callback' => '__return_true'
3202
- ) );
3203
- register_rest_route( 'trustindex/v1', '/setup-complete', array(
3204
- 'methods' => 'GET',
3205
- 'callback' => array($this, 'is_widget_setted_up'),
3206
- 'permission_callback' => '__return_true'
3207
- ) );
3208
- }
3209
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/uninstall.php DELETED
@@ -1,5 +0,0 @@
1
- <?php
2
- require_once plugin_dir_path( __FILE__ ) . 'plugin-load.php';
3
- $trustindex_pm_google = new TrustindexPlugin("google", __FILE__, "7.8", "Widgets for Google Reviews", "Google");
4
- $trustindex_pm_google->uninstall();
5
- ?>
 
 
 
 
 
trunk/wp-reviews-plugin-for-google.php DELETED
@@ -1,152 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Widgets for Google Reviews
4
- Plugin Title: Widgets for Google Reviews Plugin
5
- Plugin URI: https://wordpress.org/plugins/wp-reviews-plugin-for-google/
6
- Description: Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google Business reviews.
7
- Tags: google, google places reviews, reviews, widget, google business, review, testimonial, testimonials, slider, rating, google my business, customer review
8
- Author: Trustindex.io <support@trustindex.io>
9
- Author URI: https://www.trustindex.io/
10
- Contributors: trustindex
11
- License: GPLv2 or later
12
- Version: 7.8
13
- Text Domain: wp-reviews-plugin-for-google
14
- Domain Path: /languages/
15
- Donate link: https://www.trustindex.io/prices/
16
- */
17
- /*
18
- Copyright 2019 Trustindex Kft (email: support@trustindex.io)
19
- */
20
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
21
- require(ABSPATH . 'wp-includes/version.php');
22
- $page_slug = isset($_GET['page']) ? explode('/', sanitize_text_field($_GET['page']))[0] : '';
23
- $tmp = explode('/', plugin_dir_path( __FILE__ ));
24
- $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.8", "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'));
32
- add_action('admin_menu', array($trustindex_pm_google, 'add_setting_menu'), 10);
33
- add_filter('plugin_action_links', array($trustindex_pm_google, 'add_plugin_action_links'), 10, 2);
34
- add_filter('plugin_row_meta', array($trustindex_pm_google, 'add_plugin_meta_links'), 10, 2);
35
- if(!function_exists('register_block_type'))
36
- {
37
- add_action('widgets_init', array($trustindex_pm_google, 'init_widget'));
38
- add_action('widgets_init', array($trustindex_pm_google, 'register_widget'));
39
- }
40
- $widget_css_google = get_option($trustindex_pm_google->get_option_name('css-content'));
41
- if($trustindex_pm_google->is_noreg_linked() && $widget_css_google)
42
- {
43
- add_action('wp_enqueue_scripts', function() {
44
- global $trustindex_pm_google;
45
- wp_register_style('ti-widget-css-google', admin_url('admin-ajax.php') .'?action=widget_css_google', [], null);
46
- wp_enqueue_script('trustindex-frontend-js-google', $trustindex_pm_google->get_plugin_file_url('static/js/frontend.js'), [ 'jquery' ], false, true );
47
- $data = [
48
- 'ajaxurl' => admin_url('admin-ajax.php'),
49
- 'action' => 'widget_css_google',
50
- 'selector' => '.ti-widget.ti-' . substr($trustindex_pm_google->shortname, 0, 4),
51
- 'link_selector' => '#ti-widget-css-google-css'
52
- ];
53
- if(get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1))
54
- {
55
- $data['security'] = wp_create_nonce('frontend-nonce-google');
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
- header("Content-type: text/css");
63
- global $trustindex_pm_google;
64
- global $widget_css_google;
65
- if($_SERVER['REQUEST_METHOD'] !== 'GET' && get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1))
66
- {
67
- check_ajax_referer('frontend-nonce-google', 'security');
68
- }
69
- echo $widget_css_google;
70
- exit;
71
- }
72
- }
73
- add_action('init', array($trustindex_pm_google, 'init_shortcode'));
74
- add_filter('script_loader_tag', function($tag, $handle) {
75
- if(strpos($tag, 'trustindex.io/loader.js') !== false && strpos($tag, 'defer async') === false) {
76
- $tag = str_replace(' src', ' defer async src', $tag );
77
- }
78
- return $tag;
79
- }, 10, 2);
80
- add_action('init', array($trustindex_pm_google, 'register_tinymce_features'));
81
- add_action('init', array($trustindex_pm_google, 'output_buffer'));
82
- add_action('wp_ajax_list_trustindex_widgets', array($trustindex_pm_google, 'list_trustindex_widgets_ajax'));
83
- add_action('admin_enqueue_scripts', array($trustindex_pm_google, 'trustindex_add_scripts'));
84
- add_action('rest_api_init', array($trustindex_pm_google, 'init_restapi'));
85
- add_action('admin_notices', function() {
86
- $rate_us = get_option('trustindex-google-rate-us', time() - 1);
87
- if($rate_us == 'hide' || (int)$rate_us > time())
88
- {
89
- return;
90
- }
91
- $dir = plugin_dir_path( __FILE__ );
92
- $usage_time = time() + 10;
93
- if(is_dir($dir))
94
- {
95
- $usage_time = filemtime($dir) + (1 * 86400);
96
- }
97
- if($usage_time > time())
98
- {
99
- return;
100
- }
101
- ?>
102
- <div class="notice notice-warning is-dismissible trustindex-popup" style="position: fixed; top: 50px; right: 20px; padding-right: 30px; z-index: 1">
103
- <p>
104
- <?php echo TrustindexPlugin::___("Hello, I am happy to see that you've been using our <strong>%s</strong> plugin for a while now!", ["Widgets for Google Reviews"]); ?><br>
105
- <?php echo TrustindexPlugin::___("Could you please help us and give it a 5-star rating on WordPress?"); ?><br><br>
106
- <?php echo TrustindexPlugin::___("-- Thanks, Gabor M."); ?>
107
- </p>
108
- <p>
109
- <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&rate_us=open"); ?>" class="trustindex-rateus" style="text-decoration: none" target="_blank">
110
- <button class="button button-primary"><?php echo TrustindexPlugin::___("Sure, you deserve it"); ?></button>
111
- </a>
112
- <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&rate_us=later"); ?>" class="trustindex-rateus" style="text-decoration: none">
113
- <button class="button button-secondary"><?php echo TrustindexPlugin::___("Maybe later"); ?></button>
114
- </a>
115
- <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&rate_us=hide"); ?>" class="trustindex-rateus" style="text-decoration: none">
116
- <button class="button button-secondary" style="float: right"><?php echo TrustindexPlugin::___("Do not remind me again"); ?></button>
117
- </a>
118
- </p>
119
- </div>
120
- <?php
121
- });
122
- if(class_exists('Woocommerce') && !class_exists('TrustindexWoocommercePlugin') && !function_exists('ti_woocommerce_notice'))
123
- {
124
- function ti_woocommerce_notice() {
125
- $rate_us = get_option('trustindex-wc-notification', time() - 1);
126
- if($rate_us == 'hide' || (int)$rate_us > time())
127
- {
128
- return;
129
- }
130
- ?>
131
- <div class="notice notice-warning is-dismissible" style="margin: 5px 0 15px">
132
- <p><strong><?php echo TrustindexPlugin::___("Download our new <a href='%s' target='_blank'>%s</a> plugin and get features for free!", [ 'https://wordpress.org/plugins/customer-reviews-for-woocommerce/', TrustindexPlugin::___('Customer Reviews for WooCommerce') ]); ?></strong></p>
133
- <ul style="list-style-type: disc; margin-left: 10px; padding-left: 15px">
134
- <li><?php echo TrustindexPlugin::___('set up Trustindex company profile and get high quality backlink'); ?></li>
135
- <li><?php echo TrustindexPlugin::___('set up review-collector campaigns to get new ratings / reviews / recommendations automatically'); ?></li>
136
- <li><?php echo TrustindexPlugin::___('show customer reviews in fancy widgets'); ?></li>
137
- </ul>
138
- <p>
139
- <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&wc_notification=open"); ?>" target="_blank" class="trustindex-rateus" style="text-decoration: none">
140
- <button class="button button-primary"><?php echo TrustindexPlugin::___("Download plugin"); ?></button>
141
- </a>
142
- <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&wc_notification=hide"); ?>" class="trustindex-rateus" style="text-decoration: none">
143
- <button class="button button-secondary"><?php echo TrustindexPlugin::___("Do not remind me again"); ?></button>
144
- </a>
145
- </p>
146
- </div>
147
- <?php
148
- }
149
- add_action('admin_notices', 'ti_woocommerce_notice');
150
- }
151
- add_action('plugins_loaded', array($trustindex_pm_google, 'plugin_loaded'));
152
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trustindex-google-widget.class.php CHANGED
@@ -50,7 +50,7 @@ else
50
  echo TrustindexPlugin::get_alertbox(
51
  "error",
52
  " in <strong>".TrustindexPlugin::___('Widgets for Google Reviews')."</strong> plugin<br /><br />"
53
- .TrustindexPlugin::___('Please fill out <strong>all the required fields</strong> in the <a href="%s">widget settings</a> page', [admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php')]),
54
  false
55
  );
56
  }
50
  echo TrustindexPlugin::get_alertbox(
51
  "error",
52
  " in <strong>".TrustindexPlugin::___('Widgets for Google Reviews')."</strong> plugin<br /><br />"
53
+ .TrustindexPlugin::___("Please fill out <strong>all the required fields</strong> in the <a href='%s'>widget settings</a> page", [admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php')]),
54
  false
55
  );
56
  }
trustindex-plugin.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- /* GENERATED: 1641596010 */
3
  class TrustindexPlugin
4
  {
5
  private $plugin_file_path;
@@ -73,6 +73,10 @@ delete_option($this->get_option_name($opt_name));
73
  global $wpdb;
74
  $dbtable = $this->get_noreg_tablename();
75
  $wpdb->query( "DROP TABLE IF EXISTS $dbtable" );
 
 
 
 
76
  }
77
 
78
 
@@ -242,8 +246,7 @@ return [
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,13 +376,13 @@ $chosed_platform_slug = $this->plugin_slugs[ $force_platform ];
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.8", "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(
380
  "error",
381
- " @ <strong>Trustindex plugin</strong><br /><br />"
382
- .TrustindexPlugin::___('You have to connect your business (%s)!', [$force_platform]),
383
  false
384
  );
385
  }
@@ -392,8 +395,8 @@ else
392
  {
393
  return self::get_alertbox(
394
  "error",
395
- " @ <strong>Trustindex plugin</strong><br /><br />"
396
- .TrustindexPlugin::___('Your shortcode is deficient: Trustindex Widget ID is empty! Example: ') . '<br /><code>['.$this->get_shortcode_name().' data-widget-id="478dcc2136263f2b3a3726ff"]</code>',
397
  false
398
  );
399
  }
@@ -469,8 +472,9 @@ if($style_id == 17 || $style_id == 21)
469
  $server_output['css'] .= '.ti-preview-box { position: initial !important }';
470
  }
471
  update_option($this->get_option_name('css-content'), $server_output['css'], false);
 
472
  }
473
- return $content;
474
  }
475
  public function plugin_loaded()
476
  {
@@ -496,6 +500,7 @@ delete_option( $this->get_option_name('review-content') );
496
  $this->noreg_save_css(true);
497
  }
498
  }
 
499
  $this->loadI18N();
500
  if ( !class_exists('TrustindexGutenbergPlugin') && function_exists( 'register_block_type' ) )
501
  {
@@ -503,13 +508,47 @@ require_once dirname( __FILE__ ) . '/static/block-editor/block-editor.php';
503
  TrustindexGutenbergPlugin::instance();
504
  }
505
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
506
  public static $widget_templates = array (
507
  'categories' =>
508
  array (
509
- 'slider' => '4,5,13,15,19,34',
510
  'sidebar' => '6,7,8,9,10,18',
511
  'list' => '33',
512
- 'grid' => '16,31',
513
  'badge' => '11,12,20,22,23',
514
  'button' => '24,25,26,27,28,29,30,32,35',
515
  'floating' => '17,21',
@@ -522,11 +561,21 @@ public static $widget_templates = array (
522
  'name' => 'Slider I.',
523
  'type' => 'slider',
524
  ),
 
 
 
 
 
525
  15 =>
526
  array (
527
  'name' => 'Slider II.',
528
  'type' => 'slider',
529
  ),
 
 
 
 
 
530
  5 =>
531
  array (
532
  'name' => 'Slider III. - with badge',
@@ -547,6 +596,16 @@ public static $widget_templates = array (
547
  'name' => 'Slider IV.',
548
  'type' => 'slider',
549
  ),
 
 
 
 
 
 
 
 
 
 
550
  33 =>
551
  array (
552
  'name' => 'List I.',
@@ -557,6 +616,11 @@ public static $widget_templates = array (
557
  'name' => 'Grid',
558
  'type' => 'grid',
559
  ),
 
 
 
 
 
560
  31 =>
561
  array (
562
  'name' => 'Mansonry grid',
@@ -2304,7 +2368,11 @@ $sql .= " LIMIT 10";
2304
  break;
2305
  }
2306
  }
 
 
 
2307
  $reviews = $wpdb->get_results($sql);
 
2308
  if(!count($reviews) && $default_reviews)
2309
  {
2310
  $lang = substr(get_locale(), 0, 2);
@@ -2334,6 +2402,14 @@ else
2334
  {
2335
  $page_details['rating_score'] = rand(4, 5);
2336
  }
 
 
 
 
 
 
 
 
2337
  $reviews = $this->getRandomReviews($rating_num);
2338
  }
2339
  if(!count($reviews))
@@ -2431,15 +2507,19 @@ if($class_appends)
2431
  $content = str_replace('class="ti-widget" data-layout-id=', 'class="ti-widget '. implode(' ', $class_appends) .'" data-layout-id=', $content);
2432
  if(!wp_style_is('ti-widget-css-' . $this->shortname, 'registered'))
2433
  {
 
 
 
 
 
 
 
 
2434
  $content .= '<style type="text/css">'. $widget_css .'</style>';
2435
  }
2436
  else
2437
  {
2438
  wp_enqueue_style('ti-widget-css-' . $this->shortname);
2439
- if(in_array($free_css_class, $class_appends) && wp_script_is('trustindex-frontend-js-' . $this->shortname, 'enqueued'))
2440
- {
2441
- $content = str_replace(' class="ti-widget ', ' style="display: none" class="ti-widget ', $content);
2442
- }
2443
  }
2444
  }
2445
  return $content;
1
  <?php
2
+ /* GENERATED: 1642502219 */
3
  class TrustindexPlugin
4
  {
5
  private $plugin_file_path;
73
  global $wpdb;
74
  $dbtable = $this->get_noreg_tablename();
75
  $wpdb->query( "DROP TABLE IF EXISTS $dbtable" );
76
+ if(is_file($this->getCssFile()))
77
+ {
78
+ unlink($this->getCssFile());
79
+ }
80
  }
81
 
82
 
246
  'disable-font',
247
  'show-logos',
248
  'show-stars',
249
+ 'load-css-inline'
 
250
  ];
251
  }
252
  public function get_platforms()
376
  $current_platform_slug = $this->plugin_slugs[ $this->shortname ];
377
  $file_path = preg_replace('/\/[^\/]+\/trustindex-plugin\.class\.php/', "/$chosed_platform_slug/trustindex-plugin.class.php", $file_path);
378
  }
379
+ $chosed_platform = new TrustindexPlugin($force_platform, $file_path, "do-not-care-7.9", "do-not-care-Widgets for Google Reviews", "do-not-care-Google");
380
  if(!$chosed_platform->is_noreg_linked() || !$chosed_platform->is_noreg_table_exists($force_platform))
381
  {
382
  return self::get_alertbox(
383
  "error",
384
+ " @ <strong>". self::___('Trustindex plugin') ."</strong><br /><br />"
385
+ .self::___('You have to connect your business (%s)!', [$force_platform]),
386
  false
387
  );
388
  }
395
  {
396
  return self::get_alertbox(
397
  "error",
398
+ " @ <strong>". self::___('Trustindex plugin') ."</strong><br /><br />"
399
+ .self::___('Your shortcode is deficient: Trustindex Widget ID is empty! Example: ') . '<br /><code>['.$this->get_shortcode_name().' data-widget-id="478dcc2136263f2b3a3726ff"]</code>',
400
  false
401
  );
402
  }
472
  $server_output['css'] .= '.ti-preview-box { position: initial !important }';
473
  }
474
  update_option($this->get_option_name('css-content'), $server_output['css'], false);
475
+ $this->handleCssFile(true);
476
  }
477
+ return $server_output;
478
  }
479
  public function plugin_loaded()
480
  {
500
  $this->noreg_save_css(true);
501
  }
502
  }
503
+ $this->handleCssFile();
504
  $this->loadI18N();
505
  if ( !class_exists('TrustindexGutenbergPlugin') && function_exists( 'register_block_type' ) )
506
  {
508
  TrustindexGutenbergPlugin::instance();
509
  }
510
  }
511
+ public function getCssFile($return_only_file = false)
512
+ {
513
+ $file = 'trustindex-'. $this->shortname .'-widget.css';
514
+ if($return_only_file)
515
+ {
516
+ return $file;
517
+ }
518
+ $upload_dir = wp_upload_dir();
519
+ return trailingslashit($upload_dir['basedir']) . $file;
520
+ }
521
+ public function handleCssFile($force_save = false)
522
+ {
523
+ $css = get_option($this->get_option_name('css-content'));
524
+ $css_inline = get_option($this->get_option_name('load-css-inline'), 0);
525
+ if($css && !$css_inline)
526
+ {
527
+ if(is_file($this->getCssFile()) && !$force_save)
528
+ {
529
+ return;
530
+ }
531
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
532
+ global $wp_filesystem;
533
+ WP_Filesystem();
534
+ $success = $wp_filesystem->put_contents($this->getCssFile(), $css, 0644);
535
+ if(!$success)
536
+ {
537
+ add_action('admin_notices', function() {
538
+ echo '<div class="notice notice-error" style="margin: 5px 0 15px">
539
+ <p>'. self::___("Trustindex can not save CSS to <strong>%s</strong>.<br />Grant write permissions to upload folder or enable CSS internal loading in the <a href='%s'>Troubleshooting</a> page otherwise your widgets will not appear!", [ $this->getCssFile(), admin_url('admin.php?page=' . $this->get_plugin_slug() . '/settings.php&tab=troubleshooting') ]) .'</p>
540
+ </div>';
541
+ });
542
+ }
543
+ }
544
+ }
545
  public static $widget_templates = array (
546
  'categories' =>
547
  array (
548
+ 'slider' => '4,5,13,15,19,34,36,37,39,44,45,46,47',
549
  'sidebar' => '6,7,8,9,10,18',
550
  'list' => '33',
551
+ 'grid' => '16,31,38,48',
552
  'badge' => '11,12,20,22,23',
553
  'button' => '24,25,26,27,28,29,30,32,35',
554
  'floating' => '17,21',
561
  'name' => 'Slider I.',
562
  'type' => 'slider',
563
  ),
564
+ 36 =>
565
+ array (
566
+ 'name' => 'Slider I. - centered',
567
+ 'type' => 'slider',
568
+ ),
569
  15 =>
570
  array (
571
  'name' => 'Slider II.',
572
  'type' => 'slider',
573
  ),
574
+ 39 =>
575
+ array (
576
+ 'name' => 'Slider II. - centered',
577
+ 'type' => 'slider',
578
+ ),
579
  5 =>
580
  array (
581
  'name' => 'Slider III. - with badge',
596
  'name' => 'Slider IV.',
597
  'type' => 'slider',
598
  ),
599
+ 37 =>
600
+ array (
601
+ 'name' => 'Slider V.',
602
+ 'type' => 'slider',
603
+ ),
604
+ 44 =>
605
+ array (
606
+ 'name' => 'Slider VI.',
607
+ 'type' => 'slider',
608
+ ),
609
  33 =>
610
  array (
611
  'name' => 'List I.',
616
  'name' => 'Grid',
617
  'type' => 'grid',
618
  ),
619
+ 38 =>
620
+ array (
621
+ 'name' => 'Grid II.',
622
+ 'type' => 'grid',
623
+ ),
624
  31 =>
625
  array (
626
  'name' => 'Mansonry grid',
2368
  break;
2369
  }
2370
  }
2371
+ $reviews = [];
2372
+ if($this->is_noreg_table_exists())
2373
+ {
2374
  $reviews = $wpdb->get_results($sql);
2375
+ }
2376
  if(!count($reviews) && $default_reviews)
2377
  {
2378
  $lang = substr(get_locale(), 0, 2);
2402
  {
2403
  $page_details['rating_score'] = rand(4, 5);
2404
  }
2405
+ if(!isset($page_details['id']))
2406
+ {
2407
+ $page_details['id'] = '';
2408
+ }
2409
+ if(!isset($page_details['name']))
2410
+ {
2411
+ $page_details['name'] = get_bloginfo('name');
2412
+ }
2413
  $reviews = $this->getRandomReviews($rating_num);
2414
  }
2415
  if(!count($reviews))
2507
  $content = str_replace('class="ti-widget" data-layout-id=', 'class="ti-widget '. implode(' ', $class_appends) .'" data-layout-id=', $content);
2508
  if(!wp_style_is('ti-widget-css-' . $this->shortname, 'registered'))
2509
  {
2510
+ if(!get_option($this->get_option_name('load-css-inline'), 0))
2511
+ {
2512
+ return self::get_alertbox(
2513
+ "error",
2514
+ '<br />' . self::___('CSS file could not saved.'),
2515
+ false
2516
+ );
2517
+ }
2518
  $content .= '<style type="text/css">'. $widget_css .'</style>';
2519
  }
2520
  else
2521
  {
2522
  wp_enqueue_style('ti-widget-css-' . $this->shortname);
 
 
 
 
2523
  }
2524
  }
2525
  return $content;
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.8", "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.9", "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.8
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.8", "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'));
@@ -37,38 +37,9 @@ if(!function_exists('register_block_type'))
37
  add_action('widgets_init', array($trustindex_pm_google, 'init_widget'));
38
  add_action('widgets_init', array($trustindex_pm_google, 'register_widget'));
39
  }
40
- $widget_css_google = get_option($trustindex_pm_google->get_option_name('css-content'));
41
- if($trustindex_pm_google->is_noreg_linked() && $widget_css_google)
42
  {
43
- add_action('wp_enqueue_scripts', function() {
44
- global $trustindex_pm_google;
45
- wp_register_style('ti-widget-css-google', admin_url('admin-ajax.php') .'?action=widget_css_google', [], null);
46
- wp_enqueue_script('trustindex-frontend-js-google', $trustindex_pm_google->get_plugin_file_url('static/js/frontend.js'), [ 'jquery' ], false, true );
47
- $data = [
48
- 'ajaxurl' => admin_url('admin-ajax.php'),
49
- 'action' => 'widget_css_google',
50
- 'selector' => '.ti-widget.ti-' . substr($trustindex_pm_google->shortname, 0, 4),
51
- 'link_selector' => '#ti-widget-css-google-css'
52
- ];
53
- if(get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1))
54
- {
55
- $data['security'] = wp_create_nonce('frontend-nonce-google');
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
- header("Content-type: text/css");
63
- global $trustindex_pm_google;
64
- global $widget_css_google;
65
- if($_SERVER['REQUEST_METHOD'] !== 'GET' && get_option($trustindex_pm_google->get_option_name('widget-nonce'), 1))
66
- {
67
- check_ajax_referer('frontend-nonce-google', 'security');
68
- }
69
- echo $widget_css_google;
70
- exit;
71
- }
72
  }
73
  add_action('init', array($trustindex_pm_google, 'init_shortcode'));
74
  add_filter('script_loader_tag', function($tag, $handle) {
9
  Author URI: https://www.trustindex.io/
10
  Contributors: trustindex
11
  License: GPLv2 or later
12
+ Version: 7.9
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.9", "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'));
37
  add_action('widgets_init', array($trustindex_pm_google, 'init_widget'));
38
  add_action('widgets_init', array($trustindex_pm_google, 'register_widget'));
39
  }
40
+ if(is_file($trustindex_pm_google->getCssFile()))
 
41
  {
42
+ wp_register_style('ti-widget-css-google', content_url() .'/uploads/'. $trustindex_pm_google->getCssFile(true), [], null);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  }
44
  add_action('init', array($trustindex_pm_google, 'init_shortcode'));
45
  add_filter('script_loader_tag', function($tag, $handle) {