Widgets for Google Reviews - Version 8.2.3

Version Description

Download this release

Release Info

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

Code changes from version 8.2.2 to 8.2.3

Files changed (114) hide show
  1. trunk/languages/trustindex-af.mo +0 -0
  2. trunk/languages/trustindex-ar.mo +0 -0
  3. trunk/languages/trustindex-ary.mo +0 -0
  4. trunk/languages/trustindex-az.mo +0 -0
  5. trunk/languages/trustindex-azb.mo +0 -0
  6. trunk/languages/trustindex-bg_BG.mo +0 -0
  7. trunk/languages/trustindex-bn_BD.mo +0 -0
  8. trunk/languages/trustindex-bs_BA.mo +0 -0
  9. trunk/languages/trustindex-cs_CZ.mo +0 -0
  10. trunk/languages/trustindex-cy.mo +0 -0
  11. trunk/languages/trustindex-da_DK.mo +0 -0
  12. trunk/languages/trustindex-de_AT.mo +0 -0
  13. trunk/languages/trustindex-de_CH.mo +0 -0
  14. trunk/languages/trustindex-de_CH_informal.mo +0 -0
  15. trunk/languages/trustindex-de_DE.mo +0 -0
  16. trunk/languages/trustindex-de_DE_formal.mo +0 -0
  17. trunk/languages/trustindex-el.mo +0 -0
  18. trunk/languages/trustindex-es_AR.mo +0 -0
  19. trunk/languages/trustindex-es_CL.mo +0 -0
  20. trunk/languages/trustindex-es_CO.mo +0 -0
  21. trunk/languages/trustindex-es_CR.mo +0 -0
  22. trunk/languages/trustindex-es_ES.mo +0 -0
  23. trunk/languages/trustindex-es_GT.mo +0 -0
  24. trunk/languages/trustindex-es_MX.mo +0 -0
  25. trunk/languages/trustindex-es_PE.mo +0 -0
  26. trunk/languages/trustindex-es_PR.mo +0 -0
  27. trunk/languages/trustindex-es_UY.mo +0 -0
  28. trunk/languages/trustindex-es_VE.mo +0 -0
  29. trunk/languages/trustindex-et.mo +0 -0
  30. trunk/languages/trustindex-fa_AF.mo +0 -0
  31. trunk/languages/trustindex-fa_IR.mo +0 -0
  32. trunk/languages/trustindex-fi.mo +0 -0
  33. trunk/languages/trustindex-fr_BR.mo +0 -0
  34. trunk/languages/trustindex-fr_CA.mo +0 -0
  35. trunk/languages/trustindex-fr_FR.mo +0 -0
  36. trunk/languages/trustindex-gd.mo +0 -0
  37. trunk/languages/trustindex-gl_ES.mo +0 -0
  38. trunk/languages/trustindex-he_IL.mo +0 -0
  39. trunk/languages/trustindex-hi_IN.mo +0 -0
  40. trunk/languages/trustindex-hr.mo +0 -0
  41. trunk/languages/trustindex-hu_HU.mo +0 -0
  42. trunk/languages/trustindex-hy.mo +0 -0
  43. trunk/languages/trustindex-id_ID.mo +0 -0
  44. trunk/languages/trustindex-is_IS.mo +0 -0
  45. trunk/languages/trustindex-it_IT.mo +0 -0
  46. trunk/languages/trustindex-ja.mo +0 -0
  47. trunk/languages/trustindex-ka_GE.mo +0 -0
  48. trunk/languages/trustindex-kk.mo +0 -0
  49. trunk/languages/trustindex-ko_KR.mo +0 -0
  50. trunk/languages/trustindex-lt_LT.mo +0 -0
  51. trunk/languages/trustindex-mk_MK.mo +0 -0
  52. trunk/languages/trustindex-ms_MY.mo +0 -0
  53. trunk/languages/trustindex-nb_NO.mo +0 -0
  54. trunk/languages/trustindex-nl_BE.mo +0 -0
  55. trunk/languages/trustindex-nl_NL.mo +0 -0
  56. trunk/languages/trustindex-nl_NL_formal.mo +0 -0
  57. trunk/languages/trustindex-nn_NO.mo +0 -0
  58. trunk/languages/trustindex-pl_PL.mo +0 -0
  59. trunk/languages/trustindex-pt_AO.mo +0 -0
  60. trunk/languages/trustindex-pt_BR.mo +0 -0
  61. trunk/languages/trustindex-pt_PT.mo +0 -0
  62. trunk/languages/trustindex-pt_PT_ao90.mo +0 -0
  63. trunk/languages/trustindex-ro_RO.mo +0 -0
  64. trunk/languages/trustindex-ru_RU.mo +0 -0
  65. trunk/languages/trustindex-sk_SK.mo +0 -0
  66. trunk/languages/trustindex-sl_SI.mo +0 -0
  67. trunk/languages/trustindex-sq.mo +0 -0
  68. trunk/languages/trustindex-sr_RS.mo +0 -0
  69. trunk/languages/trustindex-sv_SE.mo +0 -0
  70. trunk/languages/trustindex-th.mo +0 -0
  71. trunk/languages/trustindex-tr_TR.mo +0 -0
  72. trunk/languages/trustindex-uk.mo +0 -0
  73. trunk/languages/trustindex-vi.mo +0 -0
  74. trunk/languages/trustindex-zh_CN.mo +0 -0
  75. trunk/languages/trustindex-zh_HK.mo +0 -0
  76. trunk/languages/trustindex-zh_TW.mo +0 -0
  77. trunk/readme.txt +230 -0
  78. trunk/settings.php +226 -0
  79. trunk/static/block-editor/block-editor.js +1 -0
  80. trunk/static/block-editor/block-editor.php +102 -0
  81. trunk/static/css/admin-editor.css +2 -0
  82. trunk/static/css/admin-page-settings.css +1 -0
  83. trunk/static/css/admin-widget.css +11 -0
  84. trunk/static/img/check-icon.svg +24 -0
  85. trunk/static/img/help-where-is-id.jpg +0 -0
  86. trunk/static/img/no.png +0 -0
  87. trunk/static/img/platform/logo-dark.svg +1 -0
  88. trunk/static/img/platform/logo.svg +1 -0
  89. trunk/static/img/platforms.png +0 -0
  90. trunk/static/img/special_30.jpg +0 -0
  91. trunk/static/img/trustindex-sign-logo.png +0 -0
  92. trunk/static/img/trustindex.svg +1 -0
  93. trunk/static/img/yes.png +0 -0
  94. trunk/static/js/admin-editor.js +1 -0
  95. trunk/static/js/admin-page-settings-common.js +1 -0
  96. trunk/static/js/admin-page-settings-connect.js +1 -0
  97. trunk/static/js/admin-page-settings.js +1 -0
  98. trunk/static/js/admin-popup.js +1 -0
  99. trunk/static/js/admin-widget.js +1 -0
  100. trunk/tabs/demo_widgets.php +33 -0
  101. trunk/tabs/get_reviews.php +35 -0
  102. trunk/tabs/my_reviews.php +182 -0
  103. trunk/tabs/rate.php +24 -0
  104. trunk/tabs/setup_no_reg.php +426 -0
  105. trunk/tabs/setup_no_reg_header.php +433 -0
  106. trunk/tabs/setup_no_reg_platform.php +20 -0
  107. trunk/tabs/setup_trustindex.php +36 -0
  108. trunk/tabs/setup_trustindex_join.php +180 -0
  109. trunk/tabs/troubleshooting.php +261 -0
  110. trunk/tabs/woocommerce.php +0 -0
  111. trunk/trustindex-google-widget.class.php +132 -0
  112. trunk/trustindex-plugin.class.php +5029 -0
  113. trunk/uninstall.php +5 -0
  114. trunk/wp-reviews-plugin-for-google.php +129 -0
trunk/languages/trustindex-af.mo ADDED
Binary file
trunk/languages/trustindex-ar.mo ADDED
Binary file
trunk/languages/trustindex-ary.mo ADDED
Binary file
trunk/languages/trustindex-az.mo ADDED
Binary file
trunk/languages/trustindex-azb.mo ADDED
Binary file
trunk/languages/trustindex-bg_BG.mo ADDED
Binary file
trunk/languages/trustindex-bn_BD.mo ADDED
Binary file
trunk/languages/trustindex-bs_BA.mo ADDED
Binary file
trunk/languages/trustindex-cs_CZ.mo ADDED
Binary file
trunk/languages/trustindex-cy.mo ADDED
Binary file
trunk/languages/trustindex-da_DK.mo ADDED
Binary file
trunk/languages/trustindex-de_AT.mo ADDED
Binary file
trunk/languages/trustindex-de_CH.mo ADDED
Binary file
trunk/languages/trustindex-de_CH_informal.mo ADDED
Binary file
trunk/languages/trustindex-de_DE.mo ADDED
Binary file
trunk/languages/trustindex-de_DE_formal.mo ADDED
Binary file
trunk/languages/trustindex-el.mo ADDED
Binary file
trunk/languages/trustindex-es_AR.mo ADDED
Binary file
trunk/languages/trustindex-es_CL.mo ADDED
Binary file
trunk/languages/trustindex-es_CO.mo ADDED
Binary file
trunk/languages/trustindex-es_CR.mo ADDED
Binary file
trunk/languages/trustindex-es_ES.mo ADDED
Binary file
trunk/languages/trustindex-es_GT.mo ADDED
Binary file
trunk/languages/trustindex-es_MX.mo ADDED
Binary file
trunk/languages/trustindex-es_PE.mo ADDED
Binary file
trunk/languages/trustindex-es_PR.mo ADDED
Binary file
trunk/languages/trustindex-es_UY.mo ADDED
Binary file
trunk/languages/trustindex-es_VE.mo ADDED
Binary file
trunk/languages/trustindex-et.mo ADDED
Binary file
trunk/languages/trustindex-fa_AF.mo ADDED
Binary file
trunk/languages/trustindex-fa_IR.mo ADDED
Binary file
trunk/languages/trustindex-fi.mo ADDED
Binary file
trunk/languages/trustindex-fr_BR.mo ADDED
Binary file
trunk/languages/trustindex-fr_CA.mo ADDED
Binary file
trunk/languages/trustindex-fr_FR.mo ADDED
Binary file
trunk/languages/trustindex-gd.mo ADDED
Binary file
trunk/languages/trustindex-gl_ES.mo ADDED
Binary file
trunk/languages/trustindex-he_IL.mo ADDED
Binary file
trunk/languages/trustindex-hi_IN.mo ADDED
Binary file
trunk/languages/trustindex-hr.mo ADDED
Binary file
trunk/languages/trustindex-hu_HU.mo ADDED
Binary file
trunk/languages/trustindex-hy.mo ADDED
Binary file
trunk/languages/trustindex-id_ID.mo ADDED
Binary file
trunk/languages/trustindex-is_IS.mo ADDED
Binary file
trunk/languages/trustindex-it_IT.mo ADDED
Binary file
trunk/languages/trustindex-ja.mo ADDED
Binary file
trunk/languages/trustindex-ka_GE.mo ADDED
Binary file
trunk/languages/trustindex-kk.mo ADDED
Binary file
trunk/languages/trustindex-ko_KR.mo ADDED
Binary file
trunk/languages/trustindex-lt_LT.mo ADDED
Binary file
trunk/languages/trustindex-mk_MK.mo ADDED
Binary file
trunk/languages/trustindex-ms_MY.mo ADDED
Binary file
trunk/languages/trustindex-nb_NO.mo ADDED
Binary file
trunk/languages/trustindex-nl_BE.mo ADDED
Binary file
trunk/languages/trustindex-nl_NL.mo ADDED
Binary file
trunk/languages/trustindex-nl_NL_formal.mo ADDED
Binary file
trunk/languages/trustindex-nn_NO.mo ADDED
Binary file
trunk/languages/trustindex-pl_PL.mo ADDED
Binary file
trunk/languages/trustindex-pt_AO.mo ADDED
Binary file
trunk/languages/trustindex-pt_BR.mo ADDED
Binary file
trunk/languages/trustindex-pt_PT.mo ADDED
Binary file
trunk/languages/trustindex-pt_PT_ao90.mo ADDED
Binary file
trunk/languages/trustindex-ro_RO.mo ADDED
Binary file
trunk/languages/trustindex-ru_RU.mo ADDED
Binary file
trunk/languages/trustindex-sk_SK.mo ADDED
Binary file
trunk/languages/trustindex-sl_SI.mo ADDED
Binary file
trunk/languages/trustindex-sq.mo ADDED
Binary file
trunk/languages/trustindex-sr_RS.mo ADDED
Binary file
trunk/languages/trustindex-sv_SE.mo ADDED
Binary file
trunk/languages/trustindex-th.mo ADDED
Binary file
trunk/languages/trustindex-tr_TR.mo ADDED
Binary file
trunk/languages/trustindex-uk.mo ADDED
Binary file
trunk/languages/trustindex-vi.mo ADDED
Binary file
trunk/languages/trustindex-zh_CN.mo ADDED
Binary file
trunk/languages/trustindex-zh_HK.mo ADDED
Binary file
trunk/languages/trustindex-zh_TW.mo ADDED
Binary file
trunk/readme.txt ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Widgets for Google Reviews ===
2
+ Contributors: trustindex
3
+ Donate link: https://www.trustindex.io/prices/
4
+ Tags: google, google places reviews, reviews, widget, google business, review, testimonial, testimonials, slider, rating, google my business, customer review
5
+ Requires at least: 3.0.1
6
+ Tested up to: 5.9
7
+ Requires PHP: 5.2
8
+ Stable tag: 8.2.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
12
+ Plugin Title: Widgets for Google Reviews Plugin
13
+ Plugin URI: https://wordpress.org/plugins/wp-reviews-plugin-for-google/
14
+ Author: Trustindex.io <support@trustindex.io>
15
+ Author URI: https://www.trustindex.io/
16
+ Text Domain: wp-reviews-plugin-for-google
17
+ Version: 8.2.3
18
+
19
+ Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.
20
+
21
+ == Description ==
22
+
23
+ Display your **Google Reviews** for free with our responsive widgets in 2 minutes.
24
+
25
+ The plugin displays your **Google Reviews** in amazing predesigned widgets. You can simply create and display your own widgets, and filter your reviews to build customers' trust and increase SEO.
26
+
27
+ [vimeo https://player.vimeo.com/video/506419798]
28
+
29
+ With Google reviews WordPress plugin, you can proudly display customer feedback on your business website. The widget comes in many eye-catching styles and designs, so you can choose the settings that best suit your company image. If you are growing your business or even if you’ve already established roots in your niche, a widget like this can further develop your online reputation and lead to more conversion.
30
+
31
+ Without reviews, a business is left to fend for itself. Even if your company offers excellent products or streamlined services, you may always struggle to reach a broad audience if you don’t have consumers who would vouch for you. Consumers often make purchase decisions on the back of Google reviews, so don’t miss out on this free form of marketing that can skyrocket your sales and boost your online reputation.
32
+
33
+ Our Google reviews plugin is straightforward to implement directly into your website, so you can focus your energy on other aspects of the business. All it takes is two minutes, and you’re all set up. Simply copy your business website’s link into the widget, then follow the simple process outlined in the video above to display it on your WordPress page.
34
+
35
+ ### Google Reviews WordPress Plugin
36
+
37
+ Many successful businesses use WordPress plugins to show off rave reviews left by customers, in the hope that it persuades other consumers to give them a shot. Unless you’re not interested in free marketing, displaying Google reviews for your business is a no-brainer.
38
+
39
+ Google reviews, in particular, have a significant influence on consumer purchase decisions, given the massive popularity of the search engine and the number of people with Google accounts. Many consumers claim that Google is the first place they go to assess a business based on reviews, which makes Google reviews more reliable than those from other websites.
40
+
41
+ You can leverage Google to catapult your business to further success if you try to secure as many four and five-star reviews as possible. The more reviews you have, the more prominent your business will become in a Google search, meaning more consumers will consider using your services.
42
+
43
+ If you don’t yet have any Google reviews, there’s no need to panic; simply start requesting of your existing customers that they leave one when they get a chance. Get into the habit of soliciting reviews through email and SMS since by making it a regular practice you increase your chances of getting more of them.
44
+
45
+ ### Free plugin features
46
+
47
+ The Google Reviews WordPress plugin offers various layouts and styles to choose from and allows for easy integration into any WordPress page.
48
+
49
+ * Free usage
50
+ * Display up to 10 Google Reviews* 40+ Widget layouts
51
+ * 25+ Pre-designed widget styles
52
+ * 1 Review widget
53
+ * Review filtering
54
+ * Language support
55
+ * Shortcode integration
56
+ * Keep all reviews in a WordPress database
57
+ * SEO boost
58
+ * Dark website support
59
+ * Use in any page builder: Gutenberg, Elementor, Page Origin, Beaver Builder, WPBakery, Divi, Classic, ...
60
+ * Zero loading time
61
+ * Use of assets stored in CDN
62
+ * Linux & Windows (XAMPP, WAMP,...) compatible
63
+
64
+ ### Get more features with our professional review software
65
+
66
+ [Create a free account for more features!](https://www.trustindex.io/ti-redirect.php?a=sys-wp&c=google.php-r1)
67
+
68
+ With the professional package, you’ll be able to display reviews from many of the top review websites, including Facebook, Yelp, Tripadvisor, and Airbnb. You’ll also be able to edit the widget image with a wide range of options, so you can cater to your demographic and increase the likelihood of conversion.
69
+
70
+ If you want to stand out from your competitors, a great way to do so is to make the most of the free marketing reviews can offer. The professional review management software gives you access to a whole host of tools that simplify the process, leaving you more time and energy for running the business.
71
+
72
+ Here are the features included in the software:
73
+
74
+ * Display all reviews from Google, Facebook, Yelp, Amazon, Tripadvisor, Booking.com, AirBnb, Hotels.com, ...
75
+ * Display reviews from different platforms in a widget
76
+ * Customizable design
77
+ * Unlimited number of widgets
78
+ * Management of multiple businesses
79
+ * Option to hide a review or mark as spam
80
+ * Professional review tagging system
81
+ * Widgets are updated when you receive a new review
82
+ * Widget link modification
83
+ * Edit review order
84
+ * Review shortening
85
+ * Automated review invitation system
86
+ * Review widgets for your email signatures
87
+ * Generate amazing images from your reviews to Instagram, Facebook, Twitter, Pinterest
88
+ * Shortcode & HTML/JavaScript support
89
+ * Detailed statistics
90
+ * Priority support
91
+ * AMP support
92
+
93
+ [Create a free account for more features!](https://www.trustindex.io/ti-redirect.php?a=sys-wp&c=google.php-r2)
94
+
95
+ == Screenshots ==
96
+
97
+ 1. Sample widget - Slider (light background)
98
+ 2. Sample widget - Grid (light background)
99
+ 3. Sample widget - List (light background)
100
+ 4. Connect platform easily
101
+ 5. Select layouts easily
102
+
103
+ == Additional free review plugins ==
104
+
105
+ Why not display your other ratings, too? Check out our other free review plugins:
106
+
107
+ * <a href="https://wordpress.org/plugins/review-widgets-for-airbnb/" target="_blank">Airbnb</a>
108
+ * <a href="https://wordpress.org/plugins/widgets-for-aliexpress-reviews/" target="_blank">Aliexpress</a>
109
+ * <a href="https://wordpress.org/plugins/widgets-for-alibaba-reviews/" target="_blank">Alibaba</a>
110
+ * <a href="https://wordpress.org/plugins/review-widgets-for-amazon/" target="_blank">Amazon</a>
111
+ * <a href="https://wordpress.org/plugins/review-widgets-for-booking-com/" target="_blank">Booking.com</a>
112
+ * <a href="https://wordpress.org/plugins/review-widgets-for-capterra/" target="_blank">Capterra</a>
113
+ * <a href="https://wordpress.org/plugins/widgets-for-ebay-reviews/" target="_blank">Ebay</a>
114
+ * <a href="https://wordpress.org/plugins/review-widgets-for-expedia/" target="_blank">Expedia</a>
115
+ * <a href="https://wordpress.org/plugins/free-facebook-reviews-and-recommendations-widgets/" target="_blank">Facebook</a>
116
+ * <a href="https://wordpress.org/plugins/review-widgets-for-foursquare/" target="_blank">Foursquare</a>
117
+ * <a href="https://wordpress.org/plugins/wp-reviews-plugin-for-google/" target="_blank">Google</a>
118
+ * <a href="https://wordpress.org/plugins/review-widgets-for-hotels-com/" target="_blank">Hotels.com</a>
119
+ * <a href="https://wordpress.org/plugins/reviews-widgets-for-opentable/" target="_blank">Opentable</a>
120
+ * <a href="https://wordpress.org/plugins/widgets-for-sourceforge-reviews/" target="_blank">SourceForge</a>
121
+ * <a href="https://wordpress.org/plugins/widgets-for-thumbtack-reviews/" target="_blank">Thumbtack</a>
122
+ * <a href="https://wordpress.org/plugins/review-widgets-for-tripadvisor/" target="_blank">Tripadvisor</a>
123
+ * <a href="https://wordpress.org/plugins/reviews-widgets-for-yelp/" target="_blank">Yelp</a>
124
+ * <a href="https://wordpress.org/plugins/widgets-for-zillow-reviews/" target="_blank">Zillow</a>
125
+ * <a href="https://wordpress.org/plugins/customer-reviews-for-woocommerce/" target="_blank">WooCommerce</a>
126
+ * <a href="https://wordpress.org/plugins/reviews-widgets/" target="_blank">Wordpress</a>
127
+
128
+ == Languages ==
129
+
130
+ If your company does business globally, it’s in your interest to cater to various languages.
131
+
132
+ Our Widgets for Google Reviews supports the following languages:
133
+ Afrikaans, Albanian, Arabic, Armenian, Azerbaijani, Bengali, Bosnian, Bulgarian, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, Galician, Georgian, German, Greek, Hebrew, Hindi, Hungarian, Icelandic, Indonesian, Italian, Japanese, Kazakh, Korean, Lithuanian, Macedonian, Malay, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Scottish Gaelic, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukranian, Vietnamese, Welsh
134
+
135
+ == Support ==
136
+
137
+ If you have any issues at all setting up the Google Reviews WordPress Plugin for your business, you can contact our customer support team in various ways.
138
+
139
+ We offer 24/7 email support in English.
140
+
141
+ We recommend the following order when searching for answers:
142
+ 1. Plugin FAQ here at the bottom - if you don’t already know why it’s worth displaying Google Reviews
143
+ 2. You can find more info and Troubleshooting in the plugin's admin dashboard after install.
144
+ 3. [Trustindex FAQ](https://www.trustindex.io/frequently-asked-questions/)
145
+ 4. Check topics or ask a new question here: [Support Forum](https://wordpress.org/support/plugin/wp-reviews-plugin-for-google/)
146
+ 5. If you still can't find the answer, feel free to email us: support@trustindex.io
147
+
148
+ To find out more about who we are and what we do, here are some useful links:
149
+
150
+ * [TrustIndex Website](https://www.trustindex.io/)
151
+ * [Our Blog](https://www.trustindex.io/blog/)
152
+
153
+ == Installation ==
154
+
155
+ 1. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
156
+ 2. Activate the plugin through the 'Plugins' screen in WordPress
157
+ 3. Use the Trustindex.io menu item on the left to configure the plugin.
158
+ 4. You can get premium features under the "Get more Features" tab!
159
+
160
+ == Frequently Asked Questions ==
161
+
162
+ = What is the Google reviews WordPress Plugin? =
163
+
164
+ A Google Reviews WordPress Plugin is a tool that you can use to display customer reviews on your WordPress page or website. It can help you establish an online reputation and build customer loyalty and trust.
165
+
166
+ = Can you use the plugin free without subscribing? =
167
+
168
+ Yes, the Google Reviews Widget plugin is completely free to download for all users.
169
+
170
+ = How can you get the widget’s code? =
171
+
172
+ You will gain access to the widget’s code as soon as you’ve finished setting up the plugin. You are then free to use it across your company websites as you see fit.
173
+
174
+ = What are the major features of the free plugin? =
175
+
176
+ With the free plugin, you’ll have access to as many as 40 widget layouts and 25 predesigned styles. You’ll be able to display up to 10 Google reviews, support various languages, and filter the reviews according to criteria such as star rating and date.
177
+
178
+ = Which website CMS or site builder are the widgets compatible with? =
179
+
180
+ The widgets are compatible with just about every website CMS or site builder, including but not limited to Adobe Muse, Blogger, Elementor, HTML, and Squarespace.
181
+
182
+ = How to embed Google reviews on your Website? =
183
+
184
+ To embed Google reviews on your website, simply position the widget on the website by copying the html shortcode directly to the desired page.
185
+
186
+ = How to display Google my Business reviews on your website? =
187
+
188
+ To display Google my Business reviews on your website, you need to copy and paste your Google Place URL into the plugin. Then you can easily generate the widget.
189
+
190
+ = How can you filter your Google Business reviews? =
191
+
192
+ To filter Google Business reviews, you can use the ‘filter your ratings’ drop-down menu during the widget setup process.
193
+
194
+ = Are the Google review widgets mobile responsive? =
195
+
196
+ Yes, the Google review widgets will be responsive on all devices.
197
+
198
+ = Can you display Google reviews in a slider widget? =
199
+
200
+ Yes, absolutely! In the layout screen of the setup process, the first few options you’ll see are slider widgets.
201
+
202
+ = Can you make modifications after the widget went live? =
203
+
204
+ Yes, you can. If you need to make changes after publishing the widget, you can do so through the admin board.
205
+
206
+ = Why are Google reviews important? =
207
+
208
+ Google reviews are important because they lend credibility to your business and help you establish your reputation online, influencing consumer purchase decisions.
209
+
210
+ = Are Google reviews more reliable than other reviews? =
211
+
212
+ While it’s hard to say definitively, Google reviews are most likely the first source many consumers turn to for advice about a purchase decision.
213
+
214
+ = How can you make the most out of Google reviews for your business? =
215
+
216
+ To make the most out of Google reviews, display the widget somewhere prominent on your homepage so visitors can see upfront how impressive your customer service is.
217
+
218
+ = Can your website visitors leave reviews in the widget? =
219
+
220
+ Yes we have widgets with this option, should visitors wish to have their review displayed in the widget, they can click the CTA (Call To Action) button which will lead them to the relevant review page on Google.
221
+
222
+ = What is the easiest way to collect Google reviews? =
223
+
224
+ A good rule to follow to collect more Google reviews is: if you don’t ask, you don’t get.
225
+
226
+ When you communicate with your clients, use this as an opportunity to insert a link to your Google review page or mention leaving a review, whether it’s in an email, an SMS, or an in-person interaction.
227
+
228
+ == Changelog ==
229
+
230
+ The change log and upgrade notices can be found here: [https://admin.trustindex.io/page/static/content/wp-changelog](https://admin.trustindex.io/page/static/content/wp-changelog)
trunk/settings.php ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ if (!current_user_can('edit_pages'))
4
+ {
5
+ die('The account you\'re logged in to doesn\'t have permission to access this page.');
6
+ }
7
+ if(isset($_GET['rate_us']))
8
+ {
9
+ switch(sanitize_text_field($_GET['rate_us']))
10
+ {
11
+ case 'open':
12
+ update_option($trustindex_pm_google->get_option_name('rate-us'), 'hide', false);
13
+ $url = 'https://wordpress.org/support/plugin/'. $trustindex_pm_google->get_plugin_slug() . '/reviews/?rate=5#new-post';
14
+ header('Location: '. $url);
15
+ die;
16
+ case 'later':
17
+ $time = time() + (30 * 86400);
18
+ update_option($trustindex_pm_google->get_option_name('rate-us'), $time, false);
19
+ break;
20
+ case 'hide':
21
+ update_option($trustindex_pm_google->get_option_name('rate-us'), 'hide', false);
22
+ break;
23
+ }
24
+ echo "<script type='text/javascript'>self.close();</script>";
25
+ die;
26
+ }
27
+ if(isset($_GET['wc_notification']))
28
+ {
29
+ switch(sanitize_text_field($_GET['wc_notification']))
30
+ {
31
+ case 'open':
32
+ update_option('trustindex-wc-notification', 'hide', false);
33
+ $url = 'https://wordpress.org/plugins/customer-reviews-for-woocommerce/';
34
+ header('Location: '. $url);
35
+ die;
36
+ case 'hide':
37
+ update_option('trustindex-wc-notification', 'hide', false);
38
+ break;
39
+ }
40
+ echo "<script type='text/javascript'>self.close();</script>";
41
+ die;
42
+ }
43
+ if(isset($_GET['test_proxy']))
44
+ {
45
+ delete_option($trustindex_pm_google->get_option_name('proxy-check'));
46
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=' . sanitize_text_field($_GET['tab']));
47
+ exit;
48
+ }
49
+ $tabs = [];
50
+ if($trustindex_pm_google->is_trustindex_connected())
51
+ {
52
+ $default_tab = 'setup_trustindex_join';
53
+ $tabs[ 'Trustindex admin' ] = "setup_trustindex_join";
54
+ $tabs[ TrustindexPlugin_google::___("Free Widget Configurator") ] = "setup_no_reg";
55
+ }
56
+ else
57
+ {
58
+ $default_tab = 'setup_no_reg';
59
+ $tabs[ TrustindexPlugin_google::___("Free Widget Configurator") ] = "setup_no_reg";
60
+ }
61
+ if($trustindex_pm_google->is_noreg_linked())
62
+ {
63
+ $tabs[ TrustindexPlugin_google::___("My Reviews") ] = "my_reviews";
64
+ }
65
+ $tabs[ TrustindexPlugin_google::___('Get Reviews') ] = "get_reviews";
66
+ $tabs[ TrustindexPlugin_google::___('Rate Us') ] = "rate";
67
+ if(!$trustindex_pm_google->is_trustindex_connected())
68
+ {
69
+ $tabs[ TrustindexPlugin_google::___('Get more Features') ] = "setup_trustindex";
70
+ $tabs[ TrustindexPlugin_google::___('Log In') ] = "setup_trustindex_join";
71
+ }
72
+ $tabs[ TrustindexPlugin_google::___('Troubleshooting') ] = "troubleshooting";
73
+ $selected_tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : null;
74
+ $subtabs = null;
75
+ $found = false;
76
+ foreach($tabs as $tab)
77
+ {
78
+ if(is_array($tab))
79
+ {
80
+ if(array_search($selected_tab, $tab) !== FALSE)
81
+ {
82
+ $found = true;
83
+ break;
84
+ }
85
+ }
86
+ else
87
+ {
88
+ if($selected_tab == $tab)
89
+ {
90
+ $found = true;
91
+ break;
92
+ }
93
+ }
94
+ }
95
+ if(!$found)
96
+ {
97
+ $selected_tab = $default_tab;
98
+ }
99
+ $http_blocked = false;
100
+ if(defined('WP_HTTP_BLOCK_EXTERNAL') && WP_HTTP_BLOCK_EXTERNAL)
101
+ {
102
+ if(!defined('WP_ACCESSIBLE_HOSTS') || strpos(WP_ACCESSIBLE_HOSTS, '*.trustindex.io') === FALSE)
103
+ {
104
+ $http_blocked = true;
105
+ }
106
+ }
107
+ $proxy = new WP_HTTP_Proxy();
108
+ $proxy_check = true;
109
+ if($proxy->is_enabled())
110
+ {
111
+ $opt_name = $trustindex_pm_google->get_option_name('proxy-check');
112
+ $db_data = get_option($opt_name, "");
113
+ if(!$db_data)
114
+ {
115
+ $response = wp_remote_post("https://admin.trustindex.io/" . "api/userCheckLoggedIn", [
116
+ 'timeout' => '30',
117
+ 'redirection' => '5',
118
+ 'blocking' => true
119
+ ]);
120
+ if(is_wp_error($response))
121
+ {
122
+ $proxy_check = $response->get_error_message();
123
+ update_option($opt_name, $response->get_error_message(), false);
124
+ }
125
+ else
126
+ {
127
+ update_option($opt_name, 1, false);
128
+ }
129
+ }
130
+ else
131
+ {
132
+ if($db_data !== '1')
133
+ {
134
+ $proxy_check = $db_data;
135
+ }
136
+ }
137
+ }
138
+ ?>
139
+ <div id="ti-assets-error" class="notice notice-warning" style="display: none; margin-left: 0; margin-right: 0; padding-bottom: 9px">
140
+ <p>
141
+ <?php echo TrustindexPlugin_google::___("You got an error while trying to run this plugin. Please upgrade all the plugins from Trustindex and if the error still persist send the content of the webserver's error log and the content of the Troubleshooting tab to the support!"); ?>
142
+ </p>
143
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=troubleshooting" class="button button-primary"><?php echo TrustindexPlugin_google::___("Troubleshooting") ;?></a>
144
+ </div>
145
+ <script type="text/javascript">
146
+ window.onload = function() {
147
+ let warning_box = document.getElementById("ti-assets-error");
148
+ let link = document.getElementById("trustindex_settings_style_google-css");
149
+ if(typeof Trustindex_Autocomplete == "undefined" || typeof TI_copyTextToClipboard == "undefined" || !link || !Boolean(link.sheet))
150
+ {
151
+ warning_box.style.display = "block";
152
+ }
153
+ };
154
+ </script>
155
+ <div id="trustindex-plugin-settings-page" class="ti-toggle-opacity">
156
+ <h1 class="ti-free-title">
157
+ <?php echo TrustindexPlugin_google::___("Widgets for Google Reviews"); ?>
158
+ <a href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-l" target="_blank" title="Trustindex" class="ti-pull-right">
159
+ <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/trustindex.svg'); ?>" />
160
+ </a>
161
+ </h1>
162
+ <div class="container_wrapper">
163
+ <div class="container_cell" id="container-main">
164
+ <?php if($http_blocked): ?>
165
+ <div class="ti-box ti-notice-error">
166
+ <p>
167
+ <?php echo TrustindexPlugin_google::___("Your site cannot download our widget templates, because of your server settings not allowing that:"); ?><br /><a href="https://wordpress.org/support/article/editing-wp-config-php/#block-external-url-requests" target="_blank">https://wordpress.org/support/article/editing-wp-config-php/#block-external-url-requests</a><br /><br />
168
+ <strong><?php echo TrustindexPlugin_google::___("Solution"); ?></strong><br />
169
+ <?php echo TrustindexPlugin_google::___("a) You should define <strong>WP_HTTP_BLOCK_EXTERNAL</strong> as false"); ?><br />
170
+ <?php echo TrustindexPlugin_google::___("b) or you should add Trustindex as an <strong>WP_ACCESSIBLE_HOSTS</strong>: \"*.trustindex.io\""); ?><br />
171
+ </p>
172
+ </div>
173
+ <?php endif; ?>
174
+ <?php if($proxy_check !== TRUE): ?>
175
+ <div class="ti-box ti-notice-error">
176
+ <p>
177
+ <?php echo TrustindexPlugin_google::___("It seems you are using a proxy for HTTP requests but after a test request it returned a following error:"); ?><br />
178
+ <strong><?php echo $proxy_check; ?></strong><br /><br />
179
+ <?php echo TrustindexPlugin_google::___("Therefore, our plugin might not work properly. Please, contact your hosting support, they can resolve this easily."); ?>
180
+ </p>
181
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=<?php echo esc_attr($_GET['tab']); ?>&test_proxy" class="btn-text btn-refresh" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Test again") ;?></a>
182
+ </div>
183
+ <?php endif; ?>
184
+ <div class="nav-tab-wrapper">
185
+ <?php foreach($tabs as $tab_name => $tab): ?>
186
+ <?php
187
+ $is_active = $selected_tab == $tab;
188
+ $action = $tab;
189
+ if(is_array($tab))
190
+ {
191
+ $is_active = array_search($selected_tab, $tab) !== FALSE;
192
+ $action = array_shift(array_values($tab));
193
+ if($is_active)
194
+ {
195
+ $subtabs = $tab;
196
+ }
197
+ }
198
+ ?>
199
+ <a
200
+ id="link-tab-<?php echo esc_attr($action); ?>"
201
+ class="nav-tab<?php if($is_active): ?> nav-tab-active<?php endif; ?><?php if($tab == 'troubleshooting'): ?> nav-tab-right<?php endif; ?>"
202
+ href="<?php echo admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php&tab='. esc_attr($action)); ?>"
203
+ ><?php echo esc_html($tab_name); ?></a>
204
+ <?php endforeach; ?>
205
+ </div>
206
+ <?php if($subtabs): ?>
207
+ <div class="nav-tab-wrapper sub-nav">
208
+ <?php foreach($subtabs as $tab_name => $tab): ?>
209
+ <a
210
+ id="link-tab-<?php echo esc_attr($tab); ?>"
211
+ class="nav-tab<?php if($selected_tab == $tab): ?> nav-tab-active<?php endif; ?>"
212
+ href="<?php echo admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php&tab='. esc_attr($tab)); ?>"
213
+ ><?php echo esc_html($tab_name); ?></a>
214
+ <?php endforeach; ?>
215
+ </div>
216
+ <?php endif; ?>
217
+ <div id="tab-<?php echo esc_attr($selected_tab); ?>">
218
+ <?php include(plugin_dir_path(__FILE__ ) . 'tabs' . DIRECTORY_SEPARATOR . $selected_tab . '.php'); ?>
219
+ </div>
220
+ </div>
221
+
222
+ </div>
223
+ </div>
224
+ <div id="ti-loading">
225
+ <div class="ti-loading-effect"><div></div><div></div><div></div></div>
226
+ </div>
trunk/static/block-editor/block-editor.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){var t={};function n(l){if(t[l])return t[l].exports;var i=t[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,l){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:l})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(n.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(l,i,function(t){return e[t]}.bind(null,i));return l},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=window.wp.components},function(e,t,n){"use strict";n.r(t);var l=n(0),i=wp.blocks.registerBlockType,c=function(){return React.createElement(l.Icon,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 50 50"},React.createElement("path",{fill:"none",d:"M-1-1h52v52H-1z"}),React.createElement("path",{d:"M-.043 29.977c0 11.016 8.97 19.968 19.936 19.968H29.96c11.065 0 19.936-8.952 19.936-19.968V19.975C49.896 8.958 40.925.007 29.96.007H19.893C8.828.007-.043 8.958-.043 19.975v10.002z",fillRule:"evenodd",clipRule:"evenodd",fill:"#2aa8d7"}),React.createElement("path",{d:"M23.854 24.574l10.098-10.098c.714-.743 1.938-.743 2.754 0l2.754 2.71a1.982 1.982 0 010 2.71L25.996 33.335c0 .037-.102.111-.102.148l-2.754 2.71c-.408.372-.918.557-1.326.557-.51 0-1.02-.185-1.326-.556l-2.754-2.71c0-.038-.102-.075-.102-.149l-7.038-7.054a1.982 1.982 0 010-2.71l2.754-2.71c.714-.742 1.938-.742 2.754 0l5.304 5.309.51.483 5.406 5.383-3.468-7.462z",fillRule:"evenodd",clipRule:"evenodd",fill:"#fff"}))})};i("trustindex/block-selector",{title:"Trustindex",description:"Trustindex widget plugin",icon:c(),category:"widgets",attributes:{widget_id:{type:"string"},trustindex_widgets:{type:"object"},free_widgets:{type:"object"},setup_url:{type:"string"},selected_type:{type:"string",default:"admin"}},edit:function(e){var t=e.attributes,n=e.setAttributes;function i(e){"type-select"===e.target.id&&"custom-id"===e.target.selectedOptions[0].id?(n({selected_type:"custom"}),n({widget_id:""})):"type-select"===e.target.id?(n({widget_id:e.target.value}),e.target.value.length>=20?n({selected_type:"admin"}):n({selected_type:"free"})):n({widget_id:e.target.value})}return t.trustindex_widgets||wp.apiFetch({path:"trustindex/v1/setup-complete"}).then((function(e){e.result&&n({free_widgets:e.result}),e.setup_url&&n({setup_url:e.setup_url}),wp.apiFetch({path:"trustindex/v1/get-widgets"}).then((function(e){n({trustindex_widgets:e}),e&&e.length||"admin"!==t.selected_type||n({selected_type:"custom"}),e&&e.length&&!t.widget_id&&n({widget_id:e[0].widgets[0].id})}))})),t.trustindex_widgets?React.createElement("div",{className:"components-placeholder"},React.createElement("table",null,React.createElement("tr",null,React.createElement("td",null,React.createElement("span",{style:{fontSize:"32px"}},c()," Trustindex widget")),React.createElement("td",null)),React.createElement("tr",null,React.createElement("td",null,React.createElement("select",{id:"type-select",style:{fontSize:"13px",border:"1px solid",width:"100%"},onChange:i},React.createElement("optgroup",{label:"Trustindex widgets"},t.trustindex_widgets.length?t.trustindex_widgets[0].widgets.map((function(e){return React.createElement("option",{selected:t.widget_id===e.id,value:e.id},e.name)})):React.createElement("option",{disabled:!0}," No Trustindex account connected ")),React.createElement("optgroup",{label:"Custom widget"},React.createElement("option",{selected:"custom"===t.selected_type,value:t.widget_id,id:"custom-id"},"Custom widget id")),React.createElement("optgroup",{label:"Free widgets"},Object.keys(t.free_widgets).map((function(e){return React.createElement("option",{disabled:0===t.free_widgets[e],selected:e===t.widget_id,value:e},"Free "+e+" review widget"+(0===t.free_widgets[e]?" - not configured yet":""))}))))),React.createElement("td",{style:{fontSize:"15px"}},React.createElement("span",{style:{display:"flex",alignItems:"center",lineHeight:"16px"}},t.trustindex_widgets.length?"":React.createElement(l.Icon,{icon:React.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 130 130"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"#FF4141",d:"M61.44 0c33.933 0 61.439 27.507 61.439 61.439s-27.506 61.439-61.439 61.439C27.507 122.879 0 95.372 0 61.439S27.507 0 61.44 0zm12.011 39.151a7.011 7.011 0 019.986-.027c2.764 2.776 2.775 7.292.027 10.083L71.4 61.445l12.076 12.249c2.729 2.77 2.689 7.257-.08 10.022-2.773 2.765-7.23 2.758-9.955-.013L61.446 71.54 49.428 83.728a7.011 7.011 0 01-9.986.027c-2.763-2.776-2.776-7.293-.027-10.084L51.48 61.434 39.403 49.185c-2.728-2.769-2.689-7.256.082-10.022 2.772-2.765 7.229-2.758 9.953.013l11.997 12.165 12.016-12.19z"}))}),t.trustindex_widgets.length?"":React.createElement("span",{style:{marginLeft:"5px"}},"No Trustindex account connected. ",React.createElement("a",{target:"_blank",href:t.setup_url},"Solve"))))),React.createElement("tr",null,React.createElement("td",null,React.createElement("input",{onChange:i,value:t.widget_id,style:{border:"1px solid black",display:"custom"===t.selected_type?"inherit":"none"},class:"block-editor-plain-text blocks-shortcode__textarea",type:"text"}))))):React.createElement("div",{class:"components-placeholder"},"Loading...")},save:function(e){return e.attributes,null}})}]);
trunk/static/block-editor/block-editor.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+ class TrustindexGutenbergPlugin {
4
+
5
+ public static $instance = null;
6
+
7
+ function init() {
8
+ add_action( 'enqueue_block_editor_assets', array( $this, 'gutenberg_enqueue_block_editor_assets' ) );
9
+ add_action( 'init', array( $this, 'register_block' ) );
10
+ }
11
+
12
+ function gutenberg_enqueue_block_editor_assets() {
13
+ wp_enqueue_script(
14
+ 'gutenberg-ti',
15
+ plugins_url( 'block-editor.js', __FILE__ ),
16
+ array(
17
+ 'wp-api-fetch',
18
+ 'wp-components',
19
+ 'wp-compose',
20
+ 'wp-blocks',
21
+ 'wp-element',
22
+ 'wp-i18n'
23
+ ),
24
+ filemtime( plugin_dir_path( __FILE__ ) . 'block-editor.js' )
25
+ );
26
+ }
27
+ function register_block() {
28
+ register_block_type(
29
+ 'trustindex/block-selector',
30
+ array(
31
+ 'render_callback' => array( $this, 'render_block' ),
32
+ 'attributes' => array(
33
+ 'widget_id' => array(
34
+ 'type' => 'string'
35
+ ),
36
+ 'trustindex_widgets' => array(
37
+ 'type' => 'object'
38
+ ),
39
+ 'free_widgets' => array(
40
+ 'type' => 'object'
41
+ ),
42
+ 'custom_id' => array(
43
+ 'type' => 'boolean'
44
+ ),
45
+ 'setup_url' => array(
46
+ 'type' => 'string'
47
+ )
48
+ ),
49
+ )
50
+ );
51
+ }
52
+
53
+ function render_block( $attributes ) {
54
+ if ($this->is_gutenberg_page())
55
+ {
56
+ return "";
57
+ }
58
+ if (isset($attributes['free_widgets'][$attributes['widget_id']]))
59
+ {
60
+ $short_code = "no-registration=" . $attributes['widget_id'];
61
+ }
62
+ else
63
+ {
64
+ $short_code = "data-widget-id=\"{$attributes['widget_id']}\"";
65
+ }
66
+ return "[trustindex {$short_code}]";
67
+ }
68
+ function is_gutenberg_page() {
69
+ if ( function_exists( 'is_gutenberg_page' ) &&
70
+ is_gutenberg_page()
71
+ ) {
72
+ return true;
73
+ }
74
+ if (function_exists('get_current_screen'))
75
+ {
76
+ $current_screen = get_current_screen();
77
+ if ( method_exists( $current_screen, 'is_block_editor' ) &&
78
+ $current_screen->is_block_editor()
79
+ ) {
80
+ return true;
81
+ }
82
+ }
83
+ return false;
84
+ }
85
+
86
+ public static function instance() {
87
+ if ( is_null( self::$instance ) ) {
88
+ self::$instance = new self();
89
+ self::$instance->init();
90
+ }
91
+ return self::$instance;
92
+ }
93
+
94
+ public function __clone() {
95
+ _doing_it_wrong( __FUNCTION__, "Cheatin' huh?", '1.0.0' );
96
+ }
97
+
98
+ public function __wakeup() {
99
+ _doing_it_wrong( __FUNCTION__, "Cheatin' huh?", '1.0.0' );
100
+ }
101
+ }
102
+ ?>
trunk/static/css/admin-editor.css ADDED
@@ -0,0 +1,2 @@
 
 
1
+ .dashicons, .dashicons-before:before { font-family: dashicons !important;}
2
+ .text-danger { color: red !important; }
trunk/static/css/admin-page-settings.css ADDED
@@ -0,0 +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 .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}#trustindex-plugin-settings-page .autocomplete .input input[type=text]:focus{background:#e3f2f9;border:2px solid #2AA8D7;outline:0;box-shadow:unset !important}#trustindex-plugin-settings-page .autocomplete .info-text{padding:0;padding-top:5px;opacity:0.5}#trustindex-plugin-settings-page .autocomplete .loading{position:absolute;right:8px;top:14px;width:18px;z-index:1;display:none}#trustindex-plugin-settings-page .autocomplete .btn-text{font-size:14px !important;padding:6px 15px;line-height:2;border:2px solid #2AA8D7;outline:0 !important;display:inline-block;vertical-align:top;margin:0}#trustindex-plugin-settings-page .autocomplete span{display:block;padding:10px}#trustindex-plugin-settings-page .autocomplete span.error{color:#e33244}#trustindex-plugin-settings-page .autocomplete .results{position:absolute;top:46px;z-index:1;width:calc(100% - 2px);padding:0;margin:0;border-radius:0.25rem;border:1px solid #ddd;background:#fff;display:none;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#trustindex-plugin-settings-page .autocomplete .results:after,#trustindex-plugin-settings-page .autocomplete .results:before{bottom:100%;left:32px;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}#trustindex-plugin-settings-page .autocomplete .results:after{border-color:rgba(255, 255, 255, 0);border-bottom-color:#fff;border-width:8px;margin-left:-8px}#trustindex-plugin-settings-page .autocomplete .results:before{border-color:rgba(221, 221, 221, 0);border-bottom-color:#ddd;border-width:9px;margin-left:-9px}#trustindex-plugin-settings-page .autocomplete .results ul{display:block;max-height:300px;overflow:auto;list-style-type:none;margin:0;padding:0}#trustindex-plugin-settings-page .autocomplete .results li{display:block;padding:5px 10px;margin:0;border-bottom:1px solid grey;cursor:pointer;transition:all 0.25s}#trustindex-plugin-settings-page .autocomplete .results li:last-of-type{border-bottom:0}#trustindex-plugin-settings-page .autocomplete .results li:hover{background:rgba(0, 100, 255, 0.1)}#trustindex-plugin-settings-page .autocomplete .results li svg{width:40px;height:40px;position:relative;top:3px;margin-right:10px;float:left}#trustindex-plugin-settings-page .autocomplete .results li img{width:44px;height:44px;margin-right:10px;float:left;border-radius:50%;box-shadow:0 0 2px black}#trustindex-plugin-settings-page .autocomplete .results li .title{margin:0;margin-bottom:5px;font-size:14px;color:#000;pointer-events:none}#trustindex-plugin-settings-page .autocomplete .results li .location{margin:0;font-size:12px;color:#888;pointer-events:none}#trustindex-plugin-settings-page .nav-tab-wrapper{margin-bottom:0;border:0;padding-right:100px;position:relative}#trustindex-plugin-settings-page .nav-tab{background-color:#f9f9f9;border:0;box-shadow:0 0 0px black !important;border-top:4px solid #f9f9f9;padding:12px 15px;margin-left:0;margin-right:0.35em}#trustindex-plugin-settings-page .nav-tab:last-child{margin-right:0}@media (max-width:1099px){#trustindex-plugin-settings-page .nav-tab{margin-bottom:0.35em}}#trustindex-plugin-settings-page .nav-tab-active{background-color:#fff !important;border-color:#2aa9d6}#trustindex-plugin-settings-page .nav-tab-right{position:absolute;right:0;bottom:0}#trustindex-plugin-settings-page .ti-free-steps{margin-top:0;background:#fff;font-size:14px;display:flex;justify-content:space-between;position:relative;padding:5px 0}#trustindex-plugin-settings-page .ti-free-steps li{list-style:none;padding:20px 0;display:inline-block;color:#afb2b8;margin-bottom:0;white-space:nowrap}#trustindex-plugin-settings-page .ti-free-steps li:first-child{padding-left:20px}#trustindex-plugin-settings-page .ti-free-steps li:last-child{padding-right:20px}#trustindex-plugin-settings-page .ti-free-steps li>span{display:inline-block;width:20px;height:20px;line-height:20px;text-align:center;background:#bdbec2;color:white;margin-right:7px;font-size:11px;border-radius:4px;font-weight:normal}#trustindex-plugin-settings-page .ti-free-steps li.current{font-weight:bold;pointer-events:none}#trustindex-plugin-settings-page .ti-free-steps li.active,#trustindex-plugin-settings-page .ti-free-steps li.done{color:black;cursor:pointer}#trustindex-plugin-settings-page .ti-free-steps li.active>span{background:#2aa8d8;box-shadow:0 0 3px #2aa8d8}#trustindex-plugin-settings-page .ti-free-steps li.done>span{background:#4db594;color:transparent;position:relative}#trustindex-plugin-settings-page .ti-free-steps li.done>span:after{content:'\2713';color:white;margin-left:-7px;font-weight:bold}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow{position:relative;display:inline-block;padding:0;padding-top:25px}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:before,#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:after{content:'';background:#d8d8d8;position:relative;width:11px;height:3px;display:block;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);border-radius:2px}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:after{-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);top:4px}@media (max-width:1240px){#trustindex-plugin-settings-page .ti-free-steps{flex-wrap:wrap}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(4){width:100%;opacity:0;padding-top:0;margin-top:-6px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(3){padding-right:20px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(5){padding-left:20px}}@media (max-width:600px){#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(2),#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(6){width:100%;opacity:0;padding-top:0;margin-top:-6px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(1),#trustindex-plugin-settings-page .ti-free-steps li:nth-child(5){padding-right:20px}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(3),#trustindex-plugin-settings-page .ti-free-steps li:nth-child(7){padding-left:20px;padding-right:0}#trustindex-plugin-settings-page .ti-free-steps .ti-free-arrow:nth-child(4){width:unset;opacity:unset;padding-top:25px;margin-top:unset}#trustindex-plugin-settings-page .ti-free-steps li:nth-child(5){padding-left:0}}#trustindex-plugin-settings-page .ti-free-title{font-size:25px !important;font-weight:bold !important;padding:0 20px;margin:25px 0 !important}#trustindex-plugin-settings-page .ti-back-icon{color:#5d6268;float:right;font-size:14px;font-weight:bold;position:relative;cursor:pointer;text-decoration:none;box-shadow:0 0 0px black !important;text-shadow:none !important}#trustindex-plugin-settings-page .ti-back-icon:before,#trustindex-plugin-settings-page .ti-back-icon:after{content:'';background:#d8d8d8;position:absolute;left:-18px;top:11px;width:9px;height:3px;display:block;-webkit-transform:rotate(-45deg);-ms-transform:rotate(-45deg);transform:rotate(-45deg);border-radius:2px}#trustindex-plugin-settings-page .ti-back-icon:after{-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);margin-top:4px}#trustindex-plugin-settings-page .ti-box{background:white;padding:25px;border-radius:4px;margin-bottom:1em}#trustindex-plugin-settings-page .ti-box .btn-text{margin-left:0;font-size:13px}#trustindex-plugin-settings-page .ti-box>.ti-header{font-size:18px;font-weight:600;border-bottom:1px solid #e0e0e0;margin-bottom:20px;padding-bottom:10px;color:inherit}#trustindex-plugin-settings-page .ti-box>.ti-header span,#trustindex-plugin-settings-page .ti-box>.ti-header strong{color:inherit}#trustindex-plugin-settings-page .ti-box>.ti-header .btn-text{margin:0;padding:5px 15px;margin-top:-5px}#trustindex-plugin-settings-page .ti-box>.ti-footer{border-top:1px solid #e0e0e0;margin-top:20px;padding-top:20px}#trustindex-plugin-settings-page .ti-box .preview{float:unset;box-sizing:border-box}#trustindex-plugin-settings-page .ti-box img{max-width:100%}#trustindex-plugin-settings-page .ti-box.ti-notice-error{border-left:4px solid red;border-top-left-radius:0;border-bottom-left-radius:0}#trustindex-plugin-settings-page .ti-box.ti-notice-warning{border-left:4px solid #ffb900;border-top-left-radius:0;border-bottom-left-radius:0}#trustindex-plugin-settings-page .ti-preview-boxes-container{display:flex;flex-wrap:wrap;margin:0 -10px;box-sizing:border-box}#trustindex-plugin-settings-page .ti-preview-boxes-container .ti-full-width{flex:0 0 100%;max-width:100%;padding-left:10px;padding-right:10px;box-sizing:inherit;margin-bottom:20px}#trustindex-plugin-settings-page .ti-preview-boxes-container .ti-half-width{flex:0 0 50%;max-width:50%;padding-left:10px;padding-right:10px;margin-left:auto;margin-right:auto;box-sizing:inherit;margin-bottom:20px}#trustindex-plugin-settings-page .ti-preview-boxes-container .ti-preview-boxes{height:100%}#trustindex-plugin-settings-page .ti-header-layout-text{font-weight:normal;font-size:85%}#trustindex-plugin-settings-page .ti-pull-right{float:right}#trustindex-plugin-settings-page .ti-pull-right+.ti-pull-right{margin-right:20px}#trustindex-plugin-settings-page .ti-left-block,#trustindex-plugin-settings-page .ti-right-block{display:inline-block !important;float:left;vertical-align:top;width:calc(50% - 15px) !important;margin:0 !important}#trustindex-plugin-settings-page .ti-left-block .form-control,#trustindex-plugin-settings-page .ti-right-block .form-control{max-width:400px}#trustindex-plugin-settings-page .ti-right-block{float:right}#trustindex-plugin-settings-page .ti-input-row{margin-bottom:1.33em}#trustindex-plugin-settings-page .ti-input-row:last-child{margin:0}#trustindex-plugin-settings-page .ti-input-row label{display:block;font-size:15px;font-weight:600;font-family:inherit;cursor:unset;color:inherit;margin-bottom:0.5em}#trustindex-plugin-settings-page #ti-widget-options{margin-top:25px}#trustindex-plugin-settings-page .ti-preview-box{padding:10px 0}#trustindex-plugin-settings-page .code-shortcode{display:inline-block;padding:10px;border-radius:0.25rem;border:2px solid #dcdce4;background:#f1f1f1}#trustindex-plugin-settings-page .code-shortcode+a{position:relative;top:1px}#trustindex-plugin-settings-page .ti-seo-list{margin:20px 0;counter-reset:li;padding-left:35px}#trustindex-plugin-settings-page .ti-seo-list li{position:relative;list-style:none;margin:0;margin-bottom:25px;counter-increment:li}#trustindex-plugin-settings-page .ti-seo-list li:before{content:counter(li);position:absolute;left:-35px;top:0;display:inline-block;width:20px;height:20px;line-height:20px;text-align:center;background:#4db594;color:white;font-size:11px;border-radius:4px;font-weight:normal}#trustindex-plugin-settings-page .ti-filter-row{font-size:14px;display:block;padding:20px 25px;background:#f7f7f7;margin-bottom:10px;border-radius:4px}#trustindex-plugin-settings-page .ti-filter-row>label{margin-right:15px}#trustindex-plugin-settings-page .ti-filter-row .ti-checkbox{float:unset;width:auto;margin-bottom:0}#trustindex-plugin-settings-page .ti-filter-row .ti-checkbox input{margin-right:3px}#trustindex-plugin-settings-page .ti-source-box{display:block;border:1px solid #dddddf;box-shadow:2px 2px 5px rgba(0, 0, 0, 0.1);background:white;padding:15px;padding-right:175px;position:relative;border-radius:4px;margin-bottom:20px}#trustindex-plugin-settings-page .ti-source-box img{float:left;border-radius:50%;width:50px;height:50px;margin-right:10px;object-fit:cover;object-position:top}#trustindex-plugin-settings-page .ti-source-box .ti-source-info{display:inline-block;word-wrap:break-word;max-width:calc(100% - 70px)}#trustindex-plugin-settings-page .ti-source-box .btn-text{position:absolute;right:15px;top:50%;transform:translateY(-50%);margin:0;font-size:13px}#trustindex-plugin-settings-page .ti-selected-source{margin-top:15px;display:none}#trustindex-plugin-settings-page .ti-selected-source .ti-left-label{vertical-align:top;line-height:unset;padding-top:10px;float:left}#trustindex-plugin-settings-page .ti-selected-source .ti-source-box{display:inline-block;width:550px;margin-bottom:0;float:left}#trustindex-plugin-settings-page .ti-selected-source .ti-source-box+.ti-source-box{margin-left:220px;margin-top:20px}#trustindex-plugin-settings-page #ti-widget-options .ti-checkbox{margin-bottom:5px}#trustindex-plugin-settings-page .ti-highlight-content{display:block;margin-top:10px;padding:10px 20px;background:#eee;position:relative}#trustindex-plugin-settings-page .ti-highlight-content .selection-content{position:relative;z-index:1}#trustindex-plugin-settings-page .ti-highlight-content .raw-content{position:absolute;color:transparent;width:calc(100% - 40px);z-index:0}#trustindex-plugin-settings-page .ti-highlight-content .raw-content mark{color:transparent !important;background:#fbe049 !important}#trustindex-plugin-settings-page .ti-my-reviews mark.ti-highlight{padding:0 1px;background:#4682B4;color:white}#trustindex-plugin-settings-page .ti-prokontra-good svg,#trustindex-plugin-settings-page .ti-prokontra-bad svg{width:18px;height:18px;display:inline-block;vertical-align:sub;position:relative;top:-1px}#trustindex-plugin-settings-page .ti-prokontra-good svg{fill:#0ab21b}#trustindex-plugin-settings-page .ti-prokontra-bad svg{fill:#383838}#trustindex-plugin-settings-page .ti-prokontra-good:after,#trustindex-plugin-settings-page .ti-prokontra-bad:after{content:'\a0\b7\a0'}#trustindex-plugin-settings-page .ti-special-offer{width:40%;margin:10px 0}#trustindex-plugin-settings-page .ti-special-offer img{float:left;width:100px;border:0;margin-right:15px;margin-top:2px}#trustindex-plugin-settings-page .ti-special-offer p{font-size:14px}#trustindex-plugin-settings-page .ti-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:5;display:none;overflow-x:hidden;overflow-y:auto;outline:0;background:rgba(0, 0, 0, 0.5)}#trustindex-plugin-settings-page .ti-modal .ti-modal-dialog{position:relative;width:auto;margin:30px auto;margin-top:50px;max-width:800px}#trustindex-plugin-settings-page .ti-modal .ti-modal-content{position:relative;display:flex;flex-direction:column;background-color:white;background-clip:padding-box;border:1px solid rgba(0, 0, 0, 0.2);border-radius:4px;outline:0}#trustindex-plugin-settings-page .ti-modal .ti-modal-header{display:flex;align-items:center;justify-content:space-between;padding:15px;border-bottom:1px solid #e0e0e0;font-size:18px;font-weight:600}#trustindex-plugin-settings-page .ti-modal .ti-modal-title{margin-bottom:0;line-height:1.5}#trustindex-plugin-settings-page .ti-modal .ti-modal-body{position:relative;flex:1 1 auto;padding:15px}#trustindex-plugin-settings-page .ti-modal .ti-modal-footer{display:flex;align-items:center;justify-content:flex-end;padding:15px;border-top:1px solid #e0e0e0}#trustindex-plugin-settings-page .ti-modal .ti-modal-footer>:not(:first-child){margin-left:0.25rem}#trustindex-plugin-settings-page .ti-modal .ti-modal-footer>:not(:last-child){margin-right:0.25rem}#trustindex-plugin-settings-page .troubleshooting-checklist{list-style:decimal;padding-left:25px}#trustindex-plugin-settings-page .troubleshooting-checklist .dashicons{position:relative;top:-1px;margin:0 3px}#trustindex-plugin-settings-page .troubleshooting-checklist .dashicons.dashicons-yes-alt{color:green}#trustindex-plugin-settings-page .troubleshooting-checklist .dashicons.dashicons-dismiss{color:red}#trustindex-plugin-settings-page .troubleshooting-checklist ul{list-style:disc !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}}
trunk/static/css/admin-widget.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ .text-danger { color: red; }
2
+ .text-success { color: green; }
3
+
4
+ .trustindex-widget-admin .block-help-template { display: none; }
5
+ .trustindex-widget-admin .help-block { position: absolute; background: white;padding: 10px; border: 1px solid blue; z-index: 10; }
6
+ .trustindex-widget-admin .help-block p { margin-top: 0px; }
7
+ .trustindex-widget-admin .help-block .dashicons-dismiss { float: right; cursor: pointer; }
8
+ .trustindex-widget-admin .btn-insert-tooltip { cursor: pointer; }
9
+ .trustindex-widget-admin label .dashicons { float: right; }
10
+
11
+ .trustindex-widget-admin .btn-copy-widget-id { text-decoration: none; }
trunk/static/img/check-icon.svg ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <g transform="matrix(1,0,0,1,-1456.05,-2718.07)">
5
+ <g transform="matrix(1,0,0,1,590,2240)">
6
+ <g transform="matrix(0.294981,0,0,0.294647,734.474,739.255)">
7
+ <g transform="matrix(-1.68585,-8.1708e-16,1.50946e-16,-1.68585,675.316,-776.864)">
8
+ <path d="M136,48.2C136,42.019 130.987,37 124.813,37L119.187,37C113.013,37 108,42.019 108,48.2L108,53.8C108,59.981 113.013,65 119.187,65L124.813,65C130.987,65 136,59.981 136,53.8L136,48.2Z" style="fill:rgb(18,180,131);"/>
9
+ </g>
10
+ <g transform="matrix(1.20778,0,0,1.21145,-96.4528,-133.436)">
11
+ <g transform="matrix(0.369289,0.369289,-0.707107,0.707107,-157.84,-315.308)">
12
+ <path d="M469.642,-641.5C469.642,-642.328 468.355,-643 466.769,-643L445.872,-643C444.287,-643 443,-642.328 443,-641.5L443,-638.5C443,-637.672 444.287,-637 445.872,-637L466.769,-637C468.355,-637 469.642,-637.672 469.642,-638.5L469.642,-641.5Z" style="fill:white;"/>
13
+ </g>
14
+ <g transform="matrix(0.556965,-0.556965,0.707107,0.707107,669.792,104.902)">
15
+ <path d="M469.642,-641.5C469.642,-642.328 468.788,-643 467.737,-643L444.904,-643C443.853,-643 443,-642.328 443,-641.5L443,-638.5C443,-637.672 443.853,-637 444.904,-637L467.737,-637C468.788,-637 469.642,-637.672 469.642,-638.5L469.642,-641.5Z" style="fill:white;"/>
16
+ </g>
17
+ </g>
18
+ <g transform="matrix(3.39005,0,0,3.39389,-4489.47,-10110.6)">
19
+ <path d="M1460.69,2724.11L1463.59,2727L1462.15,2723.07L1460.69,2724.11" style="fill:rgb(18,180,131);"/>
20
+ </g>
21
+ </g>
22
+ </g>
23
+ </g>
24
+ </svg>
trunk/static/img/help-where-is-id.jpg ADDED
Binary file
trunk/static/img/no.png ADDED
Binary file
trunk/static/img/platform/logo-dark.svg ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 255.2 80.3" style="enable-background:new 0 0 255.2 80.3;" xml:space="preserve"><style type="text/css">.st0{fill:#4285F4;}.st1{fill:#EA4335;}.st2{fill:#FBBC05;}.st3{fill:#34A853;}</style><g id="XMLID_11_"><path id="XMLID_10_" class="st0" d="M31.9,28.6v8.6h20.5c-0.6,4.8-2.2,8.3-4.7,10.8c-3,3-7.7,6.3-15.8,6.3 c-12.6,0-22.5-10.2-22.5-22.8S19.2,8.6,31.9,8.6c6.8,0,11.8,2.7,15.5,6.1l6-6C48.3,3.8,41.4,0,31.9,0C14.6,0,0,14.1,0,31.4 s14.6,31.4,31.9,31.4c9.4,0,16.4-3.1,21.9-8.8c5.7-5.7,7.4-13.6,7.4-20.1c0-2-0.1-3.8-0.5-5.4L31.9,28.6L31.9,28.6z"/><path id="XMLID_24_" class="st1" d="M86.9,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C107.2,30.1,98.1,21.6,86.9,21.6z M86.9,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3s11.4,5,11.4,12.3 C98.3,49.1,93,54.2,86.9,54.2z"/><path id="XMLID_21_" class="st0" d="M186.6,26.1h-0.3c-2-2.4-5.8-4.5-10.7-4.5c-10.1,0-19,8.8-19,20.3c0,11.4,8.8,20.3,19,20.3 c4.9,0,8.7-2.2,10.7-4.6h0.3v2.8c0,7.7-4.2,11.9-10.8,11.9c-5.4,0-8.8-3.9-10.2-7.2l-7.7,3.2c2.2,5.4,8.1,12,18,12 c10.4,0,19.3-6.1,19.3-21.1V22.7h-8.4v3.4H186.6z M176.4,54.2c-6.1,0-10.8-5.2-10.8-12.3c0-7.2,4.7-12.3,10.8-12.3 s10.8,5.2,10.8,12.4C187.3,49,182.5,54.2,176.4,54.2z"/><path id="XMLID_18_" class="st2" d="M132.3,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C152.6,30.1,143.5,21.6,132.3,21.6z M132.3,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3c6.1,0,11.4,5,11.4,12.3 C143.7,49.1,138.4,54.2,132.3,54.2z"/><path id="XMLID_3_" class="st3" d="M202.1,0.8h8.8v61.3h-8.8V0.8z"/><path id="XMLID_14_" class="st1" d="M237.9,54.2c-4.5,0-7.7-2.1-9.8-6.1l27.1-11.2l-0.9-2.3c-1.7-4.5-6.8-12.9-17.3-12.9 c-10.4,0-19.1,8.2-19.1,20.3c0,11.4,8.6,20.3,20.1,20.3c9.3,0,14.7-5.7,16.9-9l-6.9-4.6C245.6,51.9,242.4,54.2,237.9,54.2 L237.9,54.2z M237.3,29.2c3.6,0,6.7,1.9,7.7,4.5l-18.3,7.6C226.6,32.7,232.7,29.2,237.3,29.2z"/></g></svg>
trunk/static/img/platform/logo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 255.2 80.3" style="enable-background:new 0 0 255.2 80.3;" xml:space="preserve"><style type="text/css">.st0{fill:#4285F4;}.st1{fill:#EA4335;}.st2{fill:#FBBC05;}.st3{fill:#34A853;}</style><g id="XMLID_11_"><path id="XMLID_10_" class="st0" d="M31.9,28.6v8.6h20.5c-0.6,4.8-2.2,8.3-4.7,10.8c-3,3-7.7,6.3-15.8,6.3 c-12.6,0-22.5-10.2-22.5-22.8S19.2,8.6,31.9,8.6c6.8,0,11.8,2.7,15.5,6.1l6-6C48.3,3.8,41.4,0,31.9,0C14.6,0,0,14.1,0,31.4 s14.6,31.4,31.9,31.4c9.4,0,16.4-3.1,21.9-8.8c5.7-5.7,7.4-13.6,7.4-20.1c0-2-0.1-3.8-0.5-5.4H31.9z"/><path id="XMLID_24_" class="st1" d="M86.9,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C107.2,30.1,98.1,21.6,86.9,21.6z M86.9,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3c6.1,0,11.4,5,11.4,12.3 C98.3,49.1,93,54.2,86.9,54.2z"/><path id="XMLID_21_" class="st0" d="M186.6,26.1h-0.3c-2-2.4-5.8-4.5-10.7-4.5c-10.1,0-19,8.8-19,20.3c0,11.4,8.8,20.3,19,20.3 c4.9,0,8.7-2.2,10.7-4.6h0.3v2.8c0,7.7-4.2,11.9-10.8,11.9c-5.4,0-8.8-3.9-10.2-7.2l-7.7,3.2c2.2,5.4,8.1,12,18,12 c10.4,0,19.3-6.1,19.3-21.1V22.7h-8.4V26.1z M176.4,54.2c-6.1,0-10.8-5.2-10.8-12.3c0-7.2,4.7-12.3,10.8-12.3 c6.1,0,10.8,5.2,10.8,12.4C187.3,49,182.5,54.2,176.4,54.2z"/><path id="XMLID_18_" class="st2" d="M132.3,21.6c-11.2,0-20.4,8.5-20.4,20.3c0,11.7,9.1,20.3,20.4,20.3s20.4-8.6,20.4-20.3 C152.6,30.1,143.5,21.6,132.3,21.6z M132.3,54.2c-6.1,0-11.4-5.1-11.4-12.3c0-7.3,5.3-12.3,11.4-12.3c6.1,0,11.4,5,11.4,12.3 C143.7,49.1,138.4,54.2,132.3,54.2z"/><path id="XMLID_3_" class="st3" d="M202.1,0.8h8.8v61.3h-8.8V0.8z"/><path id="XMLID_14_" class="st1" d="M237.9,54.2c-4.5,0-7.7-2.1-9.8-6.1l27.1-11.2l-0.9-2.3c-1.7-4.5-6.8-12.9-17.3-12.9 c-10.4,0-19.1,8.2-19.1,20.3c0,11.4,8.6,20.3,20.1,20.3c9.3,0,14.7-5.7,16.9-9l-6.9-4.6C245.6,51.9,242.4,54.2,237.9,54.2 L237.9,54.2z M237.3,29.2c3.6,0,6.7,1.9,7.7,4.5l-18.3,7.6C226.6,32.7,232.7,29.2,237.3,29.2z"/></g></svg>
trunk/static/img/platforms.png ADDED
Binary file
trunk/static/img/special_30.jpg ADDED
Binary file
trunk/static/img/trustindex-sign-logo.png ADDED
Binary file
trunk/static/img/trustindex.svg ADDED
@@ -0,0 +1 @@
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 680 114" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g><path d="M158.022,37.168l-22.876,0l-0,-13.481l62.296,0l0,13.481l-22.876,0l0,58.007l-16.544,0l0,-58.007Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M217.357,47.483c1.94,-2.655 4.493,-4.698 7.761,-6.025c3.166,-1.328 6.945,-2.043 11.132,-2.043l0,14.706c-1.736,-0.102 -2.962,-0.204 -3.575,-0.204c-4.595,-0 -8.17,1.225 -10.722,3.778c-2.554,2.553 -3.881,6.434 -3.881,11.54l-0,25.94l-15.932,0l0,-54.943l15.217,0l-0,7.251Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M298.444,40.232l0,54.943l-15.114,0l-0,-6.536c-2.145,2.349 -4.596,4.187 -7.558,5.413c-2.961,1.328 -6.127,1.94 -9.497,1.94c-7.251,0 -12.97,-2.042 -17.157,-6.229c-4.187,-4.188 -6.332,-10.315 -6.332,-18.485l-0,-31.046l15.932,0l-0,28.697c-0,8.885 3.676,13.276 11.131,13.276c3.779,0 6.843,-1.225 9.191,-3.778c2.349,-2.451 3.472,-6.128 3.472,-11.03l0,-27.165l15.932,0Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M328.673,95.992c-4.596,0 -8.987,-0.612 -13.378,-1.736c-4.392,-1.123 -7.864,-2.451 -10.417,-4.187l5.31,-11.438c2.452,1.532 5.413,2.859 8.885,3.779c3.472,1.021 6.843,1.531 10.213,1.531c6.74,0 10.11,-1.633 10.11,-5.004c0,-1.532 -0.919,-2.655 -2.757,-3.37c-1.839,-0.715 -4.698,-1.225 -8.477,-1.736c-4.493,-0.715 -8.17,-1.43 -11.131,-2.349c-2.962,-0.919 -5.413,-2.451 -7.558,-4.697c-2.246,-2.247 -3.268,-5.413 -3.268,-9.6c0,-3.472 1.022,-6.536 3.064,-9.294c1.941,-2.655 4.902,-4.697 8.783,-6.229c3.779,-1.532 8.374,-2.247 13.583,-2.247c3.88,0 7.761,0.408 11.642,1.225c3.778,0.92 6.944,2.043 9.498,3.575l-5.311,11.336c-4.8,-2.758 -10.11,-4.085 -15.829,-4.085c-3.37,-0 -5.924,0.51 -7.66,1.429c-1.736,0.92 -2.553,2.145 -2.553,3.677c0,1.736 0.919,2.859 2.758,3.574c1.838,0.715 4.8,1.328 8.782,1.941c4.494,0.715 8.17,1.532 11.03,2.348c2.859,0.92 5.31,2.452 7.455,4.698c2.145,2.247 3.166,5.413 3.166,9.396c-0,3.37 -1.021,6.434 -3.064,9.089c-2.042,2.655 -5.004,4.698 -8.885,6.127c-3.983,1.533 -8.578,2.247 -13.991,2.247Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M396.791,92.52c-1.532,1.123 -3.473,2.043 -5.719,2.553c-2.349,0.613 -4.698,0.919 -7.251,0.919c-6.536,0 -11.541,-1.634 -15.217,-5.004c-3.472,-3.37 -5.31,-8.272 -5.31,-14.706l-0,-22.569l-8.477,-0l0,-12.255l8.477,-0l-0,-13.379l15.931,0l0,13.379l13.685,-0l0,12.255l-13.685,-0l0,22.365c0,2.349 0.613,4.085 1.838,5.31c1.124,1.328 2.86,1.941 5.004,1.941c2.554,-0 4.698,-0.715 6.434,-2.043l4.29,11.234Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M402.715,40.232l15.931,0l-0,54.943l-15.931,0l-0,-54.943Zm7.965,-7.66c-2.961,0 -5.31,-0.817 -7.148,-2.552c-1.839,-1.737 -2.758,-3.779 -2.758,-6.333c0,-2.552 0.919,-4.595 2.758,-6.331c1.838,-1.736 4.187,-2.553 7.148,-2.553c2.962,-0 5.311,0.817 7.149,2.451c1.838,1.634 2.759,3.676 2.759,6.127c-0,2.656 -0.921,4.8 -2.759,6.536c-1.838,1.736 -4.187,2.655 -7.149,2.655Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M463.788,39.415c6.841,0 12.354,2.043 16.541,6.128c4.188,4.085 6.229,10.11 6.229,18.178l0,31.454l-15.929,0l0,-29.003c0,-4.392 -0.921,-7.66 -2.862,-9.805c-1.938,-2.144 -4.696,-3.165 -8.271,-3.165c-3.983,-0 -7.25,1.225 -9.6,3.676c-2.35,2.553 -3.575,6.23 -3.575,11.132l-0,27.165l-15.929,0l-0,-54.943l15.216,0l0,6.434c2.142,-2.349 4.696,-4.085 7.863,-5.413c3.167,-1.225 6.537,-1.838 10.317,-1.838Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M553.858,19.398l0,75.777l-15.216,0l-0,-6.332c-3.984,4.8 -9.7,7.149 -17.154,7.149c-5.209,0 -9.909,-1.123 -13.992,-3.472c-4.188,-2.349 -7.558,-5.617 -9.909,-9.906c-2.345,-4.289 -3.575,-9.294 -3.575,-14.91c0,-5.617 1.23,-10.622 3.575,-14.911c2.351,-4.289 5.721,-7.557 9.909,-9.906c4.083,-2.349 8.783,-3.472 13.992,-3.472c7.045,0 12.458,2.247 16.441,6.638l0,-26.655l15.929,0Zm-29.616,63.522c3.983,0 7.354,-1.43 10.008,-4.187c2.658,-2.757 3.983,-6.434 3.983,-11.029c0,-4.596 -1.325,-8.273 -3.983,-11.132c-2.654,-2.757 -6.025,-4.085 -10.008,-4.085c-4.084,0 -7.455,1.328 -10.109,4.085c-2.654,2.859 -3.983,6.536 -3.983,11.132c0,4.595 1.329,8.272 3.983,11.029c2.654,2.757 6.025,4.187 10.109,4.187Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M619.321,67.908c-0,0.204 -0.1,1.634 -0.304,4.289l-41.567,0c0.717,3.37 2.554,6.128 5.313,8.068c2.754,1.94 6.229,2.962 10.416,2.962c2.858,-0 5.413,-0.409 7.658,-1.328c2.146,-0.817 4.188,-2.145 6.125,-3.983l8.48,9.192c-5.209,5.922 -12.767,8.884 -22.671,8.884c-6.234,0 -11.646,-1.225 -16.446,-3.676c-4.796,-2.349 -8.475,-5.719 -11.029,-10.008c-2.55,-4.29 -3.879,-9.192 -3.879,-14.604c-0,-5.413 1.329,-10.213 3.879,-14.502c2.554,-4.392 6.025,-7.762 10.416,-10.111c4.496,-2.451 9.5,-3.676 15.013,-3.676c5.412,0 10.212,1.123 14.604,3.472c4.392,2.349 7.763,5.617 10.317,10.008c2.45,4.29 3.675,9.294 3.675,15.013Zm-28.492,-16.442c-3.575,-0 -6.637,1.021 -9.087,3.064c-2.455,2.042 -3.984,4.799 -4.496,8.374l27.062,-0c-0.508,-3.473 -2.041,-6.23 -4.491,-8.374c-2.45,-2.043 -5.413,-3.064 -8.988,-3.064Z" style="fill:#3b404b;fill-rule:nonzero;"/><path d="M661.804,95.175l-12.05,-16.85l-12.458,16.85l-17.363,0l21.142,-27.676l-20.425,-27.267l17.871,0l11.641,16.033l11.951,-16.033l16.954,0l-20.425,26.859l21.241,28.084l-18.079,0Z" style="fill:#3b404b;fill-rule:nonzero;"/><g><circle cx="56.942" cy="56.942" r="56.942" style="fill:#2aa8d7;"/><path d="M54.686,55.275l21.292,-21.347c1.585,-1.585 4.157,-1.585 5.742,0l5.743,5.763c1.586,1.585 1.586,4.176 -0,5.761l-28.396,28.423c-0.081,0.116 -0.17,0.232 -0.263,0.31l-5.746,5.761c-0.793,0.774 -1.841,1.199 -2.885,1.199c-1.044,0 -2.088,-0.425 -2.885,-1.199l-5.743,-5.761c-0.092,-0.078 -0.181,-0.194 -0.262,-0.31l-14.862,-14.888c-1.585,-1.586 -1.585,-4.138 0,-5.723l5.743,-5.762c1.586,-1.586 4.161,-1.586 5.746,-0l11.254,11.253l1.016,1.006l11.505,11.407l-6.999,-15.893Z" style="fill:#fff;"/></g></g></svg>
trunk/static/img/yes.png ADDED
Binary file
trunk/static/js/admin-editor.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){tinymce.create("tinymce.plugins.trustindex",{init:function(a,b){let jq_url=(typeof ajax_object!="undefined"?ajax_object.ajax_url:window.ajaxurl||null);if(!jq_url){return}a.addButton("trustindex",{title:"Add Trustindex widget shortcode",cmd:"add-trustindex-widget",image:b+"/../img/trustindex-sign-logo.png",text:""});a.addCommand("add-trustindex-widget",function(){jQuery.get(jq_url+"?action=list_trustindex_widgets",function(c){a.windowManager.open({title:"Please add an Trustindex widget ID!",body:[{type:"container",name:"container",label:"",html:c},{type:"textbox",name:"widget-id",placeholder:"Trustindex widget ID",multiline:false,minWidth:200}],onsubmit:function(f){var d=f.data["widget-id"];if(d.length<10){alert("Trustindex ID is missing or too short. Please check, mayba a copy-paste error!");return false}else{a.execCommand("mceInsertContent",0,'[trustindex data-widget-id="'+d+'"]')}}})});jQuery("body").on("click",".btn-copy-widget-id",function(c){let selected_class="text-danger";c.preventDefault();let link=jQuery(this);let id=link.data("ti-id");link.closest(".mce-form").find("input").val(id).trigger("change");link.closest(".mce-form").find(".btn-copy-widget-id."+selected_class).each(function(d,e){jQuery(e).removeClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-admin-post")});link.addClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-yes")})})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Trustindex Buttons",author:"Trustindex.io - Velvel ltd[www.velvel.hu]",authorurl:"https://www.trustindex.io/",infourl:"https://www.trustindex.io/",version:"1.1"}}});tinymce.PluginManager.add("trustindex",tinymce.plugins.trustindex)})();
trunk/static/js/admin-page-settings-common.js ADDED
@@ -0,0 +1 @@
 
1
+ String.prototype.ucfirst=function(){return this.charAt(0).toUpperCase()+this.slice(1)};jQuery(document).ready(function(){jQuery(".ti-toggle-password").on("click",function(g){g.preventDefault();let icon=jQuery(this);let parent=icon.closest(".form-group, .ti-input-field");if(icon.hasClass("dashicons-visibility")){parent.find("input").attr("type","text");icon.removeClass("dashicons-visibility").addClass("dashicons-hidden")}else{parent.find("input").attr("type","password");icon.removeClass("dashicons-hidden").addClass("dashicons-visibility")}});let nav=jQuery("#trustindex-plugin-settings-page .nav-tab-wrapper");if(nav.length){let width=nav.find(".nav-tab-right").outerWidth();nav.css("padding-right",parseInt(width+5)+"px")}jQuery(".ti-toggle-opacity").css("opacity",1);jQuery("#trustindex-plugin-settings-page .btn-toggle").on("click",function(g){g.preventDefault();jQuery(jQuery(this).attr("href")).toggle();return false});jQuery(".btn-copy2clipboard").click(function(g){g.preventDefault();let obj=jQuery(jQuery(this).attr("href"));let text=obj.html()?obj.html():obj.val();TI_copyTextToClipboard(text)});var a=function(){let style_id=jQuery("#ti-style-id").val();let box=jQuery("#ti-review-list").closest(".ti-preview-box");if(["8","9","10","11","12","20","22"].indexOf(style_id)!=-1&&!b){box.css("width","30%")}else{if(["6","7","24","25","26","27","28","29","35"].indexOf(style_id)!=-1&&!b){box.css("width","50%")}else{box.css("width","auto")}}box.css("width",box.width())};jQuery(".ti-checkbox:not(.disabled)").on("click",function(){let checkbox=jQuery(this).find("input[type=checkbox], input[type=radio]");checkbox.prop("checked",!checkbox.prop("checked")).trigger("change");return false});jQuery(".ti-select").each(function(){let el=jQuery(this);let selected=el.find("ul li.selected");if(selected.length==0){selected=el.find("ul li:first")}el.data("value",selected.data("value")).find("font").html(selected.html())});jQuery(document).on("click",".ti-select",function(){let el=jQuery(this);el.toggleClass("active");if(el.hasClass("active")){jQuery(window).unbind().on("click",function(g){if(!jQuery(g.target).is(el)&&jQuery(g.target).closest(".ti-select").length==0){el.removeClass("active");jQuery(window).unbind()}})}});jQuery(document).on("click",".ti-select li",function(){let el=jQuery(this);el.parent().parent().data("value",el.data("value")).trigger("change").find("font").html(el.html());el.parent().find("li").removeClass("selected");el.addClass("selected")});var b=false;var f=jQuery("#ti-review-list .ti-widget").clone();f.find(".ti-review-item").each(function(){let el=jQuery(this);let rating=el.find(".ti-stars .ti-star.f, .stars .ti-star.f").length;if(el.find(".ti-recommendation-icon.positive").length){rating=5}else{if(el.find(".ti-recommendation-icon.negative").length){rating=1}}if(el.find(".ti-polarity-icon.positive").length){rating=5}else{if(el.find(".ti-polarity-icon.neutral").length){rating=3}else{if(el.find(".ti-polarity-icon.negative").length){rating=1}}}if(el.find(".ti-rating-box").length){rating=Math.round(parseFloat(el.find(".ti-rating-box").text())/2)}let selector=".ti-review-content";if(el.find(".ti-review-content .ti-inner").length){selector=".ti-review-content .ti-inner"}else{if(el.find(".ti-review-text").length){selector=".ti-review-text"}}el.attr("data-rating",rating);el.attr("data-empty",el.find(selector).text().trim()==""?1:0)});var e=function(){let platform=(jQuery("#ti-filter #show-star").data("platform")||"google").ucfirst();let el=jQuery('<div class="ti-widget" style="display: none"><div class="source-'+platform+'"><span class="ti-star f"></span><span class="ti-star e"></span></div></div>');el.append("body");jQuery("body").append(el);jQuery("#ti-filter .ti-star.e").css("background",el.find(".ti-star.e").css("background"));jQuery("#ti-filter .ti-star.f").css("background",el.find(".ti-star.f").css("background"));el.remove()};e();var d=function(){let layout_id=jQuery("#ti-review-list .ti-widget").data("layout-id");return[11,12,20,22,24,25,26,27,28,29,35].indexOf(layout_id)!=-1};var c=function(g){let style_id=jQuery("#ti-style-id").val();let stars=(jQuery("#ti-filter #show-star").data("value")+"").split(",").map(function(h){return parseInt(h)});let show_only_ratings=jQuery("#ti-filter-only-ratings").prop("checked");if(!jQuery("#ti-filter").length){stars=[1,2,3,4,5];show_only_ratings=false}jQuery(".ti-widget .ti-reviews-container-wrapper .ti-review-item").remove();let widget=document.querySelector(".ti-widget");widget.replaceWith(widget.cloneNode(true));let results=0;f.find(".ti-review-item").each(function(){let el=jQuery(this);if(stars.indexOf(el.data("rating"))!==-1){if(show_only_ratings&&el.data("empty")){return}if(["8","9","10","18","33"].indexOf(style_id)!=-1&&results>4){return}let clone=el.clone();jQuery("#ti-review-list .ti-widget .ti-reviews-container-wrapper").append(clone);clone.hide();clone.fadeIn();results++}});if(typeof Trustindex!="undefined"&&Trustindex.intervalPointer){clearInterval(Trustindex.intervalPointer)}if(results==0&&!d()){jQuery("#ti-review-list").hide().next().fadeIn();b=true}else{jQuery("#ti-review-list").fadeIn().next().hide();b=false;if(g===undefined){let dot_container=jQuery("#ti-review-list .ti-widget .ti-controls-dots");if(dot_container.length){let dot=dot_container.children(":first").clone();if(dot.length){dot_container.html(" "+dot.removeAttr("data-pager-state")[0].outerHTML+" ")}}}if(typeof Trustindex!="undefined"){Trustindex.pager_inited=true;Trustindex.init_pager(document.querySelectorAll(".ti-widget"));Trustindex.resize_widgets()}}if(g!==true){jQuery.post("",{command:"save-filter",filter:JSON.stringify({stars:stars,"only-ratings":show_only_ratings})})}a()};jQuery("#ti-filter #show-star").on("change",c);jQuery("#ti-filter-only-ratings").on("change",function(g){g.preventDefault();c();return false});if(f.length){c(true);a()}jQuery("#ti-style-id, #ti-set-id, #ti-lang-id, #ti-dateformat-id, #ti-widget-options input[type=checkbox]:not(.no-form-update), #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 loading_text=a.data("loading-text");let num_of_dots=(a.html().match(new RegExp(/\./,"g"))||[]).length;let next_dots=[".","..","...",""];a.html(loading_text+next_dots[num_of_dots]);setTimeout(function(){TI_manage_dots(a)},1000)}function decodeHTMLEntities(a){let textArea=document.createElement("textarea");textArea.innerHTML=a;return textArea.value}function TI_copyTextToClipboard(c){c=decodeHTMLEntities(c);if(!navigator.clipboard){var b=document.createElement("textarea");b.value=c;b.style.position="fixed";document.body.appendChild(b);b.focus();b.select();try{var d=document.execCommand("copy")}catch(a){}document.body.removeChild(b);return}navigator.clipboard.writeText(c).then(function(){},function(e){})};
trunk/static/js/admin-page-settings-connect.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery.fn.delayKeyup=function(e,b){var d=0;var c=jQuery(this);var a=c.val();c.on("input",function(f){if(a!=c.val()){a=c.val();clearTimeout(d);d=setTimeout(e,b)}});return jQuery(this)};var Trustindex_Autocomplete=null;jQuery(document).ready(function(){Trustindex_Autocomplete={box:jQuery("#trustindex-plugin-settings-page .autocomplete .results"),load:jQuery("#trustindex-plugin-settings-page .autocomplete .loading"),input:jQuery("#trustindex-plugin-settings-page .autocomplete input.name"),button:jQuery("#trustindex-plugin-settings-page .btn-search"),svg:{Hotels:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 298.666667h-341.333334v298.666666H128V213.333333H42.666667v640h85.333333v-128h768v128h85.333333v-384a170.666667 170.666667 0 0 0-170.666666-170.666666M298.666667 554.666667a128 128 0 0 0 128-128 128 128 0 0 0-128-128 128 128 0 0 0-128 128 128 128 0 0 0 128 128z" fill="" /></svg>',Restaurants:'<svg id="Layer_1" version="1.1" viewBox="0 0 30 30" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M23,19l-3.328-3.232C19.239,15.273,19,14.637,19,13.98V12c0-4.945,3.157-9.535,3.157-9.535L23,2.999V19z"/><circle cx="23" cy="3" r="1"/><path d="M24,3h-2l-1,10v13.5c0,0.828,0.672,1.5,1.5,1.5h0c0.828,0,1.5-0.672,1.5-1.5V3z"/><path d="M13.087,2.445C13.037,2.186,12.811,2,12.548,2C12.245,2,12,2.245,12,2.548v5.807C12,8.711,11.711,9,11.355,9 c-0.329,0-0.605-0.247-0.641-0.574l-0.66-5.939C10.023,2.21,9.789,2,9.509,2H9.5H9.491C9.211,2,8.977,2.21,8.946,2.488l-0.66,5.939 C8.25,8.753,7.974,9,7.645,9C7.289,9,7,8.711,7,8.355V2.548C7,2.245,6.755,2,6.452,2C6.189,2,5.963,2.186,5.913,2.445 C5.671,3.713,5,7.362,5,9c0,4,3,5,3,5v12.5C8,27.328,8.672,28,9.5,28s1.5-0.672,1.5-1.5V14c0,0,3-1,3-5 C14,7.362,13.329,3.713,13.087,2.445z"/></svg>',Attractions:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M533.333333 128.810667l43.008 0.149333c23.573333 0.085333 42.666667 19.413333 42.666667 42.816V213.333333H405.653333c0.298667-14.357333 0.106667-42.346667 0.106667-42.346666a42.197333 42.197333 0 0 1 42.56-42.496L490.666667 128.64V64a21.333333 21.333333 0 0 1 42.666666 0v64.810667zM726.677333 661.333333c85.482667 174.272 190.698667 277.333333 190.698667 277.333334H662.186667c-65.450667-148.181333-236.032-149.056-299.029334 0H105.088s105.173333-99.925333 191.146667-277.333334H234.666667a21.333333 21.333333 0 0 1 0-42.666666h554.666666a21.333333 21.333333 0 0 1 0 42.666666h-62.634666z m-103.872-362.666666c9.237333 102.464 34.346667 195.690667 66.304 277.333333H333.333333a1074.709333 1074.709333 0 0 0 66.986667-277.333333H362.666667a21.333333 21.333333 0 0 1 0-42.666667h298.666666a21.333333 21.333333 0 0 1 0 42.666667h-38.506666z" fill="#3D3D3D" /></svg>',LodgingBusiness:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M810.666667 298.666667h-341.333334v298.666666H128V213.333333H42.666667v640h85.333333v-128h768v128h85.333333v-384a170.666667 170.666667 0 0 0-170.666666-170.666666M298.666667 554.666667a128 128 0 0 0 128-128 128 128 0 0 0-128-128 128 128 0 0 0-128 128 128 128 0 0 0 128 128z" fill="" /></svg>'},searching:false,cache:[],search:function(b){let query_term=Trustindex_Autocomplete.input.val();if(query_term.length<4){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("tooshorttext")+"</span>");Trustindex_Autocomplete.box.show();return false}if(Trustindex_Autocomplete.input.data("url")===undefined&&(query_term.substr(0,4)=="www."||query_term.substr(0,7)=="http://"||query_term.substr(0,8)=="https://")){Trustindex_Autocomplete.box.html("<span>This is an URL. "+Trustindex_Autocomplete.input.attr("placeholder")+"</span>");Trustindex_Autocomplete.box.show();return false}else{if(Trustindex_Autocomplete.input.data("url")===true&&(query_term.substr(0,4)=="www."||query_term.substr(0,7)=="http://"||query_term.substr(0,8)=="https://")&&Trustindex_Autocomplete.checkRegex&&!Trustindex_Autocomplete.checkRegex.test(query_term)){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("url-errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}}if(Trustindex_Autocomplete.searching){return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=query_term.trim();if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResults(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/searchPage",data:{q:query_term,platform:b},dataType:"jsonp",success:function(c){Trustindex_Autocomplete.cache[cache_term]=c;Trustindex_Autocomplete.showResults(c)}})},showResults:function(b){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(b.success&&b.result&&b.result.length){let html="";b.result.forEach(function(c){html+='<li class="result" data-page-id="'+c.page_id+'" data-name="'+c.name+'" data-type="'+c.type+'" data-url="'+c.url+'" data-address="'+c.address+'" data-avatar-url="'+(c.avatar_url||"")+'">'+(Trustindex_Autocomplete.svg[c.type]||"")+'<p class="title">'+c.name+'</p><p class="location">'+(c.address||c.url)+"</p></li>"});Trustindex_Autocomplete.box.html("<ul>"+html+"</ul>");Trustindex_Autocomplete.box.show()}else{if(b.success){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("noresultstext")+"</span>");Trustindex_Autocomplete.box.show()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show()}}},showResult:function(b,c){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(typeof c=="undefined"){c="errortext"}if(b.success&&b.result){let page_details={id:b.result.page_id,name:b.result.name,address:b.result.address,avatar_url:b.result.avatar_url};let form=jQuery("#submit-form");let div=form.find(".ti-selected-source");form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));div.find("img").attr("src",page_details.avatar_url);div.find("#label-noreg-page_name").html(page_details.name);if(page_details.address){div.find("#label-noreg-address").html(page_details.address+"<br />")}div.find("#label-noreg-url").html("<a target='_blank' href='"+b.result.url+"'>"+b.result.url+"</a>");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");div.fadeIn()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data(c)+"</span>");Trustindex_Autocomplete.box.show()}},check:function(){let input=jQuery("#trustindex-plugin-settings-page #page-link");if(!Trustindex_Autocomplete.checkRegex){return false}let m=Trustindex_Autocomplete.checkRegex.exec(input.val());if(!Trustindex_Autocomplete.checkRegexValid(m)){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}if(Trustindex_Autocomplete.searching){return false}let part1=m[1]||m[3];let part2=m[2]||m[4]||"";let page_id=part1;if(part2){page_id+="|"+part2}if(page_id.trim()==""){Trustindex_Autocomplete.box.html("<span>"+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=page_id;if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResult(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/getPageDetails",data:{platform:jQuery("#submit-form").data("platform"),page_id:page_id},dataType:"jsonp",success:function(b){Trustindex_Autocomplete.cache[cache_term]=b;Trustindex_Autocomplete.showResult(b)}})},checkRegex:null,checkRegexValid:function(b){if(!b){return false}for(let i=0;i<b.length;i++){if(b[i]===""){return false}}return true}};if(Trustindex_Autocomplete.input.length){Trustindex_Autocomplete.input.delayKeyup(function(){Trustindex_Autocomplete.button.click()},650)}if(Trustindex_Autocomplete.button.length){Trustindex_Autocomplete.button.click(function(b){b.preventDefault();Trustindex_Autocomplete.search(Trustindex_Autocomplete.button.closest("form").data("platform"))})}jQuery(document).on("click","#trustindex-plugin-settings-page .autocomplete .results li[data-page-id]",function(){let selected_element=jQuery(this);let form=selected_element.closest("form");let div=form.find(".ti-selected-source");let page_details={id:selected_element.data("page-id"),name:selected_element.data("name"),address:selected_element.data("address"),avatar_url:selected_element.data("avatar-url")};form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));if(page_details.avatar_url){div.find("img").attr("src",page_details.avatar_url).show()}else{div.find("img").hide()}div.find("#label-noreg-page_name").html(selected_element.data("name"));div.find("#label-noreg-url").html("<a target='_blank' href='"+selected_element.data("url")+"'>"+selected_element.data("url")+"</a>");if(selected_element.data("address")){div.find("#label-noreg-address").html(selected_element.data("address")+"<br />")}Trustindex_Autocomplete.box.hide();div.fadeIn();Trustindex_Autocomplete.button.addClass("btn-default").removeClass("btn-primary")});jQuery("#trustindex-plugin-settings-page form:not([data-platform='facebook']) .btn-connect").click(function(b){let btn=jQuery(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);Trustindex_Autocomplete.button.css("pointer-events","none");jQuery("#trustindex-plugin-settings-page .btn-check").css("pointer-events","none")});jQuery("#trustindex-plugin-settings-page .btn-refresh").click(function(b){let btn=jQuery(this);btn.css("pointer-events","none");btn.addClass("btn-default").removeClass("btn-primary");btn.blur();TI_manage_dots(btn);jQuery("#trustindex-plugin-settings-page .btn").css("pointer-events","none")});jQuery("#trustindex-plugin-settings-page .btn-check").click(function(b){b.preventDefault();Trustindex_Autocomplete.check()});var a=[];jQuery("#ti-reg-email, #ti-reg-password").blur(function(){let email=jQuery("#ti-reg-email").val();if(jQuery.inArray(email,a)!=-1){jQuery("#txt-email-used").fadeIn();return false}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/userCheckEmail",data:{email:email,s:"wp"},dataType:"jsonp",success:function(b){if(b==-1){}else{if(b==0){jQuery("#txt-email-used").fadeOut()}else{let link=jQuery("#txt-email-used").find("a");link.html(link.html().replace("$email",email));jQuery("#txt-email-used").fadeIn();jQuery("#ti-reg-email").val("");a.push(email)}}}})});jQuery("#form-reg").submit(function(b){return !jQuery("#txt-email-used").is(":visible")})});
trunk/static/js/admin-page-settings.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){Trustindex_Autocomplete.check=function(){let value=jQuery("#trustindex-plugin-settings-page #page-link").val().trim();if(Trustindex_Autocomplete.searching){return false}if(value.substr(0,4)=="www."||value.substr(0,7)=="http://"||value.substr(0,8)=="https://"){if(!/^(www\.|https?:\/\/)(www\.)?google\.[^\/]+\/(search|maps)/gm.test(value)&&!/^(www\.|https?:\/\/)(www\.)?g\.page\/[^\/]+\/(?:review|share)/gm.test(value)){Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data("errortext-search")+"</span>");Trustindex_Autocomplete.box.show();return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=value;if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResult(Trustindex_Autocomplete.cache[cache_term],"errortext-search")},400);return}let do_request=function(){jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/findPlaceId",data:{url:value},dataType:"jsonp",success:function(a){Trustindex_Autocomplete.cache[cache_term]=a;Trustindex_Autocomplete.showResult(a,"errortext-search")}})};if(/[\?&]gl=[^&]+/.test(value)){do_request()}else{jQuery.getJSON("https://ipinfo.io",function(a){let country_code=typeof a.country!="undefined"?a.country.toLowerCase():"us";value+=(value.indexOf("?")!=-1?"&":"?")+"gl="+country_code;do_request()})}}else{if(!/([A-Z][a-zA-Z0-9_-]+)/gm.test(value)){Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data("errortext")+"</span>");Trustindex_Autocomplete.box.show();return false}Trustindex_Autocomplete.box.hide();Trustindex_Autocomplete.load.show();Trustindex_Autocomplete.searching=true;let cache_term=value;if(Trustindex_Autocomplete.cache[cache_term]!==undefined){setTimeout(function(){Trustindex_Autocomplete.showResult(Trustindex_Autocomplete.cache[cache_term])},400);return}jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/getPageDetails",data:{platform:"google",page_id:value},dataType:"jsonp",success:function(a){Trustindex_Autocomplete.cache[cache_term]=a;Trustindex_Autocomplete.showResult(a)}})}};Trustindex_Autocomplete.showResult=function(a,b){Trustindex_Autocomplete.load.hide();Trustindex_Autocomplete.searching=false;if(typeof b=="undefined"){b="errortext"}if(a.success&&a.result){let page_details={id:a.result.page_id,name:a.result.name,address:a.result.address,avatar_url:a.result.avatar_url};let form=jQuery("#submit-form");let div=form.find(".ti-selected-source");form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));div.find(".ti-source-box:not(.ti-original-source-box)").remove();div.find("img").attr("src",page_details.avatar_url);div.find("#label-noreg-page_name, .label-noreg-page_name").html(page_details.name);if(page_details.address){div.find("#label-noreg-address, .label-noreg-address").html(page_details.address+"<br />")}div.find("#label-noreg-url, .label-noreg-url").html("<a target='_blank' href='"+a.result.url+"'>"+a.result.url+"</a>");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");div.fadeIn();div.find(".ti-source-box").show()}else{if(typeof a.possible_places!="undefined"){let form=jQuery("#submit-form");jQuery("#trustindex-plugin-settings-page .btn-check").addClass("btn-disabled");let source_div=form.find(".ti-selected-source");let source_row=source_div.find(".ti-original-source-box");source_div.find(".ti-source-box:not(.ti-original-source-box)").remove();source_row.find('[id|="label-noreg"]').each(function(){let el=jQuery(this);if(!el.attr("id")){return}el.attr("class",el.attr("id"));el.attr("id","")});a.possible_places.forEach(function(c){let div=source_row.clone().removeClass("ti-original-source-box");div.find("img").attr("src",c.avatar_url);div.find(".label-noreg-page_name").html(c.name);div.find(".label-noreg-url").html("<a target='_blank' href='"+c.url+"'>"+c.url+"</a>");div.find(".btn-connect").removeClass("btn-connect").addClass("btn-place-choose").attr("href",c.url);source_row.before(div);div.show()});source_row.hide();source_div.fadeIn()}else{Trustindex_Autocomplete.box.html('<span class="error">'+Trustindex_Autocomplete.box.data(b)+"</span>");Trustindex_Autocomplete.box.show()}}};jQuery(document).on("click","#trustindex-plugin-settings-page .btn-place-choose",function(a){a.preventDefault();let btn=jQuery(this);btn.css("pointer-events","none").addClass("btn-disabled").blur();TI_manage_dots(btn);Trustindex_Autocomplete.button.css("pointer-events","none");jQuery("#trustindex-plugin-settings-page .btn-text").css("pointer-events","none");jQuery.ajax({method:"POST",url:"https://admin.trustindex.io/api/findPlaceId",data:{url:btn.attr("href")},dataType:"jsonp",success:function(b){if(b.success&&b.result){let page_details={id:b.result.page_id,name:b.result.name,address:b.result.address,avatar_url:b.result.avatar_url};let form=jQuery("#submit-form");form.find("#ti-noreg-page_details").val(JSON.stringify(page_details));form.submit()}else{location.reload()}}})})});
trunk/static/js/admin-popup.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){let popupPosition=function(){let pad=jQuery("#wpcontent").css("padding-left");jQuery(".trustindex-popup").css({right:pad,"margin-left":pad})};popupPosition();jQuery(window).resize(popupPosition);jQuery(document).on("click","a.trustindex-rateus",function(a){let link=jQuery(this),closeButton=link.closest(".notice").find(".notice-dismiss"),url=link.attr("href");closeButton.click();if(link.attr("target")===undefined){a.preventDefault();jQuery.get(url);return false}})});
trunk/static/js/admin-widget.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){let wp_content=jQuery("#wpbody-content").length?jQuery("#wpbody-content"):jQuery("body");wp_content.on("click",".btn-insert-tooltip",function(a){a.preventDefault();jQuery(this).closest("label").after(jQuery(".block-help-template:last").clone().removeAttr("id").removeClass("block-help-template"))});wp_content.on("click",".dashicons-dismiss",function(a){a.preventDefault();jQuery(this).closest(".help-block").remove()});wp_content.on("click",".btn-copy-widget-id",function(a){a.preventDefault();let link=jQuery(this);link.closest("form").find(".form-control").val(link.data("ti-id")).trigger("change");TImanageCopyLinks(link.closest("form"),link)});wp_content.on("blur",".trustindex-widget-admin .form-control",function(){let input=jQuery(this);if(input.attr("required")!="required"||input.val()){input.prev().removeClass("text-danger")}else{input.prev().addClass("text-danger")}TImanageCopyLinks(input.closest("form"),input.closest("form").find("[data-ti-id='"+input.val()+"']"))})});function TImanageCopyLinks(b,a){let selected_class="text-danger";b.find(".btn-copy-widget-id."+selected_class).each(function(c,d){jQuery(d).removeClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-admin-post")});if(a){a.addClass(selected_class).find(".dashicons").attr("class","dashicons dashicons-yes")}};
trunk/tabs/demo_widgets.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="ti-preview-boxes-container">
2
+ <?php foreach(TrustindexPlugin_google::$widget_templates['templates'] as $id => $template): ?>
3
+ <?php
4
+ $class_name = 'ti-full-width';
5
+ if(in_array($template['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
6
+ {
7
+ $class_name = 'ti-half-width';
8
+ }
9
+ if(!in_array($id, [ 17, 21 ]))
10
+ {
11
+ $random_set_id = array_rand(TrustindexPlugin_google::$widget_styles);
12
+ }
13
+ else
14
+ {
15
+ $random_set_id = 'light-background';
16
+ }
17
+ ?>
18
+ <div class="<?php echo esc_attr($class_name); ?>">
19
+ <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($id); ?>" data-set-id="<?php echo esc_attr($random_set_id); ?>">
20
+ <div class="ti-header">
21
+ <span class="ti-header-layout-text">
22
+ <?php echo TrustindexPlugin_google::___('More widget examples'); ?> -
23
+ <strong><?php echo esc_html(TrustindexPlugin_google::___($template['name'])); ?></strong>
24
+ <?php if(!in_array($id, [ 17, 21 ])): ?> (<?php echo esc_html(TrustindexPlugin_google::___(TrustindexPlugin_google::$widget_styles[$random_set_id]['name'])); ?>)<?php endif; ?>
25
+ </span>
26
+ </div>
27
+ <div class="preview">
28
+ <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $id, $random_set_id, true, true); ?>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <?php endforeach; ?>
33
+ </div>
trunk/tabs/get_reviews.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ ?>
4
+ <div class="ti-box">
5
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('Want more %s reviews?', [ 'Google' ]); ?></div>
6
+ <?php if($trustindex_pm_google->shortname == "google"): ?>
7
+ <p><?php echo TrustindexPlugin_google::___("Get 100+ REAL Google reviews, with only 3 minutes of work, without developer knowledge..."); ?></p>
8
+ <a href="https://wordpress.trustindex.io/collect-google-reviews/?source=wpcs-google" target="_blank" class="btn-text"><?php echo TrustindexPlugin_google::___("DOWNLOAD OUR FREE GUIDE"); ?></a>
9
+ <?php else: ?>
10
+ <p><?php echo TrustindexPlugin_google::___("Get 100+ REAL Customer reviews, with only 3 minutes of work, without developer knowledge..."); ?></p>
11
+ <a href="https://wordpress.trustindex.io/collect-reviews/?source=wpcs-google" target="_blank" class="btn-text"><?php echo TrustindexPlugin_google::___("DOWNLOAD OUR FREE GUIDE"); ?></a>
12
+ <?php endif; ?>
13
+ </div>
14
+ <?php if(class_exists('Woocommerce')): ?>
15
+ <div class="ti-box">
16
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('Get new features for your WooCommerce shop'); ?></div>
17
+ <?php if(!class_exists('TrustindexWoocommercePlugin')): ?>
18
+ <p><?php echo TrustindexPlugin_google::___("Download our new <a href='%s' target='_blank'>%s</a> plugin and get features for free!", [ 'https://wordpress.org/plugins/customer-reviews-for-woocommerce/', TrustindexPlugin_google::___('Customer Reviews for WooCommerce') ]); ?></p>
19
+ <?php endif; ?>
20
+ <ul class="ti-check" style="margin-bottom: 20px">
21
+ <li><?php echo TrustindexPlugin_google::___('set up Trustindex company profile and get high quality backlink'); ?></li>
22
+ <li><?php echo TrustindexPlugin_google::___('set up review-collector campaigns to get new ratings / reviews / recommendations automatically'); ?></li>
23
+ <li><?php echo TrustindexPlugin_google::___('show customer reviews in fancy widgets'); ?></li>
24
+ </ul>
25
+ <?php if(class_exists('TrustindexWoocommercePlugin')): ?>
26
+ <a href="?page=customer-reviews-for-woocommerce%2Fsettings.php" class="btn-text">
27
+ <?php echo TrustindexPlugin_google::___("Get Reviews"); ?>
28
+ </a>
29
+ <?php else: ?>
30
+ <a href="https://wordpress.org/plugins/customer-reviews-for-woocommerce/" target="_blank" class="btn-text">
31
+ <?php echo TrustindexPlugin_google::___("Download plugin"); ?>
32
+ </a>
33
+ <?php endif; ?>
34
+ </div>
35
+ <?php endif; ?>
trunk/tabs/my_reviews.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ if(isset($_COOKIE['ti-success']))
4
+ {
5
+ $ti_success = sanitize_text_field($_COOKIE['ti-success']);
6
+ setcookie('ti-success', '', time() - 60, "/");
7
+ if($ti_success == 'reviews-loaded')
8
+ {
9
+ update_option( $trustindex_pm_google->get_option_name('download-timestamp') , time() + (86400 * 2), false);
10
+ }
11
+ }
12
+ if(isset($_POST['save-highlight']))
13
+ {
14
+ check_admin_referer( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_highlight_save' );
15
+ $id = null;
16
+ $start = null;
17
+ $length = null;
18
+ if(isset($_POST['id']))
19
+ {
20
+ $id = intval(sanitize_text_field($_POST['id']));
21
+ }
22
+ if(isset($_POST['start']))
23
+ {
24
+ $start = sanitize_text_field($_POST['start']);
25
+ }
26
+ if(isset($_POST['length']))
27
+ {
28
+ $length = sanitize_text_field($_POST['length']);
29
+ }
30
+ if($id)
31
+ {
32
+ $highlight = "";
33
+ if(!is_null($start))
34
+ {
35
+ $highlight = $start . ',' . $length;
36
+ }
37
+ $wpdb->query("UPDATE `". $trustindex_pm_google->get_noreg_tablename() ."` SET highlight = '$highlight' WHERE id = '$id'");
38
+ }
39
+ exit;
40
+ }
41
+ $reviews = [];
42
+ if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
43
+ {
44
+ $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
45
+ }
46
+ function trustindex_plugin_write_rating_stars($score)
47
+ {
48
+ global $trustindex_pm_google;
49
+ if($trustindex_pm_google->is_ten_scale_rating_platform())
50
+ {
51
+ return '<div class="ti-rating-box">'. $trustindex_pm_google->formatTenRating($score) .'</div>';
52
+ }
53
+ $text = "";
54
+ $link = "https://cdn.trustindex.io/assets/platform/".ucfirst("google")."/star/";
55
+ if(!is_numeric($score))
56
+ {
57
+ return $text;
58
+ }
59
+ for ($si = 1; $si <= $score; $si++)
60
+ {
61
+ $text .= '<img src="'. $link .'f.svg" class="ti-star" />';
62
+ }
63
+ $fractional = $score - floor($score);
64
+ if( 0.25 <= $fractional )
65
+ {
66
+ if ( $fractional < 0.75 )
67
+ {
68
+ $text .= '<img src="'. $link .'h.svg" class="ti-star" />';
69
+ }
70
+ else
71
+ {
72
+ $text .= '<img src="'. $link .'f.svg" class="ti-star" />';
73
+ }
74
+ $si++;
75
+ }
76
+ for (; $si <= 5; $si++)
77
+ {
78
+ $text .= '<img src="'. $link .'e.svg" class="ti-star" />';
79
+ }
80
+ return $text;
81
+ }
82
+ wp_enqueue_style('trustindex-widget-css', 'https://cdn.trustindex.io/assets/widget-presetted-css/4-light-background.css');
83
+ wp_enqueue_script('trustindex-review-js', 'https://cdn.trustindex.io/assets/js/trustindex-review.js', [], false, true);
84
+ wp_add_inline_script('trustindex-review-js', '
85
+ jQuery(".ti-review-content").TI_shorten({
86
+ "showLines": 2,
87
+ "lessText": "'. TrustindexPlugin_google::___("Show less") .'",
88
+ "moreText": "'. TrustindexPlugin_google::___("Show more") .'",
89
+ });
90
+ jQuery(".ti-review-content").TI_format();
91
+ ');
92
+ $download_timestamp = get_option($trustindex_pm_google->get_option_name('download-timestamp'), time() - 1);
93
+ ?>
94
+ <?php if(!$trustindex_pm_google->is_noreg_linked()): ?>
95
+ <div class="ti-notice notice-warning" style="margin-left: 0">
96
+ <p><?php echo TrustindexPlugin_google::___("Connect your %s platform to download reviews.", ["Google"]); ?></p>
97
+ </div>
98
+ <?php else: ?>
99
+ <?php if($trustindex_pm_google->is_trustindex_connected() && in_array($selected_tab, [ 'setup_no_reg', 'my_reviews' ])): ?>
100
+ <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
101
+ <p>
102
+ <?php echo TrustindexPlugin_google::___("You have connected your Trustindex account, so you can find premium functionality under the \"%s\" tab. You no longer need this tab unless you choose the limited but forever free mode.", ["Trustindex admin"]); ?>
103
+ </p>
104
+ </div>
105
+ <?php endif; ?>
106
+ <div class="ti-box">
107
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("My Reviews"); ?></div>
108
+ <?php if($download_timestamp < time()): ?>
109
+ <div class="tablenav top" style="margin-bottom: 15px">
110
+ <div class="alignleft actions">
111
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&refresh&my_reviews" class="btn-text btn-refresh btn-download-reviews" style="margin-left: 0" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>" data-delay=10><?php echo TrustindexPlugin_google::___("Download new reviews") ;?></a>
112
+ </div>
113
+ </div>
114
+ <?php endif; ?>
115
+ <?php if(isset($ti_success) && $ti_success == "reviews-loaded"): ?>
116
+ <div class="ti-notice notice-success is-dismissible" style="margin: 0 0 15px 0">
117
+ <p><?php echo TrustindexPlugin_google::___("New reviews loaded!"); ?></p>
118
+ <button type="button" class="notice-dismiss"></button>
119
+ </div>
120
+ <?php endif; ?>
121
+ <?php if(!$trustindex_pm_google->is_trustindex_connected() && $download_timestamp < time()): ?>
122
+ <div class="ti-notice notice-error" style="margin: 0 0 15px 0">
123
+ <p>
124
+ <?php echo TrustindexPlugin_google::___("Don't want to waste your time by updating your reviews every week? <a href='%s' target='_blank'>Create a free Trustindex account! »</a>", [ 'https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-l' ]); ?>
125
+ </p>
126
+ </div>
127
+ <?php endif; ?>
128
+ <?php if(!count($reviews)): ?>
129
+ <div class="ti-notice notice-warning" style="margin-left: 0">
130
+ <p><?php echo TrustindexPlugin_google::___("You had no reviews at the time of last review downloading."); ?></p>
131
+ </div>
132
+ <?php else: ?>
133
+ <table class="wp-list-table widefat fixed striped table-view-list ti-my-reviews ti-widget">
134
+ <thead>
135
+ <tr>
136
+ <th class="text-center"><?php echo TrustindexPlugin_google::___("Reviewer"); ?></th>
137
+ <th class="text-center" style="width: 90px;"><?php echo TrustindexPlugin_google::___("Rating"); ?></th>
138
+ <th class="text-center"><?php echo TrustindexPlugin_google::___("Date"); ?></th>
139
+ <th style="width: 48%"><?php echo TrustindexPlugin_google::___("Text"); ?></th>
140
+ <th></th>
141
+ </tr>
142
+ </thead>
143
+ <tbody>
144
+ <?php foreach ($reviews as $review): ?>
145
+ <tr data-id="<?php echo esc_attr($review->id); ?>">
146
+ <td class="text-center">
147
+ <img src="<?php echo esc_url($review->user_photo); ?>" class="ti-user-avatar" /><br />
148
+ <?php echo esc_html($review->user); ?>
149
+ </td>
150
+ <td class="text-center source-<?php echo ucfirst("google") ?>"><?php echo trustindex_plugin_write_rating_stars($review->rating); ?></td>
151
+ <td class="text-center"><?php echo esc_html($review->date); ?></td>
152
+ <td><div class="ti-review-content"><?php echo $trustindex_pm_google->getReviewHtml($review); ?></div></td>
153
+ <td>
154
+ <a href="<?php echo esc_attr($review->id); ?>" class="btn-text btn-highlight<?php if(isset($review->highlight) && $review->highlight): ?> has-highlight<?php endif; ?>" style="margin-left: 0"><?php echo TrustindexPlugin_google::___("Highlight text") ;?></a>
155
+ </td>
156
+ </tr>
157
+ <?php endforeach; ?>
158
+ </tbody>
159
+ </table>
160
+ <?php endif; ?>
161
+ </div>
162
+ <!-- Modal -->
163
+ <div class="ti-modal" id="ti-highlight-modal">
164
+ <?php wp_nonce_field( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_highlight_save' ); ?>
165
+ <div class="ti-modal-dialog">
166
+ <div class="ti-modal-content">
167
+ <div class="ti-modal-header">
168
+ <span class="ti-modal-title"><?php echo TrustindexPlugin_google::___("Highlight text") ;?></span>
169
+ </div>
170
+ <div class="ti-modal-body">
171
+ <?php echo TrustindexPlugin_google::___("Just select the text you want to highlight") ;?>:
172
+ <div class="ti-highlight-content"></div>
173
+ </div>
174
+ <div class="ti-modal-footer">
175
+ <a href="#" class="btn-text btn-modal-close"><?php echo TrustindexPlugin_google::___("Back") ;?></a>
176
+ <a href="#" class="btn-text btn-primary btn-highlight-confirm" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Save") ;?></a>
177
+ <a href="#" class="btn-text btn-danger btn-highlight-remove" style="position: absolute; left: 15px" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Remove highlight") ;?></a>
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </div>
182
+ <?php endif; ?>
trunk/tabs/rate.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ wp_enqueue_script('trustindex-js', 'https://cdn.trustindex.io/loader.js', [], false, true);
4
+ ?>
5
+ <div class="ti-box rate-us en">
6
+ <div class="ti-box-head">
7
+ <div class="ti-row">
8
+ <div class="ti-col">
9
+ <h1><?php echo TrustindexPlugin_google::___('Please help us by reviewing our Plugin.'); ?></h1>
10
+ <p><?php echo TrustindexPlugin_google::___("We've spent a lot of time developing this software. If you use the free version, you can still support us by leaving a review!"); ?></p>
11
+ <p><?php echo TrustindexPlugin_google::___('Thank you in advance!'); ?></p>
12
+ </div>
13
+ <div class="ti-col-auto rate-us-wrapper">
14
+ <a class="btn-text btn-lg" href="https://wordpress.org/support/plugin/<?php echo $trustindex_pm_google->get_plugin_slug(); ?>/reviews/?rate=5#new-post" target="_blank"><?php echo TrustindexPlugin_google::___('Click here to rate us!'); ?></a>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ <hr>
19
+ <div class="ti-row">
20
+ <div class="ti-col-12">
21
+ <div src='https://cdn.trustindex.io/loader.js?c1c627610fde227dfc5bbac1ec'></div>
22
+ </div>
23
+ </div>
24
+ </div>
trunk/tabs/setup_no_reg.php ADDED
@@ -0,0 +1,426 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php include( plugin_dir_path(__FILE__ ) . "setup_no_reg_header.php" ); ?>
2
+ <ul class="ti-free-steps">
3
+ <li class="<?php echo !$trustindex_pm_google->is_noreg_linked() ? "active" : "done"; ?><?php if($current_step == 1): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=1">
4
+ <span>1</span>
5
+ <?php echo TrustindexPlugin_google::___('Connect %s platform', [ 'Google' ]); ?>
6
+ </li>
7
+ <span class="ti-free-arrow"></span>
8
+ <li class="<?php echo $style_id ? "done" : ($trustindex_pm_google->is_noreg_linked() ? "active" : ""); ?><?php if($current_step == 2): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=2">
9
+ <span>2</span>
10
+ <?php echo TrustindexPlugin_google::___('Select Layout'); ?>
11
+ </li>
12
+ <span class="ti-free-arrow"></span>
13
+ <li class="<?php echo $scss_set ? "done" : ($style_id ? "active" : ""); ?><?php if($current_step == 3): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=3">
14
+ <span>3</span>
15
+ <?php echo TrustindexPlugin_google::___('Select Style'); ?>
16
+ </li>
17
+ <span class="ti-free-arrow"></span>
18
+ <li class="<?php echo $widget_setted_up ? "done" : ($scss_set ? "active" : ""); ?><?php if($current_step == 4): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=4">
19
+ <span>4</span>
20
+ <?php echo TrustindexPlugin_google::___('Set up widget'); ?>
21
+ </li>
22
+ <span class="ti-free-arrow"></span>
23
+ <li class="<?php echo $widget_setted_up ? "active" : ""; ?><?php if($current_step == 5): ?> current<?php endif; ?>" href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=5">
24
+ <span>5</span>
25
+ <?php echo TrustindexPlugin_google::___('Insert code'); ?>
26
+ </li>
27
+ </ul>
28
+ <?php if($trustindex_pm_google->is_trustindex_connected() && in_array($selected_tab, [ 'setup_no_reg', 'my_reviews' ])): ?>
29
+ <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
30
+ <p>
31
+ <?php echo TrustindexPlugin_google::___("You have connected your Trustindex account, so you can find premium functionality under the \"%s\" tab. You no longer need this tab unless you choose the limited but forever free mode.", ["Trustindex admin"]); ?>
32
+ </p>
33
+ </div>
34
+ <?php endif; ?>
35
+ <?php if(TrustindexPlugin_google::is_amp_active() && !get_option($trustindex_pm_google->get_option_name('amp-hidden-notification'), 0)): ?>
36
+ <div class="ti-notice notice-warning is-dismissible" style="margin: 0 0 15px 0">
37
+ <p>
38
+ <?php echo TrustindexPlugin_google::___("Free plugin features are unavailable with AMP plugin."); ?>
39
+ <?php if($trustindex_pm_google->is_trustindex_connected()): ?>
40
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_trustindex_join">Trustindex admin</a>
41
+ <?php else: ?>
42
+ <a href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-amp" target="_blank"><?php echo TrustindexPlugin_google::___("Try premium features (like AMP) for free"); ?></a>
43
+ <?php endif; ?>
44
+ </p>
45
+ <button type="button" class="notice-dismiss" data-command="save-amp-notice-hide"></button>
46
+ </div>
47
+ <?php endif; ?>
48
+ <?php if($current_step == 1 || !$trustindex_pm_google->is_noreg_linked()): ?>
49
+ <h1 class="ti-free-title">
50
+ 1. <?php echo TrustindexPlugin_google::___('Connect %s platform', [ 'Google' ]); ?>
51
+ </h1>
52
+ <?php if($trustindex_pm_google->is_noreg_linked()): ?>
53
+ <?php $page_details = get_option($trustindex_pm_google->get_option_name('page-details')); ?>
54
+ <div class="ti-source-box">
55
+ <?php if(isset($page_details['avatar_url'])): ?>
56
+ <img src="<?php echo esc_url($page_details['avatar_url']); ?>" />
57
+ <?php endif; ?>
58
+ <div class="ti-source-info">
59
+ <strong><?php echo esc_html($page_details['name']); ?></strong><br />
60
+ <?php if ($page_details['address']): ?>
61
+ <?php echo esc_html($page_details['address']); ?><br />
62
+ <?php endif; ?>
63
+ <a href="<?php echo esc_url($trustindex_pm_google->getPageUrl()); ?>" target="_blank"><?php echo esc_url($trustindex_pm_google->getPageUrl()); ?></a>
64
+ </div>
65
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&command=delete-page"><button class="btn btn-text"><?php echo TrustindexPlugin_google::___("Disconnect") ;?></button></a>
66
+ <div class="clear"></div>
67
+ </div>
68
+ <?php else: ?>
69
+ <div class="ti-box">
70
+ <form method="post" action="" data-platform="google" id="submit-form">
71
+ <input type="hidden" name="command" value="save-page" />
72
+ <?php wp_nonce_field( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_save' ); ?>
73
+ <input type="hidden"
74
+ name="page_details"
75
+ class="form-control"
76
+ required="required"
77
+ id="ti-noreg-page_details"
78
+ value=""
79
+ />
80
+ <div class="autocomplete">
81
+ <?php include( plugin_dir_path(__FILE__ ) . "setup_no_reg_platform.php" ); ?>
82
+ </div>
83
+ <div class="ti-selected-source">
84
+ <label class="ti-left-label"><?php echo TrustindexPlugin_google::___("Source"); ?>:</label>
85
+ <div class="ti-source-box ti-original-source-box">
86
+ <img />
87
+ <div class="ti-source-info">
88
+ <strong id="label-noreg-page_name"></strong><br />
89
+ <span id="label-noreg-address"></span>
90
+ <span id="label-noreg-url"></span>
91
+ </div>
92
+ <button class="btn btn-text btn-connect" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Connect") ;?></button>
93
+ </div>
94
+ <div class="clear"></div>
95
+ </div>
96
+ </form>
97
+ </div>
98
+ <?php endif; ?>
99
+ <div class="ti-box">
100
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('See a %s Widget example below:', [ 'Google Reviews' ]); ?></div>
101
+ <div class="ti-preview-box">
102
+ <?php echo $trustindex_pm_google->get_trustindex_widget('2d9bf9019f8d93ad1430e9135'); ?>
103
+ </div>
104
+ </div>
105
+ <?php include( plugin_dir_path(__FILE__ ) . "demo_widgets.php" ); ?>
106
+ <?php elseif($current_step == 2 || !$style_id): ?>
107
+ <h1 class="ti-free-title">
108
+ 2. <?php echo TrustindexPlugin_google::___('Select Layout'); ?>
109
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=1" class="ti-back-icon"><?php echo TrustindexPlugin_google::___('Back'); ?></a>
110
+ </h1>
111
+ <?php if(!count($reviews)): ?>
112
+ <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
113
+ <p>
114
+ <?php echo TrustindexPlugin_google::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
115
+ </p>
116
+ </div>
117
+ <?php endif; ?>
118
+ <div class="ti-filter-row">
119
+ <label><?php echo TrustindexPlugin_google::___('Layout'); ?>:</label>
120
+ <span class="ti-checkbox">
121
+ <input type="radio" name="layout-select" value="" data-ids="" checked>
122
+ <label><?php echo TrustindexPlugin_google::___('All'); ?></label>
123
+ </span>
124
+ <?php foreach(TrustindexPlugin_google::$widget_templates['categories'] as $category => $ids): ?>
125
+ <span class="ti-checkbox">
126
+ <input type="radio" name="layout-select" value="<?php echo esc_attr($category); ?>" data-ids="<?php echo esc_attr($ids); ?>">
127
+ <label><?php echo esc_html(TrustindexPlugin_google::___(ucfirst($category))); ?></label>
128
+ </span>
129
+ <?php endforeach; ?>
130
+ </div>
131
+ <div class="ti-preview-boxes-container">
132
+ <?php foreach(TrustindexPlugin_google::$widget_templates['templates'] as $id => $template): ?>
133
+ <?php
134
+ $class_name = 'ti-full-width';
135
+ if(in_array($template['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
136
+ {
137
+ $class_name = 'ti-half-width';
138
+ }
139
+ ?>
140
+ <div class="<?php echo esc_attr($class_name); ?>">
141
+ <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($id); ?>" data-set-id="light-background">
142
+ <div class="ti-header">
143
+ <span class="ti-header-layout-text">
144
+ <?php echo TrustindexPlugin_google::___('Layout'); ?>:
145
+ <strong><?php echo esc_html(TrustindexPlugin_google::___($template['name'])); ?></strong>
146
+ </span>
147
+ <a href="?page=<?php echo $_GET['page']; ?>&tab=setup_no_reg&command=save-style&style_id=<?php echo esc_attr(urlencode($id)); ?>" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Select") ;?></a>
148
+ <div class="clear"></div>
149
+ </div>
150
+ <div class="preview">
151
+ <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $id, 'light-background', true, true); ?>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ <?php endforeach; ?>
156
+ </div>
157
+ <?php elseif($current_step == 3 || !$scss_set): ?>
158
+ <h1 class="ti-free-title">
159
+ 3. <?php echo TrustindexPlugin_google::___('Select Style'); ?>
160
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=2" class="ti-back-icon"><?php echo TrustindexPlugin_google::___('Back'); ?></a>
161
+ </h1>
162
+ <?php if(!count($reviews)): ?>
163
+ <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
164
+ <p>
165
+ <?php echo TrustindexPlugin_google::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
166
+ </p>
167
+ </div>
168
+ <?php endif; ?>
169
+ <?php
170
+ $class_name = 'ti-full-width';
171
+ if(in_array(TrustindexPlugin_google::$widget_templates['templates'][$style_id]['type'], [ 'badge', 'button', 'floating', 'popup', 'sidebar' ]))
172
+ {
173
+ $class_name = 'ti-half-width';
174
+ }
175
+ ?>
176
+ <div class="ti-preview-boxes-container">
177
+ <?php foreach(TrustindexPlugin_google::$widget_styles as $id => $style): ?>
178
+ <div class="<?php echo esc_attr($class_name); ?>">
179
+ <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($style_id); ?>" data-set-id="<?php echo esc_attr($id); ?>">
180
+ <div class="ti-header">
181
+ <span class="ti-header-layout-text">
182
+ <?php echo TrustindexPlugin_google::___('Style'); ?>:
183
+ <strong><?php echo TrustindexPlugin_google::___($style['name']); ?></strong>
184
+ </span>
185
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&command=save-set&set_id=<?php echo esc_attr(urlencode($id)); ?>" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Select") ;?></a>
186
+ <div class="clear"></div>
187
+ </div>
188
+ <div class="preview">
189
+ <?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, $style_id, $id, true, true); ?>
190
+ </div>
191
+ </div>
192
+ </div>
193
+ <?php endforeach; ?>
194
+ </div>
195
+ <?php elseif($current_step == 4 || !$widget_setted_up): ?>
196
+ <?php
197
+ $widget_type = TrustindexPlugin_google::$widget_templates[ 'templates' ][ $style_id ]['type'];
198
+ $widget_has_reviews = !in_array($widget_type, [ 'button', 'badge' ]) || in_array($style_id, [ 23, 30, 32 ]);
199
+ ?>
200
+ <h1 class="ti-free-title">
201
+ 4. <?php echo TrustindexPlugin_google::___('Set up widget'); ?>
202
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=3" class="ti-back-icon"><?php echo TrustindexPlugin_google::___('Back'); ?></a>
203
+ </h1>
204
+ <?php if(!count($reviews)): ?>
205
+ <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
206
+ <p>
207
+ <?php echo TrustindexPlugin_google::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
208
+ </p>
209
+ </div>
210
+ <?php endif; ?>
211
+ <div class="ti-box ti-preview-boxes" data-layout-id="<?php echo esc_attr($style_id); ?>" data-set-id="<?php echo esc_attr($scss_set); ?>">
212
+ <div class="ti-header">
213
+ <?php echo TrustindexPlugin_google::___('Widget Preview'); ?>
214
+ <?php if(!in_array($style_id, [ 17, 21 ])): ?>
215
+ <span class="ti-header-layout-text ti-pull-right">
216
+ <?php echo TrustindexPlugin_google::___('Style'); ?>:
217
+ <strong><?php echo esc_html(TrustindexPlugin_google::___(TrustindexPlugin_google::$widget_styles[$scss_set]['name'])); ?></strong>
218
+ </span>
219
+ <?php endif; ?>
220
+ <span class="ti-header-layout-text ti-pull-right">
221
+ <?php echo TrustindexPlugin_google::___('Layout'); ?>:
222
+ <strong><?php echo esc_html(TrustindexPlugin_google::___(TrustindexPlugin_google::$widget_templates['templates'][$style_id]['name'])); ?></strong>
223
+ </span>
224
+ </div>
225
+ <div class="preview">
226
+ <div id="ti-review-list"><?php echo $trustindex_pm_google->get_noreg_list_reviews(null, true, null, null, false, true); ?></div>
227
+ <div style="display: none; text-align: center">
228
+ <?php echo TrustindexPlugin_google::___("You do not have reviews with the current filters. <br />Change your filters if you would like to display reviews on your page!"); ?>
229
+ </div>
230
+ </div>
231
+ </div>
232
+ <div class="ti-box">
233
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('Widget Settings'); ?></div>
234
+ <div class="ti-left-block">
235
+ <?php if($widget_has_reviews): ?>
236
+ <div id="ti-filter" class="ti-input-row">
237
+ <label><?php echo TrustindexPlugin_google::___('Filter your ratings'); ?></label>
238
+ <div class="ti-select" id="show-star" data-platform="google">
239
+ <font></font>
240
+ <ul>
241
+ <li data-value="1,2,3,4,5" <?php echo count($filter['stars']) > 2 ? 'class="selected"' : ''; ?>><?php echo TrustindexPlugin_google::___('Show all'); ?></li>
242
+ <li data-value="4,5" <?php echo count($filter['stars']) == 2 ? 'class="selected"' : ''; ?>>
243
+
244
+ &starf;&starf;&starf;&starf; - &starf;&starf;&starf;&starf;&starf;
245
+ </li>
246
+ <li data-value="5" <?php echo count($filter['stars']) == 1 ? 'class="selected"' : ''; ?>>
247
+ <?php echo TrustindexPlugin_google::___('only'); ?> &starf;&starf;&starf;&starf;&starf;
248
+ </li>
249
+ </ul>
250
+ </div>
251
+ </div>
252
+ <?php endif; ?>
253
+ <div class="ti-input-row">
254
+ <label><?php echo TrustindexPlugin_google::___('Select language'); ?></label>
255
+ <form method="post" action="">
256
+ <input type="hidden" name="command" value="save-language" />
257
+ <?php wp_nonce_field( 'save-language_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_language' ); ?>
258
+ <select class="form-control" name="lang" id="ti-lang-id">
259
+ <?php foreach(TrustindexPlugin_google::$widget_languages as $id => $name): ?>
260
+ <option value="<?php echo esc_attr($id); ?>" <?php echo $lang == $id ? 'selected' : ''; ?>><?php echo esc_html($name); ?></option>
261
+ <?php endforeach; ?>
262
+ </select>
263
+ </form>
264
+ </div>
265
+ <?php if($widget_has_reviews): ?>
266
+ <div class="ti-input-row">
267
+ <label><?php echo TrustindexPlugin_google::___('Select date format'); ?></label>
268
+ <form method="post" action="">
269
+ <input type="hidden" name="command" value="save-dateformat" />
270
+ <?php wp_nonce_field( 'save-dateformat_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_dateformat' ); ?>
271
+ <select class="form-control" name="dateformat" id="ti-dateformat-id">
272
+ <?php foreach(TrustindexPlugin_google::$widget_dateformats as $format): ?>
273
+ <option value="<?php echo esc_attr($format); ?>" <?php echo $dateformat == $format ? 'selected' : ''; ?>><?php echo date($format); ?></option>
274
+ <?php endforeach; ?>
275
+ </select>
276
+ </form>
277
+ </div>
278
+ <?php if(!in_array($style_id, [ 17, 21 ])): ?>
279
+ <div class="ti-input-row">
280
+ <label><?php echo TrustindexPlugin_google::___('Align'); ?></label>
281
+ <form method="post" action="">
282
+ <input type="hidden" name="command" value="save-align" />
283
+ <?php wp_nonce_field( 'save-align_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_align' ); ?>
284
+ <select class="form-control" name="align" id="ti-align-id">
285
+ <?php foreach([ 'left', 'center', 'right', 'justify' ] as $align_type): ?>
286
+ <option value="<?php echo esc_attr($align_type); ?>" <?php echo $align_type == $align ? 'selected' : ''; ?>><?php echo TrustindexPlugin_google::___($align_type); ?></option>
287
+ <?php endforeach; ?>
288
+ </select>
289
+ </form>
290
+ </div>
291
+ <?php endif; ?>
292
+ <?php endif; ?>
293
+ </div>
294
+ <div class="ti-right-block">
295
+ <form method="post" action="" id="ti-widget-options">
296
+ <input type="hidden" name="command" value="save-options" />
297
+ <?php wp_nonce_field( 'save-options_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_options' ); ?>
298
+ <?php if($widget_has_reviews): ?>
299
+ <span class="ti-checkbox row">
300
+ <input type="checkbox" id="ti-filter-only-ratings" class="no-form-update" name="only-ratings" value="1" <?php if($filter['only-ratings']): ?>checked<?php endif;?>>
301
+ <label><?php echo TrustindexPlugin_google::___("Hide reviews without comments"); ?></label>
302
+ </span>
303
+ <?php endif; ?>
304
+ <?php if(!in_array($style_id, [ 11, 17, 18, 21, 24, 25, 26, 27, 28, 29, 30, 35 ]) && TrustindexPlugin_google::$widget_styles[$scss_set]['_vars']['dots'] !== 'true'): ?>
305
+ <span class="ti-checkbox row">
306
+ <input type="checkbox" name="no-rating-text" value="1" <?php if($no_rating_text): ?>checked<?php endif;?>>
307
+ <label><?php echo TrustindexPlugin_google::___("Hide rating text"); ?></label>
308
+ </span>
309
+ <?php endif; ?>
310
+ <?php if($widget_has_reviews): ?>
311
+ <span class="ti-checkbox row">
312
+ <input type="checkbox" name="verified-icon" value="1" <?php if($verified_icon): ?>checked<?php endif;?>>
313
+ <label><?php echo TrustindexPlugin_google::___("Show verified review icon"); ?></label>
314
+ </span>
315
+ <?php endif; ?>
316
+ <?php if(in_array($widget_type, [ 'slider', 'sidebar' ]) && !in_array($style_id, [ 8, 9, 10, 18, 19, 37 ])): ?>
317
+ <span class="ti-checkbox row">
318
+ <input type="checkbox" name="show-arrows" value="1" <?php if($show_arrows): ?>checked<?php endif;?>>
319
+ <label><?php echo TrustindexPlugin_google::___("Show navigation arrows"); ?></label>
320
+ </span>
321
+ <?php endif; ?>
322
+ <?php if($widget_has_reviews): ?>
323
+ <span class="ti-checkbox row">
324
+ <input type="checkbox" name="show-reviewers-photo" value="1" <?php if($show_reviewers_photo): ?>checked<?php endif;?>>
325
+ <label><?php echo TrustindexPlugin_google::___("Show reviewers' photo"); ?></label>
326
+ </span>
327
+ <span class="ti-checkbox row disabled">
328
+ <input type="checkbox" value="1" disabled>
329
+ <label class="ti-tooltip">
330
+ <?php echo TrustindexPlugin_google::___("Show reviewers' photos locally, from a single image (less requests)"); ?>
331
+ <span class="ti-tooltip-message"><?php echo TrustindexPlugin_google::___("Paid package feature"); ?></span>
332
+ </label>
333
+ </span>
334
+ <?php endif; ?>
335
+ <span class="ti-checkbox row">
336
+ <input type="checkbox" name="enable-animation" value="1" <?php if($enable_animation): ?>checked<?php endif;?>>
337
+ <label><?php echo TrustindexPlugin_google::___("Enable mouseover animation"); ?></label>
338
+ </span>
339
+ <span class="ti-checkbox row">
340
+ <input type="checkbox" name="disable-font" value="1" <?php if($disable_font): ?>checked<?php endif;?>>
341
+ <label><?php echo TrustindexPlugin_google::___("Use site's font"); ?></label>
342
+ </span>
343
+ <?php if($widget_has_reviews): ?>
344
+ <span class="ti-checkbox row">
345
+ <input type="checkbox" name="show-logos" value="1" <?php if($show_logos): ?>checked<?php endif;?>>
346
+ <label><?php echo TrustindexPlugin_google::___("Show platform logos"); ?></label>
347
+ </span>
348
+ <?php if(!$trustindex_pm_google->is_ten_scale_rating_platform()): ?>
349
+ <span class="ti-checkbox row">
350
+ <input type="checkbox" name="show-stars" value="1" <?php if($show_stars): ?>checked<?php endif;?>>
351
+ <label><?php echo TrustindexPlugin_google::___("Show platform stars"); ?></label>
352
+ </span>
353
+ <?php endif; ?>
354
+ <?php endif; ?>
355
+ </form>
356
+ </div>
357
+ <div class="clear"></div>
358
+ <div class="ti-footer">
359
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&setup_widget" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___("Save and get code") ;?></a>
360
+ <div class="clear"></div>
361
+ </div>
362
+ </div>
363
+ <?php else: ?>
364
+ <h1 class="ti-free-title">
365
+ 5. <?php echo TrustindexPlugin_google::___('Insert code'); ?>
366
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&step=4" class="ti-back-icon"><?php echo TrustindexPlugin_google::___('Back'); ?></a>
367
+ </h1>
368
+ <?php if(!count($reviews)): ?>
369
+ <div class="ti-notice notice-warning" style="margin: 0 0 15px 0">
370
+ <p>
371
+ <?php echo TrustindexPlugin_google::___('There are no reviews on your %s platform.', [ 'Google' ]); ?>
372
+ </p>
373
+ </div>
374
+ <?php endif; ?>
375
+ <div class="ti-box">
376
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('Insert this shortcode into your website'); ?></div>
377
+ <div class="ti-input-row" style="margin-bottom: 2px">
378
+ <label>Shortcode</label>
379
+ <code class="code-shortcode">[<?php echo $trustindex_pm_google->get_shortcode_name(); ?> no-registration=google]</code>
380
+ <a href=".code-shortcode" class="btn-text btn-copy2clipboard"><?php echo TrustindexPlugin_google::___("Copy to clipboard") ;?></a>
381
+ </div>
382
+ <?php echo TrustindexPlugin_google::___('Copy and paste this shortcode into post, page or widget.'); ?>
383
+ </div>
384
+ <h1 class="ti-free-title"><?php echo TrustindexPlugin_google::___("Want to get more customers?"); ?></h1>
385
+ <div class="ti-box">
386
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('Increase SEO, trust and sales using customer reviews.'); ?></div>
387
+ <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-1" target="_blank"><?php echo TrustindexPlugin_google::___('Create a Free Account for More Features'); ?></a>
388
+ <div class="ti-notice notice-success ti-special-offer">
389
+ <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/special_30.jpg'); ?>">
390
+ <p><?php echo TrustindexPlugin_google::___('Now we offer you a 30%% discount off your subscription! Create your free account and benefit from the onboarding discount now!'); ?></p>
391
+ <div class="clear"></div>
392
+ </div>
393
+ <ul class="ti-seo-list">
394
+ <li>
395
+ <strong><?php echo TrustindexPlugin_google::___("%d Review Platforms", [ 58 ]); ?></strong><br />
396
+ <?php echo TrustindexPlugin_google::___("Add more reviews to your widget from %s, etc. to enjoy more trust, and to keep customers on your site.", [ 'Google, Facebook, Yelp, Amazon, Tripadvisor, Booking.com, Airbnb, Hotels.com, Capterra, Foursquare, Opentable' ]); ?><br />
397
+ <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/platforms.png'); ?>" alt="" style="margin-top: 5px" />
398
+ </li>
399
+ <li>
400
+ <strong><?php echo TrustindexPlugin_google::___("Create Unlimited Number of Widgets"); ?></strong><br />
401
+ <?php echo TrustindexPlugin_google::___("Use the widgets matching your page the best to build trust."); ?>
402
+ </li>
403
+ <li>
404
+ <strong><?php echo TrustindexPlugin_google::___("Mix Reviews"); ?></strong><br />
405
+ <?php echo TrustindexPlugin_google::___("You can mix your reviews from different platforms and display them in 1 review widget."); ?>
406
+ </li>
407
+ <li>
408
+ <strong><?php echo TrustindexPlugin_google::___("Get More Reviews!"); ?></strong><br />
409
+ <?php echo TrustindexPlugin_google::___("Use our Review Invitation System to collect hundreds of new reviews. Become impossible to resist!"); ?>
410
+ </li>
411
+ <li>
412
+ <strong><?php echo TrustindexPlugin_google::___("Manage Reviews"); ?></strong><br />
413
+ <?php echo TrustindexPlugin_google::___("Turn on email alert to ALL new reviews, so that you can manage them quickly."); ?>
414
+ </li>
415
+ <li>
416
+ <strong><?php echo TrustindexPlugin_google::___("Automatically update with NEW reviews"); ?></strong><br />
417
+ <?php echo TrustindexPlugin_google::___("Wordpress cannot update reviews, but Trustindex can! As soon as you get a new review, Trustindex Business can automatically add it to your website. Customers love fresh reviews!"); ?>
418
+ </li>
419
+ <li>
420
+ <strong><?php echo TrustindexPlugin_google::___("Display UNLIMITED number of reviews"); ?></strong><br />
421
+ <?php echo TrustindexPlugin_google::___("You can test Trustindex with 10 reviews in the free version. Upgrade to Business to display ALL the reviews received. Be the undisputed customer choice in your industry!"); ?>
422
+ </li>
423
+ </ul>
424
+ <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>
425
+ </div>
426
+ <?php endif; ?>
trunk/tabs/setup_no_reg_header.php ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ $ti_command = isset($_REQUEST['command']) ? sanitize_text_field($_REQUEST['command']) : null;
4
+ $ti_command_list = [
5
+ 'save-page',
6
+ 'delete-page',
7
+ 'save-style',
8
+ 'save-filter',
9
+ 'save-set',
10
+ 'save-language',
11
+ 'save-dateformat',
12
+ 'save-options',
13
+ 'save-align',
14
+ 'save-amp-notice-hide'
15
+ ];
16
+ if(!in_array($ti_command, $ti_command_list))
17
+ {
18
+ $ti_command = null;
19
+ }
20
+ function trustindex_plugin_connect_page($page_details = null, $default_settings = true)
21
+ {
22
+ global $trustindex_pm_google;
23
+ global $wpdb;
24
+ if(!$page_details)
25
+ {
26
+ return false;
27
+ }
28
+ if (!isset($page_details['rating_number']) || !isset($page_details['avatar_url']) || empty($page_details['avatar_url']))
29
+ {
30
+ $response = $trustindex_pm_google->download_noreg_details($page_details);
31
+ if ($response['success'])
32
+ {
33
+ if(!isset($page_details['rating_number'])) $page_details['rating_number'] = $response['result']['reviews']['count'];
34
+ if(!isset($page_details['rating_score'])) $page_details['rating_score'] = $response['result']['reviews']['score'];
35
+ if(!isset($page_details['avatar_url']) || empty($page_details['avatar_url'])) $page_details['avatar_url'] = $response['result']['avatar_url'];
36
+ }
37
+ }
38
+ $reviews = null;
39
+ if(isset($page_details['reviews']))
40
+ {
41
+ $reviews = $page_details['reviews'];
42
+ unset($page_details['reviews']);
43
+ }
44
+ update_option( $trustindex_pm_google->get_option_name('page-details') , $page_details, false );
45
+ $GLOBALS['wp_object_cache']->delete( $trustindex_pm_google->get_option_name('page-details'), 'options' );
46
+ $dbtable = $trustindex_pm_google->get_noreg_tablename();
47
+ require_once(ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'upgrade.php');
48
+ if(!$trustindex_pm_google->is_noreg_table_exists())
49
+ {
50
+ dbDelta("CREATE TABLE `$dbtable` (
51
+ id TINYINT(1) NOT NULL AUTO_INCREMENT,
52
+ user VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci,
53
+ user_photo TEXT,
54
+ text TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
55
+ rating DECIMAL(3,1),
56
+ highlight VARCHAR(11),
57
+ date DATE,
58
+ PRIMARY KEY (id)
59
+ );");
60
+ }
61
+ if(!$trustindex_pm_google->is_noreg_table_exists())
62
+ {
63
+ delete_option( $trustindex_pm_google->get_option_name('page-details') );
64
+ echo '
65
+ <div class="ti-notice notice-error" style="margin: 25px 0 0 0">
66
+ <p>
67
+ '. TrustindexPlugin_google::___('We can not create MySQL table for the reviews!') .'
68
+ </p>
69
+ </div>';
70
+ exit;
71
+ }
72
+ $wpdb->query("TRUNCATE `$dbtable`;");
73
+ if(!$reviews)
74
+ {
75
+ $reviews = $trustindex_pm_google->download_noreg_reviews($page_details, null);
76
+ $reviews = $reviews['success'] ? $reviews['result'] : [];
77
+ }
78
+ foreach($reviews as $row)
79
+ {
80
+ $date = isset($row['created_at']) ? $row['created_at'] : (isset($row['date']) ? $row['date'] : '');
81
+ $wpdb->insert($dbtable, [
82
+ 'user' => $row['reviewer']['name'],
83
+ 'user_photo' => $row['reviewer']['avatar_url'],
84
+ 'text' => $row['text'],
85
+ 'rating' => $row['rating'] ? $row['rating'] : 5,
86
+ 'date' => substr($date, 0, 10)
87
+ ]);
88
+ }
89
+ if($default_settings)
90
+ {
91
+ $lang = strtolower(substr(get_locale(), 0, 2));
92
+ if(!isset(TrustindexPlugin_google::$widget_languages[$lang]))
93
+ {
94
+ $lang = 'en';
95
+ }
96
+ update_option( $trustindex_pm_google->get_option_name('lang') , $lang, false );
97
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
98
+ }
99
+ else
100
+ {
101
+ $trustindex_pm_google->noreg_save_css(true);
102
+ }
103
+ }
104
+ function trustindex_plugin_disconnect_page($settings_delete = true)
105
+ {
106
+ global $trustindex_pm_google;
107
+ global $wpdb;
108
+ delete_option( $trustindex_pm_google->get_option_name('page-details') );
109
+ delete_option( $trustindex_pm_google->get_option_name('review-content') );
110
+ delete_option( $trustindex_pm_google->get_option_name('css-content') );
111
+ if(is_file($trustindex_pm_google->getCssFile()))
112
+ {
113
+ unlink($trustindex_pm_google->getCssFile());
114
+ }
115
+ if($settings_delete)
116
+ {
117
+ delete_option( $trustindex_pm_google->get_option_name('style-id') );
118
+ delete_option( $trustindex_pm_google->get_option_name('scss-set') );
119
+ delete_option( $trustindex_pm_google->get_option_name('filter') );
120
+ delete_option( $trustindex_pm_google->get_option_name('lang') );
121
+ delete_option( $trustindex_pm_google->get_option_name('dateformat') );
122
+ delete_option( $trustindex_pm_google->get_option_name('no-rating-text') );
123
+ delete_option( $trustindex_pm_google->get_option_name('verified-icon') );
124
+ delete_option( $trustindex_pm_google->get_option_name('enable-animation') );
125
+ delete_option( $trustindex_pm_google->get_option_name('show-arrows') );
126
+ delete_option( $trustindex_pm_google->get_option_name('show-reviewers-photo') );
127
+ delete_option( $trustindex_pm_google->get_option_name('widget-setted-up') );
128
+ }
129
+ $dbtable = $trustindex_pm_google->get_noreg_tablename();
130
+ $wpdb->query("TRUNCATE `$dbtable`;");
131
+ }
132
+ function trustindex_plugin_change_step($step = 5)
133
+ {
134
+ global $trustindex_pm_google;
135
+ if($step < 5)
136
+ {
137
+ $options_to_delete = [
138
+ 'widget-setted-up',
139
+ 'align',
140
+ 'verified-icon',
141
+ 'enable-animation',
142
+ 'no-rating-text',
143
+ 'disable-font',
144
+ 'show-reviewers-photo',
145
+ 'show-logos',
146
+ 'show-stars'
147
+ ];
148
+ foreach($options_to_delete as $name)
149
+ {
150
+ delete_option($trustindex_pm_google->get_option_name($name));
151
+ }
152
+ }
153
+ if($step < 4)
154
+ {
155
+ delete_option($trustindex_pm_google->get_option_name('scss-set'));
156
+ }
157
+ if($step < 3)
158
+ {
159
+ delete_option($trustindex_pm_google->get_option_name('style-id'));
160
+ }
161
+ if($step < 2)
162
+ {
163
+ trustindex_plugin_disconnect_page();
164
+ }
165
+ }
166
+ if($ti_command == 'save-page')
167
+ {
168
+ check_admin_referer( 'save-noreg_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_save' );
169
+ $page_details = isset($_POST['page_details']) ? wp_kses_post($_POST['page_details']) : null;
170
+ $page_details = json_decode(stripcslashes($page_details), true);
171
+
172
+ trustindex_plugin_connect_page($page_details);
173
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
174
+ exit;
175
+ }
176
+ elseif($ti_command == 'delete-page')
177
+ {
178
+ trustindex_plugin_disconnect_page();
179
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
180
+ exit;
181
+ }
182
+ elseif($ti_command == 'save-style')
183
+ {
184
+ $style_id = sanitize_text_field($_REQUEST['style_id']);
185
+ update_option( $trustindex_pm_google->get_option_name('style-id') , $style_id, false );
186
+ delete_option( $trustindex_pm_google->get_option_name('review-content') );
187
+ trustindex_plugin_change_step(3);
188
+ if(in_array($style_id, [ 17, 21 ]))
189
+ {
190
+ $trustindex_pm_google->noreg_save_css();
191
+ }
192
+ if(isset($_GET['style_id']))
193
+ {
194
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
195
+ }
196
+ exit;
197
+ }
198
+ elseif($ti_command == 'save-set')
199
+ {
200
+ update_option( $trustindex_pm_google->get_option_name('scss-set') , sanitize_text_field($_REQUEST['set_id']), false );
201
+ trustindex_plugin_change_step(4);
202
+ $trustindex_pm_google->noreg_save_css(true);
203
+ if(isset($_GET['set_id']))
204
+ {
205
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
206
+ }
207
+ exit;
208
+ }
209
+ elseif($ti_command == 'save-filter')
210
+ {
211
+ $filter = isset($_POST['filter']) ? sanitize_text_field($_POST['filter']) : null;
212
+ $filter = json_decode(stripcslashes($filter), true);
213
+ update_option( $trustindex_pm_google->get_option_name('filter') , $filter, false );
214
+ exit;
215
+ }
216
+ elseif($ti_command == 'save-language')
217
+ {
218
+ check_admin_referer( 'save-language_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_language' );
219
+ update_option( $trustindex_pm_google->get_option_name('lang') , sanitize_text_field($_POST['lang']), false );
220
+ delete_option( $trustindex_pm_google->get_option_name('review-content') );
221
+ exit;
222
+ }
223
+ elseif($ti_command == 'save-dateformat')
224
+ {
225
+ check_admin_referer( 'save-dateformat_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_dateformat' );
226
+ update_option( $trustindex_pm_google->get_option_name('dateformat') , sanitize_text_field($_POST['dateformat']), false );
227
+ exit;
228
+ }
229
+ elseif($ti_command == 'save-options')
230
+ {
231
+ check_admin_referer( 'save-options_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_options' );
232
+ $r = 0;
233
+ if(isset($_POST['verified-icon']))
234
+ {
235
+ $r = sanitize_text_field($_POST['verified-icon']);
236
+ }
237
+ update_option( $trustindex_pm_google->get_option_name('verified-icon') , $r, false );
238
+ $r = 1;
239
+ if(isset($_POST['enable-animation']))
240
+ {
241
+ $r = sanitize_text_field($_POST['enable-animation']);
242
+ }
243
+ update_option( $trustindex_pm_google->get_option_name('enable-animation') , $r, false );
244
+ $r = 1;
245
+ if(isset($_POST['show-arrows']))
246
+ {
247
+ $r = sanitize_text_field($_POST['show-arrows']);
248
+ }
249
+ update_option( $trustindex_pm_google->get_option_name('show-arrows') , $r, false );
250
+ $r = 1;
251
+ if(isset($_POST['show-reviewers-photo']))
252
+ {
253
+ $r = sanitize_text_field($_POST['show-reviewers-photo']);
254
+ }
255
+ update_option( $trustindex_pm_google->get_option_name('show-reviewers-photo') , $r, false );
256
+ $r = 0;
257
+ if(isset($_POST['no-rating-text']))
258
+ {
259
+ $r = sanitize_text_field($_POST['no-rating-text']);
260
+ }
261
+ update_option( $trustindex_pm_google->get_option_name('no-rating-text') , $r, false );
262
+ $r = 0;
263
+ if(isset($_POST['disable-font']))
264
+ {
265
+ $r = sanitize_text_field($_POST['disable-font']);
266
+ }
267
+ update_option( $trustindex_pm_google->get_option_name('disable-font') , $r, false );
268
+ $r = 1;
269
+ if(isset($_POST['show-logos']))
270
+ {
271
+ $r = sanitize_text_field($_POST['show-logos']);
272
+ }
273
+ update_option( $trustindex_pm_google->get_option_name('show-logos') , $r, false );
274
+ $r = 1;
275
+ if(isset($_POST['show-stars']))
276
+ {
277
+ $r = sanitize_text_field($_POST['show-stars']);
278
+ }
279
+ update_option( $trustindex_pm_google->get_option_name('show-stars') , $r, false );
280
+ delete_option( $trustindex_pm_google->get_option_name('review-content') );
281
+ $trustindex_pm_google->noreg_save_css(true);
282
+ exit;
283
+ }
284
+ elseif($ti_command == 'save-align')
285
+ {
286
+ check_admin_referer( 'save-align_'.$trustindex_pm_google->get_plugin_slug(), '_wpnonce_align' );
287
+ update_option( $trustindex_pm_google->get_option_name('align') , sanitize_text_field($_POST['align']), false );
288
+ $trustindex_pm_google->noreg_save_css(true);
289
+ exit;
290
+ }
291
+ elseif($ti_command == 'save-amp-notice-hide')
292
+ {
293
+ update_option( $trustindex_pm_google->get_option_name('amp-hidden-notification'), 1, false );
294
+ exit;
295
+ }
296
+ $reviews = [];
297
+ $only_ratings_default = false;
298
+ if($trustindex_pm_google->is_noreg_linked())
299
+ {
300
+ $reviews = $wpdb->get_results('SELECT * FROM '. $trustindex_pm_google->get_noreg_tablename() .' ORDER BY date DESC');
301
+ $reviews_with_text = 0;
302
+ foreach($reviews as $r)
303
+ {
304
+ if($r->text)
305
+ {
306
+ $reviews_with_text++;
307
+ }
308
+ }
309
+ $only_ratings_default = $reviews_with_text >= 3;
310
+ }
311
+ $style_id = get_option( $trustindex_pm_google->get_option_name('style-id') );
312
+ $scss_set = get_option( $trustindex_pm_google->get_option_name('scss-set') );
313
+ $lang = get_option( $trustindex_pm_google->get_option_name('lang'), 'en');
314
+ $dateformat = get_option( $trustindex_pm_google->get_option_name('dateformat'), 'Y-m-d' );
315
+ $no_rating_text = get_option( $trustindex_pm_google->get_option_name('no-rating-text'), $trustindex_pm_google->get_default_no_rating_text($style_id, $scss_set) );
316
+ $filter = get_option( $trustindex_pm_google->get_option_name('filter'), [ 'stars' => [1, 2, 3, 4, 5], 'only-ratings' => $only_ratings_default ] );
317
+ $verified_icon = get_option( $trustindex_pm_google->get_option_name('verified-icon'), 0 );
318
+ $enable_animation = get_option( $trustindex_pm_google->get_option_name('enable-animation'), 1 );
319
+ $show_arrows = get_option( $trustindex_pm_google->get_option_name('show-arrows'), 1 );
320
+ $widget_setted_up = get_option( $trustindex_pm_google->get_option_name('widget-setted-up'), 0);
321
+ $disable_font = get_option( $trustindex_pm_google->get_option_name('disable-font'), 0 );
322
+ $align = get_option( $trustindex_pm_google->get_option_name('align'), in_array($style_id, [ 36, 37, 38, 39 ]) ? 'center' : 'left' );
323
+ $scss_set_tmp = $scss_set ? $scss_set : 'light-background';
324
+ $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 );
325
+ $show_logos = get_option( $trustindex_pm_google->get_option_name('show-logos'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['hide-logos'] ? 0 : 1 );
326
+ $show_stars = get_option( $trustindex_pm_google->get_option_name('show-stars'), TrustindexPlugin_google::$widget_styles[$scss_set_tmp]['hide-stars'] ? 0 : 1 );
327
+ $need_to_refresh = false;
328
+ if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_ten_scale_rating_platform())
329
+ {
330
+ $fields = $wpdb->get_results('SHOW FIELDS FROM `'. $trustindex_pm_google->get_noreg_tablename() .'` WHERE Field = "rating"');
331
+ if($fields && isset($fields[0]) && isset($fields[0]->Type))
332
+ {
333
+ if($fields[0]->Type == 'tinyint(1)')
334
+ {
335
+ $wpdb->query('ALTER TABLE `'. $trustindex_pm_google->get_noreg_tablename() .'` CHANGE `rating` `rating` DECIMAL(3,1) NULL DEFAULT NULL');
336
+ $need_to_refresh = true;
337
+ }
338
+ }
339
+ }
340
+ if(isset($_GET['refresh']) || $need_to_refresh)
341
+ {
342
+ $page_details = get_option( $trustindex_pm_google->get_option_name('page-details') );
343
+ $tmp = $trustindex_pm_google->download_noreg_details($page_details);
344
+ if($tmp['success'])
345
+ {
346
+ $page_details['rating_number'] = $tmp['result']['reviews']['count'];
347
+ $page_details['rating_score'] = $tmp['result']['reviews']['score'];
348
+ $page_details['avatar_url'] = $tmp['result']['avatar_url'];
349
+ }
350
+ trustindex_plugin_disconnect_page(false);
351
+ trustindex_plugin_connect_page($page_details, false);
352
+ if(isset($_GET['my_reviews']))
353
+ {
354
+ setcookie('ti-success', 'reviews-loaded', time() + 60, "/");
355
+ }
356
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . (isset($_GET['my_reviews']) ? '&tab=my_reviews' : '&tab=setup_no_reg'));
357
+ exit;
358
+ }
359
+ if(isset($_GET['recreate']))
360
+ {
361
+ $trustindex_pm_google->uninstall();
362
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
363
+ exit;
364
+ }
365
+ if(isset($_GET['setup_widget']))
366
+ {
367
+ update_option( $trustindex_pm_google->get_option_name('widget-setted-up') , 1, false );
368
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) .'&tab=setup_no_reg');
369
+ exit;
370
+ }
371
+ $current_step = isset($_GET['step']) ? intval(sanitize_text_field($_GET['step'])) : 0;
372
+ if($current_step == 3 && in_array($style_id, [ 17, 21 ]))
373
+ {
374
+ $current_step = 4;
375
+ }
376
+ if(!$trustindex_pm_google->is_noreg_linked())
377
+ {
378
+ $style_id = null;
379
+ $scss_set = null;
380
+ $widget_setted_up = null;
381
+ }
382
+ wp_enqueue_style("trustindex-widget-preview-css", "https://cdn.trustindex.io/assets/ti-preview-box.css");
383
+ $example = 'HairPalace';
384
+ $example_url = null;
385
+ switch("google")
386
+ {
387
+ case 'airbnb':
388
+ $example_url = 'https://www.airbnb.com/rooms/2861469';
389
+ break;
390
+ case 'amazon':
391
+ $example_url = 'https://www.amazon.com/sp?seller=A2VE8XCDXE9M4H';
392
+ break;
393
+ case 'booking':
394
+ $example_url = 'https://www.booking.com/hotel/us/four-seasons-san-francisco.html';
395
+ break;
396
+ case 'capterra':
397
+ $example_url = 'https://www.capterra.com/p/192416/MicroStation';
398
+ break;
399
+ case 'ebay':
400
+ $example_url = 'https://www.ebay.com/fdbk/feedback_profile/scarhead1';
401
+ break;
402
+ case 'foursquare':
403
+ $example_url = 'https://foursquare.com/v/lands-end-lookout/4f839a12e4b049ff96c6b29a';
404
+ break;
405
+ case 'hotels':
406
+ $example_url = 'https://www.hotels.com/ho108742';
407
+ break;
408
+ case 'opentable':
409
+ $example_url = 'https://www.opentable.com/r/historic-johns-grill-san-francisco';
410
+ break;
411
+ case 'szallashu':
412
+ $example_url = 'https://revngo.com/ramada-by-wyndham-city-center-hotel-budapest';
413
+ break;
414
+ case 'thumbtack':
415
+ $example_url = 'https://www.thumbtack.com/ca/san-francisco/handyman/steve-switchenko-installations-handyman-services/service/246750705829561442';
416
+ break;
417
+ case 'tripadvisor':
418
+ $example_url = 'https://www.tripadvisor.com/Restaurant_Review-g186338-d5122082-Reviews-Alexander_The_Great-London_England.html';
419
+ break;
420
+ case 'trustpilot':
421
+ $example_url = 'https://www.trustpilot.com/review/generalitravelinsurance.com';
422
+ break;
423
+ case 'expedia':
424
+ $example_url = 'https://www.expedia.com/London-Hotels-The-Hayden-Pub-Rooms.h39457643.Hotel-Information';
425
+ break;
426
+ case 'google':
427
+ $example = 'ChIJ9TmAVZfbQUcROoTJtH8TuFU';
428
+ break;
429
+ case 'zillow':
430
+ $example_url = 'https://www.zillow.com/profile/NealandNealTeam/#reviews';
431
+ break;
432
+ }
433
+ ?>
trunk/tabs/setup_no_reg_platform.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <label class="ti-left-label"><?php echo TrustindexPlugin_google::___("Google Place ID or URL"); ?>:</label>
2
+ <div class="input">
3
+ <input class="form-control"
4
+ placeholder="<?php echo TrustindexPlugin_google::___("e.g.:") . ' ' . esc_attr($example); ?>"
5
+ id="page-link"
6
+ type="text" required="required"
7
+ />
8
+ <span class="info-text">
9
+ <?php echo TrustindexPlugin_google::___("Google Search or Google Maps URL where you can see your business profile."); ?>
10
+ <?php echo TrustindexPlugin_google::___("For example: <a href='%s' target='_blank'>illustration</a>, <a href='%s' target='_blank'>illustration</a>", [ 'https://cdn.trustindex.io/' . 'assets/img/trustindex-google-search-1.jpg', 'https://cdn.trustindex.io/' . 'assets/img/trustindex-google-search-2.jpg' ]); ?>
11
+ <br />
12
+ <strong><?php echo TrustindexPlugin_google::___('Or enter the Place ID if you want to be sure.'); ?></strong> <a href="https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder" target="_blank"><?php echo TrustindexPlugin_google::___('You can find it here after typing the address in the search bar on the map.'); ?></a>
13
+ </span>
14
+ <img class="loading" src="<?php echo admin_url('images/loading.gif'); ?>" />
15
+ <div class="results"
16
+ data-errortext="<?php echo TrustindexPlugin_google::___("Please add your Place ID again: this is not a valid %s page.", [ "Google" ]); ?>"
17
+ data-errortext-search="<?php echo TrustindexPlugin_google::___("Please give us that URL where you can see your business profile in Google Search or in Google Maps!"); ?>"
18
+ ></div>
19
+ </div>
20
+ <button class="btn btn-text btn-check"><?php echo TrustindexPlugin_google::___("Check") ;?></button>
trunk/tabs/setup_trustindex.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ wp_enqueue_script('trustindex-js', 'https://cdn.trustindex.io/loader.js', [], false, true);
4
+ ?>
5
+ <div id="tab-setup_trustindex">
6
+ <div class="ti-box">
7
+ <div class="ti-row">
8
+ <div class="ti-col-6">
9
+ <h1><?php echo TrustindexPlugin_google::___('Skyrocket Your Sales with Customer Reviews'); ?></h1>
10
+ <h2>
11
+ <?php echo TrustindexPlugin_google::___('%d+ WordPress websites use Trustindex to embed reviews fast and easily.', [ 30.000 ]); ?><br />
12
+ <?php echo TrustindexPlugin_google::___('Increase SEO, trust and sales using customer reviews.'); ?>
13
+ </h2>
14
+ <h3><?php echo TrustindexPlugin_google::___('Top Features'); ?></h3>
15
+ <ul class="ti-check">
16
+ <li><?php echo TrustindexPlugin_google::___("%d Review Platforms", [ 58 ]); ?></li>
17
+ <li><?php echo TrustindexPlugin_google::___('Create Unlimited Number of Widgets'); ?></li>
18
+ <li><?php echo TrustindexPlugin_google::___('Mix Reviews from Different Platforms'); ?></li>
19
+ <li><?php echo TrustindexPlugin_google::___('Get More Reviews!'); ?></li>
20
+ <li><?php echo TrustindexPlugin_google::___('Manage All Reviews in 1 Place'); ?></li>
21
+ <li><?php echo TrustindexPlugin_google::___('Automatically update with NEW reviews'); ?></li>
22
+ <li><?php echo TrustindexPlugin_google::___('Display UNLIMITED number of reviews'); ?></li>
23
+ </ul>
24
+ </div>
25
+ <div class="ti-col-6">
26
+ <div src='https://cdn.trustindex.io/loader.js?76afafc10ad42261d7587d98bf'></div>
27
+ </div>
28
+ </div>
29
+ <a class="btn-text btn-lg arrow-btn" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-3" target="_blank"><?php echo TrustindexPlugin_google::___('Create a Free Trustindex Account for More Features'); ?></a>
30
+ <div class="ti-notice notice-success ti-special-offer">
31
+ <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/special_30.jpg'); ?>">
32
+ <p><?php echo TrustindexPlugin_google::___('Now we offer you a 30%% discount off your subscription! Create your free account and benefit from the onboarding discount now!'); ?></p>
33
+ <div class="clear"></div>
34
+ </div>
35
+ </div>
36
+ </div>
trunk/tabs/setup_trustindex_join.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ $ti_success = "";
4
+ if(isset($_COOKIE['ti-success']))
5
+ {
6
+ $ti_success = sanitize_text_field($_COOKIE['ti-success']);
7
+ setcookie('ti-success', '', time() - 60, "/");
8
+ }
9
+ $ti_error = null;
10
+ $ti_command = isset($_POST['command']) ? sanitize_text_field($_POST['command']) : null;
11
+ if (!in_array($ti_command, array("connect", "disconnect"))) { $ti_command = null; }
12
+ if ($ti_command == "connect")
13
+ {
14
+ check_admin_referer( 'connect-reg_'.$trustindex_pm_google->get_plugin_slug());
15
+ $sanitized_email = sanitize_email($_POST['email']);
16
+ $sanitized_password = stripslashes(sanitize_text_field(htmlentities($_POST['password'], ENT_QUOTES)));
17
+ if (
18
+ $sanitized_email
19
+ && $sanitized_password
20
+ )
21
+ {
22
+ $server_output = $trustindex_pm_google->connect_trustindex_api(
23
+ array(
24
+ "signin" => array(
25
+ "username" => $sanitized_email,
26
+ "password" => html_entity_decode($sanitized_password),
27
+ ),
28
+ "callback" => bin2hex(openssl_random_pseudo_bytes(10))
29
+ ),
30
+ "connect"
31
+ );
32
+ if ($server_output['success'])
33
+ {
34
+ setcookie('ti-success', 'connected', time() + 60, "/");
35
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=' . sanitize_text_field($_GET['tab']));
36
+ exit;
37
+ }
38
+ else
39
+ {
40
+ $ti_error = TrustindexPlugin_google::___('Wrong e-mail or password!');
41
+ }
42
+ }
43
+ else
44
+ {
45
+ $ti_error = TrustindexPlugin_google::___('You must provide a password and a valid e-mail!');
46
+ }
47
+ }
48
+ elseif ($ti_command == "disconnect")
49
+ {
50
+ check_admin_referer( 'disconnect-reg_'.$trustindex_pm_google->get_plugin_slug());
51
+ delete_option($trustindex_pm_google->get_option_name("subscription-id"));
52
+ setcookie('ti-success', 'disconnected', time() + 60, "/");
53
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=' . sanitize_text_field($_GET['tab']));
54
+ exit;
55
+ }
56
+ $trustindex_subscription_id = $trustindex_pm_google->is_trustindex_connected();
57
+ $widget_number = $trustindex_pm_google->get_trustindex_widget_number();
58
+ ?>
59
+ <?php if ($ti_success == "connected"): ?>
60
+ <?php echo TrustindexPlugin_google::get_noticebox("success", TrustindexPlugin_google::___('Trustindex account successfully connected!')); ?>
61
+ <?php elseif ($ti_success == "disconnected"): ?>
62
+ <?php echo TrustindexPlugin_google::get_noticebox("success", TrustindexPlugin_google::___('Trustindex account successfully disconnected!')); ?>
63
+ <?php endif; ?>
64
+ <?php if ($ti_error): ?>
65
+ <?php echo TrustindexPlugin_google::get_noticebox("error", $ti_error); ?>
66
+ <?php endif; ?>
67
+ <div class="ti-box">
68
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___('Connect your Trustindex account'); ?></div>
69
+ <p><strong><?php echo TrustindexPlugin_google::___('You can connect your %s with your Trustindex account, and can display your widgets easier.', [ 'Widgets for Google Reviews' ]); ?></strong></p>
70
+ <?php if ($trustindex_subscription_id): ?>
71
+ <?php
72
+ $ti_widgets = $trustindex_pm_google->get_trustindex_widgets();
73
+ $ti_package = is_array($ti_widgets) && $ti_widgets && isset($ti_widgets[0]['package']) ? $ti_widgets[0]['package'] : null;
74
+ ?>
75
+ <p>
76
+ <?php echo TrustindexPlugin_google::___("Your %s is connected.", [ TrustindexPlugin_google::___('Trustindex account') ]); ?><br />
77
+ - <?php echo TrustindexPlugin_google::___('Your subscription ID:'); ?> <strong><?php echo esc_html($trustindex_subscription_id); ?></strong><br />
78
+ <?php if ($ti_package): ?>
79
+ - <?php echo TrustindexPlugin_google::___('Your package:'); ?> <strong><?php echo esc_html(TrustindexPlugin_google::___($ti_package)); ?></strong>
80
+ <?php endif; ?>
81
+ </p>
82
+ <?php if ($ti_package == "free"): ?>
83
+ <?php echo TrustindexPlugin_google::get_noticebox("error", TrustindexPlugin_google::___('Once the trial period has expired, the widgets will not appear. You can subscribe or switch back the the "%s" tab', [ TrustindexPlugin_google::___('Free Widget Configurator') ])); ?>
84
+ <?php elseif ($ti_package == "trial"): ?>
85
+ <?php echo TrustindexPlugin_google::get_noticebox("warning", TrustindexPlugin_google::___('Once the trial period has expired, the widgets will not appear. You can subscribe or switch back the the "%s" tab', [ TrustindexPlugin_google::___('Free Widget Configurator') ])); ?>
86
+ <?php endif; ?>
87
+ <form method="post" action="">
88
+ <input type="hidden" name="command" value="disconnect" />
89
+ <?php wp_nonce_field( 'disconnect-reg_'.$trustindex_pm_google->get_plugin_slug() ); ?>
90
+ <div class="text-center">
91
+ <button class="btn btn-text" type="submit" style="margin-top: 20px; margin-bottom: 0"><?php echo TrustindexPlugin_google::___("Disconnect"); ?></button>
92
+ </div>
93
+ </form>
94
+ <?php else: ?>
95
+ <div class="ti-row">
96
+ <form id="form-connect" class="box-content ti-col-6" method="post" action="">
97
+ <input type="hidden" name="command" value="connect" />
98
+ <?php wp_nonce_field( 'connect-reg_'.$trustindex_pm_google->get_plugin_slug() ); ?>
99
+ <div class="form-group">
100
+ <label for="ti-reg-email2">E-mail</label>
101
+ <input type="email"
102
+ placeholder="E-mail"
103
+ name="email"
104
+ class="form-control"
105
+ required="required"
106
+ id="ti-reg-email2"
107
+ value="<?php echo esc_attr($current_user->user_email); ?>"
108
+ />
109
+ </div>
110
+ <div class="form-group">
111
+ <label for="ti-reg-password2"><?php echo TrustindexPlugin_google::___('Password'); ?></label>
112
+ <input type="password"
113
+ placeholder="<?php echo TrustindexPlugin_google::___('Password'); ?>"
114
+ name="password"
115
+ class="form-control"
116
+ required="required"
117
+ id="ti-reg-password2"
118
+ />
119
+ <span class="dashicons dashicons-visibility ti-toggle-password"></span>
120
+ </div>
121
+ <button type="submit" class="btn btn-primary" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>"><?php echo TrustindexPlugin_google::___('CONNECT ACCOUNT');?></button>
122
+ <br />
123
+ <p class="text-center">
124
+ <a class="btn-text" href="<?php echo 'https://admin.trustindex.io/'; ?>forgot-password" target="_blank"><?php echo TrustindexPlugin_google::___('Have you forgotten your password?'); ?></a>
125
+ <a class="btn-text" href="https://www.trustindex.io/ti-redirect.php?a=sys&c=wp-google-4" target="_blank"><?php echo TrustindexPlugin_google::___('Create a new Trustindex account');?></a>
126
+ </p>
127
+ </form>
128
+ <div class="ti-col-6"></div>
129
+ </div>
130
+ <?php endif; ?>
131
+ </div>
132
+ <?php if($trustindex_subscription_id): ?>
133
+ <div class="ti-box disabled">
134
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("Manage your Trustindex account"); ?></div>
135
+ <a class="btn-text" href="<?php echo 'https://admin.trustindex.io/'; ?>widget" target="_blank" <?php if ($ti_success == "connected"): ?>data-autoclick="true"<?php endif; ?>><?php echo TrustindexPlugin_google::___("Go to Trustindex's admin!"); ?></a>
136
+ <?php if ($ti_success == "connected"): ?>
137
+ <?php echo TrustindexPlugin_google::get_noticebox("success", TrustindexPlugin_google::___('We will redirect you to the admin panel automatically in some seconds...')); ?>
138
+ <?php endif; ?>
139
+ </div>
140
+ <div class="ti-box">
141
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("Insert your widget into your wordpress site using shortcode"); ?></div>
142
+ <?php if($trustindex_subscription_id): ?>
143
+ <?php if($widget_number): ?>
144
+ <p>
145
+ <?php echo TrustindexPlugin_google::___('You have got %d widgets saved in Trustindex admin.', array($widget_number)); ?>
146
+ </p>
147
+ <?php foreach ($ti_widgets as $wc_i => $wc): ?>
148
+ <p><strong><?php echo esc_html($wc['name']); ?>:</strong></p>
149
+ <?php if ($wc['widgets']): ?>
150
+ <ul>
151
+ <?php foreach ($wc['widgets'] as $wi_num => $w): ?>
152
+ <li>
153
+ <?php echo esc_html($wi_num+1); ?>.
154
+ <a href=".ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>" class="btn-toggle" data-ti-id="<?php echo esc_attr($w['id']); ?>">
155
+ <?php echo esc_html($w['name']); ?>
156
+ </a>
157
+ <div style="display: none;" class="ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>">
158
+ <code class="code-ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>">[<?php echo $trustindex_pm_google->get_shortcode_name(); ?> data-widget-id="<?php echo esc_attr($w['id']); ?>"]</code>
159
+ <a href=".code-ti-w-<?php echo esc_attr($wc_i .'-'. $wi_num); ?>" class="btn-text btn-copy2clipboard"><?php echo TrustindexPlugin_google::___("Copy to clipboard") ;?></a>
160
+ <br />
161
+ <br />
162
+ </div>
163
+ </li>
164
+ <?php endforeach; ?>
165
+ </ul>
166
+ <?php else: ?>
167
+ -
168
+ <?php endif; ?>
169
+ <?php endforeach; ?>
170
+ <?php else: ?>
171
+ <div style="margin: 0 -15px">
172
+ <?php echo TrustindexPlugin_google::get_noticebox("warning", "You have no widgets saved!"); ?>
173
+ </div>
174
+ <?php endif; ?>
175
+ <p>
176
+ <a class="btn-text" href="<?php echo 'https://admin.trustindex.io/'; ?>widget" target="_blank"><?php echo TrustindexPlugin_google::___("Create more!"); ?></a>
177
+ </p>
178
+ <?php endif; ?>
179
+ </div>
180
+ <?php endif; ?>
trunk/tabs/troubleshooting.php ADDED
@@ -0,0 +1,261 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ $reviews = [];
4
+ if($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
5
+ {
6
+ $reviews = $wpdb->get_results('SELECT * FROM `'. $trustindex_pm_google->get_noreg_tablename() .'` ORDER BY date DESC');
7
+ }
8
+ $auto_updates = get_option('auto_update_plugins', []);
9
+ $plugin_slug = "wp-reviews-plugin-for-google/wp-reviews-plugin-for-google.php";
10
+ if(isset($_GET['auto_update']))
11
+ {
12
+ if(!in_array($plugin_slug, $auto_updates))
13
+ {
14
+ array_push($auto_updates, $plugin_slug);
15
+ update_option('auto_update_plugins', $auto_updates, false);
16
+ }
17
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
18
+ exit;
19
+ }
20
+ if(isset($_GET['toggle_css_inline']))
21
+ {
22
+ $v = intval($_GET['toggle_css_inline']);
23
+ update_option($trustindex_pm_google->get_option_name('load-css-inline'), $v, false);
24
+ if($v && is_file($trustindex_pm_google->getCssFile()))
25
+ {
26
+ unlink($trustindex_pm_google->getCssFile());
27
+ }
28
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
29
+ exit;
30
+ }
31
+ if(isset($_GET['delete_css']))
32
+ {
33
+ if(is_file($trustindex_pm_google->getCssFile()))
34
+ {
35
+ unlink($trustindex_pm_google->getCssFile());
36
+ }
37
+ header('Location: admin.php?page=' . sanitize_text_field($_GET['page']) . '&tab=troubleshooting');
38
+ 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() <= "8.2.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
+ ?>
46
+ <div class="ti-box">
47
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("Troubleshooting"); ?></div>
48
+ <p><strong><?php echo TrustindexPlugin_google::___('If you have any problem, you should try these steps:'); ?></strong></p>
49
+ <ul class="troubleshooting-checklist">
50
+ <li>
51
+ <?php echo TrustindexPlugin_google::___("Trustindex plugin"); ?>
52
+ <ul>
53
+ <li>
54
+ <?php echo TrustindexPlugin_google::___('Use the latest version:') .' '. ($plugin_updated ? $yes_icon : $no_icon); ?>
55
+ <?php if(!$plugin_updated): ?>
56
+ <a href="/wp-admin/plugins.php"><?php echo TrustindexPlugin_google::___("Update"); ?></a>
57
+ <?php endif; ?>
58
+ </li>
59
+ <li>
60
+ <?php echo TrustindexPlugin_google::___('Use automatic plugin update:') .' '. (in_array($plugin_slug, $auto_updates) ? $yes_icon : $no_icon); ?>
61
+ <?php if(!in_array($plugin_slug, $auto_updates)): ?>
62
+ <a href="?page=<?php echo sanitize_text_field($_GET['page']); ?>&tab=troubleshooting&auto_update"><?php echo TrustindexPlugin_google::___("Enable"); ?></a>
63
+ <div class="ti-notice notice-warning">
64
+ <p><?php echo TrustindexPlugin_google::___("You should enable it, to get new features and fixes automatically, right after they published!"); ?></p>
65
+ </div>
66
+ <?php endif; ?>
67
+ </li>
68
+ </ul>
69
+ </li>
70
+ <?php if($css): ?>
71
+ <li>
72
+ CSS
73
+ <ul>
74
+ <li><?php
75
+ $upload_dir = dirname($trustindex_pm_google->getCssFile());
76
+ echo TrustindexPlugin_google::___('writing permission') .' (<strong>'. $upload_dir .'</strong>): '. (is_writable($upload_dir) ? $yes_icon : $no_icon); ?>
77
+ </li>
78
+ <li>
79
+ <?php echo TrustindexPlugin_google::___('CSS content:'); ?>
80
+ <?php
81
+ if(is_file($trustindex_pm_google->getCssFile()))
82
+ {
83
+ $content = file_get_contents($trustindex_pm_google->getCssFile());
84
+ if($content === $css)
85
+ {
86
+ echo $yes_icon;
87
+ }
88
+ else
89
+ {
90
+ echo $no_icon .' '. TrustindexPlugin_google::___("corrupted") .'
91
+ <div class="ti-notice notice-warning">
92
+ <p><a href="?page='. sanitize_text_field($_GET['page']) .'&tab=troubleshooting&delete_css">'. TrustindexPlugin_google::___("Delete the CSS file at <strong>%s</strong>.", [ $trustindex_pm_google->getCssFile() ]) .'</a></p>
93
+ </div>';
94
+ }
95
+ }
96
+ else
97
+ {
98
+ echo $no_icon;
99
+ }
100
+ ?>
101
+ <span class="ti-checkbox row" style="margin-top: 5px">
102
+ <input type="checkbox" value="1" <?php if($css_inline): ?>checked<?php endif;?> onchange="window.location.href = '?page=<?php echo sanitize_text_field($_GET['page']); ?>&tab=troubleshooting&toggle_css_inline=' + (this.checked ? 1 : 0)">
103
+ <label><?php echo TrustindexPlugin_google::___("Enable CSS internal loading"); ?></label>
104
+ </span>
105
+ </li>
106
+ </ul>
107
+ </li>
108
+ <?php endif; ?>
109
+ <li>
110
+ <?php echo TrustindexPlugin_google::___('If you are using cacher plugin, you should:'); ?>
111
+ <ul>
112
+ <li><?php echo TrustindexPlugin_google::___('clear the cache'); ?></li>
113
+ <li><?php echo TrustindexPlugin_google::___("exclude Trustindex's JS file:"); ?> <strong><?php echo 'https://cdn.trustindex.io/'; ?>loader.js</strong>
114
+ <ul>
115
+ <li><a href="#" onclick="jQuery('#list-wp-rocket').toggle(); return false;">WP Rocket</a>
116
+ <ol id="list-wp-rocket" style="display: none;">
117
+ <li><?php echo TrustindexPlugin_google::___('Navigate to'); ?> "Settings" > "WP Rocket menu" > "File optimization"</li>
118
+ <li><?php echo TrustindexPlugin_google::___('Scroll to'); ?> "Excluded Javascript files"</li>
119
+ <li><?php echo TrustindexPlugin_google::___('In a new line, add'); ?> https://cdn.trustindex.io/*</li>
120
+ <li><?php echo TrustindexPlugin_google::___('Save'); ?></li>
121
+ </ol>
122
+ </li>
123
+ <li><a href="#" onclick="jQuery('#list-w3-total-cache').toggle(); return false;">W3 Total Cache</a>
124
+ <ol id="list-w3-total-cache" style="display: none;">
125
+ <li><?php echo TrustindexPlugin_google::___('Navigate to'); ?> "Performance" > "Minify"</li>
126
+ <li><?php echo TrustindexPlugin_google::___('Scroll to'); ?> "Never minify the following JS files"</li>
127
+ <li><?php echo TrustindexPlugin_google::___('In a new line, add'); ?> https://cdn.trustindex.io/*</li>
128
+ <li><?php echo TrustindexPlugin_google::___('Save'); ?></li>
129
+ </ol>
130
+ </li>
131
+ </ul>
132
+ </li>
133
+ </ul>
134
+ </li>
135
+ <li>
136
+ <?php
137
+ $plugin_url = 'https://wordpress.org/support/plugin/' . $trustindex_pm_google->get_plugin_slug();
138
+ $screenshot_url = 'https://snipboard.io';
139
+ $screencast_url = 'https://streamable.com/upload-video';
140
+ $pastebin_url = 'https://pastebin.com';
141
+ echo TrustindexPlugin_google::___("If the problem/question still exists, please create an issue here: %s", [ '<a href="'. $plugin_url .'" target="_blank">'. $plugin_url .'</a>' ]);
142
+ ?>
143
+ <br />
144
+ <?php echo TrustindexPlugin_google::___('Please help us with some information:'); ?>
145
+ <ul>
146
+ <li><?php echo TrustindexPlugin_google::___('Describe your problem'); ?></li>
147
+ <li><?php echo TrustindexPlugin_google::___('You can share a screenshot with %s', [ '<a href="'. $screenshot_url .'" target="_blank">'. $screenshot_url .'</a>' ]); ?></li>
148
+ <li><?php echo TrustindexPlugin_google::___('You can share a screencast video with %s', [ '<a href="'. $screencast_url .'" target="_blank">'. $screencast_url .'</a>' ]); ?></li>
149
+ <li><?php echo TrustindexPlugin_google::___('If you have an (webserver) error log, you can copy it to the issue, or link it with %s', [ '<a href="'. $pastebin_url .'" target="_blank">'. $pastebin_url .'</a>' ]); ?></li>
150
+ <li><?php echo TrustindexPlugin_google::___('And include the information below:'); ?></li>
151
+ </ul>
152
+ </li>
153
+ </ul>
154
+ <?php
155
+ $dir = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'wp-reviews-plugin-for-google.php';
156
+ $plugin_data = get_plugin_data( $dir );
157
+ ?>
158
+ <?php
159
+ $memory_limit = "N/A";
160
+ if(ini_get('memory_limit'))
161
+ {
162
+ $memory_limit = filter_var(ini_get('memory_limit'), FILTER_SANITIZE_STRING);
163
+ }
164
+ $upload_max = "N/A";
165
+ if (ini_get('upload_max_filesize'))
166
+ {
167
+ $upload_max = filter_var(ini_get('upload_max_filesize'), FILTER_SANITIZE_STRING);
168
+ }
169
+ $post_max = "N/A";
170
+ if (ini_get('post_max_size'))
171
+ {
172
+ $post_max = filter_var(ini_get('post_max_size'), FILTER_SANITIZE_STRING);
173
+ }
174
+ $max_execute = "N/A";
175
+ if (ini_get('max_execution_time'))
176
+ {
177
+ $max_execute = filter_var(ini_get('max_execution_time'));
178
+ }
179
+ ?>
180
+ <textarea class="ti-troubleshooting-info" readonly>
181
+ URL: <?php echo esc_url(get_option('siteurl')) ."\n"; ?>
182
+ MySQL Version: <?php echo esc_html($wpdb->db_version()) ."\n"; ?>
183
+ WP Table Prefix: <?php echo esc_html($wpdb->prefix) ."\n"; ?>
184
+ WP Version: <?php echo esc_html($wp_version) ."\n"; ?>
185
+ Server Name: <?php echo esc_html($_SERVER['SERVER_NAME']) ."\n"; ?>
186
+ Cookie Domain: <?php $cookieDomain = parse_url(strtolower(get_bloginfo('wpurl'))); echo esc_html($cookieDomain['host']) ."\n"; ?>
187
+ CURL Library Present: <?php echo (function_exists('curl_init') ? "Yes" : "No") ."\n"; ?>
188
+ CSS path: <?php echo esc_html($trustindex_pm_google->getCssFile()) ."\n\n"; ?>
189
+ PHP Info: <?php echo "\n\t"; ?>
190
+ Version: <?php echo esc_html(phpversion()) ."\n\t"; ?>
191
+ Memory Usage: <?php echo round(memory_get_usage() / 1024 / 1024, 2) . "MB\n\t"; ?>
192
+ Memory Limit: <?php echo esc_html($memory_limit) . "\n\t"; ?>
193
+ Max Upload Size: <?php echo esc_html($upload_max) . "\n\t"; ?>
194
+ Max Post Size: <?php echo esc_html($post_max) . "\n\t"; ?>
195
+ Allow URL fopen: <?php echo (ini_get('allow_url_fopen') ? "On" : "Off") . "\n\t"; ?>
196
+ Allow URL Include: <?php echo (ini_get('allow_url_include') ? "On" : "Off") . "\n\t"; ?>
197
+ Display Errors: <?php echo (ini_get('display_errors') ? "On" : "Off") . "\n\t"; ?>
198
+ Max Script Execution Time: <?php echo esc_html($max_execute) . " seconds\n\t"; ?>
199
+ WP_HTTP_BLOCK_EXTERNAL: <?php echo (defined('WP_HTTP_BLOCK_EXTERNAL') ? var_export(WP_HTTP_BLOCK_EXTERNAL, true) : 'not defined') . "\n\t"; ?>
200
+ WP_ACCESSIBLE_HOSTS: <?php echo (defined('WP_ACCESSIBLE_HOSTS') ? WP_ACCESSIBLE_HOSTS : 'not defined') . "\n\n"; ?>
201
+ Plugin: <?php echo esc_html($plugin_data['Name']) ."\n"; ?>
202
+ Plugin Version: <?php echo esc_html($plugin_data['Version']) ."\n"; ?>
203
+ Options: <?php foreach($trustindex_pm_google->get_option_names() as $opt_name) {
204
+ if($opt_name == "css-content")
205
+ {
206
+ continue;
207
+ }
208
+ $option = get_option($trustindex_pm_google->get_option_name( $opt_name ));
209
+ echo "\n\t". esc_html($opt_name) .": ";
210
+ if($opt_name == "page-details" || is_array($option))
211
+ {
212
+ if(isset($option['reviews']))
213
+ {
214
+ unset($option['reviews']);
215
+ }
216
+ echo esc_html(str_replace("\n", "\n\t\t", print_r($option, true)));
217
+ }
218
+ else if($opt_name == 'download-timestamp' && $option)
219
+ {
220
+ echo date('Y-m-d H:i:s', esc_html($option));
221
+ }
222
+ else
223
+ {
224
+ echo esc_html($option);
225
+ }
226
+ }
227
+ echo "\n\n"; ?>
228
+ Reviews: <?php echo esc_html(str_replace("\n", "\n\t", print_r($reviews, true))) ."\n\n\t"; ?>
229
+ CSS: <?php echo esc_html(get_option($trustindex_pm_google->get_option_name('css-content'))) ."\n\n"; ?>
230
+ Active Theme: <?php
231
+ if (!function_exists('wp_get_theme'))
232
+ {
233
+ $theme = get_theme(get_current_theme());
234
+ echo esc_html($theme['Name'] . ' ' . $theme['Version']);
235
+ }
236
+ else
237
+ {
238
+ $theme = wp_get_theme();
239
+ echo esc_html($theme->Name . ' ' . $theme->Version);
240
+ }
241
+ echo "\n"; ?>
242
+ Plugins: <?php foreach (get_plugins() as $key => $plugin) {
243
+ echo "\n\t". esc_html($plugin['Name'].' ('.$plugin['Version'] . (is_plugin_active($key) ? ' - active' : '') . ')');
244
+ } ?>
245
+ </textarea>
246
+ <a href=".ti-troubleshooting-info" class="btn-text btn-copy2clipboard ti-pull-right"><?php echo TrustindexPlugin_google::___("Copy to clipboard"); ?></a>
247
+ <div class="clear"></div>
248
+ </div>
249
+ <div class="ti-box">
250
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("Re-create plugin"); ?></div>
251
+ <p><?php echo TrustindexPlugin_google::___('Re-create the database tables of the plugin.<br />Please note: this removes all settings and reviews.'); ?></p>
252
+ <a href="?page=<?php echo esc_attr($_GET['page']); ?>&tab=setup_no_reg&recreate" class="btn-text btn-refresh ti-pull-right" data-loading-text="<?php echo TrustindexPlugin_google::___("Loading") ;?>" style="margin-left: 0"><?php echo TrustindexPlugin_google::___("Re-create plugin"); ?></a>
253
+ <div class="clear"></div>
254
+ </div>
255
+ <div class="ti-box">
256
+ <div class="ti-header"><?php echo TrustindexPlugin_google::___("Translation"); ?></div>
257
+ <p>
258
+ <?php echo TrustindexPlugin_google::___('If you notice an incorrect translation in the plugin text, please report it here:'); ?>
259
+ <a href="mailto:support@trustindex.io">support@trustindex.io</a>
260
+ </p>
261
+ </div>
trunk/tabs/woocommerce.php ADDED
File without changes
trunk/trustindex-google-widget.class.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
3
+ class TrustindexWidget_google extends WP_Widget {
4
+ private $widget_fields = array(
5
+ 'ti-widget-ID' => array('default' => '', 'required' => true,
6
+ 'placeholder' => 'eg.: 478dcc2136263f2b3a3726ff', 'name' => 'Trustindex Widget ID',
7
+ 'help' => null,
8
+ 'help-icon' => '<span class="dashicons dashicons-editor-help btn-insert-tooltip"></span>'
9
+ ),
10
+ );
11
+ private $errors = array();
12
+ public function __construct()
13
+ {
14
+ parent::__construct(
15
+ 'trustindex_google_widget',
16
+ 'Review Widgets for Google',
17
+ array(
18
+ 'classname' => 'trustindex-widget',
19
+ 'description' => 'Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.'
20
+ )
21
+ );
22
+ }
23
+ function widget($args, $instance)
24
+ {
25
+ global $wpdb;
26
+ global $trustindex_pm_google;
27
+ if ($trustindex_pm_google->is_enabled())
28
+ {
29
+ extract($args);
30
+ echo $before_widget;
31
+ $was_error = false;
32
+ foreach ($this->widget_fields as $fname => $fparams)
33
+ {
34
+ if($fparams['required'] && (!isset($instance[$fname]) || $instance[$fname] == ""))
35
+ {
36
+ $was_error = true;
37
+ break;
38
+ }
39
+ }
40
+ if(!$was_error && $instance['ti-widget-ID'])
41
+ {
42
+ echo $trustindex_pm_google->get_trustindex_widget($instance['ti-widget-ID']);
43
+ }
44
+ elseif($trustindex_pm_google->is_noreg_linked() && $trustindex_pm_google->is_noreg_table_exists())
45
+ {
46
+ echo $trustindex_pm_google->get_noreg_list_reviews();
47
+ }
48
+ else
49
+ {
50
+ echo TrustindexPlugin_google::get_alertbox(
51
+ "error",
52
+ " in <strong>".TrustindexPlugin_google::___('Widgets for Google Reviews')."</strong> plugin<br /><br />"
53
+ .TrustindexPlugin_google::___("Please fill out <strong>all the required fields</strong> in the <a href='%s'>widget settings</a> page", [admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php')]),
54
+ false
55
+ );
56
+ }
57
+ echo $after_widget;
58
+ }
59
+ else
60
+ {
61
+ }
62
+ }
63
+ function form($instance)
64
+ {
65
+ global $wp_version;
66
+ global $trustindex_pm_google;
67
+ $ti_widgets = $trustindex_pm_google->get_trustindex_widgets();
68
+ $selected_widget_id = isset($instance['ti-widget-ID']) ? esc_attr($instance['ti-widget-ID']) : $this->widget_fields['ti-widget-ID']['default'];
69
+ ?>
70
+ <div class="trustindex-widget-admin">
71
+ <?php if ($trustindex_pm_google->is_trustindex_connected()): ?>
72
+ <?php if ($ti_widgets): ?>
73
+ <h2><?php echo TrustindexPlugin_google::___('Your saved widgets'); ?></h2>
74
+ <?php foreach ($ti_widgets as $wc): ?>
75
+ <p><strong><?php echo esc_html($wc['name']); ?>:</strong></p>
76
+ <p>
77
+ <?php foreach ($wc['widgets'] as $w): ?>
78
+ <a href="#" class="btn-copy-widget-id <?php if($selected_widget_id == $w['id']): ?>text-danger<?php endif; ?>" data-ti-id="<?php echo esc_attr($w['id']); ?>">
79
+ <span class="dashicons <?php if($selected_widget_id == $w['id']): ?>dashicons-yes<?php else: ?>dashicons-admin-post<?php endif; ?>"></span>
80
+ <?php echo esc_html($w['name']); ?>
81
+ </a><br />
82
+ <?php endforeach; ?>
83
+ </p>
84
+ <?php endforeach; ?>
85
+ <?php else: ?>
86
+ <?php echo TrustindexPlugin_google::get_alertbox("warning",
87
+ TrustindexPlugin_google::___("You have no widget saved!") . " "
88
+ . "<a target='_blank' href='" . "https://admin.trustindex.io/" . "widget'>". TrustindexPlugin_google::___("Let's go, create amazing widgets for free!")."</a>"
89
+ ); ?>
90
+ <?php endif; ?>
91
+ <?php foreach ($this->widget_fields as $fname => $fparams): ?>
92
+ <div class="form-group">
93
+ <div class="col-sm-12">
94
+ <label class="<?php if (isset($this->errors[$fname])):?>text-danger<?php endif; ?>">
95
+ <?php echo TrustindexPlugin_google::___($fparams['name']); ?> <?php if ($fparams['required']): ?><strong class="text-danger">*</strong><?php endif; ?>
96
+ <?php if ($fparams['help-icon']): ?>
97
+ <?php echo TrustindexPlugin_google::___($fparams['help-icon']); ?>
98
+ <?php endif; ?>
99
+ </label>
100
+ <input type="text"
101
+ placeholder="<?php echo TrustindexPlugin_google::___($fparams['placeholder']); ?>"
102
+ id="<?php echo $this->get_field_id($fname); ?>"
103
+ name="<?php echo $this->get_field_name($fname); ?>"
104
+ value="<?php echo isset($instance[$fname]) ? esc_attr($instance[$fname]) : $fparams['default']; ?>"
105
+ class="form-control"
106
+ <?php if ($fparams['required']): ?>required="required"<?php endif; ?>
107
+ />
108
+ <?php if ($fparams['help']): ?>
109
+ <small class="text-muted"><?php echo TrustindexPlugin_google::___($fparams['help']); ?></small>
110
+ <?php endif; ?>
111
+ </div>
112
+ </div>
113
+ <?php endforeach; ?>
114
+ <div class="help-block block-help-template">
115
+ <span class="dashicons dashicons-dismiss"></span>
116
+ <p>
117
+ Check our portal, <a href="<?php echo 'https://admin.trustindex.io/'; ?>widget" target="_blank">list your widgets</a> and find IDs in the first colums.
118
+ </p>
119
+ <img src="<?php echo $trustindex_pm_google->get_plugin_file_url('static/img/help-where-is-id.jpg'); ?>" alt="ID column here: <?php echo 'https://admin.trustindex.io/'; ?>widget" />
120
+ </div>
121
+ <?php else: ?>
122
+ <?php echo TrustindexPlugin_google::get_alertbox("warning",
123
+ TrustindexPlugin_google::___("You have not set up your Trustindex account yet!") . " " .
124
+ TrustindexPlugin_google::___("You can only list 10 reviews without it.") . "<br>"
125
+ . TrustindexPlugin_google::___("Go to <a href='%s'>plugin setup page</a> to complete the one-step setup guide and enjoy the full functionalization!", [ admin_url('admin.php?page='.$trustindex_pm_google->get_plugin_slug().'/settings.php&tab=setup_trustindex') ])
126
+ ); ?>
127
+ <?php endif; ?>
128
+ </div>
129
+ <?php
130
+ }
131
+ }
132
+ ?>
trunk/trustindex-plugin.class.php ADDED
@@ -0,0 +1,5029 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TrustindexPlugin_google
3
+ {
4
+ private $plugin_file_path;
5
+ private $plugin_name;
6
+ private $platform_name;
7
+ public $shortname;
8
+ private $version;
9
+ public function __construct($shortname, $plugin_file_path, $version, $plugin_name, $platform_name)
10
+ {
11
+ $this->shortname = $shortname;
12
+ $this->plugin_file_path = $plugin_file_path;
13
+ $this->version = $version;
14
+ $this->plugin_name = $plugin_name;
15
+ $this->platform_name = $platform_name;
16
+ }
17
+ public function getShortName()
18
+ {
19
+ return $this->shortname;
20
+ }
21
+
22
+
23
+ public function get_plugin_dir()
24
+ {
25
+ return plugin_dir_path($this->plugin_file_path);
26
+ }
27
+ public function get_plugin_file_url($file, $add_versioning = true)
28
+ {
29
+ $url = plugins_url($file, $this->plugin_file_path);
30
+ if ($add_versioning)
31
+ {
32
+ $append_mark = strpos($url, "?") === FALSE ? "?" : "&";
33
+ $url .= $append_mark . 'ver=' . $this->version;
34
+ }
35
+ return $url;
36
+ }
37
+ public function get_plugin_slug()
38
+ {
39
+ return basename($this->get_plugin_dir());
40
+ }
41
+
42
+ /* I18N
43
+ * make sure you do not use any translatable string function calls before the call to our ‘load_plugin_textdomain’
44
+ */
45
+ public function loadI18N()
46
+ {
47
+ load_plugin_textdomain('trustindex', false, $this->get_plugin_slug() . DIRECTORY_SEPARATOR . 'languages');
48
+ }
49
+ public static function ___($text, $params = null)
50
+ {
51
+ if (!is_array($params))
52
+ {
53
+ $params = func_get_args();
54
+ $params = array_slice($params, 1);
55
+ }
56
+ return vsprintf(__($text, 'trustindex'), $params);
57
+ }
58
+
59
+
60
+ public function output_buffer()
61
+ {
62
+ ob_start();
63
+ }
64
+
65
+
66
+ public function uninstall()
67
+ {
68
+ foreach ($this->get_option_names() as $opt_name)
69
+ {
70
+ delete_option($this->get_option_name($opt_name));
71
+ }
72
+ if($this->is_noreg_table_exists())
73
+ {
74
+ global $wpdb;
75
+ $wpdb->query('DROP TABLE `'. $this->get_noreg_tablename() .'`');
76
+ }
77
+ if(is_file($this->getCssFile()))
78
+ {
79
+ unlink($this->getCssFile());
80
+ }
81
+ }
82
+
83
+
84
+ public function activate()
85
+ {
86
+ if ($this->is_need_update())
87
+ {
88
+ add_option($this->get_option_name('active'), '1');
89
+ update_option($this->get_option_name('version'), $this->version);
90
+ }
91
+ }
92
+ public function deactivate()
93
+ {
94
+ }
95
+ public function is_enabled()
96
+ {
97
+ $active = get_option($this->get_option_name('active'));
98
+ if (empty($active) || $active === '0')
99
+ {
100
+ return false;
101
+ }
102
+ return true;
103
+ }
104
+ public function is_need_update()
105
+ {
106
+ $version = (string)get_option($this->get_option_name('version'));
107
+ if (!$version)
108
+ {
109
+ $version = '0';
110
+ }
111
+ if (version_compare($version, $this->version, '<'))
112
+ {
113
+ return true;
114
+ }
115
+ return false;
116
+ }
117
+
118
+ public function add_setting_menu()
119
+ {
120
+ global $menu, $submenu;
121
+ $permission = 'edit_pages';
122
+ $settings_page_url = $this->get_plugin_slug() . "/settings.php";
123
+ $settings_page_title = $this->platform_name . ' ';
124
+ if(function_exists('mb_strtolower'))
125
+ {
126
+ $settings_page_title .= mb_strtolower(self::___('Reviews'));
127
+ }
128
+ else
129
+ {
130
+ $settings_page_title .= strtolower(self::___('Reviews'));
131
+ }
132
+ $top_menu = false;
133
+ foreach($menu as $key => $item)
134
+ {
135
+ if($item[0] == 'Trustindex.io')
136
+ {
137
+ $top_menu = $item;
138
+ break;
139
+ }
140
+ }
141
+ if($top_menu === false)
142
+ {
143
+ add_menu_page(
144
+ $settings_page_title,
145
+ 'Trustindex.io',
146
+ $permission,
147
+ $settings_page_url,
148
+ '',
149
+ $this->get_plugin_file_url('static/img/trustindex-sign-logo.png')
150
+ );
151
+ }
152
+ else
153
+ {
154
+ if(!isset($submenu[$top_menu[2]]))
155
+ {
156
+ add_submenu_page(
157
+ $top_menu[2],
158
+ 'Trustindex.io',
159
+ $top_menu[3],
160
+ $permission,
161
+ $top_menu[2]
162
+ );
163
+ }
164
+ add_submenu_page(
165
+ $top_menu[2],
166
+ 'Trustindex.io',
167
+ $settings_page_title,
168
+ $permission,
169
+ $settings_page_url
170
+ );
171
+ }
172
+ }
173
+ public function add_plugin_action_links($links, $file)
174
+ {
175
+ $plugin_file = basename($this->plugin_file_path);
176
+ if (basename($file) == $plugin_file)
177
+ {
178
+ $new_item2 = '<a target="_blank" href="https://www.trustindex.io" target="_blank">by <span style="background-color: #4067af; color: white; font-weight: bold; padding: 1px 8px;">Trustindex.io</span></a>';
179
+ $new_item1 = '<a href="' . admin_url('admin.php?page=' . $this->get_plugin_slug() . '/settings.php') . '">' . self::___('Settings') . '</a>';
180
+ array_unshift($links, $new_item2, $new_item1);
181
+ }
182
+ return $links;
183
+ }
184
+ public function add_plugin_meta_links( $meta, $file )
185
+ {
186
+ $plugin_file = basename($this->plugin_file_path);
187
+ if (basename($file) == $plugin_file)
188
+ {
189
+ $meta[] = "<a href='http://wordpress.org/support/view/plugin-reviews/".$this->get_plugin_slug()."' target='_blank' rel='noopener noreferrer' title='" . self::___( 'Rate our plugin') . ': '.$this->plugin_name . "'>" . self::___('Rate our plugin') . '</a>';
190
+ }
191
+ return $meta;
192
+ }
193
+
194
+
195
+ public function init_widget()
196
+ {
197
+ if (!class_exists('TrustindexWidget_'.$this->shortname))
198
+ {
199
+ require $this->get_plugin_dir() . 'trustindex-'.$this->shortname.'-widget.class.php';
200
+ }
201
+ }
202
+ public function register_widget()
203
+ {
204
+ return register_widget('TrustindexWidget_'.$this->shortname);
205
+ }
206
+
207
+
208
+ public function get_option_name($opt_name)
209
+ {
210
+ if (!in_array($opt_name, $this->get_option_names()))
211
+ {
212
+ echo "Option not registered in plugin (Trustindex class)";
213
+ }
214
+ if(in_array($opt_name, [ 'subscription-id', 'proxy-check' ]))
215
+ {
216
+ return "trustindex-".$opt_name;
217
+ }
218
+ else
219
+ {
220
+ return "trustindex-".$this->shortname."-".$opt_name;
221
+ }
222
+ }
223
+ public function get_option_names()
224
+ {
225
+ return [
226
+ 'active',
227
+ 'version',
228
+ 'page-details',
229
+ 'subscription-id',
230
+ 'proxy-check',
231
+ 'style-id',
232
+ 'review-content',
233
+ 'filter',
234
+ 'scss-set',
235
+ 'css-content',
236
+ 'lang',
237
+ 'no-rating-text',
238
+ 'dateformat',
239
+ 'rate-us',
240
+ 'verified-icon',
241
+ 'enable-animation',
242
+ 'show-arrows',
243
+ 'content-saved-to',
244
+ 'show-reviewers-photo',
245
+ 'download-timestamp',
246
+ 'widget-setted-up',
247
+ 'disable-font',
248
+ 'show-logos',
249
+ 'show-stars',
250
+ 'load-css-inline',
251
+ 'align',
252
+ 'amp-hidden-notification'
253
+ ];
254
+ }
255
+ public function get_platforms()
256
+ {
257
+ return array (
258
+ 0 => 'facebook',
259
+ 1 => 'google',
260
+ 2 => 'tripadvisor',
261
+ 3 => 'yelp',
262
+ 4 => 'booking',
263
+ 5 => 'amazon',
264
+ 6 => 'arukereso',
265
+ 7 => 'airbnb',
266
+ 8 => 'hotels',
267
+ 9 => 'opentable',
268
+ 10 => 'foursquare',
269
+ 11 => 'capterra',
270
+ 12 => 'szallashu',
271
+ 13 => 'thumbtack',
272
+ 14 => 'expedia',
273
+ 15 => 'zillow',
274
+ 16 => 'wordpressPlugin',
275
+ 17 => 'aliexpress',
276
+ 18 => 'alibaba',
277
+ 19 => 'sourceForge',
278
+ 20 => 'ebay',
279
+ );
280
+ }
281
+ private $plugin_slugs = array (
282
+ 'facebook' => 'free-facebook-reviews-and-recommendations-widgets',
283
+ 'google' => 'wp-reviews-plugin-for-google',
284
+ 'tripadvisor' => 'review-widgets-for-tripadvisor',
285
+ 'yelp' => 'reviews-widgets-for-yelp',
286
+ 'booking' => 'review-widgets-for-booking-com',
287
+ 'amazon' => 'review-widgets-for-amazon',
288
+ 'arukereso' => 'review-widgets-for-arukereso',
289
+ 'airbnb' => 'review-widgets-for-airbnb',
290
+ 'hotels' => 'review-widgets-for-hotels-com',
291
+ 'opentable' => 'review-widgets-for-opentable',
292
+ 'foursquare' => 'review-widgets-for-foursquare',
293
+ 'capterra' => 'review-widgets-for-capterra',
294
+ 'szallashu' => 'review-widgets-for-szallas-hu',
295
+ 'thumbtack' => 'widgets-for-thumbtack-reviews',
296
+ 'expedia' => 'widgets-for-expedia-reviews',
297
+ 'zillow' => 'widgets-for-zillow-reviews',
298
+ 'wordpressPlugin' => 'reviews-widgets',
299
+ 'aliexpress' => 'widgets-for-aliexpress-reviews',
300
+ 'alibaba' => 'widgets-for-alibaba-reviews',
301
+ 'sourceForge' => 'widgets-for-sourceforge-reviews',
302
+ 'ebay' => 'widgets-for-ebay-reviews',
303
+ );
304
+ public function get_plugin_slugs()
305
+ {
306
+ return array_values($this->plugin_slugs);
307
+ }
308
+
309
+
310
+ public static function get_noticebox($type, $message)
311
+ {
312
+ return '<div class="ti-notice notice-'.$type.' is-dismissible"><p>'.self::___($message).'</p><button type="button" class="notice-dismiss"></button></div>';
313
+ }
314
+ public static function get_alertbox($type, $content, $newline_content = true)
315
+ {
316
+ $types = array(
317
+ "warning" => array(
318
+ "css" => "color: #856404; background-color: #fff3cd; border-color: #ffeeba;",
319
+ "icon" => "dashicons-warning"
320
+ ),
321
+ "info" => array(
322
+ "css" => "color: #0c5460; background-color: #d1ecf1; border-color: #bee5eb;",
323
+ "icon" => "dashicons-info"
324
+ ),
325
+ "error" => array(
326
+ "css" => "color: #721c24; background-color: #f8d7da; border-color: #f5c6cb;",
327
+ "icon" => "dashicons-info"
328
+ )
329
+ );
330
+ return "<div style='margin:20px 0px; padding:10px; " . $types[$type]['css'] . " border-radius: 5px;'>"
331
+ . "<span class='dashicons " . $types[$type]['icon'] . "'></span> <strong>" . strtoupper(self::___($type)) . "</strong>"
332
+ . ($newline_content ? "<br />" : "")
333
+ . $content
334
+ . "</div>";
335
+ }
336
+
337
+
338
+ public function get_trustindex_widget($ti_id)
339
+ {
340
+ wp_enqueue_script('trustindex-js', 'https://cdn.trustindex.io/loader.js', [], false, true);
341
+ return "<div src='https://cdn.trustindex.io/loader.js?" . $ti_id . "'></div>";
342
+ }
343
+ public function get_shortcode_name()
344
+ {
345
+ return 'trustindex';
346
+ }
347
+ public function init_shortcode()
348
+ {
349
+ if (!shortcode_exists($this->get_shortcode_name()))
350
+ {
351
+ add_shortcode( $this->get_shortcode_name(), [$this, 'shortcode_func'] );
352
+ }
353
+ }
354
+ public function shortcode_func($atts)
355
+ {
356
+ $atts = shortcode_atts(
357
+ array(
358
+ 'data-widget-id' => null,
359
+ 'no-registration' => null
360
+ ),
361
+ $atts
362
+ );
363
+ if (isset($atts["data-widget-id"]) && $atts["data-widget-id"])
364
+ {
365
+ return $this->get_trustindex_widget($atts["data-widget-id"]);
366
+ }
367
+ else if (isset($atts["no-registration"]) && $atts["no-registration"])
368
+ {
369
+ $force_platform = $atts["no-registration"];
370
+ if(substr($force_platform, 0, 5) != 'trust' && substr($force_platform, -4) != 'ilot' && !in_array($force_platform, $this->get_platforms()))
371
+ {
372
+ $av_platforms = $this->get_platforms();
373
+ $force_platform = $av_platforms[0];
374
+ }
375
+ $file_path = __FILE__;
376
+ if(isset($this->plugin_slugs[ $force_platform ]))
377
+ {
378
+ $chosed_platform_slug = $this->plugin_slugs[ $force_platform ];
379
+ $current_platform_slug = $this->plugin_slugs[ $this->shortname ];
380
+ $file_path = preg_replace('/[^\/\\\\]+([\\\\\/]trustindex-plugin\.class\.php)/', $chosed_platform_slug . '$1', $file_path);
381
+ }
382
+ $chosed_platform = new self($force_platform, $file_path, "do-not-care-8.2.3", "do-not-care-Widgets for Google Reviews", "do-not-care-Google");
383
+ if(!$chosed_platform->is_noreg_linked() || !$chosed_platform->is_noreg_table_exists($force_platform))
384
+ {
385
+ return self::get_alertbox(
386
+ "error",
387
+ " @ <strong>". self::___('Trustindex plugin') ."</strong><br /><br />"
388
+ .self::___('You have to connect your business (%s)!', [$force_platform]),
389
+ false
390
+ );
391
+ }
392
+ else
393
+ {
394
+ return $chosed_platform->get_noreg_list_reviews($force_platform);
395
+ }
396
+ }
397
+ else
398
+ {
399
+ return self::get_alertbox(
400
+ "error",
401
+ " @ <strong>". self::___('Trustindex plugin') ."</strong><br /><br />"
402
+ .self::___('Your shortcode is deficient: Trustindex Widget ID is empty! Example: ') . '<br /><code>['.$this->get_shortcode_name().' data-widget-id="478dcc2136263f2b3a3726ff"]</code>',
403
+ false
404
+ );
405
+ }
406
+ }
407
+
408
+ /* WITHOUT REG MODE HELPERS
409
+ *
410
+ * @force_platform - default ($this->shortname) platform name can be overriden, because of the general shortcode.
411
+ * (For example: if Yelp plugin loaded first --> yelp plugin will load the widget, other Trustindex plugins will not load shortcode.
412
+ * But Yelp plugins's shortcode should be able to operate other platforms' (ie.: Google) shortcodes, too. )
413
+ */
414
+ public function is_noreg_linked()
415
+ {
416
+ $page_details = get_option($this->get_option_name('page-details'));
417
+ return $page_details && !empty($page_details);
418
+ }
419
+ public function get_noreg_tablename($force_platform = null)
420
+ {
421
+ global $wpdb;
422
+ $force_platform = $force_platform ? $force_platform : $this->shortname;
423
+ return $wpdb->prefix ."trustindex_".$force_platform."_reviews";
424
+ }
425
+ public function is_noreg_table_exists($force_platform = null)
426
+ {
427
+ global $wpdb;
428
+ $dbtable = $this->get_noreg_tablename($force_platform);
429
+ return ($wpdb->get_var("SHOW TABLES LIKE '$dbtable'") == $dbtable);
430
+ }
431
+ public function noreg_save_css($set_change = false)
432
+ {
433
+ $style_id = (int)get_option($this->get_option_name('style-id'), 4);
434
+ $set_id = get_option($this->get_option_name('scss-set'));
435
+ $args = array(
436
+ 'timeout' => '20',
437
+ 'redirection' => '5',
438
+ 'blocking' => true
439
+ );
440
+ add_filter( 'https_ssl_verify', '__return_false' );
441
+ add_filter( 'block_local_requests', '__return_false' );
442
+ $params = [
443
+ 'platform' => $this->shortname,
444
+ 'layout_id' => $style_id,
445
+ 'overrides' => [
446
+ 'nav' => get_option($this->get_option_name('show-arrows'), 1) ? true : false,
447
+ 'hover-anim' => get_option($this->get_option_name('enable-animation'), 1) ? true : false,
448
+ 'enable-font' => get_option($this->get_option_name('disable-font'), 0) ? false : true,
449
+ ]
450
+ ];
451
+ if(in_array($style_id, [ 36, 37, 38, 39 ]))
452
+ {
453
+ $params['overrides']['content-align'] = get_option($this->get_option_name('align'), 'center');
454
+ }
455
+ else
456
+ {
457
+ $params['overrides']['text-align'] = get_option($this->get_option_name('align'), 'left');
458
+ }
459
+ if($set_change)
460
+ {
461
+ $params['set_id'] = $set_id;
462
+ }
463
+ $url = 'https://admin.trustindex.io/' . 'api/getLayoutScss?' . http_build_query($params);
464
+ $server_output = $this->post_request($url, [
465
+ 'timeout' => '20',
466
+ 'redirection' => '5',
467
+ 'blocking' => true
468
+ ]);
469
+ if($server_output[0] !== '[' && $server_output[0] !== '{')
470
+ {
471
+ $server_output = substr($server_output, strpos($server_output, '('));
472
+ $server_output = trim($server_output,'();');
473
+ }
474
+ $server_output = json_decode($server_output, true);
475
+ if(!$set_change)
476
+ {
477
+ update_option($this->get_option_name('scss-set'), $server_output['default'], false);
478
+ }
479
+ if($server_output['css'])
480
+ {
481
+ if($style_id == 17 || $style_id == 21)
482
+ {
483
+ $server_output['css'] .= '.ti-preview-box { position: initial !important }';
484
+ }
485
+ update_option($this->get_option_name('css-content'), $server_output['css'], false);
486
+ $this->handleCssFile();
487
+ }
488
+ return $server_output;
489
+ }
490
+ public function plugin_loaded()
491
+ {
492
+ global $wpdb;
493
+ $version = $this->version;
494
+
495
+ if($this->is_noreg_table_exists())
496
+ {
497
+ $db_table_name = $this->get_noreg_tablename();
498
+
499
+ if($version >= 6.3 && count($wpdb->get_results("SHOW COLUMNS FROM $db_table_name LIKE 'highlight'")) == 0)
500
+ {
501
+ $wpdb->query("ALTER TABLE $db_table_name ADD highlight VARCHAR(11) NULL AFTER rating");
502
+ }
503
+ }
504
+ if($this->is_noreg_linked() && get_option( $this->get_option_name('review-content') ))
505
+ {
506
+ $content_version = get_option( $this->get_option_name('content-saved-to') );
507
+ if(!$content_version || $content_version != $version)
508
+ {
509
+ update_option( $this->get_option_name('content-saved-to'), $version, false );
510
+ delete_option( $this->get_option_name('review-content') );
511
+ $this->noreg_save_css(true);
512
+ }
513
+ }
514
+ $this->handleCssFile();
515
+ $this->loadI18N();
516
+ if ( !class_exists('TrustindexGutenbergPlugin') && function_exists( 'register_block_type' ) )
517
+ {
518
+ require_once dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'static' . DIRECTORY_SEPARATOR . 'block-editor' . DIRECTORY_SEPARATOR . 'block-editor.php';
519
+ TrustindexGutenbergPlugin::instance();
520
+ }
521
+ $used_options = [];
522
+ foreach($this->get_option_names() as $opt_name)
523
+ {
524
+ $used_options []= $this->get_option_name($opt_name);
525
+ }
526
+ $wpdb->query('DELETE FROM `'. $wpdb->options .'` WHERE option_name LIKE "trustindex-'. $this->shortname .'-%" AND option_name NOT IN ("'. implode('", "', $used_options) .'")');
527
+ }
528
+ public function getCssFile($return_only_file = false)
529
+ {
530
+ $file = 'trustindex-'. $this->shortname .'-widget.css';
531
+ if($return_only_file)
532
+ {
533
+ return $file;
534
+ }
535
+ $upload_dir = wp_upload_dir();
536
+ return trailingslashit($upload_dir['basedir']) . $file;
537
+ }
538
+ public function handleCssFile()
539
+ {
540
+ $css = get_option($this->get_option_name('css-content'));
541
+ if(!$css)
542
+ {
543
+ return;
544
+ }
545
+ if(get_option($this->get_option_name('load-css-inline'), 0))
546
+ {
547
+ return;
548
+ }
549
+ $file_exists = is_file($this->getCssFile());
550
+ $success = false;
551
+ $error_type = null;
552
+ $error_message = "";
553
+ if($file_exists && !is_readable($this->getCssFile()))
554
+ {
555
+ $error_type = 'permission';
556
+ }
557
+ else
558
+ {
559
+ if($file_exists && $css === file_get_contents($this->getCssFile()))
560
+ {
561
+ return;
562
+ }
563
+ require_once(ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'file.php');
564
+ global $wp_filesystem;
565
+ set_error_handler(function ($err_severity, $err_msg, $err_file, $err_line, array $err_context) {
566
+ throw new ErrorException( $err_msg, 0, $err_severity, $err_file, $err_line );
567
+ }, E_WARNING);
568
+ add_filter('filesystem_method', array($this, 'filter_filesystem_method'));
569
+ WP_Filesystem();
570
+ try
571
+ {
572
+ $success = $wp_filesystem->put_contents($this->getCssFile(), $css, 0777);
573
+ }
574
+ catch(Exception $e)
575
+ {
576
+ if(strpos($e->getMessage(), 'Permission denied') !== FALSE)
577
+ {
578
+ $error_type = 'permission';
579
+ }
580
+ else
581
+ {
582
+ $error_type = 'filesystem';
583
+ $error_message = $e->__toString();
584
+ }
585
+ }
586
+ restore_error_handler();
587
+ remove_filter('filesystem_method', array($this, 'filter_filesystem_method'));
588
+ }
589
+ if(!$success)
590
+ {
591
+ add_action('admin_notices', function() use ($file_exists, $error_type, $error_message) {
592
+ $html = '
593
+ <div class="notice notice-error" style="margin: 5px 0 15px">
594
+ <p>' .
595
+ '<strong>'. self::___('ERROR with the following plugin:') .'</strong> '. self::___($this->plugin_name) .'<br /><br />' .
596
+ self::___('CSS file could not saved.') .' <strong>('. $this->getCssFile() .')</strong> '. self::___('Your widgets do not display properly!') . '<br />';
597
+ if($error_type == 'filesystem')
598
+ {
599
+ $html .= '<br />
600
+ <strong>There is an error with your filesystem. We got the following error message:</strong>
601
+ <pre style="display: block; margin: 10px 0; padding: 20px; background: #eee">'. $error_message .'</pre>
602
+ <strong>Maybe you configured your filesystem incorrectly.<br />
603
+ <a href="https://wordpress.org/support/article/editing-wp-config-php/#wordpress-upgrade-constants" target="_blank">Here you can read about how to configure filesystem in your WordPress.</a></strong>';
604
+ }
605
+ else
606
+ {
607
+ if($file_exists)
608
+ {
609
+ $html .= self::___('CSS file exists and it is not writeable. Delete the file');
610
+ }
611
+ else
612
+ {
613
+ $html .= self::___('Grant write permissions to upload folder');
614
+ }
615
+ $html .= '<br />' .
616
+ self::___('or') . '<br />' .
617
+ self::___("enable 'CSS internal loading' in the <a href='%s'>Troubleshooting</a> page!", [ admin_url('admin.php?page=' . $this->get_plugin_slug() . '/settings.php&tab=troubleshooting') ]);
618
+ }
619
+ echo $html . '</p></div>';
620
+ });
621
+ }
622
+ return $success;
623
+ }
624
+ public static $widget_templates = array (
625
+ 'categories' =>
626
+ array (
627
+ 'slider' => '4,5,13,15,19,34,36,37,39,44,45,46,47',
628
+ 'sidebar' => '6,7,8,9,10,18',
629
+ 'list' => '33',
630
+ 'grid' => '16,31,38,48',
631
+ 'badge' => '11,12,20,22,23',
632
+ 'button' => '24,25,26,27,28,29,30,32,35',
633
+ 'floating' => '17,21',
634
+ 'popup' => '23,30,32',
635
+ ),
636
+ 'templates' =>
637
+ array (
638
+ 4 =>
639
+ array (
640
+ 'name' => 'Slider I.',
641
+ 'type' => 'slider',
642
+ ),
643
+ 36 =>
644
+ array (
645
+ 'name' => 'Slider I. - centered',
646
+ 'type' => 'slider',
647
+ ),
648
+ 15 =>
649
+ array (
650
+ 'name' => 'Slider II.',
651
+ 'type' => 'slider',
652
+ ),
653
+ 39 =>
654
+ array (
655
+ 'name' => 'Slider II. - centered',
656
+ 'type' => 'slider',
657
+ ),
658
+ 5 =>
659
+ array (
660
+ 'name' => 'Slider III. - with badge',
661
+ 'type' => 'slider',
662
+ ),
663
+ 34 =>
664
+ array (
665
+ 'name' => 'Slider III. - with badge II.',
666
+ 'type' => 'slider',
667
+ ),
668
+ 13 =>
669
+ array (
670
+ 'name' => 'Slider III. - with company header',
671
+ 'type' => 'slider',
672
+ ),
673
+ 19 =>
674
+ array (
675
+ 'name' => 'Slider IV.',
676
+ 'type' => 'slider',
677
+ ),
678
+ 37 =>
679
+ array (
680
+ 'name' => 'Slider V.',
681
+ 'type' => 'slider',
682
+ ),
683
+ 44 =>
684
+ array (
685
+ 'name' => 'Slider VI.',
686
+ 'type' => 'slider',
687
+ ),
688
+ 33 =>
689
+ array (
690
+ 'name' => 'List I.',
691
+ 'type' => 'list',
692
+ ),
693
+ 16 =>
694
+ array (
695
+ 'name' => 'Grid',
696
+ 'type' => 'grid',
697
+ ),
698
+ 38 =>
699
+ array (
700
+ 'name' => 'Grid II.',
701
+ 'type' => 'grid',
702
+ ),
703
+ 31 =>
704
+ array (
705
+ 'name' => 'Mansonry grid',
706
+ 'type' => 'grid',
707
+ ),
708
+ 6 =>
709
+ array (
710
+ 'name' => 'Sidebar slider I.',
711
+ 'type' => 'sidebar',
712
+ ),
713
+ 7 =>
714
+ array (
715
+ 'name' => 'Sidebar slider II.',
716
+ 'type' => 'sidebar',
717
+ ),
718
+ 8 =>
719
+ array (
720
+ 'name' => 'Full sidebar I.',
721
+ 'type' => 'sidebar',
722
+ ),
723
+ 18 =>
724
+ array (
725
+ 'name' => 'Full sidebar I. - without header',
726
+ 'type' => 'sidebar',
727
+ ),
728
+ 9 =>
729
+ array (
730
+ 'name' => 'Full sidebar II.',
731
+ 'type' => 'sidebar',
732
+ ),
733
+ 10 =>
734
+ array (
735
+ 'name' => 'Full sidebar III.',
736
+ 'type' => 'sidebar',
737
+ ),
738
+ 24 =>
739
+ array (
740
+ 'name' => 'Button I.',
741
+ 'type' => 'button',
742
+ ),
743
+ 25 =>
744
+ array (
745
+ 'name' => 'Button II.',
746
+ 'type' => 'button',
747
+ ),
748
+ 26 =>
749
+ array (
750
+ 'name' => 'Button III.',
751
+ 'type' => 'button',
752
+ ),
753
+ 27 =>
754
+ array (
755
+ 'name' => 'Button IV.',
756
+ 'type' => 'button',
757
+ ),
758
+ 28 =>
759
+ array (
760
+ 'name' => 'Button V.',
761
+ 'type' => 'button',
762
+ ),
763
+ 29 =>
764
+ array (
765
+ 'name' => 'Button VI.',
766
+ 'type' => 'button',
767
+ ),
768
+ 30 =>
769
+ array (
770
+ 'name' => 'Button VII. - with dropdown',
771
+ 'type' => 'button',
772
+ ),
773
+ 35 =>
774
+ array (
775
+ 'name' => 'Button VII.',
776
+ 'type' => 'button',
777
+ ),
778
+ 32 =>
779
+ array (
780
+ 'name' => 'Button VII. - with popup',
781
+ 'type' => 'button',
782
+ ),
783
+ 22 =>
784
+ array (
785
+ 'name' => 'Company badge I.',
786
+ 'type' => 'badge',
787
+ ),
788
+ 23 =>
789
+ array (
790
+ 'name' => 'Company badge I. - with popup',
791
+ 'type' => 'badge',
792
+ ),
793
+ 11 =>
794
+ array (
795
+ 'name' => 'HTML badge I.',
796
+ 'type' => 'badge',
797
+ ),
798
+ 12 =>
799
+ array (
800
+ 'name' => 'HTML badge II.',
801
+ 'type' => 'badge',
802
+ ),
803
+ 20 =>
804
+ array (
805
+ 'name' => 'HTML badge III.',
806
+ 'type' => 'badge',
807
+ ),
808
+ 17 =>
809
+ array (
810
+ 'name' => 'Floating',
811
+ 'type' => 'floating',
812
+ ),
813
+ 21 =>
814
+ array (
815
+ 'name' => 'Floating II.',
816
+ 'type' => 'floating',
817
+ ),
818
+ ),
819
+ );
820
+ public static $widget_styles = array (
821
+ 'light-background' =>
822
+ array (
823
+ 'id' => 'light-background',
824
+ 'name' => 'Light background',
825
+ 'position' => 0,
826
+ 'select-position' => 0,
827
+ 'reviewer-photo' => true,
828
+ 'verified-icon' => true,
829
+ 'hide-logos' => false,
830
+ 'hide-stars' => false,
831
+ '_vars' =>
832
+ array (
833
+ 'style_id' => '"light-background"',
834
+ 'bg-color' => '#ffffff',
835
+ 'text-color' => '#000000',
836
+ 'outside-text-color' => '#000000',
837
+ 'profile-color' => '#000000',
838
+ 'profile-font-size' => '15px',
839
+ 'review-font-size' => '14px',
840
+ 'rating-text' => '14px',
841
+ 'company-font-size' => '16px',
842
+ 'review-lines' => '4',
843
+ 'box-background-color' => '#efefef',
844
+ 'box-border-color' => '#efefef',
845
+ 'box-border-radius' => '4px',
846
+ 'box-padding' => '15px',
847
+ 'scroll' => 'true',
848
+ 'scroll-color' => '#555555',
849
+ 'arrow-color' => '#cccccc',
850
+ 'float-widget-align' => 'left',
851
+ 'nav' => 'true',
852
+ 'dots' => 'mobile',
853
+ 'hover-anim' => 'true',
854
+ 'review-italic' => 'false',
855
+ 'enable-font' => 'true',
856
+ 'align-mini' => 'center',
857
+ 'readmore' => 'true',
858
+ 'popup-background' => '#ffffff',
859
+ 'popup-company-color' => '#333333',
860
+ 'popup-company-size' => '16px',
861
+ 'popup-profile-color' => '#333333',
862
+ 'popup-profile-size' => '15px',
863
+ 'popup-review-color' => '#333333',
864
+ 'popup-review-size' => '14px',
865
+ 'popup-separator-color' => '#dedede',
866
+ 'popup-separator-width' => '1px',
867
+ 'box-shadow' => 'false',
868
+ 'box-shadow-color' => '#000000',
869
+ 'box-shadow-opacity' => '0.15',
870
+ 'box-border-top-width' => '2px',
871
+ 'box-border-bottom-width' => '2px',
872
+ 'box-border-left-width' => '2px',
873
+ 'box-border-right-width' => '2px',
874
+ 'box-background-opacity' => '1',
875
+ 'box-backdrop-blur' => '0px',
876
+ 'highlight-color' => '#fbe049',
877
+ 'highlight-size' => '19px',
878
+ 'review-title' => 'normal',
879
+ 'content-align' => 'center',
880
+ 'text-align' => 'left',
881
+ 'original-rating-text' => '14px',
882
+ ),
883
+ ),
884
+ 'light-background-large' =>
885
+ array (
886
+ 'id' => 'light-background-large',
887
+ 'name' => 'Light background - large',
888
+ 'position' => 0,
889
+ 'select-position' => 0,
890
+ 'reviewer-photo' => true,
891
+ 'verified-icon' => false,
892
+ 'hide-logos' => false,
893
+ 'hide-stars' => false,
894
+ '_vars' =>
895
+ array (
896
+ 'style_id' => '"light-background-large"',
897
+ 'bg-color' => '#ffffff',
898
+ 'text-color' => '#000000',
899
+ 'outside-text-color' => '#000000',
900
+ 'profile-color' => '#000000',
901
+ 'profile-font-size' => '15px',
902
+ 'review-font-size' => '16px',
903
+ 'rating-text' => '14px',
904
+ 'company-font-size' => '16px',
905
+ 'review-lines' => '5',
906
+ 'box-background-color' => '#f8f9f9',
907
+ 'box-border-color' => '#f8f9f9',
908
+ 'box-border-radius' => '12px',
909
+ 'box-padding' => '25px',
910
+ 'scroll' => 'true',
911
+ 'scroll-color' => '#c3c3c3',
912
+ 'arrow-color' => '#cccccc',
913
+ 'float-widget-align' => 'left',
914
+ 'nav' => 'false',
915
+ 'dots' => 'true',
916
+ 'hover-anim' => 'true',
917
+ 'review-italic' => 'false',
918
+ 'enable-font' => 'true',
919
+ 'align-mini' => 'center',
920
+ 'readmore' => 'true',
921
+ 'popup-background' => '#ffffff',
922
+ 'popup-company-color' => '#333333',
923
+ 'popup-company-size' => '16px',
924
+ 'popup-profile-color' => '#333333',
925
+ 'popup-profile-size' => '15px',
926
+ 'popup-review-color' => '#333333',
927
+ 'popup-review-size' => '14px',
928
+ 'popup-separator-color' => '#dedede',
929
+ 'popup-separator-width' => '1px',
930
+ 'box-shadow' => 'false',
931
+ 'box-shadow-color' => '#000000',
932
+ 'box-shadow-opacity' => '0.15',
933
+ 'box-border-top-width' => '0px',
934
+ 'box-border-bottom-width' => '0px',
935
+ 'box-border-left-width' => '0px',
936
+ 'box-border-right-width' => '0px',
937
+ 'box-background-opacity' => '1',
938
+ 'box-backdrop-blur' => '0px',
939
+ 'highlight-color' => '#fbe049',
940
+ 'highlight-size' => '19px',
941
+ 'review-title' => 'normal',
942
+ 'content-align' => 'center',
943
+ 'text-align' => 'left',
944
+ 'original-rating-text' => '14px',
945
+ ),
946
+ ),
947
+ 'ligth-border' =>
948
+ array (
949
+ 'id' => 'ligth-border',
950
+ 'name' => 'Light border',
951
+ 'position' => 0,
952
+ 'select-position' => 1,
953
+ 'reviewer-photo' => true,
954
+ 'verified-icon' => true,
955
+ 'hide-logos' => false,
956
+ 'hide-stars' => false,
957
+ '_vars' =>
958
+ array (
959
+ 'style_id' => '"light-border"',
960
+ 'bg-color' => '#ffffff',
961
+ 'text-color' => '#000000',
962
+ 'outside-text-color' => '#000000',
963
+ 'profile-color' => '#000000',
964
+ 'profile-font-size' => '15px',
965
+ 'review-font-size' => '14px',
966
+ 'rating-text' => '14px',
967
+ 'company-font-size' => '16px',
968
+ 'review-lines' => '4',
969
+ 'box-background-color' => '#ffffff',
970
+ 'box-border-color' => '#e5e5e5',
971
+ 'box-border-radius' => '4px',
972
+ 'box-padding' => '15px',
973
+ 'scroll' => 'true',
974
+ 'scroll-color' => '#555555',
975
+ 'arrow-color' => '#cccccc',
976
+ 'float-widget-align' => 'left',
977
+ 'nav' => 'true',
978
+ 'dots' => 'mobile',
979
+ 'hover-anim' => 'true',
980
+ 'review-italic' => 'false',
981
+ 'enable-font' => 'true',
982
+ 'align-mini' => 'center',
983
+ 'readmore' => 'true',
984
+ 'popup-background' => '#ffffff',
985
+ 'popup-company-color' => '#333333',
986
+ 'popup-company-size' => '16px',
987
+ 'popup-profile-color' => '#333333',
988
+ 'popup-profile-size' => '15px',
989
+ 'popup-review-color' => '#333333',
990
+ 'popup-review-size' => '14px',
991
+ 'popup-separator-color' => '#dedede',
992
+ 'popup-separator-width' => '1px',
993
+ 'box-shadow' => 'false',
994
+ 'box-shadow-color' => '#000000',
995
+ 'box-shadow-opacity' => '0.15',
996
+ 'box-border-top-width' => '2px',
997
+ 'box-border-bottom-width' => '2px',
998
+ 'box-border-left-width' => '2px',
999
+ 'box-border-right-width' => '2px',
1000
+ 'box-background-opacity' => '1',
1001
+ 'box-backdrop-blur' => '0px',
1002
+ 'highlight-color' => '#fbe049',
1003
+ 'highlight-size' => '19px',
1004
+ 'review-title' => 'normal',
1005
+ 'content-align' => 'center',
1006
+ 'text-align' => 'left',
1007
+ 'original-rating-text' => '14px',
1008
+ ),
1009
+ ),
1010
+ 'ligth-border-3d-large' =>
1011
+ array (
1012
+ 'id' => 'ligth-border-3d-large',
1013
+ 'name' => 'Light border - 3D - large',
1014
+ 'position' => 0,
1015
+ 'select-position' => 1,
1016
+ 'reviewer-photo' => false,
1017
+ 'verified-icon' => true,
1018
+ 'hide-logos' => false,
1019
+ 'hide-stars' => false,
1020
+ '_vars' =>
1021
+ array (
1022
+ 'style_id' => '"light-border-3d-large"',
1023
+ 'bg-color' => '#ffffff',
1024
+ 'text-color' => '#000000',
1025
+ 'outside-text-color' => '#000000',
1026
+ 'profile-color' => '#000000',
1027
+ 'profile-font-size' => '15px',
1028
+ 'review-font-size' => '16px',
1029
+ 'rating-text' => '14px',
1030
+ 'company-font-size' => '16px',
1031
+ 'review-lines' => '5',
1032
+ 'box-background-color' => '#ffffff',
1033
+ 'box-border-color' => '#efefef',
1034
+ 'box-border-radius' => '10px',
1035
+ 'box-padding' => '25px',
1036
+ 'scroll' => 'true',
1037
+ 'scroll-color' => '#b4b4b4',
1038
+ 'arrow-color' => '#cccccc',
1039
+ 'float-widget-align' => 'left',
1040
+ 'nav' => 'false',
1041
+ 'dots' => 'true',
1042
+ 'hover-anim' => 'true',
1043
+ 'review-italic' => 'false',
1044
+ 'enable-font' => 'true',
1045
+ 'align-mini' => 'center',
1046
+ 'readmore' => 'true',
1047
+ 'popup-background' => '#ffffff',
1048
+ 'popup-company-color' => '#333333',
1049
+ 'popup-company-size' => '16px',
1050
+ 'popup-profile-color' => '#333333',
1051
+ 'popup-profile-size' => '15px',
1052
+ 'popup-review-color' => '#333333',
1053
+ 'popup-review-size' => '14px',
1054
+ 'popup-separator-color' => '#dedede',
1055
+ 'popup-separator-width' => '1px',
1056
+ 'box-shadow' => 'false',
1057
+ 'box-shadow-color' => '#000000',
1058
+ 'box-shadow-opacity' => '0.15',
1059
+ 'box-border-top-width' => '1px',
1060
+ 'box-border-bottom-width' => '4px',
1061
+ 'box-border-left-width' => '1px',
1062
+ 'box-border-right-width' => '4px',
1063
+ 'box-background-opacity' => '1',
1064
+ 'box-backdrop-blur' => '0px',
1065
+ 'highlight-color' => '#fbe049',
1066
+ 'highlight-size' => '19px',
1067
+ 'review-title' => 'normal',
1068
+ 'content-align' => 'center',
1069
+ 'text-align' => 'left',
1070
+ 'original-rating-text' => '14px',
1071
+ ),
1072
+ ),
1073
+ 'ligth-border-large' =>
1074
+ array (
1075
+ 'id' => 'ligth-border-large',
1076
+ 'name' => 'Light border - large',
1077
+ 'position' => 0,
1078
+ 'select-position' => 1,
1079
+ 'reviewer-photo' => true,
1080
+ 'verified-icon' => true,
1081
+ 'hide-logos' => true,
1082
+ 'hide-stars' => true,
1083
+ '_vars' =>
1084
+ array (
1085
+ 'style_id' => '"light-border-large"',
1086
+ 'bg-color' => '#ffffff',
1087
+ 'text-color' => '#000000',
1088
+ 'outside-text-color' => '#000000',
1089
+ 'profile-color' => '#000000',
1090
+ 'profile-font-size' => '15px',
1091
+ 'review-font-size' => '16px',
1092
+ 'rating-text' => '14px',
1093
+ 'company-font-size' => '16px',
1094
+ 'review-lines' => '5',
1095
+ 'box-background-color' => '#ffffff',
1096
+ 'box-border-color' => '#e2e2e2',
1097
+ 'box-border-radius' => '4px',
1098
+ 'box-padding' => '25px',
1099
+ 'scroll' => 'true',
1100
+ 'scroll-color' => '#cccccc',
1101
+ 'arrow-color' => '#cccccc',
1102
+ 'float-widget-align' => 'left',
1103
+ 'nav' => 'false',
1104
+ 'dots' => 'true',
1105
+ 'hover-anim' => 'true',
1106
+ 'review-italic' => 'false',
1107
+ 'enable-font' => 'true',
1108
+ 'align-mini' => 'center',
1109
+ 'readmore' => 'true',
1110
+ 'popup-background' => '#ffffff',
1111
+ 'popup-company-color' => '#333333',
1112
+ 'popup-company-size' => '16px',
1113
+ 'popup-profile-color' => '#333333',
1114
+ 'popup-profile-size' => '15px',
1115
+ 'popup-review-color' => '#333333',
1116
+ 'popup-review-size' => '14px',
1117
+ 'popup-separator-color' => '#dedede',
1118
+ 'popup-separator-width' => '1px',
1119
+ 'box-shadow' => 'false',
1120
+ 'box-shadow-color' => '#000000',
1121
+ 'box-shadow-opacity' => '0.15',
1122
+ 'box-border-top-width' => '1px',
1123
+ 'box-border-bottom-width' => '1px',
1124
+ 'box-border-left-width' => '1px',
1125
+ 'box-border-right-width' => '1px',
1126
+ 'box-background-opacity' => '1',
1127
+ 'box-backdrop-blur' => '0px',
1128
+ 'highlight-color' => '#fbe049',
1129
+ 'highlight-size' => '19px',
1130
+ 'review-title' => 'normal',
1131
+ 'content-align' => 'center',
1132
+ 'text-align' => 'left',
1133
+ 'original-rating-text' => '14px',
1134
+ ),
1135
+ ),
1136
+ 'ligth-border-large-red' =>
1137
+ array (
1138
+ 'id' => 'ligth-border-large-red',
1139
+ 'name' => 'Light border - large - red',
1140
+ 'position' => 0,
1141
+ 'select-position' => 1,
1142
+ 'reviewer-photo' => true,
1143
+ 'verified-icon' => true,
1144
+ 'hide-logos' => false,
1145
+ 'hide-stars' => false,
1146
+ '_vars' =>
1147
+ array (
1148
+ 'style_id' => '"light-border-large-red"',
1149
+ 'bg-color' => '#ffffff',
1150
+ 'text-color' => '#000000',
1151
+ 'outside-text-color' => '#000000',
1152
+ 'profile-color' => '#000000',
1153
+ 'profile-font-size' => '15px',
1154
+ 'review-font-size' => '16px',
1155
+ 'rating-text' => '14px',
1156
+ 'company-font-size' => '16px',
1157
+ 'review-lines' => '5',
1158
+ 'box-background-color' => '#ffffff',
1159
+ 'box-border-color' => '#d93623',
1160
+ 'box-border-radius' => '0px',
1161
+ 'box-padding' => '25px',
1162
+ 'scroll' => 'true',
1163
+ 'scroll-color' => '#8d8d8d',
1164
+ 'arrow-color' => '#8d8d8d',
1165
+ 'float-widget-align' => 'left',
1166
+ 'nav' => 'false',
1167
+ 'dots' => 'true',
1168
+ 'hover-anim' => 'true',
1169
+ 'review-italic' => 'false',
1170
+ 'enable-font' => 'true',
1171
+ 'align-mini' => 'center',
1172
+ 'readmore' => 'true',
1173
+ 'popup-background' => '#ffffff',
1174
+ 'popup-company-color' => '#333333',
1175
+ 'popup-company-size' => '16px',
1176
+ 'popup-profile-color' => '#333333',
1177
+ 'popup-profile-size' => '15px',
1178
+ 'popup-review-color' => '#333333',
1179
+ 'popup-review-size' => '14px',
1180
+ 'popup-separator-color' => '#dedede',
1181
+ 'popup-separator-width' => '1px',
1182
+ 'box-shadow' => 'false',
1183
+ 'box-shadow-color' => '#000000',
1184
+ 'box-shadow-opacity' => '0.15',
1185
+ 'box-border-top-width' => '3px',
1186
+ 'box-border-bottom-width' => '3px',
1187
+ 'box-border-left-width' => '3px',
1188
+ 'box-border-right-width' => '3px',
1189
+ 'box-background-opacity' => '1',
1190
+ 'box-backdrop-blur' => '0px',
1191
+ 'highlight-color' => '#fbe049',
1192
+ 'highlight-size' => '19px',
1193
+ 'review-title' => 'normal',
1194
+ 'content-align' => 'center',
1195
+ 'text-align' => 'left',
1196
+ 'original-rating-text' => '14px',
1197
+ ),
1198
+ ),
1199
+ 'drop-shadow' =>
1200
+ array (
1201
+ 'id' => 'drop-shadow',
1202
+ 'name' => 'Drop shadow',
1203
+ 'position' => 0,
1204
+ 'select-position' => 2,
1205
+ 'reviewer-photo' => true,
1206
+ 'verified-icon' => true,
1207
+ 'hide-logos' => false,
1208
+ 'hide-stars' => false,
1209
+ '_vars' =>
1210
+ array (
1211
+ 'style_id' => '"drop-shadow"',
1212
+ 'bg-color' => '#ffffff',
1213
+ 'text-color' => '#000000',
1214
+ 'outside-text-color' => '#000000',
1215
+ 'profile-color' => '#000000',
1216
+ 'profile-font-size' => '15px',
1217
+ 'review-font-size' => '14px',
1218
+ 'rating-text' => '14px',
1219
+ 'company-font-size' => '16px',
1220
+ 'review-lines' => '4',
1221
+ 'box-background-color' => '#ffffff',
1222
+ 'box-border-color' => '#ffffff',
1223
+ 'box-border-radius' => '5px',
1224
+ 'box-padding' => '15px',
1225
+ 'scroll' => 'true',
1226
+ 'scroll-color' => '#555555',
1227
+ 'arrow-color' => '#cccccc',
1228
+ 'float-widget-align' => 'right',
1229
+ 'nav' => 'true',
1230
+ 'dots' => 'mobile',
1231
+ 'hover-anim' => 'false',
1232
+ 'review-italic' => 'false',
1233
+ 'enable-font' => 'true',
1234
+ 'align-mini' => 'center',
1235
+ 'readmore' => 'true',
1236
+ 'popup-background' => '#ffffff',
1237
+ 'popup-company-color' => '#333333',
1238
+ 'popup-company-size' => '16px',
1239
+ 'popup-profile-color' => '#333333',
1240
+ 'popup-profile-size' => '15px',
1241
+ 'popup-review-color' => '#333333',
1242
+ 'popup-review-size' => '14px',
1243
+ 'popup-separator-color' => '#dedede',
1244
+ 'popup-separator-width' => '1px',
1245
+ 'box-shadow' => 'true',
1246
+ 'box-shadow-color' => '#000000',
1247
+ 'box-shadow-opacity' => '0.15',
1248
+ 'box-border-top-width' => '0px',
1249
+ 'box-border-bottom-width' => '0px',
1250
+ 'box-border-left-width' => '0px',
1251
+ 'box-border-right-width' => '0px',
1252
+ 'box-background-opacity' => '1',
1253
+ 'box-backdrop-blur' => '0px',
1254
+ 'highlight-color' => '#fbe049',
1255
+ 'highlight-size' => '19px',
1256
+ 'review-title' => 'normal',
1257
+ 'content-align' => 'center',
1258
+ 'text-align' => 'left',
1259
+ 'original-rating-text' => '14px',
1260
+ ),
1261
+ ),
1262
+ 'drop-shadow-large' =>
1263
+ array (
1264
+ 'id' => 'drop-shadow-large',
1265
+ 'name' => 'Drop shadow - large',
1266
+ 'position' => 0,
1267
+ 'select-position' => 2,
1268
+ 'reviewer-photo' => true,
1269
+ 'verified-icon' => true,
1270
+ 'hide-logos' => false,
1271
+ 'hide-stars' => false,
1272
+ '_vars' =>
1273
+ array (
1274
+ 'style_id' => '"drop-shadow-large"',
1275
+ 'bg-color' => '#ffffff',
1276
+ 'text-color' => '#000000',
1277
+ 'outside-text-color' => '#000000',
1278
+ 'profile-color' => '#444444',
1279
+ 'profile-font-size' => '15px',
1280
+ 'review-font-size' => '16px',
1281
+ 'rating-text' => '14px',
1282
+ 'company-font-size' => '16px',
1283
+ 'review-lines' => '5',
1284
+ 'box-background-color' => '#ffffff',
1285
+ 'box-border-color' => '#ffffff',
1286
+ 'box-border-radius' => '12px',
1287
+ 'box-padding' => '25px',
1288
+ 'scroll' => 'true',
1289
+ 'scroll-color' => '#939393',
1290
+ 'arrow-color' => '#cccccc',
1291
+ 'float-widget-align' => 'right',
1292
+ 'nav' => 'false',
1293
+ 'dots' => 'true',
1294
+ 'hover-anim' => 'true',
1295
+ 'review-italic' => 'false',
1296
+ 'enable-font' => 'true',
1297
+ 'align-mini' => 'center',
1298
+ 'readmore' => 'true',
1299
+ 'popup-background' => '#ffffff',
1300
+ 'popup-company-color' => '#333333',
1301
+ 'popup-company-size' => '16px',
1302
+ 'popup-profile-color' => '#333333',
1303
+ 'popup-profile-size' => '15px',
1304
+ 'popup-review-color' => '#333333',
1305
+ 'popup-review-size' => '14px',
1306
+ 'popup-separator-color' => '#dedede',
1307
+ 'popup-separator-width' => '1px',
1308
+ 'box-shadow' => 'true',
1309
+ 'box-shadow-color' => '#000000',
1310
+ 'box-shadow-opacity' => '0.1',
1311
+ 'box-border-top-width' => '0px',
1312
+ 'box-border-bottom-width' => '0px',
1313
+ 'box-border-left-width' => '0px',
1314
+ 'box-border-right-width' => '0px',
1315
+ 'box-background-opacity' => '1',
1316
+ 'box-backdrop-blur' => '0px',
1317
+ 'highlight-color' => '#fbe049',
1318
+ 'highlight-size' => '19px',
1319
+ 'review-title' => 'normal',
1320
+ 'content-align' => 'center',
1321
+ 'text-align' => 'left',
1322
+ 'original-rating-text' => '14px',
1323
+ ),
1324
+ ),
1325
+ 'light-minimal' =>
1326
+ array (
1327
+ 'id' => 'light-minimal',
1328
+ 'name' => 'Minimal',
1329
+ 'position' => 0,
1330
+ 'select-position' => 3,
1331
+ 'reviewer-photo' => true,
1332
+ 'verified-icon' => true,
1333
+ 'hide-logos' => false,
1334
+ 'hide-stars' => false,
1335
+ '_vars' =>
1336
+ array (
1337
+ 'style_id' => '"light-minimal"',
1338
+ 'bg-color' => '#ffffff',
1339
+ 'text-color' => '#000000',
1340
+ 'outside-text-color' => '#000000',
1341
+ 'profile-color' => '#000000',
1342
+ 'profile-font-size' => '15px',
1343
+ 'review-font-size' => '14px',
1344
+ 'rating-text' => '14px',
1345
+ 'company-font-size' => '16px',
1346
+ 'review-lines' => '4',
1347
+ 'box-background-color' => '#ffffff',
1348
+ 'box-border-color' => '#efefef',
1349
+ 'box-border-radius' => '0px',
1350
+ 'box-padding' => '15px',
1351
+ 'scroll' => 'true',
1352
+ 'scroll-color' => '#555555',
1353
+ 'arrow-color' => '#cccccc',
1354
+ 'float-widget-align' => 'right',
1355
+ 'nav' => 'true',
1356
+ 'dots' => 'mobile',
1357
+ 'hover-anim' => 'true',
1358
+ 'review-italic' => 'false',
1359
+ 'enable-font' => 'true',
1360
+ 'align-mini' => 'center',
1361
+ 'readmore' => 'true',
1362
+ 'popup-background' => '#ffffff',
1363
+ 'popup-company-color' => '#333333',
1364
+ 'popup-company-size' => '16px',
1365
+ 'popup-profile-color' => '#333333',
1366
+ 'popup-profile-size' => '15px',
1367
+ 'popup-review-color' => '#333333',
1368
+ 'popup-review-size' => '14px',
1369
+ 'popup-separator-color' => '#dedede',
1370
+ 'popup-separator-width' => '1px',
1371
+ 'box-shadow' => 'false',
1372
+ 'box-shadow-color' => '#000000',
1373
+ 'box-shadow-opacity' => '0.15',
1374
+ 'box-border-top-width' => '0px',
1375
+ 'box-border-bottom-width' => '1px',
1376
+ 'box-border-left-width' => '0px',
1377
+ 'box-border-right-width' => '0px',
1378
+ 'box-background-opacity' => '0',
1379
+ 'box-backdrop-blur' => '0px',
1380
+ 'highlight-color' => '#fbe049',
1381
+ 'highlight-size' => '19px',
1382
+ 'review-title' => 'normal',
1383
+ 'content-align' => 'center',
1384
+ 'text-align' => 'left',
1385
+ 'original-rating-text' => '14px',
1386
+ ),
1387
+ ),
1388
+ 'light-minimal-large' =>
1389
+ array (
1390
+ 'id' => 'light-minimal-large',
1391
+ 'name' => 'Minimal - large',
1392
+ 'position' => 0,
1393
+ 'select-position' => 3,
1394
+ 'reviewer-photo' => false,
1395
+ 'verified-icon' => false,
1396
+ 'hide-logos' => false,
1397
+ 'hide-stars' => false,
1398
+ '_vars' =>
1399
+ array (
1400
+ 'style_id' => '"light-minimal-large"',
1401
+ 'bg-color' => '#ffffff',
1402
+ 'text-color' => '#000000',
1403
+ 'outside-text-color' => '#000000',
1404
+ 'profile-color' => '#000000',
1405
+ 'profile-font-size' => '15px',
1406
+ 'review-font-size' => '16px',
1407
+ 'rating-text' => '14px',
1408
+ 'company-font-size' => '16px',
1409
+ 'review-lines' => '5',
1410
+ 'box-background-color' => '#ffffff',
1411
+ 'box-border-color' => '#ffffff',
1412
+ 'box-border-radius' => '0px',
1413
+ 'box-padding' => '20px',
1414
+ 'scroll' => 'false',
1415
+ 'scroll-color' => '#555555',
1416
+ 'arrow-color' => '#cccccc',
1417
+ 'float-widget-align' => 'right',
1418
+ 'nav' => 'false',
1419
+ 'dots' => 'true',
1420
+ 'hover-anim' => 'true',
1421
+ 'review-italic' => 'false',
1422
+ 'enable-font' => 'true',
1423
+ 'align-mini' => 'center',
1424
+ 'readmore' => 'true',
1425
+ 'popup-background' => '#ffffff',
1426
+ 'popup-company-color' => '#333333',
1427
+ 'popup-company-size' => '16px',
1428
+ 'popup-profile-color' => '#333333',
1429
+ 'popup-profile-size' => '15px',
1430
+ 'popup-review-color' => '#333333',
1431
+ 'popup-review-size' => '14px',
1432
+ 'popup-separator-color' => '#dedede',
1433
+ 'popup-separator-width' => '1px',
1434
+ 'box-shadow' => 'false',
1435
+ 'box-shadow-color' => '#000000',
1436
+ 'box-shadow-opacity' => '0.15',
1437
+ 'box-border-top-width' => '0px',
1438
+ 'box-border-bottom-width' => '0px',
1439
+ 'box-border-left-width' => '0px',
1440
+ 'box-border-right-width' => '0px',
1441
+ 'box-background-opacity' => '0',
1442
+ 'box-backdrop-blur' => '0px',
1443
+ 'highlight-color' => '#fbe049',
1444
+ 'highlight-size' => '19px',
1445
+ 'review-title' => 'normal',
1446
+ 'content-align' => 'center',
1447
+ 'text-align' => 'left',
1448
+ 'original-rating-text' => '14px',
1449
+ ),
1450
+ ),
1451
+ 'soft' =>
1452
+ array (
1453
+ 'id' => 'soft',
1454
+ 'name' => 'Soft',
1455
+ 'position' => 1,
1456
+ 'select-position' => 4,
1457
+ 'reviewer-photo' => true,
1458
+ 'verified-icon' => true,
1459
+ 'hide-logos' => false,
1460
+ 'hide-stars' => false,
1461
+ '_vars' =>
1462
+ array (
1463
+ 'style_id' => '"soft"',
1464
+ 'bg-color' => '#e4e4e4',
1465
+ 'text-color' => '#000000',
1466
+ 'outside-text-color' => '#000000',
1467
+ 'profile-color' => '#000000',
1468
+ 'profile-font-size' => '15px',
1469
+ 'review-font-size' => '14px',
1470
+ 'rating-text' => '14px',
1471
+ 'company-font-size' => '16px',
1472
+ 'review-lines' => '4',
1473
+ 'box-background-color' => '#ffffff',
1474
+ 'box-border-color' => '#ffffff',
1475
+ 'box-border-radius' => '4px',
1476
+ 'box-padding' => '15px',
1477
+ 'scroll' => 'true',
1478
+ 'scroll-color' => '#555555',
1479
+ 'arrow-color' => '#b7b7b7',
1480
+ 'float-widget-align' => 'left',
1481
+ 'nav' => 'true',
1482
+ 'dots' => 'mobile',
1483
+ 'hover-anim' => 'true',
1484
+ 'review-italic' => 'false',
1485
+ 'enable-font' => 'true',
1486
+ 'align-mini' => 'center',
1487
+ 'readmore' => 'true',
1488
+ 'popup-background' => '#ffffff',
1489
+ 'popup-company-color' => '#333333',
1490
+ 'popup-company-size' => '16px',
1491
+ 'popup-profile-color' => '#333333',
1492
+ 'popup-profile-size' => '15px',
1493
+ 'popup-review-color' => '#333333',
1494
+ 'popup-review-size' => '14px',
1495
+ 'popup-separator-color' => '#dedede',
1496
+ 'popup-separator-width' => '1px',
1497
+ 'box-shadow' => 'false',
1498
+ 'box-shadow-color' => '#000000',
1499
+ 'box-shadow-opacity' => '0.15',
1500
+ 'box-border-top-width' => '2px',
1501
+ 'box-border-bottom-width' => '2px',
1502
+ 'box-border-left-width' => '2px',
1503
+ 'box-border-right-width' => '2px',
1504
+ 'box-background-opacity' => '1',
1505
+ 'box-backdrop-blur' => '0px',
1506
+ 'highlight-color' => '#fbe049',
1507
+ 'highlight-size' => '19px',
1508
+ 'review-title' => 'normal',
1509
+ 'content-align' => 'center',
1510
+ 'text-align' => 'left',
1511
+ 'original-rating-text' => '14px',
1512
+ ),
1513
+ ),
1514
+ 'light-clean' =>
1515
+ array (
1516
+ 'id' => 'light-clean',
1517
+ 'name' => 'Light clean',
1518
+ 'position' => 0,
1519
+ 'select-position' => 5,
1520
+ 'reviewer-photo' => true,
1521
+ 'verified-icon' => true,
1522
+ 'hide-logos' => false,
1523
+ 'hide-stars' => false,
1524
+ '_vars' =>
1525
+ array (
1526
+ 'style_id' => '"light-clean"',
1527
+ 'bg-color' => '#ffffff',
1528
+ 'text-color' => '#000000',
1529
+ 'outside-text-color' => '#000000',
1530
+ 'profile-color' => '#000000',
1531
+ 'profile-font-size' => '14px',
1532
+ 'review-font-size' => '13px',
1533
+ 'rating-text' => '14px',
1534
+ 'company-font-size' => '15px',
1535
+ 'review-lines' => '4',
1536
+ 'box-background-color' => '#ffffff',
1537
+ 'box-border-color' => '#dddddd',
1538
+ 'box-border-radius' => '0px',
1539
+ 'box-padding' => '15px',
1540
+ 'scroll' => 'true',
1541
+ 'scroll-color' => '#555555',
1542
+ 'arrow-color' => '#cccccc',
1543
+ 'float-widget-align' => 'right',
1544
+ 'nav' => 'true',
1545
+ 'dots' => 'mobile',
1546
+ 'hover-anim' => 'true',
1547
+ 'review-italic' => 'false',
1548
+ 'enable-font' => 'true',
1549
+ 'align-mini' => 'center',
1550
+ 'readmore' => 'true',
1551
+ 'popup-background' => '#ffffff',
1552
+ 'popup-company-color' => '#333333',
1553
+ 'popup-company-size' => '16px',
1554
+ 'popup-profile-color' => '#333333',
1555
+ 'popup-profile-size' => '15px',
1556
+ 'popup-review-color' => '#333333',
1557
+ 'popup-review-size' => '14px',
1558
+ 'popup-separator-color' => '#dedede',
1559
+ 'popup-separator-width' => '1px',
1560
+ 'box-shadow' => 'false',
1561
+ 'box-shadow-color' => '#000000',
1562
+ 'box-shadow-opacity' => '0.15',
1563
+ 'box-border-top-width' => '1px',
1564
+ 'box-border-bottom-width' => '1px',
1565
+ 'box-border-left-width' => '1px',
1566
+ 'box-border-right-width' => '1px',
1567
+ 'box-background-opacity' => '1',
1568
+ 'box-backdrop-blur' => '0px',
1569
+ 'highlight-color' => '#fbe049',
1570
+ 'highlight-size' => '19px',
1571
+ 'review-title' => 'normal',
1572
+ 'content-align' => 'center',
1573
+ 'text-align' => 'left',
1574
+ 'original-rating-text' => '14px',
1575
+ ),
1576
+ ),
1577
+ 'light-square' =>
1578
+ array (
1579
+ 'id' => 'light-square',
1580
+ 'name' => 'Clean dark',
1581
+ 'position' => 0,
1582
+ 'select-position' => 6,
1583
+ 'reviewer-photo' => true,
1584
+ 'verified-icon' => true,
1585
+ 'hide-logos' => false,
1586
+ 'hide-stars' => false,
1587
+ '_vars' =>
1588
+ array (
1589
+ 'style_id' => '"light-square"',
1590
+ 'bg-color' => '#ffffff',
1591
+ 'text-color' => '#000000',
1592
+ 'outside-text-color' => '#000000',
1593
+ 'profile-color' => '#000000',
1594
+ 'profile-font-size' => '14px',
1595
+ 'review-font-size' => '14px',
1596
+ 'rating-text' => '14px',
1597
+ 'company-font-size' => '15px',
1598
+ 'review-lines' => '4',
1599
+ 'box-background-color' => '#f3f3f3',
1600
+ 'box-border-color' => '#dddddd',
1601
+ 'box-border-radius' => '0px',
1602
+ 'box-padding' => '15px',
1603
+ 'scroll' => 'true',
1604
+ 'scroll-color' => '#555555',
1605
+ 'arrow-color' => '#cccccc',
1606
+ 'float-widget-align' => 'right',
1607
+ 'nav' => 'true',
1608
+ 'dots' => 'mobile',
1609
+ 'hover-anim' => 'true',
1610
+ 'review-italic' => 'false',
1611
+ 'enable-font' => 'true',
1612
+ 'align-mini' => 'center',
1613
+ 'readmore' => 'true',
1614
+ 'popup-background' => '#ffffff',
1615
+ 'popup-company-color' => '#333333',
1616
+ 'popup-company-size' => '16px',
1617
+ 'popup-profile-color' => '#333333',
1618
+ 'popup-profile-size' => '15px',
1619
+ 'popup-review-color' => '#333333',
1620
+ 'popup-review-size' => '14px',
1621
+ 'popup-separator-color' => '#dedede',
1622
+ 'popup-separator-width' => '1px',
1623
+ 'box-shadow' => 'false',
1624
+ 'box-shadow-color' => '#000000',
1625
+ 'box-shadow-opacity' => '0.15',
1626
+ 'box-border-top-width' => '0px',
1627
+ 'box-border-bottom-width' => '3px',
1628
+ 'box-border-left-width' => '0px',
1629
+ 'box-border-right-width' => '0px',
1630
+ 'box-background-opacity' => '1',
1631
+ 'box-backdrop-blur' => '0px',
1632
+ 'highlight-color' => '#fbe049',
1633
+ 'highlight-size' => '19px',
1634
+ 'review-title' => 'normal',
1635
+ 'content-align' => 'center',
1636
+ 'text-align' => 'left',
1637
+ 'original-rating-text' => '14px',
1638
+ ),
1639
+ ),
1640
+ 'light-background-border' =>
1641
+ array (
1642
+ 'id' => 'light-background-border',
1643
+ 'name' => 'Light background border',
1644
+ 'position' => 0,
1645
+ 'select-position' => 7,
1646
+ 'reviewer-photo' => true,
1647
+ 'verified-icon' => true,
1648
+ 'hide-logos' => false,
1649
+ 'hide-stars' => false,
1650
+ '_vars' =>
1651
+ array (
1652
+ 'style_id' => '"light-background-border"',
1653
+ 'bg-color' => '#ffffff',
1654
+ 'text-color' => '#000000',
1655
+ 'outside-text-color' => '#000000',
1656
+ 'profile-color' => '#000000',
1657
+ 'profile-font-size' => '15px',
1658
+ 'review-font-size' => '14px',
1659
+ 'rating-text' => '14px',
1660
+ 'company-font-size' => '16px',
1661
+ 'review-lines' => '4',
1662
+ 'box-background-color' => '#efefef',
1663
+ 'box-border-color' => '#cccccc',
1664
+ 'box-border-radius' => '4px',
1665
+ 'box-padding' => '15px',
1666
+ 'scroll' => 'true',
1667
+ 'scroll-color' => '#555555',
1668
+ 'arrow-color' => '#cccccc',
1669
+ 'float-widget-align' => 'left',
1670
+ 'nav' => 'true',
1671
+ 'dots' => 'mobile',
1672
+ 'hover-anim' => 'true',
1673
+ 'review-italic' => 'false',
1674
+ 'enable-font' => 'true',
1675
+ 'align-mini' => 'center',
1676
+ 'readmore' => 'true',
1677
+ 'popup-background' => '#ffffff',
1678
+ 'popup-company-color' => '#333333',
1679
+ 'popup-company-size' => '16px',
1680
+ 'popup-profile-color' => '#333333',
1681
+ 'popup-profile-size' => '15px',
1682
+ 'popup-review-color' => '#333333',
1683
+ 'popup-review-size' => '14px',
1684
+ 'popup-separator-color' => '#dedede',
1685
+ 'popup-separator-width' => '1px',
1686
+ 'box-shadow' => 'false',
1687
+ 'box-shadow-color' => '#000000',
1688
+ 'box-shadow-opacity' => '0.15',
1689
+ 'box-border-top-width' => '2px',
1690
+ 'box-border-bottom-width' => '2px',
1691
+ 'box-border-left-width' => '2px',
1692
+ 'box-border-right-width' => '2px',
1693
+ 'box-background-opacity' => '1',
1694
+ 'box-backdrop-blur' => '0px',
1695
+ 'highlight-color' => '#fbe049',
1696
+ 'highlight-size' => '19px',
1697
+ 'review-title' => 'normal',
1698
+ 'content-align' => 'center',
1699
+ 'text-align' => 'left',
1700
+ 'original-rating-text' => '14px',
1701
+ ),
1702
+ ),
1703
+ 'blue' =>
1704
+ array (
1705
+ 'id' => 'blue',
1706
+ 'name' => 'Blue',
1707
+ 'position' => 0,
1708
+ 'select-position' => 8,
1709
+ 'reviewer-photo' => true,
1710
+ 'verified-icon' => true,
1711
+ 'hide-logos' => false,
1712
+ 'hide-stars' => false,
1713
+ '_vars' =>
1714
+ array (
1715
+ 'style_id' => '"blue"',
1716
+ 'bg-color' => '#ffffff',
1717
+ 'text-color' => '#000000',
1718
+ 'outside-text-color' => '#000000',
1719
+ 'profile-color' => '#365899',
1720
+ 'profile-font-size' => '14px',
1721
+ 'review-font-size' => '14px',
1722
+ 'rating-text' => '14px',
1723
+ 'company-font-size' => '15px',
1724
+ 'review-lines' => '4',
1725
+ 'box-background-color' => '#ffffff',
1726
+ 'box-border-color' => '#dddfe2',
1727
+ 'box-border-radius' => '4px',
1728
+ 'box-padding' => '15px',
1729
+ 'scroll' => 'true',
1730
+ 'scroll-color' => '#555555',
1731
+ 'arrow-color' => '#cccccc',
1732
+ 'float-widget-align' => 'left',
1733
+ 'nav' => 'true',
1734
+ 'dots' => 'mobile',
1735
+ 'hover-anim' => 'true',
1736
+ 'review-italic' => 'false',
1737
+ 'enable-font' => 'true',
1738
+ 'align-mini' => 'center',
1739
+ 'readmore' => 'true',
1740
+ 'popup-background' => '#ffffff',
1741
+ 'popup-company-color' => '#333333',
1742
+ 'popup-company-size' => '16px',
1743
+ 'popup-profile-color' => '#333333',
1744
+ 'popup-profile-size' => '15px',
1745
+ 'popup-review-color' => '#333333',
1746
+ 'popup-review-size' => '14px',
1747
+ 'popup-separator-color' => '#dedede',
1748
+ 'popup-separator-width' => '1px',
1749
+ 'box-shadow' => 'false',
1750
+ 'box-shadow-color' => '#000000',
1751
+ 'box-shadow-opacity' => '0.15',
1752
+ 'box-border-top-width' => '1px',
1753
+ 'box-border-bottom-width' => '1px',
1754
+ 'box-border-left-width' => '1px',
1755
+ 'box-border-right-width' => '1px',
1756
+ 'box-background-opacity' => '1',
1757
+ 'box-backdrop-blur' => '0px',
1758
+ 'highlight-color' => '#fbe049',
1759
+ 'highlight-size' => '19px',
1760
+ 'review-title' => 'normal',
1761
+ 'content-align' => 'center',
1762
+ 'text-align' => 'left',
1763
+ 'original-rating-text' => '14px',
1764
+ ),
1765
+ ),
1766
+ 'light-background-large-purple' =>
1767
+ array (
1768
+ 'id' => 'light-background-large-purple',
1769
+ 'name' => 'Light background - large - purple',
1770
+ 'position' => 0,
1771
+ 'select-position' => 9,
1772
+ 'reviewer-photo' => true,
1773
+ 'verified-icon' => false,
1774
+ 'hide-logos' => false,
1775
+ 'hide-stars' => false,
1776
+ '_vars' =>
1777
+ array (
1778
+ 'style_id' => '"light-background-large-purple"',
1779
+ 'bg-color' => '#ffffff',
1780
+ 'text-color' => '#593072',
1781
+ 'outside-text-color' => '#593072',
1782
+ 'profile-color' => '#593072',
1783
+ 'profile-font-size' => '15px',
1784
+ 'review-font-size' => '16px',
1785
+ 'rating-text' => '14px',
1786
+ 'company-font-size' => '16px',
1787
+ 'review-lines' => '5',
1788
+ 'box-background-color' => '#f6f1f9',
1789
+ 'box-border-color' => '#fbf9fc',
1790
+ 'box-border-radius' => '15px',
1791
+ 'box-padding' => '25px',
1792
+ 'scroll' => 'true',
1793
+ 'scroll-color' => '#593072',
1794
+ 'arrow-color' => '#593072',
1795
+ 'float-widget-align' => 'left',
1796
+ 'nav' => 'false',
1797
+ 'dots' => 'true',
1798
+ 'hover-anim' => 'true',
1799
+ 'review-italic' => 'false',
1800
+ 'enable-font' => 'true',
1801
+ 'align-mini' => 'center',
1802
+ 'readmore' => 'true',
1803
+ 'popup-background' => '#ffffff',
1804
+ 'popup-company-color' => '#333333',
1805
+ 'popup-company-size' => '16px',
1806
+ 'popup-profile-color' => '#333333',
1807
+ 'popup-profile-size' => '15px',
1808
+ 'popup-review-color' => '#333333',
1809
+ 'popup-review-size' => '14px',
1810
+ 'popup-separator-color' => '#dedede',
1811
+ 'popup-separator-width' => '1px',
1812
+ 'box-shadow' => 'false',
1813
+ 'box-shadow-color' => '#000000',
1814
+ 'box-shadow-opacity' => '0.15',
1815
+ 'box-border-top-width' => '5px',
1816
+ 'box-border-bottom-width' => '5px',
1817
+ 'box-border-left-width' => '5px',
1818
+ 'box-border-right-width' => '5px',
1819
+ 'box-background-opacity' => '1',
1820
+ 'box-backdrop-blur' => '0px',
1821
+ 'highlight-color' => '#fbe049',
1822
+ 'highlight-size' => '19px',
1823
+ 'review-title' => 'normal',
1824
+ 'content-align' => 'center',
1825
+ 'text-align' => 'left',
1826
+ 'original-rating-text' => '14px',
1827
+ ),
1828
+ ),
1829
+ 'light-background-image' =>
1830
+ array (
1831
+ 'id' => 'light-background-image',
1832
+ 'name' => 'Light background image',
1833
+ 'position' => 0,
1834
+ 'select-position' => 9,
1835
+ 'reviewer-photo' => true,
1836
+ 'verified-icon' => true,
1837
+ 'hide-logos' => false,
1838
+ 'hide-stars' => false,
1839
+ '_vars' =>
1840
+ array (
1841
+ 'style_id' => '"light-background-image"',
1842
+ 'bg-color' => '#ffffff',
1843
+ 'text-color' => '#000000',
1844
+ 'outside-text-color' => '#000000',
1845
+ 'profile-color' => '#000000',
1846
+ 'profile-font-size' => '14px',
1847
+ 'review-font-size' => '14px',
1848
+ 'rating-text' => '15px',
1849
+ 'company-font-size' => '18px',
1850
+ 'review-lines' => '4',
1851
+ 'box-background-color' => '#ffffff',
1852
+ 'box-border-color' => '#ffffff',
1853
+ 'box-border-radius' => '8px',
1854
+ 'box-padding' => '15px',
1855
+ 'scroll' => 'true',
1856
+ 'scroll-color' => '#555555',
1857
+ 'arrow-color' => '#999999',
1858
+ 'float-widget-align' => 'right',
1859
+ 'nav' => 'true',
1860
+ 'dots' => 'mobile',
1861
+ 'hover-anim' => 'false',
1862
+ 'review-italic' => 'false',
1863
+ 'enable-font' => 'true',
1864
+ 'align-mini' => 'center',
1865
+ 'readmore' => 'true',
1866
+ 'popup-background' => '#ffffff',
1867
+ 'popup-company-color' => '#333333',
1868
+ 'popup-company-size' => '16px',
1869
+ 'popup-profile-color' => '#333333',
1870
+ 'popup-profile-size' => '15px',
1871
+ 'popup-review-color' => '#333333',
1872
+ 'popup-review-size' => '14px',
1873
+ 'popup-separator-color' => '#dedede',
1874
+ 'popup-separator-width' => '1px',
1875
+ 'box-shadow' => 'true',
1876
+ 'box-shadow-color' => '#000000',
1877
+ 'box-shadow-opacity' => '0.05',
1878
+ 'box-border-top-width' => '0px',
1879
+ 'box-border-bottom-width' => '0px',
1880
+ 'box-border-left-width' => '0px',
1881
+ 'box-border-right-width' => '0px',
1882
+ 'box-background-opacity' => '0.3',
1883
+ 'box-backdrop-blur' => '5px',
1884
+ 'highlight-color' => '#fbe049',
1885
+ 'highlight-size' => '19px',
1886
+ 'review-title' => 'normal',
1887
+ 'content-align' => 'center',
1888
+ 'text-align' => 'left',
1889
+ 'original-rating-text' => '15px',
1890
+ ),
1891
+ ),
1892
+ 'light-contrast' =>
1893
+ array (
1894
+ 'id' => 'light-contrast',
1895
+ 'name' => 'Light contrast',
1896
+ 'position' => 0,
1897
+ 'select-position' => 10,
1898
+ 'reviewer-photo' => true,
1899
+ 'verified-icon' => true,
1900
+ 'hide-logos' => false,
1901
+ 'hide-stars' => false,
1902
+ '_vars' =>
1903
+ array (
1904
+ 'style_id' => '"light-contrast"',
1905
+ 'bg-color' => '#ffffff',
1906
+ 'text-color' => '#ffffff',
1907
+ 'outside-text-color' => '#000000',
1908
+ 'profile-color' => '#ffffff',
1909
+ 'profile-font-size' => '15px',
1910
+ 'review-font-size' => '14px',
1911
+ 'rating-text' => '14px',
1912
+ 'company-font-size' => '16px',
1913
+ 'review-lines' => '4',
1914
+ 'box-background-color' => '#222222',
1915
+ 'box-border-color' => '#222222',
1916
+ 'box-border-radius' => '4px',
1917
+ 'box-padding' => '15px',
1918
+ 'scroll' => 'true',
1919
+ 'scroll-color' => '#555555',
1920
+ 'arrow-color' => '#555555',
1921
+ 'float-widget-align' => 'left',
1922
+ 'nav' => 'true',
1923
+ 'dots' => 'mobile',
1924
+ 'hover-anim' => 'true',
1925
+ 'review-italic' => 'false',
1926
+ 'enable-font' => 'true',
1927
+ 'align-mini' => 'center',
1928
+ 'readmore' => 'true',
1929
+ 'popup-background' => '#ffffff',
1930
+ 'popup-company-color' => '#333333',
1931
+ 'popup-company-size' => '16px',
1932
+ 'popup-profile-color' => '#333333',
1933
+ 'popup-profile-size' => '15px',
1934
+ 'popup-review-color' => '#333333',
1935
+ 'popup-review-size' => '14px',
1936
+ 'popup-separator-color' => '#dedede',
1937
+ 'popup-separator-width' => '1px',
1938
+ 'box-shadow' => 'false',
1939
+ 'box-shadow-color' => '#000000',
1940
+ 'box-shadow-opacity' => '0.15',
1941
+ 'box-border-top-width' => '2px',
1942
+ 'box-border-bottom-width' => '2px',
1943
+ 'box-border-left-width' => '2px',
1944
+ 'box-border-right-width' => '2px',
1945
+ 'box-background-opacity' => '1',
1946
+ 'box-backdrop-blur' => '0px',
1947
+ 'highlight-color' => '#fbe049',
1948
+ 'highlight-size' => '19px',
1949
+ 'review-title' => 'normal',
1950
+ 'content-align' => 'center',
1951
+ 'text-align' => 'left',
1952
+ 'original-rating-text' => '14px',
1953
+ ),
1954
+ ),
1955
+ 'light-contrast-large' =>
1956
+ array (
1957
+ 'id' => 'light-contrast-large',
1958
+ 'name' => 'Light contrast - large',
1959
+ 'position' => 0,
1960
+ 'select-position' => 10,
1961
+ 'reviewer-photo' => false,
1962
+ 'verified-icon' => false,
1963
+ 'hide-logos' => true,
1964
+ 'hide-stars' => true,
1965
+ '_vars' =>
1966
+ array (
1967
+ 'style_id' => '"light-contrast-large"',
1968
+ 'bg-color' => '#ffffff',
1969
+ 'text-color' => '#ffffff',
1970
+ 'outside-text-color' => '#252c44',
1971
+ 'profile-color' => '#ffffff',
1972
+ 'profile-font-size' => '15px',
1973
+ 'review-font-size' => '16px',
1974
+ 'rating-text' => '14px',
1975
+ 'company-font-size' => '16px',
1976
+ 'review-lines' => '5',
1977
+ 'box-background-color' => '#252c44',
1978
+ 'box-border-color' => '#252c44',
1979
+ 'box-border-radius' => '0px',
1980
+ 'box-padding' => '25px',
1981
+ 'scroll' => 'true',
1982
+ 'scroll-color' => '#ffffff',
1983
+ 'arrow-color' => '#252c44',
1984
+ 'float-widget-align' => 'left',
1985
+ 'nav' => 'false',
1986
+ 'dots' => 'true',
1987
+ 'hover-anim' => 'true',
1988
+ 'review-italic' => 'false',
1989
+ 'enable-font' => 'true',
1990
+ 'align-mini' => 'center',
1991
+ 'readmore' => 'true',
1992
+ 'popup-background' => '#ffffff',
1993
+ 'popup-company-color' => '#333333',
1994
+ 'popup-company-size' => '16px',
1995
+ 'popup-profile-color' => '#333333',
1996
+ 'popup-profile-size' => '15px',
1997
+ 'popup-review-color' => '#333333',
1998
+ 'popup-review-size' => '14px',
1999
+ 'popup-separator-color' => '#dedede',
2000
+ 'popup-separator-width' => '1px',
2001
+ 'box-shadow' => 'true',
2002
+ 'box-shadow-color' => '#252c44',
2003
+ 'box-shadow-opacity' => '0.45',
2004
+ 'box-border-top-width' => '0px',
2005
+ 'box-border-bottom-width' => '0px',
2006
+ 'box-border-left-width' => '0px',
2007
+ 'box-border-right-width' => '0px',
2008
+ 'box-background-opacity' => '1',
2009
+ 'box-backdrop-blur' => '0px',
2010
+ 'highlight-color' => '#fbe049',
2011
+ 'highlight-size' => '19px',
2012
+ 'review-title' => 'normal',
2013
+ 'content-align' => 'center',
2014
+ 'text-align' => 'left',
2015
+ 'original-rating-text' => '14px',
2016
+ ),
2017
+ ),
2018
+ 'light-contrast-large-blue' =>
2019
+ array (
2020
+ 'id' => 'light-contrast-large-blue',
2021
+ 'name' => 'Light contrast - large - blue',
2022
+ 'position' => 0,
2023
+ 'select-position' => 10,
2024
+ 'reviewer-photo' => true,
2025
+ 'verified-icon' => false,
2026
+ 'hide-logos' => false,
2027
+ 'hide-stars' => false,
2028
+ '_vars' =>
2029
+ array (
2030
+ 'style_id' => '"light-contrast-large-blue"',
2031
+ 'bg-color' => '#ffffff',
2032
+ 'text-color' => '#ffffff',
2033
+ 'outside-text-color' => '#252c44',
2034
+ 'profile-color' => '#ffffff',
2035
+ 'profile-font-size' => '15px',
2036
+ 'review-font-size' => '16px',
2037
+ 'rating-text' => '14px',
2038
+ 'company-font-size' => '16px',
2039
+ 'review-lines' => '5',
2040
+ 'box-background-color' => '#242f62',
2041
+ 'box-border-color' => '#2aa8d7',
2042
+ 'box-border-radius' => '0px',
2043
+ 'box-padding' => '25px',
2044
+ 'scroll' => 'true',
2045
+ 'scroll-color' => '#ffffff',
2046
+ 'arrow-color' => '#242f62',
2047
+ 'float-widget-align' => 'left',
2048
+ 'nav' => 'false',
2049
+ 'dots' => 'true',
2050
+ 'hover-anim' => 'true',
2051
+ 'review-italic' => 'false',
2052
+ 'enable-font' => 'true',
2053
+ 'align-mini' => 'center',
2054
+ 'readmore' => 'true',
2055
+ 'popup-background' => '#ffffff',
2056
+ 'popup-company-color' => '#333333',
2057
+ 'popup-company-size' => '16px',
2058
+ 'popup-profile-color' => '#333333',
2059
+ 'popup-profile-size' => '15px',
2060
+ 'popup-review-color' => '#333333',
2061
+ 'popup-review-size' => '14px',
2062
+ 'popup-separator-color' => '#dedede',
2063
+ 'popup-separator-width' => '1px',
2064
+ 'box-shadow' => 'false',
2065
+ 'box-shadow-color' => '#252c44',
2066
+ 'box-shadow-opacity' => '0.45',
2067
+ 'box-border-top-width' => '0px',
2068
+ 'box-border-bottom-width' => '0px',
2069
+ 'box-border-left-width' => '10px',
2070
+ 'box-border-right-width' => '0px',
2071
+ 'box-background-opacity' => '1',
2072
+ 'box-backdrop-blur' => '0px',
2073
+ 'highlight-color' => '#fbe049',
2074
+ 'highlight-size' => '19px',
2075
+ 'review-title' => 'normal',
2076
+ 'content-align' => 'center',
2077
+ 'text-align' => 'left',
2078
+ 'original-rating-text' => '14px',
2079
+ ),
2080
+ ),
2081
+ 'dark-background' =>
2082
+ array (
2083
+ 'id' => 'dark-background',
2084
+ 'name' => 'Dark background',
2085
+ 'position' => 1,
2086
+ 'select-position' => 11,
2087
+ 'reviewer-photo' => true,
2088
+ 'verified-icon' => true,
2089
+ 'hide-logos' => false,
2090
+ 'hide-stars' => false,
2091
+ '_vars' =>
2092
+ array (
2093
+ 'style_id' => '"dark-background"',
2094
+ 'bg-color' => '#222222',
2095
+ 'text-color' => '#ffffff',
2096
+ 'outside-text-color' => '#ffffff',
2097
+ 'profile-color' => '#ffffff',
2098
+ 'profile-font-size' => '15px',
2099
+ 'review-font-size' => '14px',
2100
+ 'rating-text' => '14px',
2101
+ 'company-font-size' => '16px',
2102
+ 'review-lines' => '4',
2103
+ 'box-background-color' => '#303030',
2104
+ 'box-border-color' => '#303030',
2105
+ 'box-border-radius' => '4px',
2106
+ 'box-padding' => '15px',
2107
+ 'scroll' => 'true',
2108
+ 'scroll-color' => '#555555',
2109
+ 'arrow-color' => '#666666',
2110
+ 'float-widget-align' => 'left',
2111
+ 'nav' => 'true',
2112
+ 'dots' => 'mobile',
2113
+ 'hover-anim' => 'true',
2114
+ 'review-italic' => 'false',
2115
+ 'enable-font' => 'true',
2116
+ 'align-mini' => 'center',
2117
+ 'readmore' => 'true',
2118
+ 'popup-background' => '#ffffff',
2119
+ 'popup-company-color' => '#333333',
2120
+ 'popup-company-size' => '16px',
2121
+ 'popup-profile-color' => '#333333',
2122
+ 'popup-profile-size' => '15px',
2123
+ 'popup-review-color' => '#333333',
2124
+ 'popup-review-size' => '14px',
2125
+ 'popup-separator-color' => '#dedede',
2126
+ 'popup-separator-width' => '1px',
2127
+ 'box-shadow' => 'false',
2128
+ 'box-shadow-color' => '#000000',
2129
+ 'box-shadow-opacity' => '0.15',
2130
+ 'box-border-top-width' => '2px',
2131
+ 'box-border-bottom-width' => '2px',
2132
+ 'box-border-left-width' => '2px',
2133
+ 'box-border-right-width' => '2px',
2134
+ 'box-background-opacity' => '1',
2135
+ 'box-backdrop-blur' => '0px',
2136
+ 'highlight-color' => '#fbe049',
2137
+ 'highlight-size' => '19px',
2138
+ 'review-title' => 'normal',
2139
+ 'content-align' => 'center',
2140
+ 'text-align' => 'left',
2141
+ 'original-rating-text' => '14px',
2142
+ ),
2143
+ ),
2144
+ 'dark-minimal' =>
2145
+ array (
2146
+ 'id' => 'dark-minimal',
2147
+ 'name' => 'Minimal dark',
2148
+ 'position' => 0,
2149
+ 'select-position' => 11,
2150
+ 'reviewer-photo' => true,
2151
+ 'verified-icon' => true,
2152
+ 'hide-logos' => false,
2153
+ 'hide-stars' => false,
2154
+ '_vars' =>
2155
+ array (
2156
+ 'style_id' => '"dark-minimal"',
2157
+ 'bg-color' => '#000000',
2158
+ 'text-color' => '#ffffff',
2159
+ 'outside-text-color' => '#ffffff',
2160
+ 'profile-color' => '#ffffff',
2161
+ 'profile-font-size' => '15px',
2162
+ 'review-font-size' => '14px',
2163
+ 'rating-text' => '14px',
2164
+ 'company-font-size' => '16px',
2165
+ 'review-lines' => '4',
2166
+ 'box-background-color' => '#ffffff',
2167
+ 'box-border-color' => '#444444',
2168
+ 'box-border-radius' => '0px',
2169
+ 'box-padding' => '15px',
2170
+ 'scroll' => 'true',
2171
+ 'scroll-color' => '#555555',
2172
+ 'arrow-color' => '#cccccc',
2173
+ 'float-widget-align' => 'right',
2174
+ 'nav' => 'true',
2175
+ 'dots' => 'mobile',
2176
+ 'hover-anim' => 'true',
2177
+ 'review-italic' => 'false',
2178
+ 'enable-font' => 'true',
2179
+ 'align-mini' => 'center',
2180
+ 'readmore' => 'true',
2181
+ 'popup-background' => '#ffffff',
2182
+ 'popup-company-color' => '#333333',
2183
+ 'popup-company-size' => '16px',
2184
+ 'popup-profile-color' => '#333333',
2185
+ 'popup-profile-size' => '15px',
2186
+ 'popup-review-color' => '#333333',
2187
+ 'popup-review-size' => '14px',
2188
+ 'popup-separator-color' => '#dedede',
2189
+ 'popup-separator-width' => '1px',
2190
+ 'box-shadow' => 'false',
2191
+ 'box-shadow-color' => '#000000',
2192
+ 'box-shadow-opacity' => '0.15',
2193
+ 'box-border-top-width' => '0px',
2194
+ 'box-border-bottom-width' => '1px',
2195
+ 'box-border-left-width' => '0px',
2196
+ 'box-border-right-width' => '0px',
2197
+ 'box-background-opacity' => '0',
2198
+ 'box-backdrop-blur' => '0px',
2199
+ 'highlight-color' => '#fbe049',
2200
+ 'highlight-size' => '19px',
2201
+ 'review-title' => 'normal',
2202
+ 'content-align' => 'center',
2203
+ 'text-align' => 'left',
2204
+ 'original-rating-text' => '14px',
2205
+ ),
2206
+ ),
2207
+ 'dark-border' =>
2208
+ array (
2209
+ 'id' => 'dark-border',
2210
+ 'name' => 'Dark border',
2211
+ 'position' => 1,
2212
+ 'select-position' => 12,
2213
+ 'reviewer-photo' => true,
2214
+ 'verified-icon' => true,
2215
+ 'hide-logos' => false,
2216
+ 'hide-stars' => false,
2217
+ '_vars' =>
2218
+ array (
2219
+ 'style_id' => '"dark-border"',
2220
+ 'bg-color' => '#222222',
2221
+ 'text-color' => '#ffffff',
2222
+ 'outside-text-color' => '#ffffff',
2223
+ 'profile-color' => '#ffffff',
2224
+ 'profile-font-size' => '15px',
2225
+ 'review-font-size' => '14px',
2226
+ 'rating-text' => '14px',
2227
+ 'company-font-size' => '16px',
2228
+ 'review-lines' => '4',
2229
+ 'box-background-color' => '#222222',
2230
+ 'box-border-color' => '#444444',
2231
+ 'box-border-radius' => '4px',
2232
+ 'box-padding' => '15px',
2233
+ 'scroll' => 'true',
2234
+ 'scroll-color' => '#555555',
2235
+ 'arrow-color' => '#444444',
2236
+ 'float-widget-align' => 'left',
2237
+ 'nav' => 'true',
2238
+ 'dots' => 'mobile',
2239
+ 'hover-anim' => 'true',
2240
+ 'review-italic' => 'false',
2241
+ 'enable-font' => 'true',
2242
+ 'align-mini' => 'center',
2243
+ 'readmore' => 'true',
2244
+ 'popup-background' => '#ffffff',
2245
+ 'popup-company-color' => '#333333',
2246
+ 'popup-company-size' => '16px',
2247
+ 'popup-profile-color' => '#333333',
2248
+ 'popup-profile-size' => '15px',
2249
+ 'popup-review-color' => '#333333',
2250
+ 'popup-review-size' => '14px',
2251
+ 'popup-separator-color' => '#dedede',
2252
+ 'popup-separator-width' => '1px',
2253
+ 'box-shadow' => 'false',
2254
+ 'box-shadow-color' => '#000000',
2255
+ 'box-shadow-opacity' => '0.15',
2256
+ 'box-border-top-width' => '2px',
2257
+ 'box-border-bottom-width' => '2px',
2258
+ 'box-border-left-width' => '2px',
2259
+ 'box-border-right-width' => '2px',
2260
+ 'box-background-opacity' => '1',
2261
+ 'box-backdrop-blur' => '0px',
2262
+ 'highlight-color' => '#fbe049',
2263
+ 'highlight-size' => '19px',
2264
+ 'review-title' => 'normal',
2265
+ 'content-align' => 'center',
2266
+ 'text-align' => 'left',
2267
+ 'original-rating-text' => '14px',
2268
+ ),
2269
+ ),
2270
+ 'dark-contrast' =>
2271
+ array (
2272
+ 'id' => 'dark-contrast',
2273
+ 'name' => 'Dark contrast',
2274
+ 'position' => 1,
2275
+ 'select-position' => 14,
2276
+ 'reviewer-photo' => true,
2277
+ 'verified-icon' => true,
2278
+ 'hide-logos' => false,
2279
+ 'hide-stars' => false,
2280
+ '_vars' =>
2281
+ array (
2282
+ 'style_id' => '"dark-contrast"',
2283
+ 'bg-color' => '#222222',
2284
+ 'text-color' => '#000000',
2285
+ 'outside-text-color' => '#ffffff',
2286
+ 'profile-color' => '#000000',
2287
+ 'profile-font-size' => '15px',
2288
+ 'review-font-size' => '14px',
2289
+ 'rating-text' => '14px',
2290
+ 'company-font-size' => '16px',
2291
+ 'review-lines' => '4',
2292
+ 'box-background-color' => '#ffffff',
2293
+ 'box-border-color' => '#ffffff',
2294
+ 'box-border-radius' => '4px',
2295
+ 'box-padding' => '15px',
2296
+ 'scroll' => 'true',
2297
+ 'scroll-color' => '#555555',
2298
+ 'arrow-color' => '#ffffff',
2299
+ 'float-widget-align' => 'left',
2300
+ 'nav' => 'true',
2301
+ 'dots' => 'mobile',
2302
+ 'hover-anim' => 'true',
2303
+ 'review-italic' => 'false',
2304
+ 'enable-font' => 'true',
2305
+ 'align-mini' => 'center',
2306
+ 'readmore' => 'true',
2307
+ 'popup-background' => '#ffffff',
2308
+ 'popup-company-color' => '#333333',
2309
+ 'popup-company-size' => '16px',
2310
+ 'popup-profile-color' => '#333333',
2311
+ 'popup-profile-size' => '15px',
2312
+ 'popup-review-color' => '#333333',
2313
+ 'popup-review-size' => '14px',
2314
+ 'popup-separator-color' => '#dedede',
2315
+ 'popup-separator-width' => '1px',
2316
+ 'box-shadow' => 'false',
2317
+ 'box-shadow-color' => '#000000',
2318
+ 'box-shadow-opacity' => '0.15',
2319
+ 'box-border-top-width' => '2px',
2320
+ 'box-border-bottom-width' => '2px',
2321
+ 'box-border-left-width' => '2px',
2322
+ 'box-border-right-width' => '2px',
2323
+ 'box-background-opacity' => '1',
2324
+ 'box-backdrop-blur' => '0px',
2325
+ 'highlight-color' => '#fbe049',
2326
+ 'highlight-size' => '19px',
2327
+ 'review-title' => 'normal',
2328
+ 'content-align' => 'center',
2329
+ 'text-align' => 'left',
2330
+ 'original-rating-text' => '14px',
2331
+ ),
2332
+ ),
2333
+ 'dark-background-image' =>
2334
+ array (
2335
+ 'id' => 'dark-background-image',
2336
+ 'name' => 'Dark background image',
2337
+ 'position' => 0,
2338
+ 'select-position' => 15,
2339
+ 'reviewer-photo' => true,
2340
+ 'verified-icon' => true,
2341
+ 'hide-logos' => false,
2342
+ 'hide-stars' => false,
2343
+ '_vars' =>
2344
+ array (
2345
+ 'style_id' => '"dark-background-image"',
2346
+ 'bg-color' => '#ffffff',
2347
+ 'text-color' => '#ffffff',
2348
+ 'outside-text-color' => '#ffffff',
2349
+ 'profile-color' => '#ffffff',
2350
+ 'profile-font-size' => '15px',
2351
+ 'review-font-size' => '15px',
2352
+ 'rating-text' => '15px',
2353
+ 'company-font-size' => '16px',
2354
+ 'review-lines' => '4',
2355
+ 'box-background-color' => '#000000',
2356
+ 'box-border-color' => '#000000',
2357
+ 'box-border-radius' => '5px',
2358
+ 'box-padding' => '20px',
2359
+ 'scroll' => 'true',
2360
+ 'scroll-color' => '#555555',
2361
+ 'arrow-color' => '#cccccc',
2362
+ 'float-widget-align' => 'right',
2363
+ 'nav' => 'true',
2364
+ 'dots' => 'mobile',
2365
+ 'hover-anim' => 'false',
2366
+ 'review-italic' => 'false',
2367
+ 'enable-font' => 'true',
2368
+ 'align-mini' => 'center',
2369
+ 'readmore' => 'true',
2370
+ 'popup-background' => '#ffffff',
2371
+ 'popup-company-color' => '#333333',
2372
+ 'popup-company-size' => '16px',
2373
+ 'popup-profile-color' => '#333333',
2374
+ 'popup-profile-size' => '15px',
2375
+ 'popup-review-color' => '#333333',
2376
+ 'popup-review-size' => '14px',
2377
+ 'popup-separator-color' => '#dedede',
2378
+ 'popup-separator-width' => '1px',
2379
+ 'box-shadow' => 'true',
2380
+ 'box-shadow-color' => '#000000',
2381
+ 'box-shadow-opacity' => '0.20',
2382
+ 'box-border-top-width' => '0px',
2383
+ 'box-border-bottom-width' => '0px',
2384
+ 'box-border-left-width' => '0px',
2385
+ 'box-border-right-width' => '0px',
2386
+ 'box-background-opacity' => '0.3',
2387
+ 'box-backdrop-blur' => '5px',
2388
+ 'highlight-color' => '#fbe049',
2389
+ 'highlight-size' => '19px',
2390
+ 'review-title' => 'normal',
2391
+ 'content-align' => 'center',
2392
+ 'text-align' => 'left',
2393
+ 'original-rating-text' => '15px',
2394
+ ),
2395
+ ),
2396
+ );
2397
+ public static $widget_languages = [
2398
+ 'ar' => "العربية",
2399
+ 'zh' => "汉语",
2400
+ 'cs' => "Čeština",
2401
+ 'da' => "Dansk",
2402
+ 'nl' => "Nederlands",
2403
+ 'en' => "English",
2404
+ 'et' => "Eestlane",
2405
+ 'fi' => "Suomi",
2406
+ 'fr' => "Français",
2407
+ 'de' => "Deutsch",
2408
+ 'el' => "Ελληνικά",
2409
+ 'hi' => "हिन्दी",
2410
+ 'hu' => "Magyar",
2411
+ 'it' => "Italiano",
2412
+ 'no' => "Norsk",
2413
+ 'pl' => "Polski",
2414
+ 'pt' => "Português",
2415
+ 'ro' => "Română",
2416
+ 'ru' => "Русский",
2417
+ 'sk' => "Slovenčina",
2418
+ 'es' => "Español",
2419
+ 'sv' => "Svenska",
2420
+ 'tr' => "Türkçe",
2421
+ 'gd' => 'Gàidhlig na h-Alba',
2422
+ 'hr' => 'Hrvatski',
2423
+ 'id' => 'Bahasa Indonesia',
2424
+ 'is' => 'Íslensku',
2425
+ 'he' => 'עִברִית',
2426
+ 'ja' => '日本',
2427
+ 'ko' => '한국어',
2428
+ 'lt' => 'Lietuvių',
2429
+ 'ms' => 'Bahasa Melayu',
2430
+ 'sl' => 'Slovenščina',
2431
+ 'sr' => 'Српски',
2432
+ 'th' => 'ไทย',
2433
+ 'uk' => 'Українська',
2434
+ 'vi' => 'Tiếng Việt',
2435
+ 'mk' => 'Македонски',
2436
+ 'bg' => 'български',
2437
+ 'sq' => 'Shqip',
2438
+ 'af' => 'Afrikaans',
2439
+ 'az' => 'Azərbaycan dili',
2440
+ 'bn' => 'বাংলা',
2441
+ 'bs' => 'Bosanski',
2442
+ 'cy' => 'Cymraeg',
2443
+ 'fa' => 'فارسی',
2444
+ 'gl' => 'Galego',
2445
+ 'hy' => 'հայերեն',
2446
+ 'ka' => 'ქართული',
2447
+ 'kk' => 'қазақ'
2448
+ ];
2449
+ public static $widget_dateformats = [ 'j. F, Y.', 'F j, Y.', 'Y.m.d.', 'Y-m-d', 'd/m/Y' ];
2450
+ private static $widget_rating_texts = array (
2451
+ 'en' =>
2452
+ array (
2453
+ 0 => 'poor',
2454
+ 1 => 'below average',
2455
+ 2 => 'average',
2456
+ 3 => 'good',
2457
+ 4 => 'excellent',
2458
+ ),
2459
+ 'fr' =>
2460
+ array (
2461
+ 0 => 'faible',
2462
+ 1 => 'moyenne basse',
2463
+ 2 => 'moyenne',
2464
+ 3 => 'bien',
2465
+ 4 => 'excellent',
2466
+ ),
2467
+ 'de' =>
2468
+ array (
2469
+ 0 => 'Schwach',
2470
+ 1 => 'Unterdurchschnittlich',
2471
+ 2 => 'Durchschnittlich',
2472
+ 3 => 'Gut',
2473
+ 4 => 'Ausgezeichnet',
2474
+ ),
2475
+ 'es' =>
2476
+ array (
2477
+ 0 => 'Flojo',
2478
+ 1 => 'Por debajo de lo regular',
2479
+ 2 => 'Regular',
2480
+ 3 => 'Bueno',
2481
+ 4 => 'Excelente',
2482
+ ),
2483
+ 'ar' =>
2484
+ array (
2485
+ 0 => 'فيعض',
2486
+ 1 => 'طسوتملا تحت',
2487
+ 2 => 'طسوتم',
2488
+ 3 => 'ديج',
2489
+ 4 => 'زاتمم',
2490
+ ),
2491
+ 'cs' =>
2492
+ array (
2493
+ 0 => 'Slabý',
2494
+ 1 => 'Podprůměrný',
2495
+ 2 => 'Průměrný',
2496
+ 3 => 'Dobrý',
2497
+ 4 => 'Vynikající',
2498
+ ),
2499
+ 'da' =>
2500
+ array (
2501
+ 0 => 'Svag',
2502
+ 1 => 'Under gennemsnitlig',
2503
+ 2 => 'Gennemsnitlig',
2504
+ 3 => 'God',
2505
+ 4 => 'Fremragende',
2506
+ ),
2507
+ 'et' =>
2508
+ array (
2509
+ 0 => 'halb',
2510
+ 1 => 'alla keskmise',
2511
+ 2 => 'keskmine',
2512
+ 3 => 'hea',
2513
+ 4 => 'suurepärane',
2514
+ ),
2515
+ 'el' =>
2516
+ array (
2517
+ 0 => 'Χαμηλή',
2518
+ 1 => 'Κάτω από τον μέσο όρο',
2519
+ 2 => 'Μέτρια',
2520
+ 3 => 'Καλή',
2521
+ 4 => 'Άριστη',
2522
+ ),
2523
+ 'fi' =>
2524
+ array (
2525
+ 0 => 'Heikko',
2526
+ 1 => 'Keskitasoa alhaisempi',
2527
+ 2 => 'Keskitasoinen',
2528
+ 3 => 'Hyvä',
2529
+ 4 => 'Erinomainen',
2530
+ ),
2531
+ 'hi' =>
2532
+ array (
2533
+ 0 => 'कमज़ोर',
2534
+ 1 => 'औसत से कम ',
2535
+ 2 => 'औसत ',
2536
+ 3 => 'अच्छा ',
2537
+ 4 => 'अति उत्कृष्ट ',
2538
+ ),
2539
+ 'hu' =>
2540
+ array (
2541
+ 0 => 'Gyenge',
2542
+ 1 => 'Átlag alatti',
2543
+ 2 => 'Átlagos',
2544
+ 3 => 'Jó',
2545
+ 4 => 'Kiváló',
2546
+ ),
2547
+ 'it' =>
2548
+ array (
2549
+ 0 => 'Scarso',
2550
+ 1 => 'Sotto la media',
2551
+ 2 => 'Medio',
2552
+ 3 => 'Buono',
2553
+ 4 => 'Eccellente',
2554
+ ),
2555
+ 'ja' =>
2556
+ array (
2557
+ 0 => '悪い',
2558
+ 1 => '平均以下の',
2559
+ 2 => '平均',
2560
+ 3 => '良い',
2561
+ 4 => '優れた',
2562
+ ),
2563
+ 'nl' =>
2564
+ array (
2565
+ 0 => 'Zwak',
2566
+ 1 => 'Onder gemiddeld',
2567
+ 2 => 'Gemiddeld',
2568
+ 3 => 'Goed',
2569
+ 4 => 'Uitstekend',
2570
+ ),
2571
+ 'no' =>
2572
+ array (
2573
+ 0 => 'Dårlig',
2574
+ 1 => 'Utilstrekkelig',
2575
+ 2 => 'Gjennomsnittlig',
2576
+ 3 => 'Bra',
2577
+ 4 => 'Utmerket',
2578
+ ),
2579
+ 'pl' =>
2580
+ array (
2581
+ 0 => 'Słaba',
2582
+ 1 => 'Poniżej średniej',
2583
+ 2 => 'Średnia',
2584
+ 3 => 'Dobra',
2585
+ 4 => 'Doskonała',
2586
+ ),
2587
+ 'pt' =>
2588
+ array (
2589
+ 0 => 'Fraco',
2590
+ 1 => 'Inferior ao médio',
2591
+ 2 => 'Medíocre',
2592
+ 3 => 'Bom',
2593
+ 4 => 'Excelente',
2594
+ ),
2595
+ 'ro' =>
2596
+ array (
2597
+ 0 => 'sărac',
2598
+ 1 => 'sub medie',
2599
+ 2 => 'in medie',
2600
+ 3 => 'bun',
2601
+ 4 => 'excelent',
2602
+ ),
2603
+ 'ru' =>
2604
+ array (
2605
+ 0 => 'Слабо',
2606
+ 1 => 'Ниже среднего',
2607
+ 2 => 'Средний',
2608
+ 3 => 'Хорошо',
2609
+ 4 => 'Отлично',
2610
+ ),
2611
+ 'sl' =>
2612
+ array (
2613
+ 0 => 'slabo',
2614
+ 1 => 'pod povprečjem',
2615
+ 2 => 'povprečno',
2616
+ 3 => 'dobro',
2617
+ 4 => 'odlično',
2618
+ ),
2619
+ 'sk' =>
2620
+ array (
2621
+ 0 => 'Slabé',
2622
+ 1 => 'Podpriemerné',
2623
+ 2 => 'Priemerné',
2624
+ 3 => 'Dobré',
2625
+ 4 => 'Vynikajúce',
2626
+ ),
2627
+ 'sv' =>
2628
+ array (
2629
+ 0 => 'Dålig',
2630
+ 1 => 'Under genomsnittet',
2631
+ 2 => 'Genomsnittlig',
2632
+ 3 => 'Bra',
2633
+ 4 => 'Utmärkt',
2634
+ ),
2635
+ 'tr' =>
2636
+ array (
2637
+ 0 => 'Zayıf',
2638
+ 1 => 'Ortanın altıi',
2639
+ 2 => 'Orta',
2640
+ 3 => 'İyi',
2641
+ 4 => 'Mükemmel',
2642
+ ),
2643
+ 'uk' =>
2644
+ array (
2645
+ 0 => 'погано',
2646
+ 1 => 'нижче середнього',
2647
+ 2 => 'середній',
2648
+ 3 => 'добре',
2649
+ 4 => 'відмінно',
2650
+ ),
2651
+ 'zh' =>
2652
+ array (
2653
+ 0 => '差',
2654
+ 1 => '不如一般',
2655
+ 2 => '一般',
2656
+ 3 => '好',
2657
+ 4 => '非常好',
2658
+ ),
2659
+ 'gd' =>
2660
+ array (
2661
+ 0 => 'bochd',
2662
+ 1 => 'nas ìsle na a ’chuibheasachd',
2663
+ 2 => 'cuibheasach',
2664
+ 3 => 'math',
2665
+ 4 => 'sgoinneil',
2666
+ ),
2667
+ 'hr' =>
2668
+ array (
2669
+ 0 => 'slabo',
2670
+ 1 => 'ispod prosjeka',
2671
+ 2 => 'prosjed',
2672
+ 3 => 'dobro',
2673
+ 4 => 'odličan',
2674
+ ),
2675
+ 'id' =>
2676
+ array (
2677
+ 0 => 'miskin',
2678
+ 1 => 'dibawah rata-rata',
2679
+ 2 => 'rata-rata',
2680
+ 3 => 'bagus',
2681
+ 4 => 'bagus sekali',
2682
+ ),
2683
+ 'is' =>
2684
+ array (
2685
+ 0 => 'fátækur',
2686
+ 1 => 'fyrir neðan meðallag',
2687
+ 2 => 'að meðaltali',
2688
+ 3 => 'góður',
2689
+ 4 => 'Æðislegt',
2690
+ ),
2691
+ 'he' =>
2692
+ array (
2693
+ 0 => 'עני',
2694
+ 1 => 'מתחת לממוצע',
2695
+ 2 => 'מְמוּצָע',
2696
+ 3 => 'טוֹב',
2697
+ 4 => 'מְעוּלֶה',
2698
+ ),
2699
+ 'ko' =>
2700
+ array (
2701
+ 0 => '가난한',
2702
+ 1 => '평균 이하',
2703
+ 2 => '평균',
2704
+ 3 => '좋은',
2705
+ 4 => '훌륭한',
2706
+ ),
2707
+ 'lt' =>
2708
+ array (
2709
+ 0 => 'vargšas',
2710
+ 1 => 'žemiau vidurkio',
2711
+ 2 => 'vidurkis',
2712
+ 3 => 'gerai',
2713
+ 4 => 'puikus',
2714
+ ),
2715
+ 'ms' =>
2716
+ array (
2717
+ 0 => 'miskin',
2718
+ 1 => 'bawah purata',
2719
+ 2 => 'purata',
2720
+ 3 => 'baik',
2721
+ 4 => 'cemerlang',
2722
+ ),
2723
+ 'sr' =>
2724
+ array (
2725
+ 0 => 'Слабо',
2726
+ 1 => 'Испод просека',
2727
+ 2 => 'Просек',
2728
+ 3 => 'Добро',
2729
+ 4 => 'Oдлично',
2730
+ ),
2731
+ 'th' =>
2732
+ array (
2733
+ 0 => 'ยากจน',
2734
+ 1 => 'ต่ำกว่าค่าเฉลี่ย',
2735
+ 2 => 'เฉลี่ย',
2736
+ 3 => 'ดี',
2737
+ 4 => 'ยอดเยี่ยม',
2738
+ ),
2739
+ 'vi' =>
2740
+ array (
2741
+ 0 => 'nghèo nàn',
2742
+ 1 => 'dưới mức trung bình',
2743
+ 2 => 'Trung bình',
2744
+ 3 => 'tốt',
2745
+ 4 => 'thông minh',
2746
+ ),
2747
+ 'mk' =>
2748
+ array (
2749
+ 0 => 'Сиромашен',
2750
+ 1 => 'под просек',
2751
+ 2 => 'просек',
2752
+ 3 => 'Добро',
2753
+ 4 => 'одлично',
2754
+ ),
2755
+ 'bg' =>
2756
+ array (
2757
+ 0 => 'беден',
2758
+ 1 => 'под средното',
2759
+ 2 => 'средно аритметично',
2760
+ 3 => 'добре',
2761
+ 4 => 'отлично',
2762
+ ),
2763
+ 'sq' =>
2764
+ array (
2765
+ 0 => 'i varfer',
2766
+ 1 => 'nën mesataren',
2767
+ 2 => 'mesatare',
2768
+ 3 => 'mire',
2769
+ 4 => 'e shkëlqyeshme',
2770
+ ),
2771
+ 'af' =>
2772
+ array (
2773
+ 0 => 'arm',
2774
+ 1 => 'onder gemiddeld',
2775
+ 2 => 'gemiddeld',
2776
+ 3 => 'goed',
2777
+ 4 => 'uitstekend',
2778
+ ),
2779
+ 'az' =>
2780
+ array (
2781
+ 0 => 'kasıb',
2782
+ 1 => 'ortalamadan aşağı',
2783
+ 2 => 'orta',
2784
+ 3 => 'yaxşı',
2785
+ 4 => 'əla',
2786
+ ),
2787
+ 'bn' =>
2788
+ array (
2789
+ 0 => 'দরিদ্র',
2790
+ 1 => 'গড়ের নিচে',
2791
+ 2 => 'গড়',
2792
+ 3 => 'ভাল',
2793
+ 4 => 'চমৎকার',
2794
+ ),
2795
+ 'bs' =>
2796
+ array (
2797
+ 0 => 'jadan',
2798
+ 1 => 'ispod prosjeka',
2799
+ 2 => 'prosjek',
2800
+ 3 => 'dobro',
2801
+ 4 => 'odličan',
2802
+ ),
2803
+ 'cy' =>
2804
+ array (
2805
+ 0 => 'gwael',
2806
+ 1 => 'islaw\'r cyfartaledd',
2807
+ 2 => 'cyffredin',
2808
+ 3 => 'da',
2809
+ 4 => 'rhagorol',
2810
+ ),
2811
+ 'fa' =>
2812
+ array (
2813
+ 0 => 'فقیر',
2814
+ 1 => 'زیر میانگین',
2815
+ 2 => 'میانگین',
2816
+ 3 => 'خوب',
2817
+ 4 => 'عالی',
2818
+ ),
2819
+ 'gl' =>
2820
+ array (
2821
+ 0 => 'pobre',
2822
+ 1 => 'por debaixo da media',
2823
+ 2 => 'media',
2824
+ 3 => 'bo',
2825
+ 4 => 'excelente',
2826
+ ),
2827
+ 'hy' =>
2828
+ array (
2829
+ 0 => 'աղքատ',
2830
+ 1 => 'միջինից ցածր',
2831
+ 2 => 'միջին',
2832
+ 3 => 'լավ',
2833
+ 4 => 'գերազանց',
2834
+ ),
2835
+ 'ka' =>
2836
+ array (
2837
+ 0 => 'ღარიბი',
2838
+ 1 => 'საშუალოზე დაბლა',
2839
+ 2 => 'საშუალო',
2840
+ 3 => 'კარგი',
2841
+ 4 => 'შესანიშნავი',
2842
+ ),
2843
+ 'kk' =>
2844
+ array (
2845
+ 0 => 'кедей',
2846
+ 1 => 'орташадан төмен',
2847
+ 2 => 'орташа',
2848
+ 3 => 'жақсы',
2849
+ 4 => 'өте жақсы',
2850
+ ),
2851
+ );
2852
+ private static $widget_recommendation_texts = array (
2853
+ 'en' =>
2854
+ array (
2855
+ 'negative' => 'NOT_RECOMMEND_ICON not recommends',
2856
+ 'positive' => 'RECOMMEND_ICON recommends',
2857
+ ),
2858
+ 'fr' =>
2859
+ array (
2860
+ 'negative' => 'NOT_RECOMMEND_ICON ne recommande pas',
2861
+ 'positive' => 'RECOMMEND_ICON recommande',
2862
+ ),
2863
+ 'de' =>
2864
+ array (
2865
+ 'negative' => 'NOT_RECOMMEND_ICON wird nicht empfohlen',
2866
+ 'positive' => 'RECOMMEND_ICON empfiehlt',
2867
+ ),
2868
+ 'es' =>
2869
+ array (
2870
+ 'negative' => 'NOT_RECOMMEND_ICON no recomienda',
2871
+ 'positive' => 'RECOMMEND_ICON recomienda',
2872
+ ),
2873
+ 'ar' =>
2874
+ array (
2875
+ 'negative' => 'لا توصي NOT_RECOMMEND_ICON',
2876
+ 'positive' => 'توصي RECOMMEND_ICON',
2877
+ ),
2878
+ 'cs' =>
2879
+ array (
2880
+ 'negative' => 'NOT_RECOMMEND_ICON nedoporučuje',
2881
+ 'positive' => 'RECOMMEND_ICON doporučuje',
2882
+ ),
2883
+ 'da' =>
2884
+ array (
2885
+ 'negative' => 'NOT_RECOMMEND_ICON anbefaler ikke',
2886
+ 'positive' => 'RECOMMEND_ICON anbefaler',
2887
+ ),
2888
+ 'et' =>
2889
+ array (
2890
+ 'negative' => 'NOT_RECOMMEND_ICON ei soovita',
2891
+ 'positive' => 'RECOMMEND_ICON soovitab',
2892
+ ),
2893
+ 'el' =>
2894
+ array (
2895
+ 'negative' => 'NOT_RECOMMEND_ICON δεν συνιστά',
2896
+ 'positive' => 'RECOMMEND_ICON συνιστά',
2897
+ ),
2898
+ 'fi' =>
2899
+ array (
2900
+ 'negative' => 'NOT_RECOMMEND_ICON ei suosittele',
2901
+ 'positive' => 'RECOMMEND_ICON suosittelee',
2902
+ ),
2903
+ 'hi' =>
2904
+ array (
2905
+ 'negative' => 'NOT_RECOMMEND_ICON अनुशंसा नहीं करता है',
2906
+ 'positive' => 'RECOMMEND_ICON अनुशंसा करता है',
2907
+ ),
2908
+ 'hu' =>
2909
+ array (
2910
+ 'negative' => 'NOT_RECOMMEND_ICON nem ajánlja',
2911
+ 'positive' => 'RECOMMEND_ICON ajánlja',
2912
+ ),
2913
+ 'it' =>
2914
+ array (
2915
+ 'negative' => 'NOT_RECOMMEND_ICON non lo consiglia',
2916
+ 'positive' => 'RECOMMEND_ICON consiglia',
2917
+ ),
2918
+ 'ja' =>
2919
+ array (
2920
+ 'negative' => 'NOT_RECOMMEND_ICON おすすめできない',
2921
+ 'positive' => 'RECOMMEND_ICON おすすめ',
2922
+ ),
2923
+ 'nl' =>
2924
+ array (
2925
+ 'negative' => 'NOT_RECOMMEND_ICON raadt niet aan',
2926
+ 'positive' => 'RECOMMEND_ICON raadt aan',
2927
+ ),
2928
+ 'no' =>
2929
+ array (
2930
+ 'negative' => 'NOT_RECOMMEND_ICON anbefaler ikke',
2931
+ 'positive' => 'RECOMMEND_ICON anbefaler',
2932
+ ),
2933
+ 'pl' =>
2934
+ array (
2935
+ 'negative' => 'NOT_RECOMMEND_ICON nie poleca',
2936
+ 'positive' => 'RECOMMEND_ICON poleca',
2937
+ ),
2938
+ 'pt' =>
2939
+ array (
2940
+ 'negative' => 'NOT_RECOMMEND_ICON não recomenda',
2941
+ 'positive' => 'RECOMMEND_ICON recomenda',
2942
+ ),
2943
+ 'ro' =>
2944
+ array (
2945
+ 'negative' => 'NOT_RECOMMEND_ICON nu se recomandă',
2946
+ 'positive' => 'RECOMMEND_ICON recomandă',
2947
+ ),
2948
+ 'ru' =>
2949
+ array (
2950
+ 'negative' => 'NOT_RECOMMEND_ICON не рекомендует',
2951
+ 'positive' => 'RECOMMEND_ICON рекомендует',
2952
+ ),
2953
+ 'sl' =>
2954
+ array (
2955
+ 'negative' => 'NOT_RECOMMEND_ICON ne priporoča',
2956
+ 'positive' => 'RECOMMEND_ICON priporoča',
2957
+ ),
2958
+ 'sk' =>
2959
+ array (
2960
+ 'negative' => 'NOT_RECOMMEND_ICON neodporúča',
2961
+ 'positive' => 'RECOMMEND_ICON odporúča',
2962
+ ),
2963
+ 'sv' =>
2964
+ array (
2965
+ 'negative' => 'NOT_RECOMMEND_ICON rekommenderar inte',
2966
+ 'positive' => 'RECOMMEND_ICON rekommenderar',
2967
+ ),
2968
+ 'tr' =>
2969
+ array (
2970
+ 'negative' => 'NOT_RECOMMEND_ICON önerilmez',
2971
+ 'positive' => 'RECOMMEND_ICON önerir',
2972
+ ),
2973
+ 'uk' =>
2974
+ array (
2975
+ 'negative' => 'NOT_RECOMMEND_ICON не рекомендує',
2976
+ 'positive' => 'RECOMMEND_ICON рекомендує',
2977
+ ),
2978
+ 'zh' =>
2979
+ array (
2980
+ 'negative' => 'NOT_RECOMMEND_ICON 不推荐',
2981
+ 'positive' => 'RECOMMEND_ICON 推荐',
2982
+ ),
2983
+ 'gd' =>
2984
+ array (
2985
+ 'negative' => 'NOT_RECOMMEND_ICON no moladh',
2986
+ 'positive' => 'RECOMMEND_ICON a ’moladh',
2987
+ ),
2988
+ 'hr' =>
2989
+ array (
2990
+ 'negative' => 'NOT_RECOMMEND_ICON ne preporučuje',
2991
+ 'positive' => 'RECOMMEND_ICON preporučuje',
2992
+ ),
2993
+ 'id' =>
2994
+ array (
2995
+ 'negative' => 'NOT_RECOMMEND_ICON tidak merekomendasikan',
2996
+ 'positive' => 'RECOMMEND_ICON merekomendasikan',
2997
+ ),
2998
+ 'is' =>
2999
+ array (
3000
+ 'negative' => 'NOT_RECOMMEND_ICON mælir ekki með',
3001
+ 'positive' => 'RECOMMEND_ICON mælir með',
3002
+ ),
3003
+ 'he' =>
3004
+ array (
3005
+ 'negative' => 'NOT_RECOMMEND_ICON לא ממליץ',
3006
+ 'positive' => 'RECOMMEND_ICON ממליץ',
3007
+ ),
3008
+ 'ko' =>
3009
+ array (
3010
+ 'negative' => 'NOT_RECOMMEND_ICON 권장하지 않음',
3011
+ 'positive' => 'RECOMMEND_ICON 추천',
3012
+ ),
3013
+ 'lt' =>
3014
+ array (
3015
+ 'negative' => 'NOT_RECOMMEND_ICON nerekomenduoja',
3016
+ 'positive' => 'RECOMMEND_ICON rekomenduoja',
3017
+ ),
3018
+ 'ms' =>
3019
+ array (
3020
+ 'negative' => 'NOT_RECOMMEND_ICON tidak mengesyorkan',
3021
+ 'positive' => 'RECOMMEND_ICON mengesyorkan',
3022
+ ),
3023
+ 'sr' =>
3024
+ array (
3025
+ 'negative' => 'NOT_RECOMMEND_ICON не препоручује',
3026
+ 'positive' => 'RECOMMEND_ICON препоручује',
3027
+ ),
3028
+ 'th' =>
3029
+ array (
3030
+ 'negative' => 'NOT_RECOMMEND_ICON ไม่แนะนำ',
3031
+ 'positive' => 'RECOMMEND_ICON แนะนำ',
3032
+ ),
3033
+ 'vi' =>
3034
+ array (
3035
+ 'negative' => 'NOT_RECOMMEND_ICON không được đề xuất',
3036
+ 'positive' => 'RECOMMEND_ICON đề xuất',
3037
+ ),
3038
+ 'mk' =>
3039
+ array (
3040
+ 'negative' => 'NOT_RECOMMEND_ICON не препорачува',
3041
+ 'positive' => 'RECOMMEND_ICON препорачува',
3042
+ ),
3043
+ 'bg' =>
3044
+ array (
3045
+ 'negative' => 'NOT_RECOMMEND_ICON не препоръчва',
3046
+ 'positive' => 'RECOMMEND_ICON препоръчва',
3047
+ ),
3048
+ 'sq' =>
3049
+ array (
3050
+ 'negative' => 'NOT_RECOMMEND_ICON nuk rekomandon',
3051
+ 'positive' => 'RECOMMEND_ICON rekomandon',
3052
+ ),
3053
+ 'af' =>
3054
+ array (
3055
+ 'negative' => 'NOT_RECOMMEND_ICON beveel nie aan',
3056
+ 'positive' => 'RECOMMEND_ICON beveel aan',
3057
+ ),
3058
+ 'az' =>
3059
+ array (
3060
+ 'negative' => 'NOT_RECOMMEND_ICON tövsiyə etmir',
3061
+ 'positive' => 'RECOMMEND_ICON tövsiyə edir',
3062
+ ),
3063
+ 'bn' =>
3064
+ array (
3065
+ 'negative' => 'NOT_RECOMMEND_ICON সুপারিশ করে না',
3066
+ 'positive' => 'RECOMMEND_ICON সুপারিশ করে',
3067
+ ),
3068
+ 'bs' =>
3069
+ array (
3070
+ 'negative' => 'NOT_RECOMMEND_ICON ne preporučuje',
3071
+ 'positive' => 'RECOMMEND_ICON preporučuje',
3072
+ ),
3073
+ 'cy' =>
3074
+ array (
3075
+ 'negative' => 'NOT_RECOMMEND_ICON ddim yn argymell',
3076
+ 'positive' => 'RECOMMEND_ICON yn argymell',
3077
+ ),
3078
+ 'fa' =>
3079
+ array (
3080
+ 'negative' => 'NOT_RECOMMEND_ICON توصیه نمی کند',
3081
+ 'positive' => 'RECOMMEND_ICON توصیه می‌کند',
3082
+ ),
3083
+ 'gl' =>
3084
+ array (
3085
+ 'negative' => 'NOT_RECOMMEND_ICON non recomendado',
3086
+ 'positive' => 'RECOMMEND_ICON recomenda',
3087
+ ),
3088
+ 'hy' =>
3089
+ array (
3090
+ 'negative' => 'NOT_RECOMMEND_ICON-ը խորհուրդ չի տալիս',
3091
+ 'positive' => 'RECOMMEND_ICON խորհուրդ է տալիս',
3092
+ ),
3093
+ 'ka' =>
3094
+ array (
3095
+ 'negative' => 'NOT_RECOMMEND_ICON არ გირჩევთ',
3096
+ 'positive' => 'RECOMMEND_ICON გირჩევთ',
3097
+ ),
3098
+ 'kk' =>
3099
+ array (
3100
+ 'negative' => 'NOT_RECOMMEND_ICON ұсынбайды',
3101
+ 'positive' => 'RECOMMEND_ICON ұсынады',
3102
+ ),
3103
+ );
3104
+ private static $widget_verified_texts = array (
3105
+ 'en' => 'Verified',
3106
+ 'fr' => 'vérifié',
3107
+ 'de' => 'Verifizierte',
3108
+ 'es' => 'Verificada',
3109
+ 'ar' => 'تم التحقق',
3110
+ 'cs' => 'Ověřená',
3111
+ 'da' => 'Bekræftet',
3112
+ 'et' => 'Kinnitatud',
3113
+ 'el' => 'επαληθεύτηκε',
3114
+ 'fi' => 'Vahvistettu',
3115
+ 'hi' => 'सत्यापित',
3116
+ 'hu' => 'Hitelesített',
3117
+ 'it' => 'Verificata',
3118
+ 'ja' => '確認済み',
3119
+ 'nl' => 'Geverifieerde',
3120
+ 'no' => 'Bekreftet',
3121
+ 'pl' => 'Zweryfikowana',
3122
+ 'pt' => 'Verificada',
3123
+ 'ro' => 'Verificat',
3124
+ 'ru' => 'Проверенный',
3125
+ 'sl' => 'Preverjeno',
3126
+ 'sk' => 'Overená',
3127
+ 'sv' => 'Verifierad',
3128
+ 'tr' => 'Doğrulanmış',
3129
+ 'uk' => 'Перевірено',
3130
+ 'zh' => '已验证',
3131
+ 'gd' => 'Dearbhaichte',
3132
+ 'hr' => 'Potvrđen',
3133
+ 'id' => 'Diverifikasi',
3134
+ 'is' => 'Staðfesting',
3135
+ 'he' => 'מְאוּמָת',
3136
+ 'ko' => '검증 된',
3137
+ 'lt' => 'Patvirtinta',
3138
+ 'ms' => 'Disahkan',
3139
+ 'sr' => 'Проверено',
3140
+ 'th' => 'ตรวจสอบแล้ว',
3141
+ 'vi' => 'Đã xác minh',
3142
+ 'mk' => 'Потврдена',
3143
+ 'bg' => 'Проверени',
3144
+ 'sq' => 'Verifikuar',
3145
+ 'af' => 'Geverifieer',
3146
+ 'az' => 'Doğrulanmışdır',
3147
+ 'bn' => 'যাচাই',
3148
+ 'bs' => 'Provjereno',
3149
+ 'cy' => 'Wedi\'i ddilysu',
3150
+ 'fa' => 'تأیید شده',
3151
+ 'gl' => 'Verificado',
3152
+ 'hy' => 'Ստուգված',
3153
+ 'ka' => 'დამოწმებული',
3154
+ 'kk' => 'тексерілген',
3155
+ );
3156
+ private static $widget_month_names = array (
3157
+ 'en' =>
3158
+ array (
3159
+ 0 => 'January',
3160
+ 1 => 'February',
3161
+ 2 => 'March',
3162
+ 3 => 'April',
3163
+ 4 => 'May',
3164
+ 5 => 'June',
3165
+ 6 => 'July',
3166
+ 7 => 'August',
3167
+ 8 => 'September',
3168
+ 9 => 'October',
3169
+ 10 => 'November',
3170
+ 11 => 'December',
3171
+ ),
3172
+ 'et' =>
3173
+ array (
3174
+ 0 => 'jaanuar',
3175
+ 1 => 'veebruar',
3176
+ 2 => 'märts',
3177
+ 3 => 'aprill',
3178
+ 4 => 'mai',
3179
+ 5 => 'juuni',
3180
+ 6 => 'juuli',
3181
+ 7 => 'august',
3182
+ 8 => 'september',
3183
+ 9 => 'oktoober',
3184
+ 10 => 'november',
3185
+ 11 => 'detsember',
3186
+ ),
3187
+ 'ar' =>
3188
+ array (
3189
+ 0 => 'يناير',
3190
+ 1 => 'فبراير',
3191
+ 2 => 'مارس',
3192
+ 3 => 'أبريل',
3193
+ 4 => 'مايو',
3194
+ 5 => 'يونيو',
3195
+ 6 => 'يوليه',
3196
+ 7 => 'أغسطس',
3197
+ 8 => 'سبتمبر',
3198
+ 9 => 'أكتوبر',
3199
+ 10 => 'نوفمبر',
3200
+ 11 => 'ديسمبر',
3201
+ ),
3202
+ 'zh' =>
3203
+ array (
3204
+ 0 => '一月',
3205
+ 1 => '二月',
3206
+ 2 => '三月',
3207
+ 3 => '四月',
3208
+ 4 => '五月',
3209
+ 5 => '六月',
3210
+ 6 => '七月',
3211
+ 7 => '八月',
3212
+ 8 => '九月',
3213
+ 9 => '十月',
3214
+ 10 => '十一月',
3215
+ 11 => '十二月',
3216
+ ),
3217
+ 'cs' =>
3218
+ array (
3219
+ 0 => 'Leden',
3220
+ 1 => 'Únor',
3221
+ 2 => 'Březen',
3222
+ 3 => 'Duben',
3223
+ 4 => 'Květen',
3224
+ 5 => 'Červen',
3225
+ 6 => 'Červenec',
3226
+ 7 => 'Srpen',
3227
+ 8 => 'Září',
3228
+ 9 => 'Říjen',
3229
+ 10 => 'Listopad',
3230
+ 11 => 'Prosinec',
3231
+ ),
3232
+ 'da' =>
3233
+ array (
3234
+ 0 => 'Januar',
3235
+ 1 => 'Februar',
3236
+ 2 => 'Marts',
3237
+ 3 => 'April',
3238
+ 4 => 'Maj',
3239
+ 5 => 'Juni',
3240
+ 6 => 'Juli',
3241
+ 7 => 'August',
3242
+ 8 => 'September',
3243
+ 9 => 'Oktober',
3244
+ 10 => 'November',
3245
+ 11 => 'December',
3246
+ ),
3247
+ 'nl' =>
3248
+ array (
3249
+ 0 => 'Januari',
3250
+ 1 => 'Februari',
3251
+ 2 => 'Maart',
3252
+ 3 => 'April',
3253
+ 4 => 'Mei',
3254
+ 5 => 'Juni',
3255
+ 6 => 'Juli',
3256
+ 7 => 'Augustus',
3257
+ 8 => 'September',
3258
+ 9 => 'Oktober',
3259
+ 10 => 'November',
3260
+ 11 => 'December',
3261
+ ),
3262
+ 'fi' =>
3263
+ array (
3264
+ 0 => 'Tammikuu',
3265
+ 1 => 'Helmikuu',
3266
+ 2 => 'Maaliskuu',
3267
+ 3 => 'Huhtikuu',
3268
+ 4 => 'Toukokuu',
3269
+ 5 => 'Kesäkuu',
3270
+ 6 => 'Heinäkuu',
3271
+ 7 => 'Elokuu',
3272
+ 8 => 'Syyskuu',
3273
+ 9 => 'Lokakuu',
3274
+ 10 => 'Marraskuu',
3275
+ 11 => 'Joulukuu',
3276
+ ),
3277
+ 'fr' =>
3278
+ array (
3279
+ 0 => 'Janvier',
3280
+ 1 => 'Février',
3281
+ 2 => 'Mars',
3282
+ 3 => 'Avril',
3283
+ 4 => 'Mai',
3284
+ 5 => 'Juin',
3285
+ 6 => 'Juillet',
3286
+ 7 => 'Août',
3287
+ 8 => 'Septembre',
3288
+ 9 => 'Octobre',
3289
+ 10 => 'Novembre',
3290
+ 11 => 'Décembre',
3291
+ ),
3292
+ 'de' =>
3293
+ array (
3294
+ 0 => 'Januar',
3295
+ 1 => 'Februar',
3296
+ 2 => 'März',
3297
+ 3 => 'April',
3298
+ 4 => 'Mai',
3299
+ 5 => 'Juni',
3300
+ 6 => 'Juli',
3301
+ 7 => 'August',
3302
+ 8 => 'September',
3303
+ 9 => 'Oktober',
3304
+ 10 => 'November',
3305
+ 11 => 'Dezember',
3306
+ ),
3307
+ 'el' =>
3308
+ array (
3309
+ 0 => 'Iανουάριος',
3310
+ 1 => 'Φεβρουάριος',
3311
+ 2 => 'Μάρτιος',
3312
+ 3 => 'Aρίλιος',
3313
+ 4 => 'Μάιος',
3314
+ 5 => 'Iούνιος',
3315
+ 6 => 'Iούλιος',
3316
+ 7 => 'Αύγουστος',
3317
+ 8 => 'Σεπτέμβριος',
3318
+ 9 => 'Oκτώβριος',
3319
+ 10 => 'Νοέμβριος',
3320
+ 11 => 'Δεκέμβριος',
3321
+ ),
3322
+ 'he' =>
3323
+ array (
3324
+ 0 => 'ינואר',
3325
+ 1 => 'פברואר',
3326
+ 2 => 'מרץ',
3327
+ 3 => 'אפריל',
3328
+ 4 => 'מאי',
3329
+ 5 => 'יוני',
3330
+ 6 => 'יולי',
3331
+ 7 => 'אוגוסט',
3332
+ 8 => 'ספטמבר',
3333
+ 9 => 'אוקטובר',
3334
+ 10 => 'נובמבר',
3335
+ 11 => 'דצמבר',
3336
+ ),
3337
+ 'hi' =>
3338
+ array (
3339
+ 0 => 'जनवरी',
3340
+ 1 => 'फ़रवरी',
3341
+ 2 => 'मार्च',
3342
+ 3 => 'अप्रैल',
3343
+ 4 => 'मई',
3344
+ 5 => 'जून',
3345
+ 6 => 'जुलाई',
3346
+ 7 => 'अगस्त',
3347
+ 8 => 'सितंबर',
3348
+ 9 => 'अक्टूबर',
3349
+ 10 => 'नवंबर',
3350
+ 11 => 'दिसंबर',
3351
+ ),
3352
+ 'hu' =>
3353
+ array (
3354
+ 0 => 'Január',
3355
+ 1 => 'Február',
3356
+ 2 => 'Március',
3357
+ 3 => 'Április',
3358
+ 4 => 'Május',
3359
+ 5 => 'Június',
3360
+ 6 => 'Július',
3361
+ 7 => 'Augusztus',
3362
+ 8 => 'Szeptember',
3363
+ 9 => 'Október',
3364
+ 10 => 'November',
3365
+ 11 => 'December',
3366
+ ),
3367
+ 'it' =>
3368
+ array (
3369
+ 0 => 'Gennaio',
3370
+ 1 => 'Febbraio',
3371
+ 2 => 'Marzo',
3372
+ 3 => 'Aprile',
3373
+ 4 => 'Maggio',
3374
+ 5 => 'Giugno',
3375
+ 6 => 'Luglio',
3376
+ 7 => 'Agosto',
3377
+ 8 => 'Settembre',
3378
+ 9 => 'Ottobre',
3379
+ 10 => 'Novembre',
3380
+ 11 => 'Dicembre',
3381
+ ),
3382
+ 'ja' =>
3383
+ array (
3384
+ 0 => '1月',
3385
+ 1 => '2月',
3386
+ 2 => '3月',
3387
+ 3 => '4月',
3388
+ 4 => '5月',
3389
+ 5 => '6月',
3390
+ 6 => '7月',
3391
+ 7 => '8月',
3392
+ 8 => '9月',
3393
+ 9 => '10月',
3394
+ 10 => '11月',
3395
+ 11 => '12月',
3396
+ ),
3397
+ 'no' =>
3398
+ array (
3399
+ 0 => 'Januar',
3400
+ 1 => 'Februar',
3401
+ 2 => 'Mars',
3402
+ 3 => 'April',
3403
+ 4 => 'Mai',
3404
+ 5 => 'Juni',
3405
+ 6 => 'Juli',
3406
+ 7 => 'August',
3407
+ 8 => 'September',
3408
+ 9 => 'Oktober',
3409
+ 10 => 'November',
3410
+ 11 => 'Desember',
3411
+ ),
3412
+ 'pl' =>
3413
+ array (
3414
+ 0 => 'Styczeń',
3415
+ 1 => 'Luty',
3416
+ 2 => 'Marzec',
3417
+ 3 => 'Kwiecień',
3418
+ 4 => 'Maj',
3419
+ 5 => 'Czerwiec',
3420
+ 6 => 'Lipiec',
3421
+ 7 => 'Sierpień',
3422
+ 8 => 'Wrzesień',
3423
+ 9 => 'Październik',
3424
+ 10 => 'Listopad',
3425
+ 11 => 'Grudzień',
3426
+ ),
3427
+ 'pt' =>
3428
+ array (
3429
+ 0 => 'Janeiro',
3430
+ 1 => 'Fevereiro',
3431
+ 2 => 'Março',
3432
+ 3 => 'Abril',
3433
+ 4 => 'Maio',
3434
+ 5 => 'Junho',
3435
+ 6 => 'Julho',
3436
+ 7 => 'Agosto',
3437
+ 8 => 'Setembro',
3438
+ 9 => 'Outubro',
3439
+ 10 => 'Novembro',
3440
+ 11 => 'Dezembro',
3441
+ ),
3442
+ 'ro' =>
3443
+ array (
3444
+ 0 => 'Ianuarie',
3445
+ 1 => 'Februarie',
3446
+ 2 => 'Martie',
3447
+ 3 => 'Aprilie',
3448
+ 4 => 'Mai',
3449
+ 5 => 'Iunie',
3450
+ 6 => 'Iulie',
3451
+ 7 => 'August',
3452
+ 8 => 'Septembrie',
3453
+ 9 => 'Octombrie',
3454
+ 10 => 'Noiembrie',
3455
+ 11 => 'Decembrie',
3456
+ ),
3457
+ 'ru' =>
3458
+ array (
3459
+ 0 => 'январь',
3460
+ 1 => 'февраль',
3461
+ 2 => 'март',
3462
+ 3 => 'апрель',
3463
+ 4 => 'май',
3464
+ 5 => 'июнь',
3465
+ 6 => 'июль',
3466
+ 7 => 'август',
3467
+ 8 => 'сентябрь',
3468
+ 9 => 'октябрь',
3469
+ 10 => 'ноябрь',
3470
+ 11 => 'декабрь',
3471
+ ),
3472
+ 'sk' =>
3473
+ array (
3474
+ 0 => 'Január',
3475
+ 1 => 'Február',
3476
+ 2 => 'Marec',
3477
+ 3 => 'Apríl',
3478
+ 4 => 'Máj',
3479
+ 5 => 'Jún',
3480
+ 6 => 'Júl',
3481
+ 7 => 'August',
3482
+ 8 => 'September',
3483
+ 9 => 'Október',
3484
+ 10 => 'November',
3485
+ 11 => 'December',
3486
+ ),
3487
+ 'sl' =>
3488
+ array (
3489
+ 0 => 'Januar',
3490
+ 1 => 'Februar',
3491
+ 2 => 'Marec',
3492
+ 3 => 'April',
3493
+ 4 => 'Maj',
3494
+ 5 => 'Junij',
3495
+ 6 => 'Julij',
3496
+ 7 => 'Avgust',
3497
+ 8 => 'September',
3498
+ 9 => 'Oktober',
3499
+ 10 => 'November',
3500
+ 11 => 'December',
3501
+ ),
3502
+ 'es' =>
3503
+ array (
3504
+ 0 => 'Enero',
3505
+ 1 => 'Febrero',
3506
+ 2 => 'Marzo',
3507
+ 3 => 'Abril',
3508
+ 4 => 'Mayo',
3509
+ 5 => 'Junio',
3510
+ 6 => 'Julio',
3511
+ 7 => 'Agosto',
3512
+ 8 => 'Septiembre',
3513
+ 9 => 'Octubre',
3514
+ 10 => 'Noviembre',
3515
+ 11 => 'Diciembre',
3516
+ ),
3517
+ 'sv' =>
3518
+ array (
3519
+ 0 => 'Januari',
3520
+ 1 => 'Februari',
3521
+ 2 => 'Mars',
3522
+ 3 => 'April',
3523
+ 4 => 'Maj',
3524
+ 5 => 'Juni',
3525
+ 6 => 'Juli',
3526
+ 7 => 'Augusti',
3527
+ 8 => 'September',
3528
+ 9 => 'Oktober',
3529
+ 10 => 'November',
3530
+ 11 => 'December',
3531
+ ),
3532
+ 'tr' =>
3533
+ array (
3534
+ 0 => 'Ocak',
3535
+ 1 => 'Şubat',
3536
+ 2 => 'Mart',
3537
+ 3 => 'Nisan',
3538
+ 4 => 'Mayis',
3539
+ 5 => 'Haziran',
3540
+ 6 => 'Temmuz',
3541
+ 7 => 'Ağustos',
3542
+ 8 => 'Eylül',
3543
+ 9 => 'Ekim',
3544
+ 10 => 'Kasım',
3545
+ 11 => 'Aralık',
3546
+ ),
3547
+ 'uk' =>
3548
+ array (
3549
+ 0 => 'Січня',
3550
+ 1 => 'Лютий',
3551
+ 2 => 'Березень',
3552
+ 3 => 'квітень',
3553
+ 4 => 'травень',
3554
+ 5 => 'червень',
3555
+ 6 => 'липень',
3556
+ 7 => 'серпень',
3557
+ 8 => 'вересень',
3558
+ 9 => 'жовтень',
3559
+ 10 => 'листопад',
3560
+ 11 => 'грудень',
3561
+ ),
3562
+ 'gd' =>
3563
+ array (
3564
+ 0 => 'am Faoilleach',
3565
+ 1 => 'an Gearran',
3566
+ 2 => 'am Màrt',
3567
+ 3 => 'an Giblean',
3568
+ 4 => 'an Cèitean',
3569
+ 5 => 'an t-Ògmhios',
3570
+ 6 => 'an t-luchar',
3571
+ 7 => 'an Lùnastal',
3572
+ 8 => 'an t-Sultain',
3573
+ 9 => 'an Dàmhair',
3574
+ 10 => 'an t-Samhain',
3575
+ 11 => 'an Dùbhlachd',
3576
+ ),
3577
+ 'hr' =>
3578
+ array (
3579
+ 0 => 'Siječanj',
3580
+ 1 => 'Veljača',
3581
+ 2 => 'Ožujak',
3582
+ 3 => 'Travanj',
3583
+ 4 => 'Svibanj',
3584
+ 5 => 'Lipanj',
3585
+ 6 => 'Srpanj',
3586
+ 7 => 'Kolovoz',
3587
+ 8 => 'Rujan',
3588
+ 9 => 'Listopad',
3589
+ 10 => 'Studeni',
3590
+ 11 => 'Prosinac',
3591
+ ),
3592
+ 'id' =>
3593
+ array (
3594
+ 0 => 'Januari',
3595
+ 1 => 'Februari',
3596
+ 2 => 'Maret',
3597
+ 3 => 'April',
3598
+ 4 => 'Mei',
3599
+ 5 => 'Juni',
3600
+ 6 => 'Juli',
3601
+ 7 => 'Agustus',
3602
+ 8 => 'September',
3603
+ 9 => 'Oktober',
3604
+ 10 => 'November',
3605
+ 11 => 'Desember',
3606
+ ),
3607
+ 'is' =>
3608
+ array (
3609
+ 0 => 'Janúar',
3610
+ 1 => 'Febrúar',
3611
+ 2 => 'Mars',
3612
+ 3 => 'April',
3613
+ 4 => 'Maí',
3614
+ 5 => 'Júní',
3615
+ 6 => 'Júlí',
3616
+ 7 => 'Ágúst',
3617
+ 8 => 'September',
3618
+ 9 => 'Október',
3619
+ 10 => 'Nóvember',
3620
+ 11 => 'Desember',
3621
+ ),
3622
+ 'ko' =>
3623
+ array (
3624
+ 0 => '일월',
3625
+ 1 => '이월',
3626
+ 2 => '삼월',
3627
+ 3 => '사월',
3628
+ 4 => '오월',
3629
+ 5 => '유월',
3630
+ 6 => '칠월',
3631
+ 7 => '팔월',
3632
+ 8 => '구월',
3633
+ 9 => '시월',
3634
+ 10 => '십일월',
3635
+ 11 => '십이월',
3636
+ ),
3637
+ 'lt' =>
3638
+ array (
3639
+ 0 => 'Sausis',
3640
+ 1 => 'Vasaris',
3641
+ 2 => 'Kovas',
3642
+ 3 => 'Balandis',
3643
+ 4 => 'Gegužė',
3644
+ 5 => 'Birželis',
3645
+ 6 => 'Liepa',
3646
+ 7 => 'Rugpjūtis',
3647
+ 8 => 'Rugsėjis',
3648
+ 9 => 'Spalis',
3649
+ 10 => 'Lapkritis',
3650
+ 11 => 'Gruodis',
3651
+ ),
3652
+ 'ms' =>
3653
+ array (
3654
+ 0 => 'Januari',
3655
+ 1 => 'Februari',
3656
+ 2 => 'Mac',
3657
+ 3 => 'April',
3658
+ 4 => 'Mei',
3659
+ 5 => 'Jun',
3660
+ 6 => 'Julai',
3661
+ 7 => 'Ogos',
3662
+ 8 => 'September',
3663
+ 9 => 'Oktober',
3664
+ 10 => 'November',
3665
+ 11 => 'Disember',
3666
+ ),
3667
+ 'sr' =>
3668
+ array (
3669
+ 0 => 'Јануар',
3670
+ 1 => 'Фебруар',
3671
+ 2 => 'Март',
3672
+ 3 => 'Април',
3673
+ 4 => 'Mај',
3674
+ 5 => 'Јуни',
3675
+ 6 => 'Јул',
3676
+ 7 => 'Август',
3677
+ 8 => 'Cептембар',
3678
+ 9 => 'Октобар',
3679
+ 10 => 'Новембар',
3680
+ 11 => 'Децембар',
3681
+ ),
3682
+ 'th' =>
3683
+ array (
3684
+ 0 => 'มกราคม',
3685
+ 1 => 'กุมภาพันธ์',
3686
+ 2 => 'มีนาคม',
3687
+ 3 => 'เมษายน',
3688
+ 4 => 'พฤษภาคม',
3689
+ 5 => 'มิถุนายน',
3690
+ 6 => 'กรกฎาคม',
3691
+ 7 => 'สิงหาคม',
3692
+ 8 => 'กันยายน',
3693
+ 9 => 'ตุลาคม',
3694
+ 10 => 'พฤศจิกายน',
3695
+ 11 => 'ธันวาคม',
3696
+ ),
3697
+ 'vi' =>
3698
+ array (
3699
+ 0 => 'tháng một',
3700
+ 1 => 'tháng hai',
3701
+ 2 => 'tháng ba',
3702
+ 3 => 'tháng tư',
3703
+ 4 => 'tháng năm',
3704
+ 5 => 'tháng sáu',
3705
+ 6 => 'tháng bảy',
3706
+ 7 => 'tháng tám',
3707
+ 8 => 'tháng chín',
3708
+ 9 => 'tháng mười',
3709
+ 10 => 'tháng mười một',
3710
+ 11 => 'tháng mười hai',
3711
+ ),
3712
+ 'mk' =>
3713
+ array (
3714
+ 0 => 'Jануари',
3715
+ 1 => 'февруари',
3716
+ 2 => 'март',
3717
+ 3 => 'април',
3718
+ 4 => 'мај',
3719
+ 5 => 'јуни',
3720
+ 6 => 'јули',
3721
+ 7 => 'август',
3722
+ 8 => 'септември',
3723
+ 9 => 'октомври',
3724
+ 10 => 'ноември',
3725
+ 11 => 'декември',
3726
+ ),
3727
+ 'bg' =>
3728
+ array (
3729
+ 0 => 'Януари',
3730
+ 1 => 'февруари',
3731
+ 2 => 'Март',
3732
+ 3 => 'Aприл',
3733
+ 4 => 'май',
3734
+ 5 => 'юни',
3735
+ 6 => 'юли',
3736
+ 7 => 'Август',
3737
+ 8 => 'Септември',
3738
+ 9 => 'Октомври',
3739
+ 10 => 'Ноември',
3740
+ 11 => 'Декември',
3741
+ ),
3742
+ 'sq' =>
3743
+ array (
3744
+ 0 => 'Janar',
3745
+ 1 => 'Shkurt',
3746
+ 2 => 'Mars',
3747
+ 3 => 'Prill',
3748
+ 4 => 'Maj',
3749
+ 5 => 'Qershor',
3750
+ 6 => 'Korrik',
3751
+ 7 => 'Gusht',
3752
+ 8 => 'Shtator',
3753
+ 9 => 'Tetor',
3754
+ 10 => 'Nëntor',
3755
+ 11 => 'Dhjetor',
3756
+ ),
3757
+ 'af' =>
3758
+ array (
3759
+ 0 => 'Januarie',
3760
+ 1 => 'Februarie',
3761
+ 2 => 'Maart',
3762
+ 3 => 'April',
3763
+ 4 => 'Mei',
3764
+ 5 => 'Junie',
3765
+ 6 => 'Julie',
3766
+ 7 => 'Augustus',
3767
+ 8 => 'September',
3768
+ 9 => 'Oktober',
3769
+ 10 => 'November',
3770
+ 11 => 'Desember',
3771
+ ),
3772
+ 'az' =>
3773
+ array (
3774
+ 0 => 'Yanvar',
3775
+ 1 => 'Fevral',
3776
+ 2 => 'Mart',
3777
+ 3 => 'Aprel',
3778
+ 4 => 'May',
3779
+ 5 => 'İyun',
3780
+ 6 => 'İyul',
3781
+ 7 => 'Avqust',
3782
+ 8 => 'Sentyabr',
3783
+ 9 => 'Oktyabr',
3784
+ 10 => 'Noyabr',
3785
+ 11 => 'Dekabr',
3786
+ ),
3787
+ 'bn' =>
3788
+ array (
3789
+ 0 => 'জানুয়ারি',
3790
+ 1 => 'ফেব্রুয়ারি',
3791
+ 2 => 'মার্চ',
3792
+ 3 => 'এপ্রিল',
3793
+ 4 => 'মে',
3794
+ 5 => 'জুন',
3795
+ 6 => 'জুলাই',
3796
+ 7 => 'আগস্ট',
3797
+ 8 => 'সেপ্টেম্বর',
3798
+ 9 => 'অক্টোবর',
3799
+ 10 => 'নভেম্বর',
3800
+ 11 => 'ডিসেম্বর',
3801
+ ),
3802
+ 'bs' =>
3803
+ array (
3804
+ 0 => 'Januar',
3805
+ 1 => 'Februar',
3806
+ 2 => 'Mart',
3807
+ 3 => 'April',
3808
+ 4 => 'Maj',
3809
+ 5 => 'Jun',
3810
+ 6 => 'Jul',
3811
+ 7 => 'Avgust',
3812
+ 8 => 'Septembar',
3813
+ 9 => 'Oktobar',
3814
+ 10 => 'Novembar',
3815
+ 11 => 'Decembar',
3816
+ ),
3817
+ 'cy' =>
3818
+ array (
3819
+ 0 => 'Ionawr',
3820
+ 1 => 'Chwefror',
3821
+ 2 => 'Mawrth',
3822
+ 3 => 'Ebrill',
3823
+ 4 => 'Mai',
3824
+ 5 => 'Mehefin',
3825
+ 6 => 'Gorffennaf',
3826
+ 7 => 'Awst',
3827
+ 8 => 'Medi',
3828
+ 9 => 'Hydref',
3829
+ 10 => 'Tachwedd',
3830
+ 11 => 'Rhagfyr',
3831
+ ),
3832
+ 'fa' =>
3833
+ array (
3834
+ 0 => 'ژانویه',
3835
+ 1 => 'فوریه',
3836
+ 2 => 'مارس',
3837
+ 3 => 'آوریل',
3838
+ 4 => 'ممکن است',
3839
+ 5 => 'ژوئن',
3840
+ 6 => 'جولای',
3841
+ 7 => 'اوت',
3842
+ 8 => 'سپتامبر',
3843
+ 9 => 'اکتبر',
3844
+ 10 => 'نوامبر',
3845
+ 11 => 'دسامبر',
3846
+ ),
3847
+ 'gl' =>
3848
+ array (
3849
+ 0 => 'Xaneiro',
3850
+ 1 => 'Febreiro',
3851
+ 2 => 'Marzo',
3852
+ 3 => 'Abril',
3853
+ 4 => 'Maio',
3854
+ 5 => 'Xuño',
3855
+ 6 => 'Xullo',
3856
+ 7 => 'Agosto',
3857
+ 8 => 'Setembro',
3858
+ 9 => 'Outubro',
3859
+ 10 => 'Novembro',
3860
+ 11 => 'Decembro',
3861
+ ),
3862
+ 'hy' =>
3863
+ array (
3864
+ 0 => 'Հունվար',
3865
+ 1 => 'փետրվար',
3866
+ 2 => 'մարտ',
3867
+ 3 => 'ապրիլ',
3868
+ 4 => 'մայիս',
3869
+ 5 => 'հունիս',
3870
+ 6 => 'հուլիս',
3871
+ 7 => 'օգոստոս',
3872
+ 8 => 'սեպտեմբեր',
3873
+ 9 => 'հոկտեմբեր',
3874
+ 10 => 'նոյեմբեր',
3875
+ 11 => 'դեկտեմբեր',
3876
+ ),
3877
+ 'ka' =>
3878
+ array (
3879
+ 0 => 'იანვარი',
3880
+ 1 => 'თებერვალი',
3881
+ 2 => 'მარტი',
3882
+ 3 => 'აპრილი',
3883
+ 4 => 'მაისი',
3884
+ 5 => 'ივნისი',
3885
+ 6 => 'ივლისი',
3886
+ 7 => 'აგვისტო',
3887
+ 8 => 'სექტემბერი',
3888
+ 9 => 'ოქტომბერი',
3889
+ 10 => 'ნოემბერი',
3890
+ 11 => 'დეკემბერი',
3891
+ ),
3892
+ 'kk' =>
3893
+ array (
3894
+ 0 => 'қаңтар',
3895
+ 1 => 'ақпан',
3896
+ 2 => 'наурыз',
3897
+ 3 => 'сәуір',
3898
+ 4 => 'мамыр',
3899
+ 5 => 'маусым',
3900
+ 6 => 'шілде',
3901
+ 7 => 'тамыз',
3902
+ 8 => 'қыркүйек',
3903
+ 9 => 'қазан',
3904
+ 10 => 'қараша',
3905
+ 11 => 'желтоқсан',
3906
+ ),
3907
+ );
3908
+ private static $page_urls = array (
3909
+ 'facebook' => 'https://www.facebook.com/pg/%page_id%',
3910
+ 'google' => 'https://www.google.com/maps/search/?api=1&query=Google&query_place_id=%page_id%',
3911
+ 'tripadvisor' => 'https://www.tripadvisor.com/%page_id%',
3912
+ 'yelp' => 'https://www.yelp.com/biz/%25page_id%25',
3913
+ 'booking' => 'https://www.booking.com/hotel/%page_id%',
3914
+ 'amazon' => 'https://www.amazon.%domain%/sp?seller=%page_id%',
3915
+ 'arukereso' => 'https://www.arukereso.hu/stores/%page_id%/#velemenyek',
3916
+ 'airbnb' => 'https://www.airbnb.com/rooms/%page_id%',
3917
+ 'hotels' => 'https://hotels.com/%page_id%',
3918
+ 'opentable' => 'https://www.opentable.com/%page_id%',
3919
+ 'foursquare' => 'https://foursquare.com/v/%25page_id%25',
3920
+ 'capterra' => 'https://www.capterra.com/p/%page_id%/reviews',
3921
+ 'szallashu' => 'https://szallas.hu/%page_id%?#rating',
3922
+ 'thumbtack' => 'https://www.thumbtack.com/%page_id%',
3923
+ 'expedia' => 'https://www.expedia.com/%page_id%',
3924
+ 'zillow' => 'https://www.zillow.com/profile/%page_id%/#reviews',
3925
+ 'wordpressPlugin' => 'https://www.wordpress.org/plugins/%page_id%',
3926
+ 'aliexpress' => 'https://www.aliexpress.com/store/%page_id%',
3927
+ 'alibaba' => 'https://%page_id%.en.alibaba.com',
3928
+ 'sourceForge' => 'https://sourceforge.net/software/product/%page_id%/',
3929
+ 'ebay' => 'https://www.ebay.com/fdbk/feedback_profile/%page_id%',
3930
+ );
3931
+ public function getPageUrl()
3932
+ {
3933
+ if(!isset(self::$page_urls[ $this->shortname ]))
3934
+ {
3935
+ return "";
3936
+ }
3937
+ $page_details = get_option($this->get_option_name('page-details'));
3938
+ if(!$page_details)
3939
+ {
3940
+ return "";
3941
+ }
3942
+ $page_id = $page_details['id'];
3943
+ $domain = "";
3944
+ if($this->shortname == "amazon" || $this->shortname == "arukereso")
3945
+ {
3946
+ $tmp = explode('|', $page_id);
3947
+ $domain = $tmp[0];
3948
+ if(isset($tmp[1]))
3949
+ {
3950
+ $page_id = $tmp[1];
3951
+ }
3952
+ else
3953
+ {
3954
+ $domain = 'com';
3955
+ }
3956
+ }
3957
+ $url = str_replace([ '%domain%', '%page_id%', '%25page_id%25' ], [ $domain, $page_id, $page_id ], self::$page_urls[ $this->shortname ]);
3958
+ if($this->shortname == "airbnb")
3959
+ {
3960
+ $url = str_replace('rooms/experiences/', 'experiences/', $url);
3961
+ }
3962
+ if($this->shortname == "amazon" && strpos($page_id, '/') !== false)
3963
+ {
3964
+ $url = str_replace('sp?seller=', '', $url);
3965
+ }
3966
+ return $url;
3967
+ }
3968
+ public function getReviewHtml($review)
3969
+ {
3970
+ $html = preg_replace('/\r\n|\r|\n/', "\n", html_entity_decode($review->text, ENT_HTML5 | ENT_QUOTES));
3971
+ if(isset($review->highlight) && $review->highlight)
3972
+ {
3973
+ $tmp = explode(',', $review->highlight);
3974
+ $start = (int)$tmp[0];
3975
+ $length = (int)$tmp[1];
3976
+ $html = mb_substr($html, 0, $start) . '<mark class="ti-highlight">' . mb_substr($html, $start, $length) . '</mark>' . mb_substr($html, $start + $length, mb_strlen($html));
3977
+ /* format <mark></mark> tags in other tags
3978
+ * like:
3979
+ * <strong><mark>...</strong>...</mark>....
3980
+ * to:
3981
+ * <strong><mark>...</mark></strong><mark>...</mark>....
3982
+ */
3983
+ preg_match('/<mark class="ti-highlight">(.*)<\/mark>/Us', $html, $matches);
3984
+ if(isset($matches[1]))
3985
+ {
3986
+ $replaced_content = preg_replace('/(<\/?[^>]+>)/U', '</mark>$1<mark class="ti-highlight">', $matches[1]);
3987
+ $html = str_replace($matches[0], '<mark class="ti-highlight">' . $replaced_content . '</mark>', $html);
3988
+ }
3989
+ }
3990
+ return $html;
3991
+ }
3992
+ public function get_default_no_rating_text($style_id, $set_id)
3993
+ {
3994
+ $value = in_array($style_id, [ 15, 19, 36, 38, 39, 44 ]) ? 1 : 0;
3995
+ if($set_id && self::$widget_styles[$set_id]['_vars']['dots'] === 'true')
3996
+ {
3997
+ $value = 1;
3998
+ }
3999
+ return $value;
4000
+ }
4001
+ private $preview_content = null;
4002
+ private $template_cache = null;
4003
+ public function get_noreg_list_reviews($force_platform = null, $list_all = false, $default_style_id = 4, $default_set_id = 'light-background', $only_preview = false, $default_reviews = false)
4004
+ {
4005
+ global $wpdb;
4006
+ $page_details = get_option($this->get_option_name('page-details'));
4007
+ $style_id = (int)get_option($this->get_option_name('style-id'), 4);
4008
+ $set_id = get_option($this->get_option_name('scss-set'), 'light-background');
4009
+ $content = get_option($this->get_option_name('review-content'));
4010
+ $lang = get_option($this->get_option_name('lang'), 'en');
4011
+ $dateformat = get_option($this->get_option_name('dateformat'), 'Y-m-d');
4012
+ $no_rating_text = get_option($this->get_option_name('no-rating-text'), $this->get_default_no_rating_text($style_id, $set_id));
4013
+ $verified_icon = get_option($this->get_option_name('verified-icon'), 0);
4014
+ $show_reviewers_photo = get_option($this->get_option_name('show-reviewers-photo'), self::$widget_styles[$set_id]['reviewer-photo'] ? 1 : 0);
4015
+ $show_logos = get_option($this->get_option_name('show-logos'), self::$widget_styles[$set_id]['hide-logos'] ? 0 : 1);
4016
+ $show_stars = get_option($this->get_option_name('show-stars'), self::$widget_styles[$set_id]['hide-stars'] ? 0 : 1);
4017
+ $need_to_parse = true;
4018
+ if($only_preview)
4019
+ {
4020
+ $content = false;
4021
+ $style_id = $default_style_id;
4022
+ $set_id = $default_set_id;
4023
+ $show_logos = self::$widget_styles[$set_id]['hide-logos'] ? 0 : 1;
4024
+ $show_stars = self::$widget_styles[$set_id]['hide-stars'] ? 0 : 1;
4025
+ $show_reviewers_photo = self::$widget_styles[$set_id]['reviewer-photo'] ? 1 : 0;
4026
+ if($this->preview_content && $this->preview_content['id'] == $style_id)
4027
+ {
4028
+ $content = $this->preview_content['content'];
4029
+ }
4030
+ $no_rating_text = $this->get_default_no_rating_text($style_id, $set_id);
4031
+ }
4032
+ $sql_rating_field = 'rating';
4033
+ if($this->is_ten_scale_rating_platform())
4034
+ {
4035
+ $sql_rating_field = 'ROUND(rating / 2, 0)';
4036
+ }
4037
+ $sql = 'SELECT *, rating as original_rating, '. $sql_rating_field .' as rating FROM `'. $this->get_noreg_tablename($force_platform) .'` ';
4038
+ $filter = get_option($this->get_option_name('filter'));
4039
+ if(!$list_all && $filter)
4040
+ {
4041
+ if(count($filter['stars']) == 0)
4042
+ {
4043
+ $sql .= 'WHERE 0 ';
4044
+ }
4045
+ else
4046
+ {
4047
+ $sql .= 'WHERE ('. $sql_rating_field .' IN ('. implode(',', $filter['stars']) .')';
4048
+ if(in_array(5, $filter['stars']))
4049
+ {
4050
+ $sql .= ' or rating IS NULL';
4051
+ }
4052
+ $sql .= ') ';
4053
+ if($filter['only-ratings'])
4054
+ {
4055
+ $sql .= 'and text != "" ';
4056
+ }
4057
+ }
4058
+ }
4059
+ $sql .= 'ORDER BY date DESC';
4060
+ if($only_preview || !$list_all)
4061
+ {
4062
+ switch($style_id)
4063
+ {
4064
+ case 16:
4065
+ case 31:
4066
+ case 38:
4067
+ $sql .= ' LIMIT 9';
4068
+ break;
4069
+ default:
4070
+ $sql .= ' LIMIT 10';
4071
+ break;
4072
+ }
4073
+ }
4074
+ $reviews = [];
4075
+ if($this->is_noreg_table_exists())
4076
+ {
4077
+ $reviews = $wpdb->get_results($sql);
4078
+ }
4079
+ if(!count($reviews) && $default_reviews)
4080
+ {
4081
+ $lang = substr(get_locale(), 0, 2);
4082
+ if(!isset(self::$widget_languages[$lang]))
4083
+ {
4084
+ $lang = 'en';
4085
+ }
4086
+ if(!isset($page_details['avatar_url']))
4087
+ {
4088
+ $page_details['avatar_url'] = 'https://cdn.trustindex.io/companies/default_avatar.jpg';
4089
+ }
4090
+ $rating_num = 5;
4091
+ if(in_array($style_id, [ 16, 31, 38 ]))
4092
+ {
4093
+ $rating_num = 9;
4094
+ }
4095
+ else if(in_array(self::$widget_templates[ 'templates' ][ $style_id ]['type'], [ 'sidebar', 'list' ]))
4096
+ {
4097
+ $rating_num = 3;
4098
+ }
4099
+ $page_details['rating_number'] = $rating_num;
4100
+ if($this->is_ten_scale_rating_platform())
4101
+ {
4102
+ $page_details['rating_score'] = number_format(rand(80, 100) / 10, 1);
4103
+ }
4104
+ else
4105
+ {
4106
+ $page_details['rating_score'] = rand(4, 5);
4107
+ }
4108
+ if(!isset($page_details['id']))
4109
+ {
4110
+ $page_details['id'] = '';
4111
+ }
4112
+ if(!isset($page_details['name']))
4113
+ {
4114
+ $page_details['name'] = get_bloginfo('name');
4115
+ }
4116
+ $reviews = $this->getRandomReviews($rating_num);
4117
+ }
4118
+ if(!count($reviews))
4119
+ {
4120
+ return self::get_alertbox(
4121
+ "error",
4122
+ '<br />' . self::___('There are no reviews on your %s platform.', [ ucfirst($this->shortname) ]),
4123
+ false
4124
+ );
4125
+ }
4126
+ if(self::is_amp_active() && self::is_amp_enabled())
4127
+ {
4128
+ return self::get_alertbox(
4129
+ "error",
4130
+ '<br />' . self::___('Free plugin features are unavailable with AMP plugin.'),
4131
+ false
4132
+ );
4133
+ }
4134
+ $script_name = 'trustindex-js';
4135
+ if(!wp_script_is($script_name, 'enqueued'))
4136
+ {
4137
+ wp_enqueue_script($script_name, 'https://cdn.trustindex.io/loader.js', [], false, true);
4138
+ }
4139
+ $scripts = wp_scripts();
4140
+ if(isset($scripts->registered[ $script_name ]) && !isset($scripts->registered[ $script_name ]->extra['after']))
4141
+ {
4142
+ wp_add_inline_script($script_name, '(function ti_init() {
4143
+ if(typeof Trustindex == "undefined"){setTimeout(ti_init, 1985);return false;}
4144
+ if(typeof Trustindex.pager_inited != "undefined"){return false;}
4145
+ Trustindex.init_pager(document.querySelectorAll(".ti-widget"));
4146
+ })();');
4147
+ }
4148
+ if($content === false || empty($content) || (strpos($content, '<!-- R-LIST -->') === false && $need_to_parse))
4149
+ {
4150
+ if(!$this->template_cache)
4151
+ {
4152
+ add_action('http_api_curl', function( $handle ){
4153
+ curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
4154
+ curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
4155
+ }, 10);
4156
+ $response = wp_remote_get("https://cdn.trustindex.io/widget-assets/template/$lang.json");
4157
+ if(is_wp_error($response))
4158
+ {
4159
+ echo $this->get_alertbox('error', '<br />' .$this->___('Could not download the template for the widget.<br />Please reload the page.<br />If the problem persists, please write an email to support@trustindex.io.'));
4160
+ die;
4161
+ }
4162
+ $this->template_cache = json_decode($response['body'], true);
4163
+ }
4164
+ $content = $this->template_cache[$style_id];
4165
+ if(!$only_preview)
4166
+ {
4167
+ update_option($this->get_option_name('review-content'), $content, false);
4168
+ }
4169
+ }
4170
+ if($need_to_parse)
4171
+ {
4172
+ $content = $this->parse_noreg_list_reviews([
4173
+ 'content' => $content,
4174
+ 'reviews' => $reviews,
4175
+ 'page_details' => $page_details,
4176
+ 'style_id' => $style_id,
4177
+ 'set_id' => $set_id,
4178
+ 'no_rating_text' => $no_rating_text,
4179
+ 'dateformat' => $dateformat,
4180
+ 'language' => $lang,
4181
+ 'verified_icon' => $verified_icon,
4182
+ 'show_reviewers_photo' => $show_reviewers_photo
4183
+ ]);
4184
+ $this->preview_content = [
4185
+ 'id' => $style_id,
4186
+ 'content' => $content
4187
+ ];
4188
+ }
4189
+ $content = preg_replace('/data-set[_-]id=[\'"][^\'"]*[\'"]/m', 'data-set-id="'. $set_id .'"', $content);
4190
+ $class_appends = [];
4191
+ $widget_type = self::$widget_templates[ 'templates' ][ $style_id ]['type'];
4192
+ if(!in_array($widget_type, [ 'button', 'badge' ]) && !$show_logos)
4193
+ {
4194
+ array_push($class_appends, 'ti-no-logo');
4195
+ }
4196
+ if(!in_array($widget_type, [ 'button', 'badge' ]) && !$show_stars)
4197
+ {
4198
+ array_push($class_appends, 'ti-no-stars');
4199
+ }
4200
+ if(!$show_reviewers_photo)
4201
+ {
4202
+ array_push($class_appends, 'ti-no-profile-img');
4203
+ }
4204
+ $free_css_class = 'ti-' . substr($this->shortname, 0, 4);
4205
+ if($only_preview)
4206
+ {
4207
+ wp_enqueue_style("trustindex-widget-css-". $this->shortname ."-". $style_id . "-". $set_id, "https://cdn.trustindex.io/assets/widget-presetted-css/". $style_id ."-". $set_id .".css");
4208
+ }
4209
+ else
4210
+ {
4211
+ $widget_css = get_option($this->get_option_name('css-content'));
4212
+ if(!$widget_css)
4213
+ {
4214
+ wp_enqueue_style("trustindex-widget-css-" . $this->shortname, "https://cdn.trustindex.io/widget-assets/css/". $style_id ."-blue.css");
4215
+ }
4216
+ else
4217
+ {
4218
+ array_push($class_appends, $free_css_class);
4219
+ }
4220
+ }
4221
+ if($class_appends)
4222
+ {
4223
+ $content = str_replace('class="ti-widget" data-layout-id=', 'class="ti-widget '. implode(' ', $class_appends) .'" data-layout-id=', $content);
4224
+ }
4225
+ if(!$only_preview)
4226
+ {
4227
+ if(!wp_style_is('ti-widget-css-' . $this->shortname, 'registered'))
4228
+ {
4229
+ if(!get_option($this->get_option_name('load-css-inline'), 0))
4230
+ {
4231
+ if (class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->editor->is_edit_mode())
4232
+ {
4233
+ }
4234
+ else
4235
+ {
4236
+ return self::get_alertbox(
4237
+ "error",
4238
+ '<br />' . self::___('CSS file could not saved.'),
4239
+ false
4240
+ );
4241
+ }
4242
+ }
4243
+ $content .= '<style type="text/css">'. $widget_css .'</style>';
4244
+ }
4245
+ else
4246
+ {
4247
+ wp_enqueue_style('ti-widget-css-' . $this->shortname);
4248
+ }
4249
+ }
4250
+ return $content;
4251
+ }
4252
+ public function parse_noreg_list_reviews($array = [])
4253
+ {
4254
+ preg_match('/<!-- R-LIST -->(.*)<!-- R-LIST -->/', $array['content'], $matches);
4255
+ if(isset($matches[1]))
4256
+ {
4257
+ $reviewContent = "";
4258
+ if($array['reviews'] && count($array['reviews'])) foreach($array['reviews'] as $r)
4259
+ {
4260
+ $date = "&nbsp;";
4261
+ if($r->date && $r->date != '0000-00-00')
4262
+ {
4263
+ $date = str_replace(self::$widget_month_names['en'], self::$widget_month_names[$array['language']], date($array['dateformat'], strtotime($r->date)));
4264
+ }
4265
+ $rating_content = $this->get_rating_stars($r->rating);
4266
+ if($this->shortname == 'facebook' && in_array($r->rating, [ 1, 5 ]))
4267
+ {
4268
+ if($r->rating == 1)
4269
+ {
4270
+ $rating_content = self::$widget_recommendation_texts[ $array['language'] ]['negative'];
4271
+ }
4272
+ else
4273
+ {
4274
+ $rating_content = self::$widget_recommendation_texts[ $array['language'] ]['positive'];
4275
+ }
4276
+ $r_text = trim(str_replace([ 'NOT_RECOMMEND_ICON', 'RECOMMEND_ICON' ], '', $rating_content));
4277
+ $rating_content = '<span class="ti-recommendation">'. str_replace([
4278
+ 'NOT_RECOMMEND_ICON',
4279
+ 'RECOMMEND_ICON',
4280
+ ' ' . $r_text,
4281
+ $r_text . ' '
4282
+ ], [
4283
+ '<span class="ti-recommendation-icon negative"></span>',
4284
+ '<span class="ti-recommendation-icon positive"></span>',
4285
+ '<span class="ti-recommendation-title">'. $r_text .'</span>',
4286
+ '<span class="ti-recommendation-title">'. $r_text .'</span>'
4287
+ ], $rating_content) .'</span>';
4288
+ $rating_content .= '<span class="ti-dummy-stars">';
4289
+ for($si = 1; $si <= 5; $si++)
4290
+ {
4291
+ $rating_content .= '<span class="ti-star '. ($si == 1 || $r->rating == 5 ? 'f' : 'e') .'"></span>';
4292
+ }
4293
+ $rating_content .= '</span>';
4294
+ }
4295
+ else if($this->shortname == 'ebay' && in_array($r->rating, [ 1, 3, 5 ]))
4296
+ {
4297
+ if($r->rating == 1)
4298
+ {
4299
+ $polarity = 'negative';
4300
+ }
4301
+ else if($r->rating == 3)
4302
+ {
4303
+ $polarity = 'neutral';
4304
+ }
4305
+ else
4306
+ {
4307
+ $polarity = 'positive';
4308
+ }
4309
+ $rating_content = '<span class="ti-polarity"><span class="ti-polarity-icon ' . $polarity . '"></span></span>';
4310
+ }
4311
+ else if($this->is_ten_scale_rating_platform())
4312
+ {
4313
+ $rating_content = '<div class="ti-rating-box">'. $this->formatTenRating($r->original_rating) .'</div>';
4314
+ }
4315
+ if($array['verified_icon'])
4316
+ {
4317
+ if($array['style_id'] == 21)
4318
+ {
4319
+ $rating_content .= '</div><div class="ti-logo-text"><span class="ti-verified-review"><span class="ti-verified-tooltip">'. self::$widget_verified_texts[ $array['language'] ] .'</span></span><span class="ti-logo-title">Trustindex</span></div><div>';
4320
+ }
4321
+ else
4322
+ {
4323
+ $rating_content .= '<span class="ti-verified-review"><span class="ti-verified-tooltip">'. self::$widget_verified_texts[ $array['language'] ] .'</span></span>';
4324
+ }
4325
+ }
4326
+ $platform_name = ucfirst($this->getShortName());
4327
+ if($platform_name == 'Szallashu')
4328
+ {
4329
+ $tmp = explode('/', $array['page_details']['id']);
4330
+ $platform_name .= '" data-domain="' . $tmp[0];
4331
+ }
4332
+ if(!$array['show_reviewers_photo'])
4333
+ {
4334
+ $matches[1] = str_replace('<div class="ti-profile-img"> <img src="%reviewer_photo%" alt="%reviewer_name%" /> </div>', '', $matches[1]);
4335
+ }
4336
+ $reviewContent .= str_replace([
4337
+ '%platform%',
4338
+ '%reviewer_photo%',
4339
+ '%reviewer_name%',
4340
+ '%created_at%',
4341
+ '%text%',
4342
+ '<span class="ti-star f"></span><span class="ti-star f"></span><span class="ti-star f"></span><span class="ti-star f"></span><span class="ti-star f"></span>'
4343
+ ], [
4344
+ $platform_name,
4345
+ $r->user_photo,
4346
+ $r->user,
4347
+ $date,
4348
+ $this->getReviewHtml($r),
4349
+ $rating_content
4350
+ ], $matches[1]);
4351
+ $reviewContent = str_replace('<div></div>', '', $reviewContent);
4352
+ }
4353
+ $array['content'] = str_replace($matches[0], $reviewContent, $array['content']);
4354
+ }
4355
+ $rating_count = $array['page_details']['rating_number'];
4356
+ $rating_score = $array['page_details']['rating_score'];
4357
+ if(empty($rating_count))
4358
+ {
4359
+ $rating_count = count($array['reviews']);
4360
+ }
4361
+ if(empty($rating_score))
4362
+ {
4363
+ $rating_sum = 0.0;
4364
+ foreach($array['reviews'] as $review)
4365
+ {
4366
+ $rating_sum += (float)$review->rating;
4367
+ }
4368
+ $c = count($array['reviews']);
4369
+ $rating_score = $c ? $rating_sum / $c : 0;
4370
+ }
4371
+ $array['content'] = str_replace([
4372
+ '%platform%',
4373
+ '%site_name%',
4374
+ "RATING_NUMBER",
4375
+ "RATING_SCORE",
4376
+ "RATING_SCALE",
4377
+ "RATING_TEXT",
4378
+ "PLATFORM_URL_LOGO",
4379
+ "PLATFORM_NAME",
4380
+ '<span class="ti-star e"></span><span class="ti-star e"></span><span class="ti-star e"></span><span class="ti-star e"></span><span class="ti-star e"></span>',
4381
+ 'PLATFORM_SMALL_LOGO'
4382
+ ], [
4383
+ ucfirst($this->getShortName()),
4384
+ $array['page_details']['name'],
4385
+ $rating_count,
4386
+ $rating_score,
4387
+ $this->is_ten_scale_rating_platform() ? 10 : 5,
4388
+ $this->get_rating_text($rating_score, $array['language']),
4389
+ $array['page_details']['avatar_url'],
4390
+ $this->get_platform_name($this->getShortName(), $array['page_details']['id']),
4391
+ $this->is_ten_scale_rating_platform() ? "<div class='ti-rating-box'>". $this->formatTenRating($rating_score) ."</div>" : $this->get_rating_stars($rating_score),
4392
+ '<div class="ti-small-logo"><img src="'. $this->get_plugin_file_url('static/img/platform/logo.svg') . '" alt="'. ucfirst($this->getShortName()) .'"></div>',
4393
+ ], $array['content']);
4394
+ if($this->isDarkLogo($array['style_id'], $array['set_id']))
4395
+ {
4396
+ $array['content'] = str_replace('img/platform/logo', 'img/platform/logo-dark', $array['content']);
4397
+ $array['content'] = str_replace('platform/'. ucfirst($this->getShortName()) .'/logo', 'platform/'. ucfirst($this->getShortName()) .'/logo-dark', $array['content']);
4398
+ }
4399
+ if($this->is_ten_scale_rating_platform() && $array['style_id'] == 11)
4400
+ {
4401
+ $array['content'] = str_replace('<span class="ti-rating">'. $rating_score .'</span> ', '', $array['content']);
4402
+ }
4403
+ if($this->shortname == 'szallashu' || $this->shortname == 'arukereso')
4404
+ {
4405
+ $split = '/';
4406
+ $replace_hu = false;
4407
+ if($this->shortname == 'arukereso')
4408
+ {
4409
+ $split = '|';
4410
+ $replace_hu = true;
4411
+ }
4412
+ $tmp = explode($split, $array['page_details']['id']);
4413
+ $array['content'] = str_replace([ 'img/platform/logo.svg', 'img/platform/logo-dark.svg' ], [ 'img/platform/logo-'. $tmp[0] .'.svg', 'img/platform/logo-'. $tmp[0] .'-dark.svg' ], $array['content']);
4414
+ $array['content'] = str_replace([ 'platform/'. ucfirst($this->getShortName()) .'/logo.svg', 'platform/'. ucfirst($this->getShortName()) .'/logo-dark.svg' ], [ 'platform/'. ucfirst($this->shortname) .'/logo-'. $tmp[0] .'.svg', 'platform/'. ucfirst($this->shortname) .'/logo-'. $tmp[0] .'-dark.svg' ], $array['content']);
4415
+ if($replace_hu)
4416
+ {
4417
+ $array['content'] = str_replace('img/platform/logo-hu', 'img/platform/logo', $array['content']);
4418
+ $array['content'] = str_replace('platform/'. ucfirst($this->getShortName()) .'/logo-hu', 'platform/'. ucfirst($this->getShortName()) .'/logo', $array['content']);
4419
+ }
4420
+ }
4421
+ if(in_array($array['style_id'], [24, 25, 26, 27, 28, 29, 35]))
4422
+ {
4423
+ $array['content'] = str_replace('%footer_link%', $this->getPageUrl(), $array['content']);
4424
+ }
4425
+ else
4426
+ {
4427
+ $array['content'] = preg_replace('/<a href=[\'"]%footer_link%[\'"][^>]*>(.+)<\/a>/mU', '$1', $array['content']);
4428
+ }
4429
+ if($array['no_rating_text'] && $array['style_id'] != 11)
4430
+ {
4431
+ if(in_array($array['style_id'], [6, 7]))
4432
+ {
4433
+ $array['content'] = preg_replace('/<div class="ti-footer">.*<\/div>/mU', '<div class="ti-footer"></div>', $array['content']);
4434
+ }
4435
+ else if(in_array($array['style_id'], [31, 33]))
4436
+ {
4437
+ $array['content'] = preg_replace('/<div class="ti-header source-.*<\/div>\s?<div class="ti-reviews-container">/mU', '<div class="ti-reviews-container">', $array['content']);
4438
+ }
4439
+ else
4440
+ {
4441
+ $array['content'] = preg_replace('/<div class="ti-rating-text">.*<\/div>/mU', '', $array['content']);
4442
+ }
4443
+ }
4444
+ preg_match('/src="([^"]+logo[^\.]*\.svg)"/m', $array['content'], $matches);
4445
+ if(isset($matches[1]) && !empty($matches[1]))
4446
+ {
4447
+ $array['content'] = str_replace($matches[0], $matches[0] . ' width="150" height="25"', $array['content']);
4448
+ }
4449
+ return $array['content'];
4450
+ }
4451
+ public function isDarkLogo($layout_id, $color_schema)
4452
+ {
4453
+ if(in_array($layout_id, [ 5, 9, 31, 34, 33 ]))
4454
+ {
4455
+ return substr($color_schema, 0, 5) == 'dark-';
4456
+ }
4457
+ switch($color_schema)
4458
+ {
4459
+ case 'light-contrast':
4460
+ case 'light-contrast-large':
4461
+ case 'light-contrast-large-blue':
4462
+ case 'dark-background':
4463
+ case 'dark-border':
4464
+ return true;
4465
+ }
4466
+ return false;
4467
+ }
4468
+ public function get_platform_name($type, $id = "")
4469
+ {
4470
+ $text = ucfirst($type);
4471
+ if($text == "Szallashu")
4472
+ {
4473
+ $domains = [
4474
+ 'cz' => 'Hotely.cz',
4475
+ 'hu' => 'Szallas.hu',
4476
+ 'ro' => 'Hotelguru.ro',
4477
+ 'com' => 'Revngo.com',
4478
+ 'pl' => 'Noclegi.pl'
4479
+ ];
4480
+ $tmp = explode('/', $id);
4481
+ if(isset($domains[ $tmp[0] ]))
4482
+ {
4483
+ $text = $domains[ $tmp[0] ];
4484
+ }
4485
+ }
4486
+ else if($text == "Arukereso")
4487
+ {
4488
+ $domains = [
4489
+ 'hu' => 'Árukereső.hu',
4490
+ 'bg' => 'Pazaruvaj.com',
4491
+ 'ro' => 'Compari.ro'
4492
+ ];
4493
+ $tmp = explode('|', $id);
4494
+ if(isset($domains[ $tmp[0] ]))
4495
+ {
4496
+ $text = $domains[ $tmp[0] ];
4497
+ }
4498
+ }
4499
+ else if($text == "WordpressPlugin")
4500
+ {
4501
+ $text = "Wordpress Plugin";
4502
+ }
4503
+ return $text;
4504
+ }
4505
+ public function get_rating_text($rating, $lang = "en")
4506
+ {
4507
+ $texts = self::$widget_rating_texts[$lang];
4508
+ $rating = round($rating);
4509
+ if($rating < 1) $rating = 1;
4510
+ elseif($rating > 5) $rating = 5;
4511
+ if(function_exists('mb_strtoupper'))
4512
+ {
4513
+ return mb_strtoupper($texts[$rating - 1]);
4514
+ }
4515
+ else
4516
+ {
4517
+ return strtoupper($texts[$rating - 1]);
4518
+ }
4519
+ }
4520
+ public function get_rating_stars($rating_score)
4521
+ {
4522
+ $text = "";
4523
+ if(!is_numeric($rating_score))
4524
+ {
4525
+ return $text;
4526
+ }
4527
+ for ($si = 1; $si <= $rating_score; $si++)
4528
+ {
4529
+ $text .= '<span class="ti-star f"></span>';
4530
+ }
4531
+ $fractional = $rating_score - floor($rating_score);
4532
+ if( 0.25 <= $fractional )
4533
+ {
4534
+ if ( $fractional < 0.75 )
4535
+ {
4536
+ $text .= '<span class="ti-star h"></span>';
4537
+ }
4538
+ else
4539
+ {
4540
+ $text .= '<span class="ti-star f"></span>';
4541
+ }
4542
+ $si++;
4543
+ }
4544
+ for (; $si <= 5; $si++)
4545
+ {
4546
+ $text .= '<span class="ti-star e"></span>';
4547
+ }
4548
+ return $text;
4549
+ }
4550
+ private function getRandomReviews($count = 9)
4551
+ {
4552
+ $random_texts = [
4553
+ 'Works very well, does the job, very easy to set up.',
4554
+ 'O plugin excede expectativas! Com ele, é possível acrescentar as avaliações do Google ao site com um design altamente customizável e configuração em poucos cliques.',
4555
+ '<strong>I have been using this firm for many...</strong><br />I have been using this firm for many years now for my office supplies and I find them excellent. Deliveries 99% next day. Stock excellent. Problem solving excellent. Prices excellent. Keep up the good service',
4556
+ 'Very good! We ordered the breaded mushrooms as a appetizer, wish I had some now!<br /><br />I ordered the slow cooked beef and Guinness stew form dinner and my boyfriend got the bangers and mash, both were delicious! And it was so nice to have a hearty warm meal with it being chilly outside.<br /><br />Would definitely recommend to friends and family visiting and I would come back myself as well',
4557
+ 'Was so impressed with the facilities. Everything very seamlessly integrated, no snags in decor etc. Loved the ambient lighting - everything was on a dimmer! Bed was very comfy, and bathroom beautifully presented! Staff were more than helpful, with the hotel boasting an extremely up-market feel for the price! Highly recommended',
4558
+ 'Smooth online transaction. very professional and reputable with solid communication',
4559
+ 'Good selection. Reasonable prices. Easy to use website. Prompt delivery.',
4560
+ 'Wonderful products, great service.',
4561
+ 'As always very pleased with the service and the packaging! I have yet to try all the different aromas but I’m sure they will be good as usual.'
4562
+ ];
4563
+ $reviews = [];
4564
+ for($i = 0; $i < $count; $i++)
4565
+ {
4566
+ shuffle($random_texts);
4567
+ $text = array_pop($random_texts);
4568
+ $r = new stdClass();
4569
+ $r->id = $i;
4570
+ $r->user = self::___('Reviewer') .' '. ($i + 1);
4571
+ $r->user_photo = 'https://cdn.trustindex.io/assets/default-avatar/noprofile-01.svg';
4572
+ $r->text = $text;
4573
+ $r->original_rating = $i == max(0, $count-2) ? 4 : 5;
4574
+ $r->rating = $r->original_rating;
4575
+ $r->highlight = null;
4576
+ $r->date = date('Y-m-d');
4577
+ if($this->is_ten_scale_rating_platform())
4578
+ {
4579
+ $r->original_rating = number_format($i == max(0, $count-2) ? 8 : 10, 1);
4580
+ $r->rating = round($r->original_rating / 2);
4581
+ }
4582
+ $reviews[] = $r;
4583
+ }
4584
+ return $reviews;
4585
+ }
4586
+ public function download_noreg_reviews($page_details, $force_platform = null)
4587
+ {
4588
+ $force_platform = $force_platform ? $force_platform : $this->getShortName();
4589
+ $url = "https://admin.trustindex.io/" . "api/getPromoReviews?platform=".$force_platform."&page_id=" . $page_details['id'];
4590
+ if($force_platform == 'facebook')
4591
+ {
4592
+ $url .= '&access_token='. $page_details['access_token'];
4593
+ }
4594
+ if(!isset($page_details['id']) && !trim($page_details['id']))
4595
+ {
4596
+ return [ 'success' => false ];
4597
+ }
4598
+ $server_output = $this->post_request($url, [
4599
+ 'body' => [ 'wp_info' => $this->get_wp_details() ],
4600
+ 'timeout' => '30',
4601
+ 'redirection' => '5',
4602
+ 'blocking' => true
4603
+ ]);
4604
+ if($server_output[0] !== '[' && $server_output[0] !== '{')
4605
+ {
4606
+ $server_output = substr($server_output, strpos($server_output, '('));
4607
+ $server_output = trim($server_output,'();');
4608
+ }
4609
+ $server_output = json_decode($server_output, true);
4610
+ return $server_output;
4611
+ }
4612
+ public function download_noreg_details($page_details, $force_platform = null)
4613
+ {
4614
+ if(!isset($page_details['id']) || empty(trim($page_details['id'])))
4615
+ {
4616
+ return null;
4617
+ }
4618
+ $force_platform = $force_platform ? $force_platform : $this->getShortName();
4619
+ $url = "https://admin.trustindex.io/" . "api/getPageDetails?platform=".$force_platform."&page_id=" . $page_details['id'];
4620
+ if($force_platform == "facebook")
4621
+ {
4622
+ $url .= "&access_token=". $page_details['access_token'];
4623
+ }
4624
+ $server_output = $this->post_request($url, [
4625
+ 'timeout' => '20',
4626
+ 'redirection' => '5',
4627
+ 'blocking' => true
4628
+ ]);
4629
+ if($server_output[0] !== '[' && $server_output[0] !== '{')
4630
+ {
4631
+ $server_output = substr($server_output, strpos($server_output, '('));
4632
+ $server_output = trim($server_output,'();');
4633
+ }
4634
+ $server_output = json_decode($server_output, true);
4635
+ return $server_output;
4636
+ }
4637
+ public function get_plugin_current_version()
4638
+ {
4639
+ add_action('http_api_curl', function( $handle ){
4640
+ curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
4641
+ curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
4642
+ }, 10);
4643
+ $response = wp_remote_get('https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]='. $this->get_plugin_slug());
4644
+ $json = json_decode($response['body'], true);
4645
+ if(!$json && !isset($json['version']))
4646
+ {
4647
+ return false;
4648
+ }
4649
+ return $json['version'];
4650
+ }
4651
+
4652
+
4653
+ private function post_request($url, $args)
4654
+ {
4655
+ $response = wp_remote_post($url, $args);
4656
+ if(is_wp_error($response))
4657
+ {
4658
+ echo $this->get_alertbox('error', '<br />Error with wp_remote_post, error message: <br /><b>'. $response->get_error_message() .'</b>');
4659
+ die;
4660
+ }
4661
+ return wp_remote_retrieve_body($response);
4662
+ }
4663
+
4664
+
4665
+ public function is_trustindex_connected()
4666
+ {
4667
+ return get_option($this->get_option_name("subscription-id"));
4668
+ }
4669
+ public function get_trustindex_widget_number()
4670
+ {
4671
+ $widgets = $this->get_trustindex_widgets();
4672
+ $number = 0;
4673
+ foreach ($widgets as $wc)
4674
+ {
4675
+ $number += count($wc['widgets']);
4676
+ }
4677
+ return $number;
4678
+ }
4679
+ public function get_trustindex_widgets()
4680
+ {
4681
+ $widgets = array();
4682
+ $trustindex_subscription_id = $this->is_trustindex_connected();
4683
+ if ($trustindex_subscription_id)
4684
+ {
4685
+ $response = wp_remote_get("https://admin.trustindex.io/" . "api/getWidgets?subscription_id=".$trustindex_subscription_id);
4686
+ if($response && !is_wp_error($response))
4687
+ {
4688
+ $widgets = json_decode($response['body'], true);
4689
+ }
4690
+ }
4691
+ return $widgets;
4692
+ }
4693
+ public function connect_trustindex_api($post_data, $mode = "new")
4694
+ {
4695
+ $url = "https://admin.trustindex.io/" . "api/connectApi";
4696
+ $post_data['wp_info'] = $this->get_wp_details();
4697
+ $server_output = $this->post_request($url, [
4698
+ 'body' => $post_data,
4699
+ 'timeout' => '5',
4700
+ 'redirection' => '5',
4701
+ 'blocking' => true
4702
+ ]);
4703
+ if($server_output[0] !== '[' && $server_output[0] !== '{')
4704
+ {
4705
+ $server_output = substr($server_output, strpos($server_output, '('));
4706
+ $server_output = trim($server_output,'();');
4707
+ }
4708
+ $server_output = json_decode($server_output, true);
4709
+ if ($server_output['success'])
4710
+ {
4711
+ update_option( $this->get_option_name("subscription-id"), $server_output["subscription_id"]);
4712
+ $GLOBALS['wp_object_cache']->delete( $this->get_option_name('subscription-id'), 'options' );
4713
+ }
4714
+ return $server_output;
4715
+ }
4716
+
4717
+
4718
+ public function register_tinymce_features()
4719
+ {
4720
+ if ( ! has_filter( "mce_external_plugins", "add_tinymce_buttons" ) )
4721
+ {
4722
+ add_filter( "mce_external_plugins", [$this, "add_tinymce_buttons"] );
4723
+ add_filter( "mce_buttons", [$this, "register_tinymce_buttons"] );
4724
+ }
4725
+ }
4726
+ public function add_tinymce_buttons( $plugin_array )
4727
+ {
4728
+ $plugin_name = 'trustindex';
4729
+ if (!isset($plugin_array[$plugin_name]))
4730
+ {
4731
+ $plugin_array[$plugin_name] = $this->get_plugin_file_url('static/js/admin-editor.js');
4732
+ }
4733
+ wp_localize_script( 'jquery', 'ajax_object', array(
4734
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
4735
+ ));
4736
+ return $plugin_array;
4737
+ }
4738
+ public function register_tinymce_buttons( $buttons )
4739
+ {
4740
+ $button_name = 'trustindex';
4741
+ if (!in_array($button_name, $buttons))
4742
+ {
4743
+ array_push( $buttons, $button_name );
4744
+ }
4745
+ return $buttons;
4746
+ }
4747
+
4748
+
4749
+ public function list_trustindex_widgets_ajax()
4750
+ {
4751
+ $ti_widgets = $this->get_trustindex_widgets();
4752
+ if ($this->is_trustindex_connected()): ?>
4753
+ <?php if ($ti_widgets): ?>
4754
+ <h2><?php echo self::___('Your saved widgets'); ?></h2>
4755
+ <?php foreach ($ti_widgets as $wc): ?>
4756
+ <p><strong><?php echo esc_html($wc['name']); ?>:</strong></p>
4757
+ <p>
4758
+ <?php foreach ($wc['widgets'] as $w): ?>
4759
+ <a href="#" class="btn-copy-widget-id" data-ti-id="<?php echo esc_attr($w['id']); ?>">
4760
+ <span class="dashicons dashicons-admin-post"></span>
4761
+ <?php echo esc_html($w['name']); ?>
4762
+ </a><br />
4763
+ <?php endforeach; ?>
4764
+ </p>
4765
+ <?php endforeach; ?>
4766
+ <?php else: ?>
4767
+ <?php echo self::get_alertbox("warning",
4768
+ self::___("You have no widget saved!") . " "
4769
+ . "<a target='_blank' href='" . "https://admin.trustindex.io/" . "widget'>". self::___("Let's go, create amazing widgets for free!")."</a>"
4770
+ ); ?>
4771
+ <?php endif; ?>
4772
+ <?php else: ?>
4773
+ <?php echo self::get_alertbox("warning",
4774
+ self::___("You have not set up your Trustindex account yet!") . " "
4775
+ . self::___("Go to <a href='%s'>plugin setup page</a> to complete the one-step setup guide and enjoy the full functionalization!", [ admin_url('admin.php?page='.$this->get_plugin_slug().'/settings.php&tab=setup_trustindex_join') ])
4776
+ ); ?>
4777
+ <?php endif;
4778
+ wp_die();
4779
+ }
4780
+ public function trustindex_add_scripts($hook)
4781
+ {
4782
+ if ($hook === 'widgets.php')
4783
+ {
4784
+ wp_enqueue_script('trustindex_script', $this->get_plugin_file_url('static/js/admin-widget.js'));
4785
+ wp_enqueue_style('trustindex_style', $this->get_plugin_file_url('static/css/admin-widget.css'));
4786
+ }
4787
+ elseif ($hook === 'post.php')
4788
+ {
4789
+ wp_enqueue_style('trustindex_editor_style', $this->get_plugin_file_url('static/css/admin-editor.css'));
4790
+ }
4791
+ else
4792
+ {
4793
+ $tmp = explode(DIRECTORY_SEPARATOR, $this->plugin_file_path);
4794
+ $plugin_slug = preg_replace('/\.php$/', '', array_pop($tmp));
4795
+ $tmp = explode('/', $hook);
4796
+ $current_slug = array_shift($tmp);
4797
+ if($plugin_slug == $current_slug)
4798
+ {
4799
+ if(file_exists($this->get_plugin_dir() . 'static' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'admin-page-settings.css'))
4800
+ {
4801
+ wp_enqueue_style('trustindex_settings_style_'. $this->shortname, $this->get_plugin_file_url('static/css/admin-page-settings.css'));
4802
+ }
4803
+ if(file_exists($this->get_plugin_dir() . 'static' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'admin-page-settings-common.js'))
4804
+ {
4805
+ wp_enqueue_script('trustindex_settings_script_common_'. $this->shortname, $this->get_plugin_file_url('static/js/admin-page-settings-common.js'));
4806
+ }
4807
+ if(file_exists($this->get_plugin_dir() . 'static' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'admin-page-settings-connect.js'))
4808
+ {
4809
+ wp_enqueue_script('trustindex_settings_script_connect_'. $this->shortname, $this->get_plugin_file_url('static/js/admin-page-settings-connect.js'));
4810
+ }
4811
+ if(file_exists($this->get_plugin_dir() . 'static' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'admin-page-settings.js'))
4812
+ {
4813
+ wp_enqueue_script('trustindex_settings_script_'. $this->shortname, $this->get_plugin_file_url('static/js/admin-page-settings.js') );
4814
+ }
4815
+ }
4816
+ }
4817
+ wp_register_script('trustindex_admin_popup', $this->get_plugin_file_url('static/js/admin-popup.js') );
4818
+ wp_enqueue_script('trustindex_admin_popup');
4819
+ }
4820
+
4821
+
4822
+ public function get_plugin_details( $plugin_slug = null )
4823
+ {
4824
+ if (!$plugin_slug)
4825
+ {
4826
+ $plugin_slug = $this->get_plugin_slug();
4827
+ }
4828
+ $plugin_return = false;
4829
+ $wp_repo_plugins= '';
4830
+ $wp_response= '';
4831
+ $wp_version = get_bloginfo('version');
4832
+ if ( $plugin_slug && $wp_version > 3.8 )
4833
+ {
4834
+ $args = array(
4835
+ 'author' => 'Trustindex.io',
4836
+ 'fields' => array(
4837
+ 'downloaded'=> true,
4838
+ 'active_installs'=> true,
4839
+ 'ratings'=> true
4840
+ )
4841
+ );
4842
+ $wp_response = wp_remote_post(
4843
+ 'http://api.wordpress.org/plugins/info/1.0/',
4844
+ array(
4845
+ 'body' => array(
4846
+ 'action'=> 'query_plugins',
4847
+ 'request' => serialize( (object) $args )
4848
+ )
4849
+ )
4850
+ );
4851
+ if ( ! is_wp_error( $wp_response ) )
4852
+ {
4853
+ $wp_repo_response = unserialize( wp_remote_retrieve_body( $wp_response ) );
4854
+ $wp_repo_plugins= $wp_repo_response->plugins;
4855
+ }
4856
+ if ( $wp_repo_plugins )
4857
+ {
4858
+ foreach ( $wp_repo_plugins as $plugin_details )
4859
+ {
4860
+ if ( $plugin_slug == $plugin_details->slug )
4861
+ {
4862
+ $plugin_return = $plugin_details;
4863
+ }
4864
+ }
4865
+ }
4866
+ }
4867
+ return $plugin_return;
4868
+ }
4869
+ public function get_wp_details()
4870
+ {
4871
+ $data = [
4872
+ 'domain' => $_SERVER['SERVER_NAME'],
4873
+ 'current_theme' => [ 'slug' => get_template() ],
4874
+ 'themes' => [],
4875
+ 'plugins' => []
4876
+ ];
4877
+ if(function_exists('wp_get_theme'))
4878
+ {
4879
+ $theme = wp_get_theme();
4880
+ }
4881
+ else
4882
+ {
4883
+ $theme = get_theme(get_current_theme());
4884
+ }
4885
+ $data['current_theme']['name'] = $theme['Name'];
4886
+ $data['current_theme']['author'] = strip_tags($theme['Author']);
4887
+ $data['current_theme']['version'] = $theme['Version'];
4888
+ if(function_exists('wp_get_themes'))
4889
+ {
4890
+ $themes = wp_get_themes();
4891
+ }
4892
+ else
4893
+ {
4894
+ $themes = get_themes();
4895
+ }
4896
+ if($themes)
4897
+ {
4898
+ foreach($themes as $slug => $theme)
4899
+ {
4900
+ $data['themes'][] = [
4901
+ 'slug' => $theme['Template'],
4902
+ 'name' => $theme['Name'],
4903
+ 'author' => strip_tags($theme['Author']),
4904
+ 'version' => $theme['Version']
4905
+ ];
4906
+ }
4907
+ }
4908
+ if(!function_exists('get_plugins'))
4909
+ {
4910
+ require_once ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'plugin.php';
4911
+ }
4912
+ $plugins = get_plugins();
4913
+ if($plugins)
4914
+ {
4915
+ foreach($plugins as $slug => $plugin)
4916
+ {
4917
+ $data['plugins'][] = [
4918
+ 'slug' => explode('/', $slug)[0],
4919
+ 'name' => $plugin['Name'],
4920
+ 'author' => strip_tags($plugin['Author']),
4921
+ 'version' => $plugin['Version']
4922
+ ];
4923
+ }
4924
+ }
4925
+ return json_encode($data);
4926
+ }
4927
+
4928
+
4929
+ public function is_ten_scale_rating_platform()
4930
+ {
4931
+ return in_array($this->shortname, [ 'booking', 'hotels', 'foursquare', 'szallashu' ]);
4932
+ }
4933
+ public function formatTenRating($rating)
4934
+ {
4935
+ if($rating == 10)
4936
+ {
4937
+ $rating = '10';
4938
+ }
4939
+ if($this->shortname == "booking")
4940
+ {
4941
+ $rating = str_replace('.', ',', $rating);
4942
+ }
4943
+ return $rating;
4944
+ }
4945
+ public static function is_amp_active()
4946
+ {
4947
+ if(!function_exists('get_plugins'))
4948
+ {
4949
+ require_once ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'plugin.php';
4950
+ }
4951
+ $amp_plugin_keys = [
4952
+ 'accelerated-mobile-pages/accelerated-moblie-pages.php',
4953
+ 'amp/amp.php'
4954
+ ];
4955
+ foreach(get_plugins() as $key => $plugin)
4956
+ {
4957
+ if(in_array($key, $amp_plugin_keys) && is_plugin_active($key))
4958
+ {
4959
+ return true;
4960
+ }
4961
+ }
4962
+ return false;
4963
+ }
4964
+ public static function is_amp_enabled()
4965
+ {
4966
+ if(function_exists('amp_is_request'))
4967
+ {
4968
+ return amp_is_request();
4969
+ }
4970
+ else if(function_exists('ampforwp_is_amp_endpoint'))
4971
+ {
4972
+ return ampforwp_is_amp_endpoint();
4973
+ }
4974
+ else
4975
+ {
4976
+ return false;
4977
+ }
4978
+ }
4979
+ public function filter_filesystem_method($method)
4980
+ {
4981
+ if($method != 'direct' && !defined('FS_METHOD'))
4982
+ {
4983
+ return 'direct';
4984
+ }
4985
+ return $method;
4986
+ }
4987
+ public function register_block_editor()
4988
+ {
4989
+ if(!class_exists('WP_Block_Type_Registry'))
4990
+ {
4991
+ return;
4992
+ }
4993
+ if(!WP_Block_Type_Registry::get_instance()->is_registered('trustindex/block-selector'))
4994
+ {
4995
+ wp_register_script('trustindex-block-editor', $this->get_plugin_file_url('static/block-editor/block-editor.js'), [ 'wp-blocks', 'wp-editor' ], true);
4996
+ register_block_type('trustindex/block-selector', [ 'editor_script' => 'trustindex-block-editor' ]);
4997
+ }
4998
+ }
4999
+ function is_widget_setted_up() {
5000
+ $result = [];
5001
+ $active_plugins = get_option( 'active_plugins' );
5002
+ $platforms = $this->get_platforms();
5003
+ foreach ($this->get_plugin_slugs() as $index => $plugin_slug)
5004
+ {
5005
+ if (in_array($plugin_slug."/".$plugin_slug.".php", $active_plugins))
5006
+ {
5007
+ $active_plugin_slug = $plugin_slug;
5008
+ $result[$platforms[$index]] = get_option("trustindex-".$platforms[$index]."-widget-setted-up", 0);
5009
+ }
5010
+ }
5011
+ return array(
5012
+ 'result' => $result,
5013
+ 'setup_url' => admin_url('admin.php?page='.$active_plugin_slug.'/settings.php&tab=setup_trustindex_join')
5014
+ );
5015
+ }
5016
+ function init_restapi() {
5017
+ register_rest_route( 'trustindex/v1', '/get-widgets', array(
5018
+ 'methods' => 'GET',
5019
+ 'callback' => array($this, 'get_trustindex_widgets'),
5020
+ 'permission_callback' => '__return_true'
5021
+ ) );
5022
+ register_rest_route( 'trustindex/v1', '/setup-complete', array(
5023
+ 'methods' => 'GET',
5024
+ 'callback' => array($this, 'is_widget_setted_up'),
5025
+ 'permission_callback' => '__return_true'
5026
+ ) );
5027
+ }
5028
+ }
5029
+ ?>
trunk/uninstall.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
3
+ $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "8.2.3", "Widgets for Google Reviews", "Google");
4
+ $trustindex_pm_google->uninstall();
5
+ ?>
trunk/wp-reviews-plugin-for-google.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Widgets for Google Reviews
4
+ Plugin Title: Widgets for Google Reviews Plugin
5
+ Plugin URI: https://wordpress.org/plugins/wp-reviews-plugin-for-google/
6
+ Description: Embed Google reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Google reviews.
7
+ Tags: google, google places reviews, reviews, widget, google business, review, testimonial, testimonials, slider, rating, google my business, customer review
8
+ Author: Trustindex.io <support@trustindex.io>
9
+ Author URI: https://www.trustindex.io/
10
+ Contributors: trustindex
11
+ License: GPLv2 or later
12
+ Version: 8.2.3
13
+ Text Domain: wp-reviews-plugin-for-google
14
+ Domain Path: /languages/
15
+ Donate link: https://www.trustindex.io/prices/
16
+ */
17
+ /*
18
+ Copyright 2019 Trustindex Kft (email: support@trustindex.io)
19
+ */
20
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
21
+ require_once plugin_dir_path( __FILE__ ) . 'trustindex-plugin.class.php';
22
+ $trustindex_pm_google = new TrustindexPlugin_google("google", __FILE__, "8.2.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);
26
+ add_filter('plugin_action_links', array($trustindex_pm_google, 'add_plugin_action_links'), 10, 2);
27
+ add_filter('plugin_row_meta', array($trustindex_pm_google, 'add_plugin_meta_links'), 10, 2);
28
+ if(!function_exists('register_block_type'))
29
+ {
30
+ add_action('widgets_init', array($trustindex_pm_google, 'init_widget'));
31
+ add_action('widgets_init', array($trustindex_pm_google, 'register_widget'));
32
+ }
33
+ if(is_file($trustindex_pm_google->getCssFile()))
34
+ {
35
+ add_action('init', function() {
36
+ 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__, "8.2.3", "Widgets for Google Reviews", "Google");
41
+ }
42
+ $path = wp_upload_dir()['baseurl'] .'/'. $trustindex_pm_google->getCssFile(true);
43
+ if(is_ssl())
44
+ {
45
+ $path = str_replace('http://', 'https://', $path);
46
+ }
47
+ wp_register_style('ti-widget-css-google', $path, [], filemtime($trustindex_pm_google->getCssFile()));
48
+ });
49
+ }
50
+ add_action('init', array($trustindex_pm_google, 'init_shortcode'));
51
+ add_filter('script_loader_tag', function($tag, $handle) {
52
+ if(strpos($tag, 'trustindex.io/loader.js') !== false && strpos($tag, 'defer async') === false) {
53
+ $tag = str_replace(' src', ' defer async src', $tag );
54
+ }
55
+ return $tag;
56
+ }, 10, 2);
57
+ add_action('init', array($trustindex_pm_google, 'register_tinymce_features'));
58
+ add_action('init', array($trustindex_pm_google, 'output_buffer'));
59
+ add_action('wp_ajax_list_trustindex_widgets', array($trustindex_pm_google, 'list_trustindex_widgets_ajax'));
60
+ add_action('admin_enqueue_scripts', array($trustindex_pm_google, 'trustindex_add_scripts'));
61
+ add_action('rest_api_init', array($trustindex_pm_google, 'init_restapi'));
62
+ add_action('admin_notices', function() {
63
+ $rate_us = get_option('trustindex-google-rate-us', time() - 1);
64
+ if($rate_us == 'hide' || (int)$rate_us > time())
65
+ {
66
+ return;
67
+ }
68
+ $dir = plugin_dir_path( __FILE__ );
69
+ $usage_time = time() + 10;
70
+ if(is_dir($dir))
71
+ {
72
+ $usage_time = filemtime($dir) + (1 * 86400);
73
+ }
74
+ if($usage_time > time())
75
+ {
76
+ return;
77
+ }
78
+ ?>
79
+ <div class="notice notice-warning is-dismissible trustindex-popup" style="position: fixed; top: 50px; right: 20px; padding-right: 30px; z-index: 1">
80
+ <p>
81
+ <?php echo TrustindexPlugin_google::___("Hello, I am happy to see that you've been using our <strong>%s</strong> plugin for a while now!", ["Widgets for Google Reviews"]); ?><br>
82
+ <?php echo TrustindexPlugin_google::___("Could you please help us and give it a 5-star rating on WordPress?"); ?><br><br>
83
+ <?php echo TrustindexPlugin_google::___("-- Thanks, Gabor M."); ?>
84
+ </p>
85
+ <p>
86
+ <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&rate_us=open"); ?>" class="trustindex-rateus" style="text-decoration: none" target="_blank">
87
+ <button class="button button-primary"><?php echo TrustindexPlugin_google::___("Sure, you deserve it"); ?></button>
88
+ </a>
89
+ <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&rate_us=later"); ?>" class="trustindex-rateus" style="text-decoration: none">
90
+ <button class="button button-secondary"><?php echo TrustindexPlugin_google::___("Maybe later"); ?></button>
91
+ </a>
92
+ <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&rate_us=hide"); ?>" class="trustindex-rateus" style="text-decoration: none">
93
+ <button class="button button-secondary" style="float: right"><?php echo TrustindexPlugin_google::___("Do not remind me again"); ?></button>
94
+ </a>
95
+ </p>
96
+ </div>
97
+ <?php
98
+ });
99
+ if(class_exists('Woocommerce') && !class_exists('TrustindexWoocommercePlugin') && !function_exists('ti_woocommerce_notice'))
100
+ {
101
+ function ti_woocommerce_notice() {
102
+ $rate_us = get_option('trustindex-wc-notification', time() - 1);
103
+ if($rate_us == 'hide' || (int)$rate_us > time())
104
+ {
105
+ return;
106
+ }
107
+ ?>
108
+ <div class="notice notice-warning is-dismissible" style="margin: 5px 0 15px">
109
+ <p><strong><?php echo TrustindexPlugin_google::___("Download our new <a href='%s' target='_blank'>%s</a> plugin and get features for free!", [ 'https://wordpress.org/plugins/customer-reviews-for-woocommerce/', TrustindexPlugin_google::___('Customer Reviews for WooCommerce') ]); ?></strong></p>
110
+ <ul style="list-style-type: disc; margin-left: 10px; padding-left: 15px">
111
+ <li><?php echo TrustindexPlugin_google::___('set up Trustindex company profile and get high quality backlink'); ?></li>
112
+ <li><?php echo TrustindexPlugin_google::___('set up review-collector campaigns to get new ratings / reviews / recommendations automatically'); ?></li>
113
+ <li><?php echo TrustindexPlugin_google::___('show customer reviews in fancy widgets'); ?></li>
114
+ </ul>
115
+ <p>
116
+ <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&wc_notification=open"); ?>" target="_blank" class="trustindex-rateus" style="text-decoration: none">
117
+ <button class="button button-primary"><?php echo TrustindexPlugin_google::___("Download plugin"); ?></button>
118
+ </a>
119
+ <a href="<?php echo admin_url("admin.php?page=wp-reviews-plugin-for-google/settings.php&wc_notification=hide"); ?>" class="trustindex-rateus" style="text-decoration: none">
120
+ <button class="button button-secondary"><?php echo TrustindexPlugin_google::___("Do not remind me again"); ?></button>
121
+ </a>
122
+ </p>
123
+ </div>
124
+ <?php
125
+ }
126
+ add_action('admin_notices', 'ti_woocommerce_notice');
127
+ }
128
+ add_action('plugins_loaded', array($trustindex_pm_google, 'plugin_loaded'));
129
+ ?>