Widgets for Google Reviews - Version 9.3

Version Description

Download this release

Release Info

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

Code changes from version 9.2 to 9.3

Files changed (95) hide show
  1. include/activate.php +41 -0
  2. include/schema.php +16 -0
  3. include/uninstall.php +12 -0
  4. languages/trustindex-af.mo +0 -0
  5. languages/trustindex-ar.mo +0 -0
  6. languages/trustindex-ary.mo +0 -0
  7. languages/trustindex-az.mo +0 -0
  8. languages/trustindex-azb.mo +0 -0
  9. languages/trustindex-bg_BG.mo +0 -0
  10. languages/trustindex-bn_BD.mo +0 -0
  11. languages/trustindex-bs_BA.mo +0 -0
  12. languages/trustindex-cs_CZ.mo +0 -0
  13. languages/trustindex-cy.mo +0 -0
  14. languages/trustindex-da_DK.mo +0 -0
  15. languages/trustindex-de_AT.mo +0 -0
  16. languages/trustindex-de_CH.mo +0 -0
  17. languages/trustindex-de_CH_informal.mo +0 -0
  18. languages/trustindex-de_DE.mo +0 -0
  19. languages/trustindex-de_DE_formal.mo +0 -0
  20. languages/trustindex-el.mo +0 -0
  21. languages/trustindex-es_AR.mo +0 -0
  22. languages/trustindex-es_CL.mo +0 -0
  23. languages/trustindex-es_CO.mo +0 -0
  24. languages/trustindex-es_CR.mo +0 -0
  25. languages/trustindex-es_ES.mo +0 -0
  26. languages/trustindex-es_GT.mo +0 -0
  27. languages/trustindex-es_MX.mo +0 -0
  28. languages/trustindex-es_PE.mo +0 -0
  29. languages/trustindex-es_PR.mo +0 -0
  30. languages/trustindex-es_UY.mo +0 -0
  31. languages/trustindex-es_VE.mo +0 -0
  32. languages/trustindex-et.mo +0 -0
  33. languages/trustindex-fa_AF.mo +0 -0
  34. languages/trustindex-fa_IR.mo +0 -0
  35. languages/trustindex-fi.mo +0 -0
  36. languages/trustindex-fr_BR.mo +0 -0
  37. languages/trustindex-fr_CA.mo +0 -0
  38. languages/trustindex-fr_FR.mo +0 -0
  39. languages/trustindex-gd.mo +0 -0
  40. languages/trustindex-gl_ES.mo +0 -0
  41. languages/trustindex-he_IL.mo +0 -0
  42. languages/trustindex-hi_IN.mo +0 -0
  43. languages/trustindex-hr.mo +0 -0
  44. languages/trustindex-hu_HU.mo +0 -0
  45. languages/trustindex-hy.mo +0 -0
  46. languages/trustindex-id_ID.mo +0 -0
  47. languages/trustindex-is_IS.mo +0 -0
  48. languages/trustindex-it_IT.mo +0 -0
  49. languages/trustindex-ja.mo +0 -0
  50. languages/trustindex-ka_GE.mo +0 -0
  51. languages/trustindex-kk.mo +0 -0
  52. languages/trustindex-ko_KR.mo +0 -0
  53. languages/trustindex-lt_LT.mo +0 -0
  54. languages/trustindex-mk_MK.mo +0 -0
  55. languages/trustindex-ms_MY.mo +0 -0
  56. languages/trustindex-nb_NO.mo +0 -0
  57. languages/trustindex-nl_BE.mo +0 -0
  58. languages/trustindex-nl_NL.mo +0 -0
  59. languages/trustindex-nl_NL_formal.mo +0 -0
  60. languages/trustindex-nn_NO.mo +0 -0
  61. languages/trustindex-pl_PL.mo +0 -0
  62. languages/trustindex-pt_AO.mo +0 -0
  63. languages/trustindex-pt_BR.mo +0 -0
  64. languages/trustindex-pt_PT.mo +0 -0
  65. languages/trustindex-pt_PT_ao90.mo +0 -0
  66. languages/trustindex-ro_RO.mo +0 -0
  67. languages/trustindex-ru_RU.mo +0 -0
  68. languages/trustindex-sk_SK.mo +0 -0
  69. languages/trustindex-sl_SI.mo +0 -0
  70. languages/trustindex-sq.mo +0 -0
  71. languages/trustindex-sr_RS.mo +0 -0
  72. languages/trustindex-sv_SE.mo +0 -0
  73. languages/trustindex-th.mo +0 -0
  74. languages/trustindex-tr_TR.mo +0 -0
  75. languages/trustindex-uk.mo +0 -0
  76. languages/trustindex-vi.mo +0 -0
  77. languages/trustindex-zh_CN.mo +0 -0
  78. languages/trustindex-zh_HK.mo +0 -0
  79. languages/trustindex-zh_TW.mo +0 -0
  80. readme.txt +2 -2
  81. static/css/admin-page-settings.css +1 -1
  82. static/js/admin-editor.js +117 -1
  83. static/js/admin-page-settings-common.js +728 -1
  84. static/js/admin-page-settings-connect.js +296 -1
  85. static/js/admin-page-settings.js +52 -1
  86. static/js/admin-popup.js +31 -1
  87. static/js/admin-widget.js +62 -1
  88. tabs/my_reviews.php +9 -6
  89. tabs/setup_no_reg.php +59 -4
  90. tabs/setup_no_reg_header.php +28 -43
  91. tabs/troubleshooting.php +3 -3
  92. trustindex-google-widget.class.php +1 -1
  93. trustindex-plugin.class.php +67 -63
  94. uninstall.php +1 -1
  95. wp-reviews-plugin-for-google.php +17 -12
include/activate.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ require_once(ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'upgrade.php');
3
+ global $wpdb;
4
+ $wpdb->hide_errors();
5
+ include $this->get_plugin_dir() . 'include' . DIRECTORY_SEPARATOR . 'schema.php';
6
+ $not_created_tables = [];
7
+ $mysql_error = "";
8
+ foreach(array_keys($ti_db_schema) as $table_name)
9
+ {
10
+ if(!$this->is_table_exists($table_name))
11
+ {
12
+ dbDelta($ti_db_schema[ $table_name ]);
13
+ }
14
+ if($wpdb->last_error)
15
+ {
16
+ $mysql_error = $wpdb->last_error;
17
+ }
18
+ if(!$this->is_table_exists($table_name))
19
+ {
20
+ $not_created_tables []= $table_name;
21
+ }
22
+ }
23
+ if($not_created_tables)
24
+ {
25
+ deactivate_plugins(plugin_basename($this->plugin_file_path));
26
+ $sqls_to_run = array_map(function($table_name) use($ti_db_schema) {
27
+ return trim($ti_db_schema[ $table_name ]);
28
+ }, $not_created_tables);
29
+ $pre_style = 'background: #eee; padding: 10px 20px; word-wrap: break-word; white-space: pre-wrap';
30
+ wp_die(
31
+ '<strong>' . self::___('Plugin activation is failed because the required MySQL tables could not created!') . '</strong><br /><br />' .
32
+ self::___('We got the following error from %s:', [ 'MySQL' ]) .
33
+ '<pre style="'. $pre_style .'">'. $mysql_error .'</pre>' .
34
+ '<strong>' . self::___('Run the following SQL codes in your MySQL administration interface (e.g. PhpMyAdmin) to create the tables or contact your system administrator:') . '</strong>' .
35
+ '<pre style="'. $pre_style .'">' . implode('</pre><pre style="'. $pre_style .'">', $sqls_to_run) . '</pre>' .
36
+ '<strong>' . self::___('Then try activate the plugin again.') . '</strong>'
37
+ );
38
+ }
39
+ update_option($this->get_option_name('active'), '1');
40
+ update_option($this->get_option_name('version'), $this->version);
41
+ ?>
include/schema.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $ti_db_schema = [
3
+ 'reviews' => "
4
+ CREATE TABLE ". $this->get_tablename('reviews') ." (
5
+ `id` TINYINT(1) NOT NULL AUTO_INCREMENT,
6
+ `user` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci,
7
+ `user_photo` TEXT,
8
+ `text` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
9
+ `rating` DECIMAL(3,1),
10
+ `highlight` VARCHAR(11),
11
+ `date` DATE,
12
+ PRIMARY KEY (`id`)
13
+ )
14
+ "
15
+ ];
16
+ ?>
include/uninstall.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ foreach($this->get_option_names() as $opt_name)
3
+ {
4
+ delete_option($this->get_option_name($opt_name));
5
+ }
6
+ global $wpdb;
7
+ include $this->get_plugin_dir() . 'include' . DIRECTORY_SEPARATOR . 'schema.php';
8
+ foreach(array_keys($ti_db_schema) as $table_name)
9
+ {
10
+ $wpdb->query('DROP TABLE IF EXISTS `'. $this->get_tablename($table_name) .'`');
11
+ }
12
+ ?>
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-ka_GE.mo CHANGED
Binary file
languages/trustindex-kk.mo CHANGED
Binary file
languages/trustindex-ko_KR.mo CHANGED
Binary file
languages/trustindex-lt_LT.mo CHANGED
Binary file
languages/trustindex-mk_MK.mo CHANGED
Binary file
languages/trustindex-ms_MY.mo CHANGED
Binary file
languages/trustindex-nb_NO.mo CHANGED
Binary file
languages/trustindex-nl_BE.mo CHANGED
Binary file
languages/trustindex-nl_NL.mo CHANGED
Binary file
languages/trustindex-nl_NL_formal.mo CHANGED
Binary file
languages/trustindex-nn_NO.mo CHANGED
Binary file
languages/trustindex-pl_PL.mo CHANGED
Binary file
languages/trustindex-pt_AO.mo CHANGED
Binary file
languages/trustindex-pt_BR.mo CHANGED
Binary file
languages/trustindex-pt_PT.mo CHANGED
Binary file
languages/trustindex-pt_PT_ao90.mo CHANGED
Binary file
languages/trustindex-ro_RO.mo CHANGED
Binary file
languages/trustindex-ru_RU.mo CHANGED
Binary file
languages/trustindex-sk_SK.mo CHANGED
Binary file
languages/trustindex-sl_SI.mo CHANGED
Binary file
languages/trustindex-sq.mo CHANGED
Binary file
languages/trustindex-sr_RS.mo CHANGED
Binary file
languages/trustindex-sv_SE.mo CHANGED
Binary file
languages/trustindex-th.mo CHANGED
Binary file
languages/trustindex-tr_TR.mo CHANGED
Binary file
languages/trustindex-uk.mo CHANGED
Binary file
languages/trustindex-vi.mo CHANGED
Binary file
languages/trustindex-zh_CN.mo CHANGED
Binary file
languages/trustindex-zh_HK.mo CHANGED
Binary file
languages/trustindex-zh_TW.mo CHANGED
Binary file
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: google, google places reviews, reviews, widget, google business, review, t
5
  Requires at least: 3.0.1
6
  Tested up to: 6.0
7
  Requires PHP: 5.2
8
- Stable tag: 9.2
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  Plugin Name: Widgets for Google Reviews
@@ -14,7 +14,7 @@ Plugin URI: https://wordpress.org/plugins/wp-reviews-plugin-for-google/
14
  Author: Trustindex.io <support@trustindex.io>
15
  Author URI: https://www.trustindex.io/
16
  Text Domain: wp-reviews-plugin-for-google
17
- Version: 9.2
18
 
19
  Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.
20
 
5
  Requires at least: 3.0.1
6
  Tested up to: 6.0
7
  Requires PHP: 5.2
8
+ Stable tag: 9.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  Plugin Name: Widgets for Google Reviews
14
  Author: Trustindex.io <support@trustindex.io>
15
  Author URI: https://www.trustindex.io/
16
  Text Domain: wp-reviews-plugin-for-google
17
+ Version: 9.3
18
 
19
  Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.
20
 
static/css/admin-page-settings.css CHANGED
@@ -1 +1 @@
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 .ti-widget strong{color:inherit}#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 .ti-tooltip#review-manual-download.btn-disabled{pointer-events:none !important}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download .ti-tooltip-message{right:initial;margin-right:0;margin-left:25px;left:100%;top:3px}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download .ti-tooltip-message:before{right:initial;left:-5px;border-width:5px 5px 5px 0;border-color:transparent #3B404B transparent transparent}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download:hover .ti-tooltip-message{opacity:0;margin-right:initial}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download.show-tooltip .ti-tooltip-message{opacity:1 !important;margin-left: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{margin-right:100%}#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;min-width:55%}#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-free-subtitle{font-size:18px !important;font-weight:bold !important;padding:0 15px;margin-bottom:15px !important;margin-top:45px !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;width:30px;height:30px;margin-right:10px;margin-top:4px;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 .ti-source-info a:only-child{display:block;margin:10px 0}#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 !important;margin:15px 0 !important;padding-left:30px !important}#trustindex-plugin-settings-page .troubleshooting-checklist ul li:last-child{margin-bottom:0}#trustindex-plugin-settings-page .troubleshooting-checklist .ti-notice{margin:5px 15px 2px !important;margin-left:0 !important;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}#ti-loading{position:fixed;background:rgba(240, 240, 241, 0.9);left:0;top:0;width:100%;height:100%;display:none;opacity:0;transition:opacity 0.4s}#ti-loading.active{display:block;opacity:1}#ti-loading .ti-loading-effect{display:inline-block;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);width:80px;height:80px}#ti-loading .ti-loading-effect div{display:inline-block;position:absolute;left:8px;width:16px;background:#000;animation:ti-loading-effect 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite}#ti-loading .ti-loading-effect div:nth-child(1){left:8px;animation-delay:-0.24s}#ti-loading .ti-loading-effect div:nth-child(2){left:32px;animation-delay:-0.12s}#ti-loading .ti-loading-effect div:nth-child(3){left:56px;animation-delay:0}@keyframes ti-loading-effect{0%{top:8px;height:64px}50%,100%{top:24px;height:32px}}
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 .ti-widget strong{color:inherit}#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 .ti-tooltip#review-manual-download.btn-disabled{pointer-events:none !important}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download .ti-tooltip-message{right:initial;margin-right:0;margin-left:25px;left:100%;top:3px}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download .ti-tooltip-message:before{right:initial;left:-5px;border-width:5px 5px 5px 0;border-color:transparent #3B404B transparent transparent}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download:hover .ti-tooltip-message{opacity:0;margin-right:initial}#trustindex-plugin-settings-page .ti-tooltip#review-manual-download.show-tooltip .ti-tooltip-message{opacity:1 !important;margin-left: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;transition:all 0.2s}#trustindex-plugin-settings-page .form-control.has-error{border-color:red}#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{margin-right:100%}#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:"›";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:"‹"}#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;min-width:55%}#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:"✓";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-free-subtitle{font-size:18px !important;font-weight:bold !important;padding:0 15px;margin-bottom:15px !important;margin-top:45px !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;width:30px;height:30px;margin-right:10px;margin-top:4px;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 .ti-source-info a:only-child{display:block;margin:10px 0}#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:" · "}#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 !important;margin:15px 0 !important;padding-left:30px !important}#trustindex-plugin-settings-page .troubleshooting-checklist ul li:last-child{margin-bottom:0}#trustindex-plugin-settings-page .troubleshooting-checklist .ti-notice{margin:5px 15px 2px !important;margin-left:0 !important;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}#trustindex-plugin-settings-page .ti-quick-rating{display:inline-block}#trustindex-plugin-settings-page .ti-quick-rating .ti-star-check{display:inline-block;float:right;width:34px;height:34px;margin-left:2px;cursor:pointer;transition:all 0.2s;background-color:#ccc;-webkit-mask:url("https://cdn.trustindex.io/assets/platform/Trustindex/star/f.svg") no-repeat 50% 50%;mask:url("https://cdn.trustindex.io/assets/platform/Trustindex/star/f.svg") no-repeat 50% 50%}#trustindex-plugin-settings-page .ti-quick-rating .ti-star-check:last-of-type{margin-left:0}#trustindex-plugin-settings-page .ti-quick-rating .ti-star-check:hover,#trustindex-plugin-settings-page .ti-quick-rating .ti-star-check:hover~.ti-star-check,#trustindex-plugin-settings-page .ti-quick-rating .ti-star-check.active,#trustindex-plugin-settings-page .ti-quick-rating .ti-star-check.active~.ti-star-check{background-color:#F6BB06}#trustindex-plugin-settings-page .ti-rate-us-box{position:relative}#trustindex-plugin-settings-page .ti-rate-us-box .ti-header{border:0;margin-bottom:5px;padding:0;font-weight:700}#trustindex-plugin-settings-page .ti-rate-us-box p{margin:0;font-size:14px}#trustindex-plugin-settings-page .ti-rate-us-box .ti-quick-rating{position:absolute;right:25px;top:50%;transform:translateY(-50%)}#trustindex-plugin-settings-page .ti-rateus-modal .ti-modal-dialog{margin:0 auto;top:50%;transform:translateY(-50%)}#trustindex-plugin-settings-page .ti-rateus-modal .ti-modal-body{text-align:center;padding:25px;padding-bottom:15px}#trustindex-plugin-settings-page .ti-rateus-modal .ti-close-icon{position:absolute;top:20px;right:20px;width:28px;height:28px;opacity:0.5;transition:opacity 0.4s;cursor:pointer;z-index:1}#trustindex-plugin-settings-page .ti-rateus-modal .ti-close-icon:before,#trustindex-plugin-settings-page .ti-rateus-modal .ti-close-icon:after{position:absolute;left:50%;content:" ";height:100%;width:2px;background-color:#666;transform:rotate(45deg)}#trustindex-plugin-settings-page .ti-rateus-modal .ti-close-icon:after{transform:rotate(-45deg)}#trustindex-plugin-settings-page .ti-rateus-modal .ti-close-icon:hover{opacity:1}#trustindex-plugin-settings-page .ti-rateus-modal .ti-rateus-logo{margin-top:15px;width:50px}#trustindex-plugin-settings-page .ti-rateus-modal .ti-rateus-title{margin-top:15px;margin-bottom:35px;font-size:26px;font-weight:bold;line-height:34px}#trustindex-plugin-settings-page .ti-rateus-modal .ti-modal-footer{border:0;justify-content:center;padding:25px;padding-top:0}#trustindex-plugin-settings-page .ti-rateus-modal textarea{resize:none;height:150px;margin-top:15px}#trustindex-plugin-settings-page .ti-rateus-modal .btn-text.btn-modal-close{background-color:#dbdde5;border-color:#dbdde5;color:#3B404B}#trustindex-plugin-settings-page .ti-rateus-modal .btn-text.btn-modal-close:hover{background-color:#bdc1d0 !important;border-color:#bdc1d0 !important}#trustindex-plugin-settings-page .ti-rateus-modal .ti-rating-textbox{display:inline-block;border-radius:4px;box-shadow:0px 4px 30px rgba(0, 0, 0, 0.15);padding:10px 20px;margin-bottom:10px;margin-top:15px;position:relative}#trustindex-plugin-settings-page .ti-rateus-modal .ti-rating-textbox:after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);width:0;height:0;border:10px solid transparent;border-bottom-width:0;border-top-color:#fff}#trustindex-plugin-settings-page .ti-rateus-modal .ti-rating-textbox .ti-quick-rating{pointer-events:none}#trustindex-plugin-settings-page .ti-rateus-modal p{margin-top:-20px;margin-bottom:5px;font-size:18px}#ti-loading{position:fixed;background:rgba(240, 240, 241, 0.9);left:0;top:0;width:100%;height:100%;display:none;opacity:0;transition:opacity 0.4s}#ti-loading.active{display:block;opacity:1}#ti-loading .ti-loading-effect{display:inline-block;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);width:80px;height:80px}#ti-loading .ti-loading-effect div{display:inline-block;position:absolute;left:8px;width:16px;background:#000;animation:ti-loading-effect 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite}#ti-loading .ti-loading-effect div:nth-child(1){left:8px;animation-delay:-0.24s}#ti-loading .ti-loading-effect div:nth-child(2){left:32px;animation-delay:-0.12s}#ti-loading .ti-loading-effect div:nth-child(3){left:56px;animation-delay:0}@keyframes ti-loading-effect{0%{top:8px;height:64px}50%,100%{top:24px;height:32px}}
static/js/admin-editor.js CHANGED
@@ -1 +1,117 @@
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)})();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ tinymce.create('tinymce.plugins.trustindex', {
3
+ /**
4
+ * Initializes the plugin, this will be executed after the plugin has been created.
5
+ * This call is done before the editor instance has finished it's initialization so use the onInit event of the editor instance to intercept that event.
6
+ *
7
+ * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
8
+ * @param {string} url Absolute URL to where the plugin is located.
9
+ */
10
+ init : function(ed, url)
11
+ {
12
+ let jq_url = (typeof ajax_object != "undefined" ? ajax_object.ajax_url : window.ajaxurl || null);
13
+
14
+ if(!jq_url)
15
+ {
16
+ return;
17
+ }
18
+
19
+ ed.addButton('trustindex', {
20
+ title : 'Add Trustindex widget shortcode',
21
+ cmd : 'add-trustindex-widget',
22
+ image : url + '/../img/trustindex-sign-logo.png',
23
+ text: ''
24
+ });
25
+
26
+ ed.addCommand('add-trustindex-widget', function() {
27
+
28
+ jQuery.get(jq_url + '?action=list_trustindex_widgets', function( ajax_return_data ) {
29
+
30
+ ed.windowManager.open( {
31
+ title: 'Please add an Trustindex widget ID!',
32
+ //html: "<p>hello!</p>",
33
+ body: [
34
+ {
35
+ type : 'container',
36
+ name : 'container',
37
+ label : '',
38
+ html : ajax_return_data
39
+ },
40
+ {
41
+ type: 'textbox',
42
+ name: 'widget-id',
43
+ placeholder: 'Trustindex widget ID',
44
+ multiline: false,
45
+ minWidth: 200,
46
+ //minHeight: 50,
47
+ }
48
+ ],
49
+ onsubmit: function( e ) {
50
+ var ti_widget_id = e.data['widget-id'];
51
+ if (ti_widget_id.length < 10)
52
+ {
53
+ alert("Trustindex ID is missing or too short. Please check, mayba a copy-paste error!");
54
+ return false;
55
+ }
56
+ else
57
+ {
58
+ ed.execCommand('mceInsertContent', 0, '[trustindex data-widget-id="' + ti_widget_id + '"]');
59
+ }
60
+ }
61
+ });
62
+ });
63
+
64
+ //select Trustindex widget ID
65
+ jQuery('body').on('click', '.btn-copy-widget-id', function(e){
66
+ let selected_class = "text-danger";
67
+ e.preventDefault();
68
+ let link = jQuery(this);
69
+ let id = link.data('ti-id');
70
+ link.closest(".mce-form").find('input').val(id).trigger("change");
71
+
72
+ //color
73
+ link.closest(".mce-form").find('.btn-copy-widget-id.' + selected_class).each(function(i, item){
74
+ jQuery(item).removeClass(selected_class)
75
+ .find(".dashicons").attr("class", "dashicons dashicons-admin-post");
76
+ });
77
+ link.addClass(selected_class)
78
+ .find(".dashicons").attr("class", "dashicons dashicons-yes");
79
+ });
80
+ });
81
+ },
82
+
83
+ /**
84
+ * Creates control instances based in the incomming name. This method is normally not
85
+ * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
86
+ * but you sometimes need to create more complex controls like listboxes, split buttons etc then this method can be used to create those.
87
+ *
88
+ * @param {String} n Name of the control to create.
89
+ * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
90
+ * @return {tinymce.ui.Control} New control instance or null if no control was created.
91
+ */
92
+ createControl : function(n, cm)
93
+ {
94
+ return null;
95
+ },
96
+
97
+ /**
98
+ * Returns information about the plugin as a name/value array.
99
+ * The current keys are longname, author, authorurl, infourl and version.
100
+ *
101
+ * @return {Object} Name/value array containing information about the plugin.
102
+ */
103
+ getInfo : function()
104
+ {
105
+ return {
106
+ longname : 'Trustindex Buttons',
107
+ author : 'Trustindex.io - Velvel ltd[www.velvel.hu]',
108
+ authorurl : 'https://www.trustindex.io/',
109
+ infourl : 'https://www.trustindex.io/',
110
+ version : "1.1"
111
+ };
112
+ }
113
+ });
114
+
115
+ // Register plugin
116
+ tinymce.PluginManager.add( 'trustindex', tinymce.plugins.trustindex );
117
+ })();
static/js/admin-page-settings-common.js CHANGED
@@ -1 +1,728 @@
1
- if(typeof Trustindex_JS_loaded=="undefined"){var Trustindex_JS_loaded={}}Trustindex_JS_loaded.common=true;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), #ti-align-id").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("#ti-loading").addClass("active");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")})}});jQuery(".ti-checkbox input[type=checkbox][onchange]").on("change",function(){jQuery("#ti-loading").addClass("active")})});function TI_manage_dots(a){let old_text=a.html();let loading_text=a.data("loading-text");let dots=[".","..","..."];let index=dots.length-1;a.data("old",old_text);a.html(loading_text+dots[index]);a.animationInterval=setInterval(function(){index++;if(index>=dots.length){index=0}a.html(loading_text+dots[index])},1000);a.restore=function(){a.html(old_text);clearInterval(a.animationInterval)}}function decodeHTMLEntities(a){let textArea=document.createElement("textarea");textArea.innerHTML=a;return textArea.value}function TI_copyTextToClipboard(c){c=decodeHTMLEntities(c);if(!navigator.clipboard){var b=document.createElement("textarea");b.value=c;b.style.position="fixed";document.body.appendChild(b);b.focus();b.select();try{var d=document.execCommand("copy")}catch(a){}document.body.removeChild(b);return}navigator.clipboard.writeText(c).then(function(){},function(e){})};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof Trustindex_JS_loaded == 'undefined')
2
+ {
3
+ var Trustindex_JS_loaded = {};
4
+ }
5
+
6
+ Trustindex_JS_loaded.common = true;
7
+
8
+ String.prototype.ucfirst = function() {
9
+ return this.charAt(0).toUpperCase() + this.slice(1)
10
+ }
11
+
12
+ jQuery(document).ready(function() {
13
+ /*************************************************************************/
14
+ /* PASSWORD TOGGLE */
15
+ jQuery(".ti-toggle-password").on('click', function(event) {
16
+ event.preventDefault();
17
+
18
+ let icon = jQuery(this);
19
+ let parent = icon.closest('.form-group, .ti-input-field');
20
+
21
+ if(icon.hasClass('dashicons-visibility'))
22
+ {
23
+ parent.find('input').attr('type', 'text');
24
+ icon.removeClass('dashicons-visibility').addClass('dashicons-hidden');
25
+ }
26
+ else
27
+ {
28
+ parent.find('input').attr('type', 'password');
29
+ icon.removeClass('dashicons-hidden').addClass('dashicons-visibility');
30
+ }
31
+ });
32
+
33
+ // nav padding-right
34
+ let nav = jQuery('#trustindex-plugin-settings-page .nav-tab-wrapper');
35
+ if(nav.length)
36
+ {
37
+ let width = nav.find('.nav-tab-right').outerWidth();
38
+ nav.css('padding-right', parseInt(width + 5) + 'px');
39
+ }
40
+
41
+ // toggle opacity
42
+ jQuery('.ti-toggle-opacity').css('opacity', 1);
43
+
44
+ /*************************************************************************/
45
+ /* TOGGLE */
46
+ jQuery("#trustindex-plugin-settings-page .btn-toggle").on('click', function(e) {
47
+ e.preventDefault();
48
+
49
+ jQuery(jQuery(this).attr("href")).toggle();
50
+
51
+ return false;
52
+ });
53
+
54
+ /*************************************************************************/
55
+ /* COPY 2 CLIPBOARD */
56
+ jQuery(".btn-copy2clipboard").click(function(e){
57
+ e.preventDefault();
58
+
59
+ let obj = jQuery(jQuery(this).attr("href"));
60
+ let text = obj.html() ? obj.html() : obj.val();
61
+
62
+ TI_copyTextToClipboard(text);
63
+ });
64
+
65
+ /*************************************************************************/
66
+ /* STYLE */
67
+ var apply_style = function() {
68
+ let style_id = jQuery('#ti-style-id').val();
69
+ let box = jQuery('#ti-review-list').closest('.ti-preview-box');
70
+
71
+ if(['8', '9', '10', '11', '12', '20', '22'].indexOf(style_id) != -1 && !is_no_reviews_with_filter)
72
+ {
73
+ box.css('width', '30%');
74
+ }
75
+ else if(['6', '7', '24', '25', '26', '27', '28', '29', '35'].indexOf(style_id) != -1 && !is_no_reviews_with_filter)
76
+ {
77
+ box.css('width', '50%');
78
+ }
79
+ else
80
+ {
81
+ box.css('width', 'auto');
82
+ }
83
+
84
+ //This is necessary to round up x.5 px width
85
+ box.css('width', box.width());
86
+ };
87
+
88
+ /*************************************************************************/
89
+ /* FILTER */
90
+ //Checkbox
91
+ jQuery('.ti-checkbox:not(.disabled)').on('click', function() {
92
+ let checkbox = jQuery(this).find('input[type=checkbox], input[type=radio]');
93
+ checkbox.prop('checked', !checkbox.prop('checked')).trigger("change");
94
+
95
+ return false;
96
+ });
97
+
98
+ //Custom select - init
99
+ jQuery('.ti-select').each(function() {
100
+ let el = jQuery(this);
101
+ let selected = el.find('ul li.selected');
102
+
103
+ if(selected.length == 0)
104
+ {
105
+ selected = el.find('ul li:first');
106
+ }
107
+
108
+ el.data('value', selected.data('value')).find('font').html(selected.html());
109
+ });
110
+
111
+ //Custom select - toggle click
112
+ jQuery(document).on('click', '.ti-select', function() {
113
+ let el = jQuery(this);
114
+ el.toggleClass('active');
115
+
116
+ if(el.hasClass('active'))
117
+ {
118
+ jQuery(window).unbind().on('click', function(e) {
119
+ if(!jQuery(e.target).is(el) && jQuery(e.target).closest('.ti-select').length == 0)
120
+ {
121
+ el.removeClass('active');
122
+ jQuery(window).unbind();
123
+ }
124
+ });
125
+ }
126
+ });
127
+
128
+ //Custom select - select item
129
+ jQuery(document).on('click', '.ti-select li', function() {
130
+ let el = jQuery(this);
131
+ el.parent().parent().data('value', el.data('value')).trigger('change').find('font').html(el.html());
132
+
133
+ el.parent().find('li').removeClass('selected');
134
+ el.addClass('selected');
135
+ });
136
+
137
+ var is_no_reviews_with_filter = false;
138
+
139
+ //Get reviews to memory
140
+ var reviews_el = jQuery('#ti-review-list .ti-widget').clone();
141
+
142
+ //Set reviews' rating and empty to attributes
143
+ reviews_el.find('.ti-review-item').each(function() {
144
+ let el = jQuery(this);
145
+ let rating = el.find('.ti-stars .ti-star.f, .stars .ti-star.f').length;
146
+
147
+ //Facebook recommendations
148
+ if(el.find('.ti-recommendation-icon.positive').length)
149
+ {
150
+ rating = 5;
151
+ }
152
+ else if(el.find('.ti-recommendation-icon.negative').length)
153
+ {
154
+ rating = 1;
155
+ }
156
+
157
+ if(el.find('.ti-polarity-icon.positive').length)
158
+ {
159
+ rating = 5;
160
+ }
161
+ else if(el.find('.ti-polarity-icon.neutral').length)
162
+ {
163
+ rating = 3;
164
+ }
165
+ else if(el.find('.ti-polarity-icon.negative').length)
166
+ {
167
+ rating = 1;
168
+ }
169
+
170
+ //Ten scale
171
+ if(el.find('.ti-rating-box').length)
172
+ {
173
+ rating = Math.round(parseFloat(el.find('.ti-rating-box').text()) / 2);
174
+ }
175
+
176
+ let selector = '.ti-review-content';
177
+ if(el.find('.ti-review-content .ti-inner').length)
178
+ {
179
+ selector = '.ti-review-content .ti-inner';
180
+ }
181
+ else if(el.find('.ti-review-text').length)
182
+ {
183
+ selector = '.ti-review-text';
184
+ }
185
+
186
+ el.attr('data-rating', rating);
187
+ el.attr('data-empty', el.find(selector).text().trim() == "" ? 1 : 0);
188
+ });
189
+
190
+ //Set the stars background in the filter for the corresponding platform
191
+ var set_star_background = function() {
192
+ let platform = (jQuery('#ti-filter #show-star').data('platform') || 'google').ucfirst();
193
+
194
+ 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>');
195
+ el.append('body');
196
+
197
+ jQuery('body').append(el);
198
+ jQuery('#ti-filter .ti-star.e').css('background', el.find('.ti-star.e').css('background'));
199
+ jQuery('#ti-filter .ti-star.f').css('background', el.find('.ti-star.f').css('background'));
200
+
201
+ el.remove();
202
+ };
203
+ set_star_background();
204
+
205
+ //Check badge type
206
+ var is_badge_widget = function() {
207
+ let layout_id = jQuery('#ti-review-list .ti-widget').data('layout-id');
208
+ return [11, 12, 20, 22, 24, 25, 26, 27, 28, 29, 35].indexOf(layout_id) != -1;
209
+ };
210
+
211
+ //Apply filter when change or init
212
+ var apply_filter = function(init) {
213
+ let style_id = jQuery('#ti-style-id').val();
214
+
215
+ //get stars
216
+ let stars = (jQuery('#ti-filter #show-star').data('value') + "").split(',').map(function(i) { return parseInt(i); });
217
+
218
+ //only ratings
219
+ let show_only_ratings = jQuery('#ti-filter-only-ratings').prop('checked');
220
+
221
+ //filter removed
222
+ if(!jQuery('#ti-filter').length)
223
+ {
224
+ stars = [ 1, 2, 3, 4, 5 ];
225
+ show_only_ratings = false;
226
+ }
227
+
228
+ //remove current review elements
229
+ jQuery('.ti-widget .ti-reviews-container-wrapper .ti-review-item').remove();
230
+
231
+ //remove all event listeners on the widget
232
+ let widget = document.querySelector(".ti-widget");
233
+ widget.replaceWith(widget.cloneNode(true));
234
+
235
+ //iterate through stored reviews
236
+ let results = 0;
237
+ reviews_el.find('.ti-review-item').each(function() {
238
+ let el = jQuery(this);
239
+
240
+ //check rating
241
+ if(stars.indexOf(el.data('rating')) !== -1)
242
+ {
243
+ //check only ratings
244
+ if(show_only_ratings && el.data('empty'))
245
+ {
246
+ return;
247
+ }
248
+
249
+ //return after 5 results (vertical widgets)
250
+ if(['8', '9', '10', '18', '33'].indexOf(style_id) != -1 && results > 4)
251
+ {
252
+ return;
253
+ }
254
+
255
+ //clone and append element
256
+ let clone = el.clone();
257
+ jQuery('#ti-review-list .ti-widget .ti-reviews-container-wrapper').append(clone);
258
+ clone.hide();
259
+ clone.fadeIn();
260
+
261
+ //increase count
262
+ results++;
263
+ }
264
+ });
265
+
266
+ //clear pager interval
267
+ if(typeof Trustindex != "undefined" && Trustindex.intervalPointer)
268
+ {
269
+ clearInterval(Trustindex.intervalPointer);
270
+ }
271
+
272
+ //show empty text
273
+ if(results == 0 && !is_badge_widget())
274
+ {
275
+ jQuery('#ti-review-list').hide().next().fadeIn();
276
+ is_no_reviews_with_filter = true;
277
+ }
278
+ else
279
+ {
280
+ jQuery('#ti-review-list').fadeIn().next().hide();
281
+ is_no_reviews_with_filter = false;
282
+
283
+ //start pager
284
+ if(init === undefined)
285
+ {
286
+ let dot_container = jQuery('#ti-review-list .ti-widget .ti-controls-dots');
287
+ if(dot_container.length)
288
+ {
289
+ let dot = dot_container.children(":first").clone();
290
+ if(dot.length)
291
+ {
292
+ dot_container.html(" " + dot.removeAttr('data-pager-state')[0].outerHTML + " ");
293
+ }
294
+ }
295
+ }
296
+
297
+ if(typeof Trustindex != "undefined")
298
+ {
299
+ Trustindex.pager_inited = true;
300
+ Trustindex.init_pager(document.querySelectorAll(".ti-widget"));
301
+ Trustindex.resize_widgets();
302
+ }
303
+ }
304
+
305
+ //ajax save
306
+ if(init !== true)
307
+ {
308
+ jQuery.post('', {
309
+ command: 'save-filter',
310
+ filter: JSON.stringify({
311
+ 'stars': stars,
312
+ 'only-ratings': show_only_ratings
313
+ })
314
+ });
315
+ }
316
+
317
+ apply_style();
318
+ }
319
+
320
+ //hooks
321
+ jQuery('#ti-filter #show-star').on('change', apply_filter);
322
+ jQuery('#ti-filter-only-ratings').on('change', function(e) {
323
+ e.preventDefault();
324
+ apply_filter();
325
+ return false;
326
+ });
327
+
328
+ //init
329
+ if(reviews_el.length)
330
+ {
331
+ apply_filter(true);
332
+ apply_style();
333
+ }
334
+
335
+ //Background post save - style and set change
336
+ jQuery("#ti-style-id, #ti-set-id, #ti-lang-id, #ti-dateformat-id, #ti-widget-options input[type=checkbox]:not(.no-form-update), #ti-align-id").on('change', function() {
337
+ let form = jQuery(this).closest('form');
338
+
339
+ let data = form.serializeArray();
340
+
341
+ // include unchecked checkboxes
342
+ form.find('input[type=checkbox]:not(.no-form-update)').each(function() {
343
+ let checkbox = jQuery(this);
344
+
345
+ if(!checkbox.prop('checked') && checkbox.attr('name'))
346
+ {
347
+ data.push({
348
+ name: checkbox.attr('name'),
349
+ value: 0
350
+ });
351
+ }
352
+ });
353
+
354
+ // show loading
355
+ jQuery('#ti-loading').addClass('active');
356
+
357
+ jQuery('li.ti-preview-box').addClass('disabled');
358
+ jQuery.ajax({
359
+ url: form.attr('action'),
360
+ type: 'post',
361
+ dataType: 'application/json',
362
+ data: data
363
+ }).always(function() {
364
+ location.reload(true);
365
+ });
366
+
367
+ return false;
368
+ });
369
+
370
+ //Layout select filter
371
+ jQuery('input[name=layout-select]').on('change', function(e) {
372
+ e.preventDefault();
373
+
374
+ let ids = (jQuery('input[name=layout-select]:checked').data('ids') + "").split(',');
375
+
376
+ if(ids == "")
377
+ {
378
+ jQuery('.ti-preview-boxes-container').find('.ti-full-width, .ti-half-width').fadeIn();
379
+ }
380
+ else
381
+ {
382
+ jQuery('.ti-preview-boxes-container').find('.ti-full-width, .ti-half-width').hide();
383
+ ids.forEach(function(id) {
384
+ jQuery('.ti-preview-boxes-container').find('.ti-preview-boxes[data-layout-id="'+ id + '"]').parent().fadeIn();
385
+ });
386
+ }
387
+
388
+ return false;
389
+ });
390
+
391
+ //Free step stepping
392
+ let is_stepping = false;
393
+ jQuery('.ti-free-steps li.done, .ti-free-steps li.active').on('click', function(e) {
394
+ e.preventDefault();
395
+
396
+ if(is_stepping)
397
+ {
398
+ return false;
399
+ }
400
+
401
+ is_stepping = true;
402
+ window.location.href = jQuery(this).attr('href');
403
+
404
+ return false;
405
+ });
406
+
407
+ //Set auto active if not present
408
+ if(jQuery('.ti-free-steps:not(.ti-setup-guide-steps) li.current').length == 0)
409
+ {
410
+ jQuery('.ti-free-steps:not(.ti-setup-guide-steps) li.active:last').addClass('current');
411
+ }
412
+
413
+ /*************************************************************************/
414
+ /* MODAL */
415
+ jQuery(document).on('click', '.btn-modal-close', function(event) {
416
+ event.preventDefault();
417
+
418
+ jQuery(this).closest('.ti-modal').fadeOut();
419
+ });
420
+
421
+ jQuery(document).on('click', '.ti-modal', function(event) {
422
+ if(event.target.nodeName != 'A')
423
+ {
424
+ event.preventDefault();
425
+
426
+ if(!jQuery(event.target).closest('.ti-modal-dialog').length)
427
+ {
428
+ jQuery(this).fadeOut();
429
+ }
430
+ }
431
+ });
432
+
433
+ /*************************************************************************/
434
+ /* HIGHLIGHT */
435
+ let highlight_modal = jQuery('#ti-highlight-modal');
436
+ if(highlight_modal.length)
437
+ {
438
+ let appendHiddenInputs = function(obj) {
439
+ highlight_modal.find('input[type=hidden]').each(function() {
440
+ let input = jQuery(this);
441
+
442
+ obj[ input.attr('name') ] = input.val();
443
+ });
444
+
445
+ return obj;
446
+ };
447
+ //show highlight modal
448
+ jQuery(document).on('click', '.btn-highlight', function(event) {
449
+ event.preventDefault();
450
+
451
+ let btn = jQuery(this);
452
+ let review_box = btn.closest('tr').find('.ti-review-content');
453
+ let raw_content = review_box.html();
454
+ let content = raw_content.replace(/<mark class="ti-highlight">/g, '').replace(/<\/mark>/, ''); // remove current highlight tags
455
+
456
+ highlight_modal.fadeIn();
457
+ highlight_modal.find('.ti-highlight-content').html("<div class='raw-content'>"+ raw_content + "</div><div class='selection-content'>"+ content + "</div>");
458
+ highlight_modal.find('.btn-highlight-confirm, .btn-highlight-remove').attr('href', btn.attr('href'));
459
+
460
+ // toggle highlight remove button
461
+ if(btn.hasClass('has-highlight'))
462
+ {
463
+ highlight_modal.find('.btn-highlight-remove').show();
464
+ }
465
+ else
466
+ {
467
+ highlight_modal.find('.btn-highlight-remove').hide();
468
+ }
469
+ });
470
+
471
+ // highlight save
472
+ jQuery(document).on('click', '.btn-highlight-confirm', function(event) {
473
+ event.preventDefault();
474
+
475
+ let btn = jQuery(this);
476
+ let highlight_content = btn.closest('.ti-modal-content').find('.ti-highlight-content .selection-content');
477
+ let data = TI_highlight_getSelection(highlight_content.get(0));
478
+
479
+ if(data.start !== null) {
480
+ data.id = btn.attr('href');
481
+ data['save-highlight'] = 1;
482
+
483
+ btn.css('pointer-events', 'none');
484
+ btn.blur();
485
+ btn.addClass('btn-disabled');
486
+ TI_manage_dots(btn);
487
+ btn.closest('.ti-modal').find('.btn-text').css('pointer-events', 'none');
488
+
489
+ jQuery.ajax({
490
+ method: "POST",
491
+ url: window.location.href,
492
+ data: appendHiddenInputs(data)
493
+ }).always(function() {
494
+ location.reload(true);
495
+ });
496
+ }
497
+ });
498
+
499
+ // highlight remove
500
+ jQuery(document).on('click', '.btn-highlight-remove', function(event) {
501
+ event.preventDefault();
502
+
503
+ let btn = jQuery(this);
504
+ let highlight_content = btn.closest('.ti-modal-content').find('.ti-highlight-content');
505
+ let data = TI_highlight_getSelection(highlight_content.get(0));
506
+
507
+ btn.css('pointer-events', 'none');
508
+ btn.blur();
509
+ btn.addClass('btn-disabled');
510
+ TI_manage_dots(btn);
511
+ btn.closest('.ti-modal').find('.btn-text').css('pointer-events', 'none');
512
+
513
+ jQuery.ajax({
514
+ method: "POST",
515
+ url: window.location.href,
516
+ data: appendHiddenInputs({
517
+ id: btn.attr('href'),
518
+ "save-highlight": 1
519
+ })
520
+ }).always(function() {
521
+ location.reload(true);
522
+ });
523
+ });
524
+ }
525
+
526
+ /*************************************************************************/
527
+ /* NOTICE HIDE */
528
+ jQuery(document).on('click', '.ti-notice.is-dismissible .notice-dismiss', function() {
529
+ let button = jQuery(this);
530
+ let container = button.closest('.ti-notice');
531
+
532
+ container.fadeOut(200);
533
+
534
+ if(button.data('command') && !button.data('ajax-run'))
535
+ {
536
+ button.data('ajax-run', 1); // prevent multiple triggers
537
+
538
+ jQuery.post('', { command: button.data('command') });
539
+ }
540
+ });
541
+
542
+ jQuery('.ti-checkbox input[type=checkbox][onchange]').on('change', function() {
543
+ jQuery('#ti-loading').addClass('active');
544
+ });
545
+
546
+ /*************************************************************************/
547
+ /* RATE US */
548
+ // remember on hover
549
+ jQuery('.ti-rate-us-box .ti-quick-rating').on('mouseenter', function(event) {
550
+ let container = jQuery(this);
551
+ let selected = container.find('.ti-star-check.active');
552
+
553
+ if(selected.length)
554
+ {
555
+ // add index to data & remove all active stars
556
+ container.data('selected', selected.index()).find('.ti-star-check').removeClass('active');
557
+
558
+ // give back active star on mouse enter
559
+ container.one('mouseleave', () => container.find('.ti-star-check').eq(container.data('selected')).addClass('active'));
560
+ }
561
+ });
562
+
563
+ // star click
564
+ jQuery(document).on('click', '.ti-rate-us-box .ti-quick-rating .ti-star-check', function(event) {
565
+ event.preventDefault();
566
+
567
+ let star = jQuery(this);
568
+ let container = star.parent();
569
+
570
+ // add index to data & remove all active stars
571
+ container.data('selected', star.index()).find('.ti-star-check').removeClass('active');
572
+
573
+ // select current star
574
+ star.addClass('active');
575
+
576
+ // show modals
577
+ if(parseInt(star.data('value')) >= 4)
578
+ {
579
+ jQuery('#ti-rateus-modal-success').fadeIn().find('.ti-quick-rating .ti-star-check').removeClass('active').eq(star.index()).addClass('active');
580
+ }
581
+ else
582
+ {
583
+ let feedback_modal = jQuery('#ti-rateus-modal-feedback');
584
+
585
+ feedback_modal.fadeIn();
586
+ feedback_modal.find('.ti-quick-rating .ti-star-check').removeClass('active').eq(star.index()).addClass('active');
587
+ feedback_modal.find('textarea').focus();
588
+ }
589
+ });
590
+
591
+ // write to support
592
+ jQuery(document).on('click', '.btn-rateus-support', function(event) {
593
+ event.preventDefault();
594
+
595
+ let btn = jQuery(this);
596
+ btn.blur();
597
+
598
+ let container = jQuery('#ti-rateus-modal-feedback');
599
+ let email = container.find('input[type=text]').val().trim();
600
+ let text = container.find('textarea').val().trim();
601
+
602
+ // hide errors
603
+ container.find('input[type=text], textarea').removeClass('has-error');
604
+
605
+ // check email
606
+ if(email == "" || !/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email))
607
+ {
608
+ container.find('input[type=text]').addClass('has-error');
609
+ }
610
+
611
+ // check text
612
+ if(text == "")
613
+ {
614
+ container.find('textarea').addClass('has-error');
615
+ }
616
+
617
+ // there is error
618
+ if(container.find('.has-error').length)
619
+ {
620
+ return false;
621
+ }
622
+
623
+ // show loading animation
624
+ btn.css('pointer-events', 'none').addClass('btn-disabled');
625
+ TI_manage_dots(btn);
626
+ btn.closest('.ti-modal').find('.btn-text').css('pointer-events', 'none');
627
+
628
+ // ajax request
629
+ jQuery.ajax({
630
+ type: 'post',
631
+ dataType: 'application/json',
632
+ data: {
633
+ command: 'rate-us-feedback',
634
+ email: email,
635
+ text: text,
636
+ star: container.find('.ti-quick-rating .ti-star-check.active').data('value')
637
+ }
638
+ }).always(function() {
639
+ location.reload(true);
640
+ });
641
+ });
642
+
643
+ // review us on wordpress
644
+ jQuery(document).on('click', '.btn-rateus-success', function(event) {
645
+ event.preventDefault();
646
+
647
+ let btn = jQuery(this);
648
+
649
+ // show loading animation
650
+ btn.blur().css('pointer-events', 'none').addClass('btn-disabled');
651
+ TI_manage_dots(btn);
652
+
653
+ // open new window
654
+ window.open(location.href + '&command=rate-us-feedback&star=' + jQuery('#ti-rateus-modal-success .ti-quick-rating .ti-star-check.active').data('value'), '_blank');
655
+
656
+ // hide modal & box
657
+ jQuery('#ti-rateus-modal-success').fadeOut();
658
+ jQuery('.ti-rate-us-box').fadeOut();
659
+ });
660
+ });
661
+
662
+ //btn: JQuery Element
663
+ function TI_manage_dots(btn)
664
+ {
665
+ let old_text = btn.html();
666
+ let loading_text = btn.data('loading-text');
667
+ let dots = [ '.', '..', '...' ];
668
+ let index = dots.length - 1;
669
+
670
+ btn.data('old', old_text);
671
+ btn.html(loading_text + dots[index]);
672
+
673
+ btn.animationInterval = setInterval(function() {
674
+ index++;
675
+
676
+ if(index >= dots.length)
677
+ {
678
+ index = 0;
679
+ }
680
+
681
+ btn.html(loading_text + dots[index]);
682
+ }, 1000);
683
+
684
+ btn.restore = function() {
685
+ btn.html(old_text);
686
+
687
+ clearInterval(btn.animationInterval);
688
+ };
689
+ }
690
+
691
+ function decodeHTMLEntities(text)
692
+ {
693
+ let textArea = document.createElement('textarea');
694
+
695
+ textArea.innerHTML = text;
696
+
697
+ return textArea.value;
698
+ }
699
+
700
+ function TI_copyTextToClipboard(text)
701
+ {
702
+ text = decodeHTMLEntities(text);
703
+
704
+ if (!navigator.clipboard)
705
+ {
706
+ //fallback
707
+ var textArea = document.createElement("textarea");
708
+ textArea.value = text;
709
+ textArea.style.position="fixed"; //avoid scrolling to bottom
710
+ document.body.appendChild(textArea);
711
+ textArea.focus();
712
+ textArea.select();
713
+
714
+ try {
715
+ var successful = document.execCommand('copy');
716
+ //console.log('Fallback: Copying text command was ' + msg);
717
+ } catch (err) {
718
+ //console.error('Fallback: Oops, unable to copy', err);
719
+ }
720
+
721
+ document.body.removeChild(textArea);
722
+ return;
723
+ }
724
+ navigator.clipboard.writeText(text).then(
725
+ function() {/*console.log('Async: Copying to clipboard was successful!');*/},
726
+ function(err) {/*console.error('Async: Could not copy text: ', err);*/}
727
+ );
728
+ }
static/js/admin-page-settings-connect.js CHANGED
@@ -1 +1,296 @@
1
- if(typeof Trustindex_JS_loaded=="undefined"){var Trustindex_JS_loaded={}}Trustindex_JS_loaded.connect=true;var Trustindex_Connect=null;jQuery(document).ready(function(b){Trustindex_Connect={box:b("#trustindex-plugin-settings-page .autocomplete .results"),input:b("#trustindex-plugin-settings-page #page-link"),button:b("#trustindex-plugin-settings-page .btn-check"),form:b("#submit-form"),check:function(c){c.preventDefault();if(!Trustindex_Connect.regex){return false}let m=Trustindex_Connect.regex.exec(Trustindex_Connect.input.val().trim());if(!Trustindex_Connect.is_regex_valid(m)){Trustindex_Connect.box.html("<span>"+Trustindex_Connect.box.data("errortext")+"</span>");Trustindex_Connect.box.show();return false}let part1=m[1]||m[3]||"";let part2=m[2]||m[4]||"";let page_id=part1;if(part2){if(part1){page_id+=Trustindex_Connect.page_id_separator}page_id+=part2}let valid=true;if(Trustindex_Connect.form.data("platform")=="arukereso"){page_id=page_id.replace(/^com/,"bg")}else{if(Trustindex_Connect.form.data("platform")=="amazon"){valid=(!(page_id.indexOf("stores/")>-1||page_id.indexOf("account/")>-1||(page_id.indexOf("gp/")>-1&&page_id.indexOf("gp/product/")==-1)||page_id.search(/\-\/[^\/]{2}\/[^\/]{2}$/)>-1)&&page_id.indexOf("product-reviews/")==-1)}else{if(Trustindex_Connect.form.data("platform")=="tripadvisor"){let not_first_page=page_id.match(/\-or[\d]+\-/);if(not_first_page&&not_first_page[0]){page_id=page_id.replace(not_first_page[0],"-")}}}}if(page_id.trim()==""||!valid){Trustindex_Connect.box.html("<span>"+Trustindex_Connect.box.data("errortext")+"</span>");Trustindex_Connect.box.show();return false}Trustindex_Connect.box.hide();b("#ti-noreg-page-id").val(page_id);let page_details={id:page_id};let url=Trustindex_Connect.input.val().trim();let div=Trustindex_Connect.form.find(".ti-selected-source");Trustindex_Connect.form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));div.find("img").attr("src","https://cdn.trustindex.io/assets/platform/Google/icon.png");div.find(".ti-source-info").html('<a target="_blank" href="'+url+'">'+url+"</a>");Trustindex_Connect.button.addClass("btn-disabled");div.fadeIn()},regex:null,is_regex_valid:function(c){if(!c){return false}for(let i=0;i<c.length;i++){if(c[i]===""){return false}}return true},page_id_separator:"|",async_request:function(c){let params=new URLSearchParams({type:"google",page_id:b("#ti-noreg-page-id").val().trim(),access_token:b("#ti-noreg-access-token").length?b("#ti-noreg-access-token").val():"",webhook_url:b("#ti-noreg-webhook-url").val(),email:b("#ti-noreg-email").val(),token:b("#ti-noreg-connect-token").val(),version:b("#ti-noreg-version").val()});b("#ti-connect-info").fadeIn();let ti_window=window.open("https://admin.trustindex.io/source/wordpressPageRequest?"+params.toString(),"trustindex","width=1000,height=1000,menubar=0");window.addEventListener("message",function(d){if(d.origin.startsWith("https://admin.trustindex.io/".replace(/\/$/,""))&&d.data.success){ti_window.close();b("#ti-connect-info").hide();c(b("#ti-noreg-connect-token").val(),d.data.request_id,typeof d.data.manual_download!="undefined"&&d.data.manual_download?1:0)}if(d.origin.startsWith("https://admin.trustindex.io/".replace(/\/$/,""))&&!d.data.success){ti_window.close();Trustindex_Connect.form.find(".ti-selected-source").hide();Trustindex_Connect.button.removeClass("btn-disabled");Trustindex_Connect.box.html("<span>"+Trustindex_Connect.box.data("errortext")+"</span>");Trustindex_Connect.box.show()}})}};if(Trustindex_Connect.button.length){Trustindex_Connect.button.click(Trustindex_Connect.check)}Trustindex_Connect.form.find(".btn-connect").on("click",function(c){c.preventDefault();let btn=b(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);Trustindex_Connect.button.css("pointer-events","none");Trustindex_Connect.async_request(function(d,f,e){b("#ti-noreg-review-download").val(d);b("#ti-noreg-review-request-id").val(f);b("#ti-noreg-manual-download").val(e);Trustindex_Connect.form.submit()})});b("#trustindex-plugin-settings-page .btn-refresh").click(function(c){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")});b(".btn-download-reviews").on("click",function(c){c.preventDefault();Trustindex_Connect.async_request(function(d,f,e){b.ajax({type:"POST",data:{review_download_request:d,review_download_request_id:f,manual_download:e}}).always(function(g){location.reload()})})});b("#review-manual-download").on("click",function(c){c.preventDefault();let btn=b(this);btn.blur().addClass("btn-disabled");TI_manage_dots(btn);b.ajax({url:location.search.replace(/&tab=[^&]+/,"&tab=setup_no_reg"),type:"POST",data:{command:"review-manual-download"},success:function(){location.reload()},error:function(){btn.restore();btn.addClass("show-tooltip")}})});var a=[];b("#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(c){if(c==-1){}else{if(c==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)}}}})});b("#form-reg").submit(function(c){return !jQuery("#txt-email-used").is(":visible")})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof Trustindex_JS_loaded == 'undefined')
2
+ {
3
+ var Trustindex_JS_loaded = {};
4
+ }
5
+
6
+ Trustindex_JS_loaded.connect = true;
7
+
8
+ // Autocomplete config
9
+ var Trustindex_Connect = null;
10
+ jQuery(document).ready(function($) {
11
+ /*************************************************************************/
12
+ /* NO REG MODE */
13
+ Trustindex_Connect = {
14
+ box: $('#trustindex-plugin-settings-page .autocomplete .results'),
15
+ input: $('#trustindex-plugin-settings-page #page-link'),
16
+ button: $('#trustindex-plugin-settings-page .btn-check'),
17
+ form: $('#submit-form'),
18
+ check: function(event) {
19
+ event.preventDefault();
20
+
21
+ if(!Trustindex_Connect.regex)
22
+ {
23
+ return false;
24
+ }
25
+
26
+ let m = Trustindex_Connect.regex.exec(Trustindex_Connect.input.val().trim());
27
+ if(!Trustindex_Connect.is_regex_valid(m))
28
+ {
29
+ Trustindex_Connect.box.html('<span>'+ Trustindex_Connect.box.data('errortext') +'</span>');
30
+ Trustindex_Connect.box.show();
31
+ return false;
32
+ }
33
+
34
+ // support for 2 regexes
35
+ let part1 = m[1] || m[3] || "";
36
+ let part2 = m[2] || m[4] || "";
37
+
38
+ let page_id = part1;
39
+ if(part2)
40
+ {
41
+ if(part1)
42
+ {
43
+ page_id += Trustindex_Connect.page_id_separator;
44
+ }
45
+
46
+ page_id += part2;
47
+ }
48
+
49
+ let valid = true;
50
+ if(Trustindex_Connect.form.data('platform') == 'arukereso')
51
+ {
52
+ page_id = page_id.replace(/^com/, 'bg');
53
+ }
54
+ else if(Trustindex_Connect.form.data('platform') == 'amazon')
55
+ {
56
+ valid = (
57
+ !(page_id.indexOf("stores/") > -1
58
+ || page_id.indexOf("account/") > -1
59
+ || (page_id.indexOf("gp/") > -1 && page_id.indexOf("gp/product/") == -1)
60
+ || page_id.search(/\-\/[^\/]{2}\/[^\/]{2}$/) > -1
61
+ )
62
+ && page_id.indexOf("product-reviews/") == -1
63
+ );
64
+ }
65
+ else if(Trustindex_Connect.form.data('platform') == 'tripadvisor')
66
+ {
67
+ // set source to first page
68
+ let not_first_page = page_id.match(/\-or[\d]+\-/);
69
+ if (not_first_page && not_first_page[0])
70
+ {
71
+ page_id = page_id.replace(not_first_page[0], '-');
72
+ }
73
+
74
+ // add .html if not in page_id
75
+ if (page_id.indexOf(".html") == -1)
76
+ {
77
+ page_id = page_id + ".html";
78
+ }
79
+ }
80
+
81
+ // no page_id
82
+ if(page_id.trim() == '' || !valid)
83
+ {
84
+ Trustindex_Connect.box.html('<span>'+ Trustindex_Connect.box.data('errortext') +'</span>');
85
+ Trustindex_Connect.box.show();
86
+ return false;
87
+ }
88
+
89
+ Trustindex_Connect.box.hide();
90
+
91
+ $('#ti-noreg-page-id').val(page_id);
92
+
93
+ // show result
94
+ let page_details = { id: page_id };
95
+ let url = Trustindex_Connect.input.val().trim();
96
+
97
+ let div = Trustindex_Connect.form.find('.ti-selected-source');
98
+ Trustindex_Connect.form.find('#ti-noreg-page_details').val(JSON.stringify(page_details));
99
+
100
+ div.find('img').attr('src', 'https://cdn.trustindex.io/assets/platform/Google/icon.png');
101
+ div.find('.ti-source-info').html('<a target="_blank" href="'+ url +'">'+ url +'</a>');
102
+
103
+ Trustindex_Connect.button.addClass('btn-disabled');
104
+ div.fadeIn();
105
+ },
106
+ regex: null,
107
+ is_regex_valid: function(m) {
108
+ if(!m)
109
+ {
110
+ return false;
111
+ }
112
+
113
+ for(let i = 0; i < m.length; i++) {
114
+ if(m[i] === "")
115
+ {
116
+ return false;
117
+ }
118
+ }
119
+
120
+ return true;
121
+ },
122
+ page_id_separator: '|',
123
+ async_request: function(callback) {
124
+ // get url params
125
+ let params = new URLSearchParams({
126
+ type: 'google',
127
+ page_id: $('#ti-noreg-page-id').val().trim(),
128
+ access_token: $('#ti-noreg-access-token').length ? $('#ti-noreg-access-token').val() : "",
129
+ webhook_url: $('#ti-noreg-webhook-url').val(),
130
+ email: $('#ti-noreg-email').val(),
131
+ token: $('#ti-noreg-connect-token').val(),
132
+ version: $('#ti-noreg-version').val()
133
+ });
134
+
135
+ // show popup info
136
+ $('#ti-connect-info').fadeIn();
137
+
138
+ // open window
139
+ let ti_window = window.open('https://admin.trustindex.io/source/wordpressPageRequest?' + params.toString(), 'trustindex', 'width=1000,height=1000,menubar=0');
140
+
141
+ // wait for process complete
142
+ window.addEventListener('message', function(event) {
143
+ if(event.origin.startsWith('https://admin.trustindex.io/'.replace(/\/$/,'')) && event.data.success)
144
+ {
145
+ ti_window.close();
146
+
147
+ $('#ti-connect-info').hide();
148
+
149
+ callback($('#ti-noreg-connect-token').val(), event.data.request_id, typeof event.data.manual_download != 'undefined' && event.data.manual_download ? 1 : 0);
150
+ }
151
+ if(event.origin.startsWith('https://admin.trustindex.io/'.replace(/\/$/,'')) && !event.data.success)
152
+ {
153
+ ti_window.close();
154
+
155
+ // reset connect form, with invalid input message
156
+ Trustindex_Connect.form.find(".ti-selected-source").hide();
157
+ Trustindex_Connect.button.removeClass("btn-disabled");
158
+ Trustindex_Connect.box.html("<span>" + Trustindex_Connect.box.data("errortext") + "</span>");
159
+ Trustindex_Connect.box.show();
160
+ }
161
+ });
162
+ }
163
+ };
164
+
165
+ // check button clicked
166
+ if(Trustindex_Connect.button.length)
167
+ {
168
+ Trustindex_Connect.button.click(Trustindex_Connect.check);
169
+ }
170
+
171
+ // show loading text on connect
172
+ Trustindex_Connect.form.find('.btn-connect').on('click', function(event) {
173
+ event.preventDefault();
174
+
175
+ // change button
176
+ let btn = $(this);
177
+
178
+ btn.css('pointer-events', 'none');
179
+ btn.addClass('btn-default').removeClass('btn-primary');
180
+ btn.blur();
181
+ TI_manage_dots(btn);
182
+
183
+ Trustindex_Connect.button.css('pointer-events', 'none');
184
+
185
+ // do request
186
+ Trustindex_Connect.async_request(function(token, request_id, manual_download) {
187
+ $('#ti-noreg-review-download').val(token);
188
+ $('#ti-noreg-review-request-id').val(request_id);
189
+ $('#ti-noreg-manual-download').val(manual_download);
190
+
191
+ Trustindex_Connect.form.submit();
192
+ });
193
+ });
194
+
195
+ // show loading text on refresh
196
+ $('#trustindex-plugin-settings-page .btn-refresh').click(function(event) {
197
+ let btn = jQuery(this);
198
+
199
+ btn.css('pointer-events', 'none');
200
+ btn.addClass('btn-default').removeClass('btn-primary');
201
+ btn.blur();
202
+ TI_manage_dots(btn);
203
+
204
+ jQuery('#trustindex-plugin-settings-page .btn').css('pointer-events', 'none');
205
+ });
206
+
207
+ // make async request on review download
208
+ $('.btn-download-reviews').on('click', function(event) {
209
+ event.preventDefault();
210
+
211
+ Trustindex_Connect.async_request(function(token, request_id, manual_download) {
212
+ $.ajax({
213
+ type: "POST",
214
+ data: {
215
+ review_download_request: token,
216
+ review_download_request_id: request_id,
217
+ manual_download: manual_download
218
+ }
219
+ }).always(function(r) {
220
+ location.reload();
221
+ });
222
+ });
223
+ });
224
+
225
+ // manual download
226
+ $('#review-manual-download').on('click', function(event) {
227
+ event.preventDefault();
228
+
229
+ let btn = $(this);
230
+
231
+ btn.blur().addClass('btn-disabled');
232
+
233
+ TI_manage_dots(btn);
234
+
235
+ $.ajax({
236
+ url: location.search.replace(/&tab=[^&]+/, '&tab=setup_no_reg'),
237
+ type: 'POST',
238
+ data: { command: 'review-manual-download' },
239
+ success: function() {
240
+ location.reload();
241
+ },
242
+ error: function() {
243
+ btn.restore();
244
+ btn.addClass('show-tooltip');
245
+ }
246
+ });
247
+ });
248
+
249
+ /*************************************************************************/
250
+ /* CONNECT TO TRUSTINDEX */
251
+ var used_emails = [];
252
+ $("#ti-reg-email, #ti-reg-password").blur(function() {
253
+ let email = jQuery("#ti-reg-email").val();
254
+
255
+ //if previously checked
256
+ if (jQuery.inArray(email, used_emails) != -1)
257
+ {
258
+ jQuery("#txt-email-used").fadeIn();
259
+ return false;
260
+ }
261
+
262
+ jQuery.ajax({
263
+ method: "POST",
264
+ url: "https://admin.trustindex.io/" + "api/userCheckEmail",
265
+ data: { 'email': email, 's': 'wp' },
266
+ dataType: "jsonp",
267
+ success: function(data) {
268
+ //invalid e-mail
269
+ if (data == -1)
270
+ {
271
+
272
+ }
273
+ //new e-mail
274
+ else if (data == 0)
275
+ {
276
+ jQuery("#txt-email-used").fadeOut();
277
+ }
278
+ //used e-mail
279
+ else
280
+ {
281
+ let link = jQuery("#txt-email-used").find("a");
282
+ link.html(link.html().replace("$email", email));
283
+ jQuery("#txt-email-used").fadeIn();
284
+ jQuery("#ti-reg-email").val("");
285
+
286
+ //register as used email
287
+ used_emails.push(email);
288
+ }
289
+ }
290
+ });
291
+ });
292
+
293
+ $("#form-reg").submit(function(e) {
294
+ return !jQuery("#txt-email-used").is(":visible");
295
+ });
296
+ });
static/js/admin-page-settings.js CHANGED
@@ -1 +1,52 @@
1
- if(typeof Trustindex_JS_loaded=="undefined"){var Trustindex_JS_loaded={}}Trustindex_JS_loaded.unique=true;jQuery(document).ready(function(a){a(".btn-connect-public").click(function(b){b.preventDefault();let button=a(this);let token=a("#ti-noreg-connect-token").val();let params=new URLSearchParams({type:"Google",referrer:"public",webhook_url:a("#ti-noreg-webhook-url").val(),email:a("#ti-noreg-email").val(),token:token,version:a("#ti-noreg-version").val()});let ti_window=window.open("https://admin.trustindex.io/source/edit2?"+params.toString(),"trustindex","width=1000,height=1000,menubar=0");window.addEventListener("message",function(c){if(c.origin.startsWith("https://admin.trustindex.io/".replace(/\/$/,""))&&c.data.id){ti_window.close();a("#ti-connect-info").hide();a("#ti-noreg-page_details").val(JSON.stringify(c.data));a("#ti-noreg-review-download").val(token);button.closest("form").submit()}});a("#ti-connect-info").fadeIn();let timer=setInterval(function(){if(ti_window.closed){a("#ti-connect-info").hide();clearInterval(timer)}},1000)})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ if(typeof Trustindex_JS_loaded == 'undefined')
2
+ {
3
+ var Trustindex_JS_loaded = {};
4
+ }
5
+
6
+ Trustindex_JS_loaded.unique = true;
7
+
8
+ jQuery(document).ready(function($) {
9
+
10
+ $(".btn-connect-public").click(function(event) {
11
+ event.preventDefault();
12
+
13
+ let button = $(this);
14
+ let token = $('#ti-noreg-connect-token').val();
15
+
16
+ // get url params
17
+ let params = new URLSearchParams({
18
+ type: 'Google',
19
+ referrer: 'public',
20
+ webhook_url: $('#ti-noreg-webhook-url').val(),
21
+ email: $('#ti-noreg-email').val(),
22
+ token: token,
23
+ version: $('#ti-noreg-version').val()
24
+ });
25
+
26
+ let ti_window = window.open('https://admin.trustindex.io/source/edit2?' + params.toString(), 'trustindex', 'width=1000,height=1000,menubar=0');
27
+
28
+ window.addEventListener('message', function(event) {
29
+ if(event.origin.startsWith('https://admin.trustindex.io/'.replace(/\/$/,'')) && event.data.id)
30
+ {
31
+ ti_window.close();
32
+ $('#ti-connect-info').hide();
33
+
34
+ $("#ti-noreg-page_details").val(JSON.stringify(event.data));
35
+ $('#ti-noreg-review-download').val(token);
36
+
37
+ button.closest("form").submit();
38
+ }
39
+ });
40
+
41
+ $('#ti-connect-info').fadeIn();
42
+ let timer = setInterval(function() {
43
+ if(ti_window.closed)
44
+ {
45
+ $('#ti-connect-info').hide();
46
+
47
+ clearInterval(timer);
48
+ }
49
+ }, 1000);
50
+ });
51
+
52
+ });
static/js/admin-popup.js CHANGED
@@ -1 +1,31 @@
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}})});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function() {
2
+ let popupPosition = function() {
3
+ let pad = jQuery('#wpcontent').css('padding-left');
4
+
5
+ jQuery('.trustindex-popup').css({
6
+ right: pad,
7
+ 'margin-left': pad
8
+ });
9
+ };
10
+
11
+ popupPosition();
12
+ jQuery(window).resize(popupPosition);
13
+
14
+ jQuery(document).on('click', 'a.trustindex-rateus', function(e) {
15
+ //Get link, close button and url
16
+ let link = jQuery(this),
17
+ closeButton = link.closest('.notice').find('.notice-dismiss'),
18
+ url = link.attr('href');
19
+
20
+ //Hide the modal - click close button
21
+ closeButton.click();
22
+
23
+ //Make ajax at the background if not the rate button clicked
24
+ if(link.attr('target') === undefined)
25
+ {
26
+ e.preventDefault();
27
+ jQuery.get(url);
28
+ return false;
29
+ }
30
+ });
31
+ });
static/js/admin-widget.js CHANGED
@@ -1 +1,62 @@
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")}};
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function(){
2
+
3
+ let wp_content = jQuery("#wpbody-content").length ? jQuery("#wpbody-content") : jQuery('body');
4
+
5
+ //open help tooltip
6
+ wp_content.on('click', '.btn-insert-tooltip', function(e){
7
+ e.preventDefault();
8
+
9
+ jQuery(this).closest("label").after( jQuery(".block-help-template:last").clone().removeAttr("id").removeClass("block-help-template") );
10
+ });
11
+
12
+ //close help tooltip
13
+ wp_content.on('click', '.dashicons-dismiss', function(e){
14
+ e.preventDefault();
15
+
16
+ jQuery(this).closest(".help-block").remove();
17
+ });
18
+
19
+ //select Trustindex widget ID
20
+ wp_content.on('click', '.btn-copy-widget-id', function(e){
21
+ e.preventDefault();
22
+
23
+ let link = jQuery(this);
24
+
25
+ link.closest("form").find('.form-control').val(link.data('ti-id')).trigger("change");
26
+
27
+ TImanageCopyLinks(link.closest("form"), link);
28
+ });
29
+
30
+ wp_content.on('blur', '.trustindex-widget-admin .form-control', function(){
31
+ let input = jQuery(this);
32
+
33
+ if (input.attr("required") != "required" || input.val())
34
+ {
35
+ input.prev().removeClass("text-danger");
36
+ }
37
+ else
38
+ {
39
+ input.prev().addClass("text-danger");
40
+ }
41
+
42
+ TImanageCopyLinks(input.closest("form"), input.closest("form").find("[data-ti-id='" + input.val() + "']"));
43
+ })
44
+ });
45
+
46
+ function TImanageCopyLinks($form, $selected_link)
47
+ {
48
+ let selected_class = "text-danger";
49
+
50
+ //reset
51
+ $form.find('.btn-copy-widget-id.' + selected_class).each(function(i, item){
52
+ jQuery(item).removeClass(selected_class)
53
+ .find(".dashicons").attr("class", "dashicons dashicons-admin-post");
54
+ });
55
+
56
+ //select
57
+ if ($selected_link)
58
+ {
59
+ $selected_link.addClass(selected_class)
60
+ .find(".dashicons").attr("class", "dashicons dashicons-yes");
61
+ }
62
+ }
tabs/my_reviews.php CHANGED
@@ -25,7 +25,7 @@ if(!is_null($start))
25
  {
26
  $highlight = $start . ',' . $length;
27
  }
28
- $wpdb->query("UPDATE `". $trustindex_pm_google->get_noreg_tablename() ."` SET highlight = '$highlight' WHERE id = '$id'");
29
  }
30
  exit;
31
  }
@@ -41,9 +41,9 @@ update_option($trustindex_pm_google->get_option_name('review-download-request-id
41
  exit;
42
  }
43
  $reviews = [];
44
- if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
45
  {
46
- $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
47
  }
48
  $is_review_download_in_progress = $trustindex_pm_google->is_review_download_in_progress();
49
  $review_download_request_id = get_option($trustindex_pm_google->get_option_name('review-download-request-id'));
@@ -122,7 +122,7 @@ $download_timestamp = get_option($trustindex_pm_google->get_option_name('downloa
122
  <input type="hidden" id="ti-noreg-page-id" value="<?php echo esc_attr($page_details['id']); ?>" />
123
  <input type="hidden" id="ti-noreg-webhook-url" value="<?php echo $trustindex_pm_google->get_webhook_url(); ?>" />
124
  <input type="hidden" id="ti-noreg-email" value="<?php echo get_option('admin_email'); ?>" />
125
- <input type="hidden" id="ti-noreg-version" value="9.2" />
126
  <?php if(isset($page_details['access_token'])): ?>
127
  <input type="hidden" id="ti-noreg-access-token" value="<?php echo esc_attr($page_details['access_token']); ?>" />
128
  <?php endif; ?>
@@ -152,7 +152,10 @@ update_option($trustindex_pm_google->get_option_name('review-download-token'), $
152
  <?php elseif($is_review_download_in_progress): ?>
153
  <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
154
  <p>
155
- <?php echo TrustindexPlugin_google::___('Your reviews are being downloaded in the background. This should not take more than a few minutes.'); ?>
 
 
 
156
  <?php if(!count($reviews)): ?>
157
  <br />
158
  <?php echo TrustindexPlugin_google::___('In the meantime, you can setup your widget with a few example reviews.'); ?>
@@ -161,7 +164,7 @@ update_option($trustindex_pm_google->get_option_name('review-download-token'), $
161
  <br />
162
  <a href="#" id="review-manual-download" class="button button-primary ti-tooltip" style="margin-top: 10px" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>">
163
  <?php echo TrustindexPlugin_google::___("Manual download") ;?>
164
- <span class="ti-tooltip-message"><?php echo TrustindexPlugin_google::___('Please wait a little while, we are not done downloading your reviews.'); ?></span>
165
  </a>
166
  <?php endif; ?>
167
  </p>
25
  {
26
  $highlight = $start . ',' . $length;
27
  }
28
+ $wpdb->query("UPDATE `". $trustindex_pm_google->get_tablename('reviews') ."` SET highlight = '$highlight' WHERE id = '$id'");
29
  }
30
  exit;
31
  }
41
  exit;
42
  }
43
  $reviews = [];
44
+ if($trustindex_pm_google->is_noreg_linked())
45
  {
46
+ $reviews = $wpdb->get_results('SELECT * FROM `'. $trustindex_pm_google->get_tablename('reviews') .'` ORDER BY date DESC');
47
  }
48
  $is_review_download_in_progress = $trustindex_pm_google->is_review_download_in_progress();
49
  $review_download_request_id = get_option($trustindex_pm_google->get_option_name('review-download-request-id'));
122
  <input type="hidden" id="ti-noreg-page-id" value="<?php echo esc_attr($page_details['id']); ?>" />
123
  <input type="hidden" id="ti-noreg-webhook-url" value="<?php echo $trustindex_pm_google->get_webhook_url(); ?>" />
124
  <input type="hidden" id="ti-noreg-email" value="<?php echo get_option('admin_email'); ?>" />
125
+ <input type="hidden" id="ti-noreg-version" value="9.3" />
126
  <?php if(isset($page_details['access_token'])): ?>
127
  <input type="hidden" id="ti-noreg-access-token" value="<?php echo esc_attr($page_details['access_token']); ?>" />
128
  <?php endif; ?>
152
  <?php elseif($is_review_download_in_progress): ?>
153
  <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
154
  <p>
155
+ <?php echo TrustindexPlugin_google::___('Your reviews are downloading in the background.'); ?>
156
+ <?php if(!in_array('google', [ 'facebook', 'google' ])): ?>
157
+ <?php echo TrustindexPlugin_google::___('This can take up to a few hours depending on the load and platform.'); ?>
158
+ <?php endif; ?>
159
  <?php if(!count($reviews)): ?>
160
  <br />
161
  <?php echo TrustindexPlugin_google::___('In the meantime, you can setup your widget with a few example reviews.'); ?>
164
  <br />
165
  <a href="#" id="review-manual-download" class="button button-primary ti-tooltip" style="margin-top: 10px" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>">
166
  <?php echo TrustindexPlugin_google::___("Manual download") ;?>
167
+ <span class="ti-tooltip-message"><?php echo TrustindexPlugin_google::___('Your reviews are downloading in the background. This can take up to a few hours depending on the load and platform.'); ?></span>
168
  </a>
169
  <?php endif; ?>
170
  </p>
tabs/setup_no_reg.php CHANGED
@@ -38,10 +38,13 @@
38
  <?php echo TrustindexPlugin_google::___('While downloading the reviews, we noticed that your connected page is not found.<br />If it really exists, please contact us to resolve the issue or try connect it again.'); ?><br />
39
  </p>
40
  </div>
41
- <?php elseif($is_review_download_in_progress): ?>
42
  <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
43
  <p>
44
- <?php echo TrustindexPlugin_google::___('Your reviews are downloading in the background. This can take up to a few hours depending on the load and platform'); ?>
 
 
 
45
  <?php if(!count($reviews)): ?>
46
  <br />
47
  <?php echo TrustindexPlugin_google::___('In the meantime, you can setup your widget with a few example reviews.'); ?>
@@ -50,7 +53,7 @@
50
  <br />
51
  <a href="#" id="review-manual-download" class="button button-primary ti-tooltip" style="margin-top: 10px" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>">
52
  <?php echo TrustindexPlugin_google::___("Manual download") ;?>
53
- <span class="ti-tooltip-message"><?php echo TrustindexPlugin_google::___('Your reviews are downloading in the background. This can take up to a few hours depending on the load and platform'); ?></span>
54
  </a>
55
  <?php endif; ?>
56
  </p>
@@ -114,7 +117,7 @@ update_option($trustindex_pm_google->get_option_name('review-download-token'), $
114
  <input type="hidden" id="ti-noreg-connect-token" name="ti-noreg-connect-token" value="<?php echo $review_download_token; ?>" />
115
  <input type="hidden" id="ti-noreg-webhook-url" value="<?php echo $trustindex_pm_google->get_webhook_url(); ?>" />
116
  <input type="hidden" id="ti-noreg-email" value="<?php echo get_option('admin_email'); ?>" />
117
- <input type="hidden" id="ti-noreg-version" value="9.2" />
118
  <input type="hidden" id="ti-noreg-review-download" name="review_download" value="0" />
119
  <input type="hidden" id="ti-noreg-review-request-id" name="review_request_id" value="" />
120
  <input type="hidden" id="ti-noreg-manual-download" name="manual_download" value=0 />
@@ -417,6 +420,15 @@ $widget_has_reviews = !in_array($widget_type, [ 'button', 'badge' ]) || in_array
417
  </div>
418
  <?php echo TrustindexPlugin_google::___('Copy and paste this shortcode into post, page or widget.'); ?>
419
  </div>
 
 
 
 
 
 
 
 
 
420
  <h1 class="ti-free-title"><?php echo TrustindexPlugin_google::___("Want to get more customers?"); ?></h1>
421
  <div class="ti-box">
422
  <div class="ti-header"><?php echo TrustindexPlugin_google::___('Increase SEO, trust and sales using customer reviews.'); ?></div>
@@ -459,4 +471,47 @@ $widget_has_reviews = !in_array($widget_type, [ 'button', 'badge' ]) || in_array
459
  </ul>
460
  <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-2" target="_blank"><?php echo TrustindexPlugin_google::___('Create a Free Account for More Features'); ?></a>
461
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  <?php endif; ?>
38
  <?php echo TrustindexPlugin_google::___('While downloading the reviews, we noticed that your connected page is not found.<br />If it really exists, please contact us to resolve the issue or try connect it again.'); ?><br />
39
  </p>
40
  </div>
41
+ <?php elseif($is_review_download_in_progress && ($trustindex_pm_google->is_review_manual_download() || !in_array('google', [ 'facebook', 'google' ]))): ?>
42
  <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
43
  <p>
44
+ <?php echo TrustindexPlugin_google::___('Your reviews are downloading in the background.'); ?>
45
+ <?php if(!in_array('google', [ 'facebook', 'google' ])): ?>
46
+ <?php echo TrustindexPlugin_google::___('This can take up to a few hours depending on the load and platform.'); ?>
47
+ <?php endif; ?>
48
  <?php if(!count($reviews)): ?>
49
  <br />
50
  <?php echo TrustindexPlugin_google::___('In the meantime, you can setup your widget with a few example reviews.'); ?>
53
  <br />
54
  <a href="#" id="review-manual-download" class="button button-primary ti-tooltip" style="margin-top: 10px" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>">
55
  <?php echo TrustindexPlugin_google::___("Manual download") ;?>
56
+ <span class="ti-tooltip-message"><?php echo TrustindexPlugin_google::___('Your reviews are downloading in the background. This can take up to a few hours depending on the load and platform.'); ?></span>
57
  </a>
58
  <?php endif; ?>
59
  </p>
117
  <input type="hidden" id="ti-noreg-connect-token" name="ti-noreg-connect-token" value="<?php echo $review_download_token; ?>" />
118
  <input type="hidden" id="ti-noreg-webhook-url" value="<?php echo $trustindex_pm_google->get_webhook_url(); ?>" />
119
  <input type="hidden" id="ti-noreg-email" value="<?php echo get_option('admin_email'); ?>" />
120
+ <input type="hidden" id="ti-noreg-version" value="9.3" />
121
  <input type="hidden" id="ti-noreg-review-download" name="review_download" value="0" />
122
  <input type="hidden" id="ti-noreg-review-request-id" name="review_request_id" value="" />
123
  <input type="hidden" id="ti-noreg-manual-download" name="manual_download" value=0 />
420
  </div>
421
  <?php echo TrustindexPlugin_google::___('Copy and paste this shortcode into post, page or widget.'); ?>
422
  </div>
423
+ <?php if(!$rate_us_feedback): ?>
424
+ <div class="ti-box ti-rate-us-box">
425
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("How's experience with Trustindex?"); ?></div>
426
+ <p><?php echo TrustindexPlugin_google::___('Rate us clicking on the stars'); ?></p>
427
+ <div class="ti-quick-rating">
428
+ <?php for($i = 5; $i >= 1; $i--): ?><div class="ti-star-check <?php if($i == 5): ?>active<?php endif; ?>" data-value="<?php echo $i; ?>"></div><?php endfor; ?>
429
+ </div>
430
+ </div>
431
+ <?php endif; ?>
432
  <h1 class="ti-free-title"><?php echo TrustindexPlugin_google::___("Want to get more customers?"); ?></h1>
433
  <div class="ti-box">
434
  <div class="ti-header"><?php echo TrustindexPlugin_google::___('Increase SEO, trust and sales using customer reviews.'); ?></div>
471
  </ul>
472
  <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-2" target="_blank"><?php echo TrustindexPlugin_google::___('Create a Free Account for More Features'); ?></a>
473
  </div>
474
+ <?php if(!$rate_us_feedback): ?>
475
+ <div class="ti-modal ti-rateus-modal" id="ti-rateus-modal-feedback">
476
+ <div class="ti-modal-dialog">
477
+ <div class="ti-modal-content">
478
+ <span class="ti-close-icon btn-modal-close"></span>
479
+ <div class="ti-modal-body">
480
+ <div class="ti-rating-textbox">
481
+ <div class="ti-quick-rating">
482
+ <?php for($i = 5; $i >= 1; $i--): ?><div class="ti-star-check" data-value="<?php echo $i; ?>"></div><?php endfor; ?>
483
+ <div class="clear"></div>
484
+ </div>
485
+ </div>
486
+ <div class="ti-rateus-title"><?php echo TrustindexPlugin_google::___('Thanks for your feedback!<br />Let us know how we can improve.') ;?></div>
487
+ <input type="text" class="form-control" placeholder="<?php echo TrustindexPlugin_google::___('Contact e-mail') ;?>" value="<?php echo $current_user->user_email; ?>" />
488
+ <textarea class="form-control" placeholder="<?php echo TrustindexPlugin_google::___('Describe your experience') ;?>"></textarea>
489
+ </div>
490
+ <div class="ti-modal-footer">
491
+ <a href="#" class="btn-text btn-modal-close"><?php echo TrustindexPlugin_google::___('Cancel') ;?></a>
492
+ <a href="#" class="btn-text btn-rateus-support" data-loading-text="<?php echo TrustindexPlugin_google::___('Loading') ;?>"><?php echo TrustindexPlugin_google::___('Contact our support') ;?></a>
493
+ </div>
494
+ </div>
495
+ </div>
496
+ </div>
497
+ <div class="ti-modal ti-rateus-modal" id="ti-rateus-modal-success">
498
+ <div class="ti-modal-dialog">
499
+ <div class="ti-modal-content">
500
+ <div class="ti-modal-body">
501
+ <div class="ti-rating-textbox">
502
+ <div class="ti-quick-rating">
503
+ <?php for($i = 5; $i >= 1; $i--): ?><div class="ti-star-check" data-value="<?php echo $i; ?>"></div><?php endfor; ?>
504
+ <div class="clear"></div>
505
+ </div>
506
+ </div>
507
+ <div class="ti-rateus-title"><?php echo TrustindexPlugin_google::___('Hurray!') ;?></div>
508
+ <p><?php echo TrustindexPlugin_google::___('Your valuable feedback encourages us to keep improving our plugin.<br />Please take a moment to share your experience with other users on Wordpress.<br />Thanks a million!'); ?></p>
509
+ </div>
510
+ <div class="ti-modal-footer">
511
+ <a href="#" class="btn-text btn-rateus-success" data-loading-text="<?php echo TrustindexPlugin_google::___('Loading') ;?>"><?php echo TrustindexPlugin_google::___('Review us on Wordpress') ;?></a>
512
+ </div>
513
+ </div>
514
+ </div>
515
+ </div>
516
+ <?php endif; ?>
517
  <?php endif; ?>
tabs/setup_no_reg_header.php CHANGED
@@ -12,31 +12,13 @@ $ti_command_list = [
12
  'save-options',
13
  'save-align',
14
  'save-amp-notice-hide',
15
- 'review-manual-download'
 
16
  ];
17
  if(!in_array($ti_command, $ti_command_list))
18
  {
19
  $ti_command = null;
20
  }
21
- function trustindex_database_create_check($table_exists_check = false)
22
- {
23
- global $wpdb;
24
- global $trustindex_pm_google;
25
- $last_error = $wpdb->last_error;
26
- if($trustindex_pm_google->is_noreg_table_exists() !== $table_exists_check)
27
- {
28
- return;
29
- }
30
- echo '
31
- <div class="ti-notice notice-error" style="margin: 25px 0 0 0">
32
- <p>
33
- '. TrustindexPlugin_google::___('We can not create MySQL table for the reviews!') .'<br /><br />
34
- '. TrustindexPlugin_google::___('We got the following error from %s:', [ 'MySQL' ]) .'<br >
35
- <strong>'. $last_error .'</strong>
36
- </p>
37
- </div>';
38
- exit;
39
- }
40
  function trustindex_plugin_connect_page($page_details = null, $default_settings = true, $review_download = false)
41
  {
42
  global $trustindex_pm_google;
@@ -45,25 +27,8 @@ if(!$page_details)
45
  {
46
  return false;
47
  }
48
- $dbtable = $trustindex_pm_google->get_noreg_tablename();
49
- require_once(ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'upgrade.php');
50
- $wpdb->hide_errors();
51
- if($trustindex_pm_google->is_noreg_table_exists())
52
- {
53
- $wpdb->query('DROP TABLE `'. $dbtable .'`');
54
- trustindex_database_create_check(true);
55
- }
56
- dbDelta("CREATE TABLE $dbtable (
57
- id TINYINT(1) NOT NULL AUTO_INCREMENT,
58
- user VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci,
59
- user_photo TEXT,
60
- text TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
61
- rating DECIMAL(3,1),
62
- highlight VARCHAR(11),
63
- date DATE,
64
- PRIMARY KEY (id)
65
- );");
66
- trustindex_database_create_check();
67
  $reviews = null;
68
  if(isset($page_details['reviews']))
69
  {
@@ -110,7 +75,7 @@ if(is_array($reviews))
110
  foreach($reviews as $row)
111
  {
112
  $date = isset($row['created_at']) ? $row['created_at'] : (isset($row['date']) ? $row['date'] : '');
113
- $wpdb->insert($dbtable, [
114
  'user' => $row['reviewer']['name'],
115
  'user_photo' => $row['reviewer']['avatar_url'],
116
  'text' => $row['text'],
@@ -171,8 +136,7 @@ delete_option( $trustindex_pm_google->get_option_name('show-arrows') );
171
  delete_option( $trustindex_pm_google->get_option_name('show-reviewers-photo') );
172
  delete_option( $trustindex_pm_google->get_option_name('widget-setted-up') );
173
  }
174
- $dbtable = $trustindex_pm_google->get_noreg_tablename();
175
- $wpdb->query("TRUNCATE `$dbtable`;");
176
  }
177
  function trustindex_plugin_change_step($step = 5)
178
  {
@@ -374,11 +338,30 @@ status_header(404);
374
  }
375
  exit;
376
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  $reviews = [];
378
  $only_ratings_default = false;
379
  if($trustindex_pm_google->is_noreg_linked())
380
  {
381
- $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
382
  $reviews_with_text = 0;
383
  foreach($reviews as $r)
384
  {
@@ -407,9 +390,11 @@ $scss_set_tmp = $scss_set ? $scss_set : 'light-background';
407
  $show_reviewers_photo = get_option( $trustindex_pm_google->get_option_name('show-reviewers-photo'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['reviewer-photo'] ? 1 : 0 );
408
  $show_logos = get_option( $trustindex_pm_google->get_option_name('show-logos'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['hide-logos'] ? 0 : 1 );
409
  $show_stars = get_option( $trustindex_pm_google->get_option_name('show-stars'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['hide-stars'] ? 0 : 1 );
 
410
  if(isset($_GET['recreate']))
411
  {
412
  $trustindex_pm_google->uninstall();
 
413
  header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
414
  exit;
415
  }
12
  'save-options',
13
  'save-align',
14
  'save-amp-notice-hide',
15
+ 'review-manual-download',
16
+ 'rate-us-feedback'
17
  ];
18
  if(!in_array($ti_command, $ti_command_list))
19
  {
20
  $ti_command = null;
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  function trustindex_plugin_connect_page($page_details = null, $default_settings = true, $review_download = false)
23
  {
24
  global $trustindex_pm_google;
27
  {
28
  return false;
29
  }
30
+ $table_name = $trustindex_pm_google->get_tablename('reviews');
31
+ $wpdb->query('TRUNCATE `'. $table_name .'`');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  $reviews = null;
33
  if(isset($page_details['reviews']))
34
  {
75
  foreach($reviews as $row)
76
  {
77
  $date = isset($row['created_at']) ? $row['created_at'] : (isset($row['date']) ? $row['date'] : '');
78
+ $wpdb->insert($table_name, [
79
  'user' => $row['reviewer']['name'],
80
  'user_photo' => $row['reviewer']['avatar_url'],
81
  'text' => $row['text'],
136
  delete_option( $trustindex_pm_google->get_option_name('show-reviewers-photo') );
137
  delete_option( $trustindex_pm_google->get_option_name('widget-setted-up') );
138
  }
139
+ $wpdb->query('TRUNCATE `'. $trustindex_pm_google->get_tablename('reviews') .'`');
 
140
  }
141
  function trustindex_plugin_change_step($step = 5)
142
  {
338
  }
339
  exit;
340
  }
341
+ elseif($ti_command == 'rate-us-feedback')
342
+ {
343
+ $text = isset($_POST['text']) ? trim(wp_kses_post(stripslashes($_POST['text']))) : "";
344
+ $email = isset($_POST['email']) ? trim(sanitize_text_field($_POST['email'])) : "";
345
+ $star = isset($_REQUEST['star']) ? intval($_REQUEST['star']) : 1;
346
+ update_option($trustindex_pm_google->get_option_name('rate-us-feedback'), $star, false);
347
+ if($star > 3)
348
+ {
349
+ header('Location: https://wordpress.org/support/plugin/'. $trustindex_pm_google->get_plugin_slug() . '/reviews/?rate=5#new-post');
350
+ }
351
+ else
352
+ {
353
+ wp_mail('support@trustindex.io', 'Feedback from Google plugin', "We received a <strong>$star star</strong> feedback about the Google plugin from $email:<br /><br />$text", [
354
+ 'From: '. $email,
355
+ 'Content-Type: text/html; charset=UTF-8'
356
+ ]);
357
+ }
358
+ exit;
359
+ }
360
  $reviews = [];
361
  $only_ratings_default = false;
362
  if($trustindex_pm_google->is_noreg_linked())
363
  {
364
+ $reviews = $wpdb->get_results('SELECT * FROM `'. $trustindex_pm_google->get_tablename('reviews') .'` ORDER BY date DESC');
365
  $reviews_with_text = 0;
366
  foreach($reviews as $r)
367
  {
390
  $show_reviewers_photo = get_option( $trustindex_pm_google->get_option_name('show-reviewers-photo'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['reviewer-photo'] ? 1 : 0 );
391
  $show_logos = get_option( $trustindex_pm_google->get_option_name('show-logos'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['hide-logos'] ? 0 : 1 );
392
  $show_stars = get_option( $trustindex_pm_google->get_option_name('show-stars'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['hide-stars'] ? 0 : 1 );
393
+ $rate_us_feedback = get_option( $trustindex_pm_google->get_option_name('rate-us-feedback'), 0 );
394
  if(isset($_GET['recreate']))
395
  {
396
  $trustindex_pm_google->uninstall();
397
+ $trustindex_pm_google->activate();
398
  header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
399
  exit;
400
  }
tabs/troubleshooting.php CHANGED
@@ -1,9 +1,9 @@
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";
@@ -39,7 +39,7 @@ exit;
39
  }
40
  $yes_icon = '<span class="dashicons dashicons-yes-alt"></span>';
41
  $no_icon = '<span class="dashicons dashicons-dismiss"></span>';
42
- $plugin_updated = ($trustindex_pm_google->get_plugin_current_version() <= "9.2");
43
  $css_inline = get_option($trustindex_pm_google->get_option_name('load-css-inline'), 0);
44
  $css = get_option($trustindex_pm_google->get_option_name('css-content'));
45
  ?>
1
  <?php
2
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
  $reviews = [];
4
+ if($trustindex_pm_google->is_noreg_linked())
5
  {
6
+ $reviews = $wpdb->get_results('SELECT * FROM `'. $trustindex_pm_google->get_tablename('reviews') .'` 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";
39
  }
40
  $yes_icon = '<span class="dashicons dashicons-yes-alt"></span>';
41
  $no_icon = '<span class="dashicons dashicons-dismiss"></span>';
42
+ $plugin_updated = ($trustindex_pm_google->get_plugin_current_version() <= "9.3");
43
  $css_inline = get_option($trustindex_pm_google->get_option_name('load-css-inline'), 0);
44
  $css = get_option($trustindex_pm_google->get_option_name('css-content'));
45
  ?>
trustindex-google-widget.class.php CHANGED
@@ -41,7 +41,7 @@ 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
  }
41
  {
42
  echo $trustindex_pm_google->get_trustindex_widget($instance['ti-widget-ID']);
43
  }
44
+ elseif($trustindex_pm_google->is_noreg_linked())
45
  {
46
  echo $trustindex_pm_google->get_noreg_list_reviews();
47
  }
trustindex-plugin.class.php CHANGED
@@ -71,8 +71,8 @@ update_option($this->get_option_name('page-details'), $details, false);
71
  public function save_reviews($tmp)
72
  {
73
  global $wpdb;
74
- $dbtable = $this->get_noreg_tablename();
75
- $wpdb->query("TRUNCATE $dbtable;");
76
  foreach($tmp as $i => $review)
77
  {
78
  foreach($review as $key => $value)
@@ -99,7 +99,7 @@ else
99
  $review[ $key ] = $value ? sanitize_text_field(stripslashes($value)) : $value;
100
  }
101
  }
102
- $wpdb->insert($dbtable, [
103
  'user' => $review['reviewer']['name'],
104
  'user_photo' => $review['reviewer']['avatar_url'],
105
  'text' => $review['text'],
@@ -156,15 +156,7 @@ public function output_buffer()
156
  public function uninstall()
157
  {
158
  $this->delete_async_request();
159
- foreach ($this->get_option_names() as $opt_name)
160
- {
161
- delete_option($this->get_option_name($opt_name));
162
- }
163
- if($this->is_noreg_table_exists())
164
- {
165
- global $wpdb;
166
- $wpdb->query('DROP TABLE `'. $this->get_noreg_tablename() .'`');
167
- }
168
  if(is_file($this->getCssFile()))
169
  {
170
  unlink($this->getCssFile());
@@ -174,36 +166,15 @@ unlink($this->getCssFile());
174
 
175
  public function activate()
176
  {
177
- if ($this->is_need_update())
178
- {
179
- add_option($this->get_option_name('active'), '1');
180
- update_option($this->get_option_name('version'), $this->version);
181
- }
182
  }
183
  public function deactivate()
184
  {
 
185
  }
186
  public function is_enabled()
187
  {
188
- $active = get_option($this->get_option_name('active'));
189
- if (empty($active) || $active === '0')
190
- {
191
- return false;
192
- }
193
- return true;
194
- }
195
- public function is_need_update()
196
- {
197
- $version = (string)get_option($this->get_option_name('version'));
198
- if (!$version)
199
- {
200
- $version = '0';
201
- }
202
- if (version_compare($version, $this->version, '<'))
203
- {
204
- return true;
205
- }
206
- return false;
207
  }
208
 
209
  public function add_setting_menu()
@@ -328,6 +299,7 @@ return [
328
  'no-rating-text',
329
  'dateformat',
330
  'rate-us',
 
331
  'verified-icon',
332
  'enable-animation',
333
  'show-arrows',
@@ -474,8 +446,8 @@ $chosed_platform_slug = $this->plugin_slugs[ $force_platform ];
474
  $current_platform_slug = $this->plugin_slugs[ $this->shortname ];
475
  $file_path = preg_replace('/[^\/\\\\]+([\\\\\/]trustindex-plugin\.class\.php)/', $chosed_platform_slug . '$1', $file_path);
476
  }
477
- $chosed_platform = new self($force_platform, $file_path, "do-not-care-9.2", "do-not-care-Widgets for Google Reviews", "do-not-care-Google");
478
- if(!$chosed_platform->is_noreg_linked() || !$chosed_platform->is_noreg_table_exists($force_platform))
479
  {
480
  return self::get_alertbox(
481
  "error",
@@ -511,18 +483,6 @@ public function is_noreg_linked()
511
  $page_details = get_option($this->get_option_name('page-details'));
512
  return $page_details && !empty($page_details);
513
  }
514
- public function get_noreg_tablename($force_platform = null)
515
- {
516
- global $wpdb;
517
- $force_platform = $force_platform ? $force_platform : $this->shortname;
518
- return $wpdb->prefix ."trustindex_".$force_platform."_reviews";
519
- }
520
- public function is_noreg_table_exists($force_platform = null)
521
- {
522
- global $wpdb;
523
- $dbtable = $this->get_noreg_tablename($force_platform);
524
- return ($wpdb->get_var("SHOW TABLES LIKE '$dbtable'") == $dbtable);
525
- }
526
  public function noreg_save_css($set_change = false)
527
  {
528
  $style_id = (int)get_option($this->get_option_name('style-id'), 4);
@@ -587,13 +547,13 @@ public function plugin_loaded()
587
  global $wpdb;
588
  $version = $this->version;
589
 
590
- if($this->is_noreg_linked() && $this->is_noreg_table_exists())
591
  {
592
- $db_table_name = $this->get_noreg_tablename();
593
 
594
- if($version >= 6.3 && count($wpdb->get_results("SHOW COLUMNS FROM $db_table_name LIKE 'highlight'")) == 0)
595
  {
596
- $wpdb->query("ALTER TABLE $db_table_name ADD highlight VARCHAR(11) NULL AFTER rating");
597
  }
598
  }
599
  if($this->is_noreg_linked() && get_option( $this->get_option_name('review-content') ))
@@ -4000,6 +3960,25 @@ private static $widget_month_names = array (
4000
  11 => 'желтоқсан',
4001
  ),
4002
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4003
  private static $page_urls = array (
4004
  'facebook' => 'https://www.facebook.com/pg/%page_id%',
4005
  'google' => 'https://www.google.com/maps/search/?api=1&query=Google&query_place_id=%page_id%',
@@ -4129,7 +4108,7 @@ if($this->is_ten_scale_rating_platform())
4129
  {
4130
  $sql_rating_field = 'ROUND(rating / 2, 0)';
4131
  }
4132
- $sql = 'SELECT *, rating as original_rating, '. $sql_rating_field .' as rating FROM `'. $this->get_noreg_tablename($force_platform) .'` ';
4133
  $filter = get_option($this->get_option_name('filter'));
4134
  if(!$list_all && $filter)
4135
  {
@@ -4166,11 +4145,7 @@ $sql .= ' LIMIT 10';
4166
  break;
4167
  }
4168
  }
4169
- $reviews = [];
4170
- if($this->is_noreg_table_exists())
4171
- {
4172
  $reviews = $wpdb->get_results($sql);
4173
- }
4174
  if($default_reviews && ($force_default_reviews || !count($reviews)))
4175
  {
4176
  $lang = substr(get_locale(), 0, 2);
@@ -4406,7 +4381,7 @@ $rating_content = '<span class="ti-polarity"><span class="ti-polarity-icon ' . $
4406
  }
4407
  else if($this->is_ten_scale_rating_platform())
4408
  {
4409
- $rating_content = '<div class="ti-rating-box">'. $this->formatTenRating($r->original_rating) .'</div>';
4410
  }
4411
  if($array['verified_icon'])
4412
  {
@@ -4484,7 +4459,7 @@ $this->is_ten_scale_rating_platform() ? 10 : 5,
4484
  $this->get_rating_text($rating_score, $array['language']),
4485
  $array['page_details']['avatar_url'],
4486
  $this->get_platform_name($this->getShortName(), $array['page_details']['id']),
4487
- $this->is_ten_scale_rating_platform() ? "<div class='ti-rating-box'>". $this->formatTenRating($rating_score) ."</div>" : $this->get_rating_stars($rating_score),
4488
  '<div class="ti-small-logo"><img src="'. $this->get_plugin_file_url('static/img/platform/logo.svg') . '" alt="'. ucfirst($this->getShortName()) .'"></div>',
4489
  ], $array['content']);
4490
  if($this->isDarkLogo($array['style_id'], $array['set_id']))
@@ -4980,13 +4955,17 @@ public function is_ten_scale_rating_platform()
4980
  {
4981
  return in_array($this->shortname, [ 'booking', 'hotels', 'foursquare', 'szallashu' ]);
4982
  }
4983
- public function formatTenRating($rating)
 
 
4984
  {
 
 
4985
  if($rating == 10)
4986
  {
4987
  $rating = '10';
4988
  }
4989
- if($this->shortname == "booking")
4990
  {
4991
  $rating = str_replace('.', ',', $rating);
4992
  }
@@ -5083,5 +5062,30 @@ register_rest_route( 'trustindex/v1', '/setup-complete', array(
5083
  'permission_callback' => '__return_true'
5084
  ) );
5085
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5086
  }
5087
  ?>
71
  public function save_reviews($tmp)
72
  {
73
  global $wpdb;
74
+ $table_name = $this->get_tablename('reviews');
75
+ $wpdb->query('TRUNCATE `'. $table_name .'`');
76
  foreach($tmp as $i => $review)
77
  {
78
  foreach($review as $key => $value)
99
  $review[ $key ] = $value ? sanitize_text_field(stripslashes($value)) : $value;
100
  }
101
  }
102
+ $wpdb->insert($table_name, [
103
  'user' => $review['reviewer']['name'],
104
  'user_photo' => $review['reviewer']['avatar_url'],
105
  'text' => $review['text'],
156
  public function uninstall()
157
  {
158
  $this->delete_async_request();
159
+ include $this->get_plugin_dir() . 'include' . DIRECTORY_SEPARATOR . 'uninstall.php';
 
 
 
 
 
 
 
 
160
  if(is_file($this->getCssFile()))
161
  {
162
  unlink($this->getCssFile());
166
 
167
  public function activate()
168
  {
169
+ include $this->get_plugin_dir() . 'include' . DIRECTORY_SEPARATOR . 'activate.php';
 
 
 
 
170
  }
171
  public function deactivate()
172
  {
173
+ update_option($this->get_option_name('active'), '0');
174
  }
175
  public function is_enabled()
176
  {
177
+ return get_option($this->get_option_name('active'), 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
 
180
  public function add_setting_menu()
299
  'no-rating-text',
300
  'dateformat',
301
  'rate-us',
302
+ 'rate-us-feedback',
303
  'verified-icon',
304
  'enable-animation',
305
  'show-arrows',
446
  $current_platform_slug = $this->plugin_slugs[ $this->shortname ];
447
  $file_path = preg_replace('/[^\/\\\\]+([\\\\\/]trustindex-plugin\.class\.php)/', $chosed_platform_slug . '$1', $file_path);
448
  }
449
+ $chosed_platform = new self($force_platform, $file_path, "do-not-care-9.3", "do-not-care-Widgets for Google Reviews", "do-not-care-Google");
450
+ if(!$chosed_platform->is_noreg_linked())
451
  {
452
  return self::get_alertbox(
453
  "error",
483
  $page_details = get_option($this->get_option_name('page-details'));
484
  return $page_details && !empty($page_details);
485
  }
 
 
 
 
 
 
 
 
 
 
 
 
486
  public function noreg_save_css($set_change = false)
487
  {
488
  $style_id = (int)get_option($this->get_option_name('style-id'), 4);
547
  global $wpdb;
548
  $version = $this->version;
549
 
550
+ if($this->is_noreg_linked())
551
  {
552
+ $table_name = $this->get_tablename('reviews');
553
 
554
+ if($version >= 6.3 && count($wpdb->get_results('SHOW COLUMNS FROM `'. $table_name .'` LIKE "highlight"')) == 0)
555
  {
556
+ $wpdb->query('ALTER TABLE `'. $table_name .'` ADD highlight VARCHAR(11) NULL AFTER rating');
557
  }
558
  }
559
  if($this->is_noreg_linked() && get_option( $this->get_option_name('review-content') ))
3960
  11 => 'желтоқсан',
3961
  ),
3962
  );
3963
+ private static $dot_separated_languages = array (
3964
+ 0 => 'ar',
3965
+ 1 => 'en',
3966
+ 2 => 'es',
3967
+ 3 => 'ms',
3968
+ 4 => 'ga',
3969
+ 5 => 'hi',
3970
+ 6 => 'iw',
3971
+ 7 => 'jp',
3972
+ 8 => 'ko',
3973
+ 9 => 'mi',
3974
+ 10 => 'mt',
3975
+ 11 => 'ne',
3976
+ 12 => 'si',
3977
+ 13 => 'th',
3978
+ 14 => 'tl',
3979
+ 15 => 'ur',
3980
+ 16 => 'zh',
3981
+ );
3982
  private static $page_urls = array (
3983
  'facebook' => 'https://www.facebook.com/pg/%page_id%',
3984
  'google' => 'https://www.google.com/maps/search/?api=1&query=Google&query_place_id=%page_id%',
4108
  {
4109
  $sql_rating_field = 'ROUND(rating / 2, 0)';
4110
  }
4111
+ $sql = 'SELECT *, rating as original_rating, '. $sql_rating_field .' as rating FROM `'. $this->get_tablename('reviews') .'` ';
4112
  $filter = get_option($this->get_option_name('filter'));
4113
  if(!$list_all && $filter)
4114
  {
4145
  break;
4146
  }
4147
  }
 
 
 
4148
  $reviews = $wpdb->get_results($sql);
 
4149
  if($default_reviews && ($force_default_reviews || !count($reviews)))
4150
  {
4151
  $lang = substr(get_locale(), 0, 2);
4381
  }
4382
  else if($this->is_ten_scale_rating_platform())
4383
  {
4384
+ $rating_content = '<div class="ti-rating-box">'. $this->formatTenRating($r->original_rating, $array['language']) .'</div>';
4385
  }
4386
  if($array['verified_icon'])
4387
  {
4459
  $this->get_rating_text($rating_score, $array['language']),
4460
  $array['page_details']['avatar_url'],
4461
  $this->get_platform_name($this->getShortName(), $array['page_details']['id']),
4462
+ $this->is_ten_scale_rating_platform() ? "<div class='ti-rating-box'>". $this->formatTenRating($rating_score, $array['language']) ."</div>" : $this->get_rating_stars($rating_score),
4463
  '<div class="ti-small-logo"><img src="'. $this->get_plugin_file_url('static/img/platform/logo.svg') . '" alt="'. ucfirst($this->getShortName()) .'"></div>',
4464
  ], $array['content']);
4465
  if($this->isDarkLogo($array['style_id'], $array['set_id']))
4955
  {
4956
  return in_array($this->shortname, [ 'booking', 'hotels', 'foursquare', 'szallashu' ]);
4957
  }
4958
+ public function formatTenRating($rating, $language = null)
4959
+ {
4960
+ if(!$language)
4961
  {
4962
+ $language = get_option($this->get_option_name('lang'), 'en');
4963
+ }
4964
  if($rating == 10)
4965
  {
4966
  $rating = '10';
4967
  }
4968
+ if(!in_array($language, self::$dot_separated_languages))
4969
  {
4970
  $rating = str_replace('.', ',', $rating);
4971
  }
5062
  'permission_callback' => '__return_true'
5063
  ) );
5064
  }
5065
+
5066
+
5067
+ public function get_tablename($name = "")
5068
+ {
5069
+ global $wpdb;
5070
+ return $wpdb->prefix . 'trustindex_' . $this->shortname . '_' . $name;
5071
+ }
5072
+ public function is_table_exists($name = "")
5073
+ {
5074
+ global $wpdb;
5075
+ $table_name = $this->get_tablename($name);
5076
+ return ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name);
5077
+ }
5078
+ public function get_noreg_tablename($force_platform = null)
5079
+ {
5080
+ global $wpdb;
5081
+ $force_platform = $force_platform ? $force_platform : $this->shortname;
5082
+ return $wpdb->prefix ."trustindex_".$force_platform."_reviews";
5083
+ }
5084
+ public function is_noreg_table_exists($force_platform = null)
5085
+ {
5086
+ global $wpdb;
5087
+ $dbtable = $this->get_noreg_tablename($force_platform);
5088
+ return ($wpdb->get_var("SHOW TABLES LIKE '$dbtable'") == $dbtable);
5089
+ }
5090
  }
5091
  ?>
uninstall.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
  require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
3
- $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "9.2", "Widgets for Google Reviews", "Google");
4
  $trustindex_pm_google->uninstall();
5
  ?>
1
  <?php
2
  require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
3
+ $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "9.3", "Widgets for Google Reviews", "Google");
4
  $trustindex_pm_google->uninstall();
5
  ?>
wp-reviews-plugin-for-google.php CHANGED
@@ -9,7 +9,7 @@ Author: Trustindex.io <support@trustindex.io>
9
  Author URI: https://www.trustindex.io/
10
  Contributors: trustindex
11
  License: GPLv2 or later
12
- Version: 9.2
13
  Text Domain: wp-reviews-plugin-for-google
14
  Domain Path: /languages/
15
  Donate link: https://www.trustindex.io/prices/
@@ -19,7 +19,7 @@ Copyright 2019 Trustindex Kft (email: support@trustindex.io)
19
  */
20
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
21
  require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
22
- $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "9.2", "Widgets for Google Reviews", "Google");
23
  register_activation_hook(__FILE__, array($trustindex_pm_google, 'activate'));
24
  register_deactivation_hook(__FILE__, array($trustindex_pm_google, 'deactivate'));
25
  add_action('admin_menu', array($trustindex_pm_google, 'add_setting_menu'), 10);
@@ -37,7 +37,7 @@ global $trustindex_pm_google;
37
  if(!isset($trustindex_pm_google) || is_null($trustindex_pm_google))
38
  {
39
  require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
40
- $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "9.2", "Widgets for Google Reviews", "Google");
41
  }
42
  $path = wp_upload_dir()['baseurl'] .'/'. $trustindex_pm_google->getCssFile(true);
43
  if(is_ssl())
@@ -141,7 +141,6 @@ $our_token = $trustindex_pm_google->is_review_download_in_progress();
141
  if(
142
  !$token
143
  || !$trustindex_pm_google->is_noreg_linked()
144
- || !$trustindex_pm_google->is_noreg_table_exists()
145
  || $our_token != $token
146
  ) {
147
  global $wp_query;
@@ -158,7 +157,6 @@ else
158
  {
159
  if(isset($_REQUEST['details']))
160
  {
161
- $name = sanitize_text_field($_REQUEST['details']['name']);
162
  $trustindex_pm_google->save_details($_REQUEST['details']);
163
  $trustindex_pm_google->save_reviews(isset($_REQUEST['reviews']) ? $_REQUEST['reviews'] : []);
164
  }
@@ -169,13 +167,20 @@ update_option($trustindex_pm_google->get_option_name('download-timestamp'), time
169
  try
170
  {
171
  $subject = 'Google reviews downloaded';
172
- $message = "
173
- Hello,<br /><br />
174
- Your request to download the reviews of ". $name ." (Google page) has been successfully completed and the Trustindex plugin has received the result.<br /><br />
175
- What's next?<br />
176
- 1. Check the widget in the plugin and change the settings if needed <br />
177
- 2. Put the widget's shortcode into your pages to increase trust in your visitors <br />
178
- 3. You may want to try the paid features (multiple platforms at once, multiple layouts, filters, automatic review updates, auto collect new reviews, ...) <br />";
 
 
 
 
 
 
 
179
  $headers = [ 'Content-Type: text/html; charset=UTF-8' ];
180
  wp_mail(get_option('admin_email'), $subject, $message, $headers, [ '' ]);
181
  }
9
  Author URI: https://www.trustindex.io/
10
  Contributors: trustindex
11
  License: GPLv2 or later
12
+ Version: 9.3
13
  Text Domain: wp-reviews-plugin-for-google
14
  Domain Path: /languages/
15
  Donate link: https://www.trustindex.io/prices/
19
  */
20
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
21
  require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
22
+ $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "9.3", "Widgets for Google Reviews", "Google");
23
  register_activation_hook(__FILE__, array($trustindex_pm_google, 'activate'));
24
  register_deactivation_hook(__FILE__, array($trustindex_pm_google, 'deactivate'));
25
  add_action('admin_menu', array($trustindex_pm_google, 'add_setting_menu'), 10);
37
  if(!isset($trustindex_pm_google) || is_null($trustindex_pm_google))
38
  {
39
  require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
40
+ $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "9.3", "Widgets for Google Reviews", "Google");
41
  }
42
  $path = wp_upload_dir()['baseurl'] .'/'. $trustindex_pm_google->getCssFile(true);
43
  if(is_ssl())
141
  if(
142
  !$token
143
  || !$trustindex_pm_google->is_noreg_linked()
 
144
  || $our_token != $token
145
  ) {
146
  global $wp_query;
157
  {
158
  if(isset($_REQUEST['details']))
159
  {
 
160
  $trustindex_pm_google->save_details($_REQUEST['details']);
161
  $trustindex_pm_google->save_reviews(isset($_REQUEST['reviews']) ? $_REQUEST['reviews'] : []);
162
  }
167
  try
168
  {
169
  $subject = 'Google reviews downloaded';
170
+ $message = '
171
+ <p>Great news!</p>
172
+ <p><strong>Your reviews are downloaded <span style="color: red">from Google</span>!</strong></p>
173
+ <p>Create amazing review widgets on your website. You can choose from 40 website widget layouts and 25 widget styles.</p>
174
+ <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate !important;border-radius: 3px;background-color: #2AA8D7;mso-table-lspace: 0pt;mso-table-rspace: 0pt;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
175
+ <tbody>
176
+ <tr>
177
+ <td align="center" valign="middle" style="font-family: Arial;font-size: 16px;padding: 12px 20px;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;">
178
+ <a title="Create website widget now! »" href="'. admin_url('admin.php') .'?page='. urlencode($trustindex_pm_google->get_plugin_slug() .'/settings.php') .'&tab=setup_no_reg" target="_blank" style="font-weight: bold;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;display: block;">Create website widget now! »</a>
179
+ </td>
180
+ </tr>
181
+ </tbody>
182
+ </table>
183
+ ';
184
  $headers = [ 'Content-Type: text/html; charset=UTF-8' ];
185
  wp_mail(get_option('admin_email'), $subject, $message, $headers, [ '' ]);
186
  }