Google Reviews Widget - Version 1.6.9

Version Description

  • Improve: 'read more' link feature
  • Improve: direct link to reviews on Google map
  • Improve: language support of Google reviews
  • Improve: added centered option
  • Improve: update widget design
  • Improve: update setting page design
Download this release

Release Info

Developer widgetpack
Plugin Icon 128x128 Google Reviews Widget
Version 1.6.9
Comparing to
See all releases

Code changes from version 1.6.8 to 1.6.9

grw-finder.php CHANGED
@@ -5,34 +5,71 @@
5
  <small class="grw-error"></small>
6
  </div>
7
  </div>
8
- <div class="form-group">
9
- <div class="col-sm-12">
10
- <button class="grw-connect-btn btn btn-block btn-primary"><?php echo grw_i('Connect Google'); ?></button>
11
- </div>
12
- </div>
13
 
14
- <!--div class="form-group">
15
- <div class="col-sm-12">
16
- <h4 class="text-left"><span class="grw-step">1</span><?php echo grw_i('Find Place'); ?></h4>
17
- <input type="text" class="grw-place-search form-control" value="" placeholder="Place ID" />
18
- </div>
19
- </div>
20
  <div class="form-group">
21
  <div class="col-sm-12">
22
- <button class="grw-search-btn btn btn-block btn-primary"><?php echo grw_i('Search Place'); ?></button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </div>
24
  </div>
 
25
  <div class="form-group">
26
  <div class="col-sm-12">
27
- <h4 class="text-left"><span class="grw-step">2</span><?php echo grw_i('Select Place'); ?></h4>
28
- <div class="grw-places"></div>
29
  </div>
30
  </div>
31
- <div class="form-group">
32
- <div class="col-sm-12">
33
- <h4 class="text-left"><span class="grw-step">3</span><?php echo grw_i('Save Place and Reviews'); ?></h4>
34
- <div class="grw-reviews"></div>
35
- <div class="grw-five-reviews-note" style="display:none"><?php echo grw_i('Google returns 5 reviews only'); ?></div>
36
- <div class="grw-save-reviews-container"></div>
37
- </div>
38
- </div-->
5
  <small class="grw-error"></small>
6
  </div>
7
  </div>
 
 
 
 
 
8
 
 
 
 
 
 
 
9
  <div class="form-group">
10
  <div class="col-sm-12">
11
+ <select class="grw-lang form-control">
12
+ <option value=""><?php echo grw_i('Language disable'); ?></option>
13
+ <option value="ar"><?php echo grw_i('Arabic'); ?></option>
14
+ <option value="bg"><?php echo grw_i('Bulgarian'); ?></option>
15
+ <option value="bn"><?php echo grw_i('Bengali'); ?></option>
16
+ <option value="ca"><?php echo grw_i('Catalan'); ?></option>
17
+ <option value="cs"><?php echo grw_i('Czech'); ?></option>
18
+ <option value="da"><?php echo grw_i('Danish'); ?></option>
19
+ <option value="de"><?php echo grw_i('German'); ?></option>
20
+ <option value="el"><?php echo grw_i('Greek'); ?></option>
21
+ <option value="en"><?php echo grw_i('English'); ?></option>
22
+ <option value="en-AU"><?php echo grw_i('English (Australian)'); ?></option>
23
+ <option value="en-GB"><?php echo grw_i('English (Great Britain)'); ?></option>
24
+ <option value="es"><?php echo grw_i('Spanish'); ?></option>
25
+ <option value="eu"><?php echo grw_i('Basque'); ?></option>
26
+ <option value="eu"><?php echo grw_i('Basque'); ?></option>
27
+ <option value="fa"><?php echo grw_i('Farsi'); ?></option>
28
+ <option value="fi"><?php echo grw_i('Finnish'); ?></option>
29
+ <option value="fil"><?php echo grw_i('Filipino'); ?></option>
30
+ <option value="fr"><?php echo grw_i('French'); ?></option>
31
+ <option value="gl"><?php echo grw_i('Galician'); ?></option>
32
+ <option value="gu"><?php echo grw_i('Gujarati'); ?></option>
33
+ <option value="hi"><?php echo grw_i('Hindi'); ?></option>
34
+ <option value="hr"><?php echo grw_i('Croatian'); ?></option>
35
+ <option value="hu"><?php echo grw_i('Hungarian'); ?></option>
36
+ <option value="id"><?php echo grw_i('Indonesian'); ?></option>
37
+ <option value="it"><?php echo grw_i('Italian'); ?></option>
38
+ <option value="iw"><?php echo grw_i('Hebrew'); ?></option>
39
+ <option value="ja"><?php echo grw_i('Japanese'); ?></option>
40
+ <option value="kn"><?php echo grw_i('Kannada'); ?></option>
41
+ <option value="ko"><?php echo grw_i('Korean'); ?></option>
42
+ <option value="lt"><?php echo grw_i('Lithuanian'); ?></option>
43
+ <option value="lv"><?php echo grw_i('Latvian'); ?></option>
44
+ <option value="ml"><?php echo grw_i('Malayalam'); ?></option>
45
+ <option value="mr"><?php echo grw_i('Marathi'); ?></option>
46
+ <option value="nl"><?php echo grw_i('Dutch'); ?></option>
47
+ <option value="no"><?php echo grw_i('Norwegian'); ?></option>
48
+ <option value="pl"><?php echo grw_i('Polish'); ?></option>
49
+ <option value="pt"><?php echo grw_i('Portuguese'); ?></option>
50
+ <option value="pt-BR"><?php echo grw_i('Portuguese (Brazil)'); ?></option>
51
+ <option value="pt-PT"><?php echo grw_i('Portuguese (Portugal)'); ?></option>
52
+ <option value="ro"><?php echo grw_i('Romanian'); ?></option>
53
+ <option value="ru"><?php echo grw_i('Russian'); ?></option>
54
+ <option value="sk"><?php echo grw_i('Slovak'); ?></option>
55
+ <option value="sl"><?php echo grw_i('Slovenian'); ?></option>
56
+ <option value="sr"><?php echo grw_i('Serbian'); ?></option>
57
+ <option value="sv"><?php echo grw_i('Swedish'); ?></option>
58
+ <option value="ta"><?php echo grw_i('Tamil'); ?></option>
59
+ <option value="te"><?php echo grw_i('Telugu'); ?></option>
60
+ <option value="th"><?php echo grw_i('Thai'); ?></option>
61
+ <option value="tl"><?php echo grw_i('Tagalog'); ?></option>
62
+ <option value="tr"><?php echo grw_i('Turkish'); ?></option>
63
+ <option value="uk"><?php echo grw_i('Ukrainian'); ?></option>
64
+ <option value="vi"><?php echo grw_i('Vietnamese'); ?></option>
65
+ <option value="zh-CN"><?php echo grw_i('Chinese (Simplified)'); ?></option>
66
+ <option value="zh-TW"><?php echo grw_i('Chinese (Traditional)'); ?></option>
67
+ </select>
68
  </div>
69
  </div>
70
+
71
  <div class="form-group">
72
  <div class="col-sm-12">
73
+ <button class="grw-connect-btn btn btn-block btn-primary"><?php echo grw_i('Connect Google'); ?></button>
 
74
  </div>
75
  </div>
 
 
 
 
 
 
 
 
grw-options.php CHANGED
@@ -1,11 +1,3 @@
1
- <?php if (isset($title)) { ?>
2
- <div class="form-group">
3
- <div class="col-sm-12">
4
- <input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" class="form-control" placeholder="<?php echo grw_i('Widget title'); ?>" />
5
- </div>
6
- </div>
7
- <?php } ?>
8
-
9
  <?php global $wp_version; if (version_compare($wp_version, '3.5', '>=')) { wp_enqueue_media(); ?>
10
  <div class="form-group">
11
  <div class="col-sm-12">
@@ -28,242 +20,92 @@
28
  </div>
29
  </div>
30
 
31
- <!-- Review Options -->
32
- <h4 class="rplg-options-toggle"><?php echo grw_i('Review Options'); ?></h4>
33
- <div class="rplg-options" style="display:none">
34
- <div class="form-group rplg-disabled">
35
- <div class="col-sm-12">
36
- <label>
37
- <input class="form-control" type="checkbox" disabled />
38
- <?php echo grw_i('Try to get more than 5 Google reviews'); ?>
39
- </label>
40
- </div>
41
- </div>
42
- <div class="form-group rplg-disabled">
43
- <div class="col-sm-12">
44
- <label>
45
- <input class="form-control" type="checkbox" disabled />
46
- <?php echo grw_i('Enable Google Rich Snippet (schema.org)'); ?>
47
- </label>
48
- </div>
49
- </div>
50
- <div class="form-group">
51
- <div class="col-sm-12">
52
- <label><?php echo grw_i('Pagination'); ?></label>
53
- <input type="text" id="<?php echo $this->get_field_id('pagination'); ?>" name="<?php echo $this->get_field_name('pagination'); ?>" value="<?php echo $pagination; ?>" placeholder="5" class="form-control"/>
54
- </div>
55
- </div>
56
- <div class="form-group rplg-disabled">
57
- <div class="col-sm-12">
58
- <?php echo grw_i('Sorting'); ?>
59
- <select class="form-control" disabled >
60
- <option value=""><?php echo grw_i('Default'); ?></option>
61
- <option value="1"><?php echo grw_i('Most recent'); ?></option>
62
- <option value="2"><?php echo grw_i('Most oldest'); ?></option>
63
- <option value="3"><?php echo grw_i('Highest score'); ?></option>
64
- <option value="4"><?php echo grw_i('Lowest score'); ?></option>
65
- </select>
66
- </div>
67
- </div>
68
- <div class="form-group rplg-disabled">
69
- <div class="col-sm-12">
70
- <?php echo grw_i('Minimum Review Rating'); ?>
71
- <select class="form-control" disabled >
72
- <option value=""><?php echo grw_i('No filter'); ?></option>
73
- <option value="5"><?php echo grw_i('5 Stars'); ?></option>
74
- <option value="4"><?php echo grw_i('4 Stars'); ?></option>
75
- <option value="3"><?php echo grw_i('3 Stars'); ?></option>
76
- <option value="2"><?php echo grw_i('2 Stars'); ?></option>
77
- <option value="1"><?php echo grw_i('1 Star'); ?></option>
78
- </select>
79
- </div>
80
- </div>
81
- <div class="form-group">
82
- <div class="rplg-pro">
83
- <?php echo grw_i('These features are available in Google Reviews Business plugin: '); ?>
84
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
85
- <?php echo grw_i('Upgrade to Business'); ?>
86
- </a>
87
- </div>
88
  </div>
89
  </div>
90
 
91
- <!-- Display Options -->
92
- <h4 class="rplg-options-toggle"><?php echo grw_i('Display Options'); ?></h4>
93
- <div class="rplg-options" style="display:none">
94
- <div class="form-group rplg-disabled">
95
- <div class="col-sm-12">
96
- <label>
97
- <input class="form-control" type="checkbox" disabled />
98
- <?php echo grw_i('Hide business photo'); ?>
99
- </label>
100
- </div>
101
- </div>
102
- <div class="form-group rplg-disabled">
103
- <div class="col-sm-12">
104
- <label>
105
- <input class="form-control" type="checkbox" disabled />
106
- <?php echo grw_i('Hide user avatars'); ?>
107
- </label>
108
- </div>
109
- </div>
110
- <div class="form-group rplg-disabled">
111
- <div class="col-sm-12">
112
- <label>
113
- <input class="form-control" type="checkbox" disabled />
114
- <?php echo grw_i('Disable links to G+ user profile'); ?>
115
- </label>
116
- </div>
117
- </div>
118
- <div class="form-group rplg-disabled">
119
- <div class="col-sm-12">
120
- <label>
121
- <input class="form-control" type="checkbox" disabled />
122
- <?php echo grw_i('Enable \'Write a review\' button'); ?>
123
- </label>
124
- </div>
125
- </div>
126
- <div class="form-group">
127
- <div class="col-sm-12">
128
- <label>
129
- <input id="<?php echo $this->get_field_id('dark_theme'); ?>" name="<?php echo $this->get_field_name('dark_theme'); ?>" type="checkbox" value="1" <?php checked('1', $dark_theme); ?> class="form-control" />
130
- <?php echo grw_i('Dark background'); ?>
131
- </label>
132
- </div>
133
  </div>
134
- <div class="form-group rplg-disabled">
135
- <div class="col-sm-12">
136
- <label><?php echo grw_i('Review limit before \'read more\' link'); ?></label>
137
- <input class="form-control" type="text" placeholder="for instance: 120" disabled />
138
- </div>
 
 
139
  </div>
140
- <div class="form-group">
141
- <div class="col-sm-12">
142
- <?php echo grw_i('Widget theme'); ?>
143
- <select id="<?php echo $this->get_field_id('view_mode'); ?>" name="<?php echo $this->get_field_name('view_mode'); ?>" class="form-control">
144
- <option value="list" <?php selected('list', $view_mode); ?>><?php echo grw_i('Review list'); ?></option>
145
- <option value="slider" <?php selected('slider', $view_mode); ?> disabled><?php echo grw_i('Reviews Slider'); ?></option>
146
- <option value="grid" <?php selected('grid', $view_mode); ?> disabled><?php echo grw_i('Reviews Grid'); ?></option>
147
- <option value="badge" <?php selected('badge', $view_mode); ?> disabled><?php echo grw_i('Google Badge: right'); ?></option>
148
- <option value="badge_left" <?php selected('badge_left', $view_mode); ?> disabled><?php echo grw_i('Google Badge: left'); ?></option>
149
- <option value="badge_inner" <?php selected('badge_inner', $view_mode); ?> disabled><?php echo grw_i('Google Badge: embed'); ?></option>
150
- </select>
151
- </div>
152
  </div>
153
- <div class="form-group">
154
- <div class="col-sm-12">
155
- <label for="<?php echo $this->get_field_id('max_width'); ?>"><?php echo grw_i('Maximum width'); ?></label>
156
- <input id="<?php echo $this->get_field_id('max_width'); ?>" name="<?php echo $this->get_field_name('max_width'); ?>" value="<?php echo $max_width; ?>" class="form-control" type="text" placeholder="for instance: 300px" />
157
- </div>
 
158
  </div>
159
- <div class="form-group">
160
- <div class="col-sm-12">
161
- <label for="<?php echo $this->get_field_id('max_height'); ?>"><?php echo grw_i('Maximum height'); ?></label>
162
- <input id="<?php echo $this->get_field_id('max_height'); ?>" name="<?php echo $this->get_field_name('max_height'); ?>" value="<?php echo $max_height; ?>" class="form-control" type="text" placeholder="for instance: 500px" />
163
- </div>
 
164
  </div>
165
- <div class="form-group">
166
- <div class="rplg-pro">
167
- <?php echo grw_i('<b>Slider</b>, <b>Grid</b>, <b>Badge</b> themes and other features are available in Google Reviews Business plugin: '); ?>
168
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
169
- <?php echo grw_i('Upgrade to Business'); ?>
170
- </a>
171
- </div>
 
172
  </div>
173
  </div>
174
 
175
- <!-- Slider Options -->
176
- <h4 class="rplg-options-toggle"><?php echo grw_i('Slider Options'); ?></h4>
177
- <div class="rplg-options" style="display:none">
178
- <div class="form-group">
179
- <div class="rplg-pro">
180
- <?php echo grw_i('<b>Slider</b> is available in Google Reviews Business plugin: '); ?>
181
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
182
- <?php echo grw_i('Upgrade to Business'); ?>
183
- </a>
184
- </div>
185
  </div>
186
  </div>
187
 
188
- <!-- Advance Options -->
189
- <h4 class="rplg-options-toggle"><?php echo grw_i('Advance Options'); ?></h4>
190
- <div class="rplg-options" style="display:none">
191
- <div class="form-group">
192
- <div class="col-sm-12">
193
- <label>
194
- <input id="<?php echo $this->get_field_id('open_link'); ?>" name="<?php echo $this->get_field_name('open_link'); ?>" type="checkbox" value="1" <?php checked('1', $open_link); ?> class="form-control" />
195
- <?php echo grw_i('Open links in new Window'); ?>
196
- </label>
197
- </div>
198
  </div>
199
- <div class="form-group">
200
- <div class="col-sm-12">
201
- <label>
202
- <input id="<?php echo $this->get_field_id('nofollow_link'); ?>" name="<?php echo $this->get_field_name('nofollow_link'); ?>" type="checkbox" value="1" <?php checked('1', $nofollow_link); ?> class="form-control" />
203
- <?php echo grw_i('Use no follow links'); ?>
204
- </label>
205
- </div>
 
206
  </div>
207
- <div class="form-group">
208
- <div class="col-sm-12">
209
- <?php echo grw_i('Language of reviews'); ?>
210
- <select id="<?php echo $this->get_field_id('reviews_lang'); ?>" name="<?php echo $this->get_field_name('reviews_lang'); ?>" class="form-control">
211
- <option value="" <?php selected('', $reviews_lang); ?>><?php echo grw_i('Disable'); ?></option>
212
- <option value="ar" <?php selected('ar', $reviews_lang); ?>><?php echo grw_i('Arabic'); ?></option>
213
- <option value="bg" <?php selected('bg', $reviews_lang); ?>><?php echo grw_i('Bulgarian'); ?></option>
214
- <option value="bn" <?php selected('bn', $reviews_lang); ?>><?php echo grw_i('Bengali'); ?></option>
215
- <option value="ca" <?php selected('ca', $reviews_lang); ?>><?php echo grw_i('Catalan'); ?></option>
216
- <option value="cs" <?php selected('cs', $reviews_lang); ?>><?php echo grw_i('Czech'); ?></option>
217
- <option value="da" <?php selected('da', $reviews_lang); ?>><?php echo grw_i('Danish'); ?></option>
218
- <option value="de" <?php selected('de', $reviews_lang); ?>><?php echo grw_i('German'); ?></option>
219
- <option value="el" <?php selected('el', $reviews_lang); ?>><?php echo grw_i('Greek'); ?></option>
220
- <option value="en" <?php selected('en', $reviews_lang); ?>><?php echo grw_i('English'); ?></option>
221
- <option value="en-AU" <?php selected('en-AU', $reviews_lang); ?>><?php echo grw_i('English (Australian)'); ?></option>
222
- <option value="en-GB" <?php selected('en-GB', $reviews_lang); ?>><?php echo grw_i('English (Great Britain)'); ?></option>
223
- <option value="es" <?php selected('es', $reviews_lang); ?>><?php echo grw_i('Spanish'); ?></option>
224
- <option value="eu" <?php selected('eu', $reviews_lang); ?>><?php echo grw_i('Basque'); ?></option>
225
- <option value="eu" <?php selected('eu', $reviews_lang); ?>><?php echo grw_i('Basque'); ?></option>
226
- <option value="fa" <?php selected('fa', $reviews_lang); ?>><?php echo grw_i('Farsi'); ?></option>
227
- <option value="fi" <?php selected('fi', $reviews_lang); ?>><?php echo grw_i('Finnish'); ?></option>
228
- <option value="fil" <?php selected('fil', $reviews_lang); ?>><?php echo grw_i('Filipino'); ?></option>
229
- <option value="fr" <?php selected('fr', $reviews_lang); ?>><?php echo grw_i('French'); ?></option>
230
- <option value="gl" <?php selected('gl', $reviews_lang); ?>><?php echo grw_i('Galician'); ?></option>
231
- <option value="gu" <?php selected('gu', $reviews_lang); ?>><?php echo grw_i('Gujarati'); ?></option>
232
- <option value="hi" <?php selected('hi', $reviews_lang); ?>><?php echo grw_i('Hindi'); ?></option>
233
- <option value="hr" <?php selected('hr', $reviews_lang); ?>><?php echo grw_i('Croatian'); ?></option>
234
- <option value="hu" <?php selected('hu', $reviews_lang); ?>><?php echo grw_i('Hungarian'); ?></option>
235
- <option value="id" <?php selected('id', $reviews_lang); ?>><?php echo grw_i('Indonesian'); ?></option>
236
- <option value="it" <?php selected('it', $reviews_lang); ?>><?php echo grw_i('Italian'); ?></option>
237
- <option value="iw" <?php selected('iw', $reviews_lang); ?>><?php echo grw_i('Hebrew'); ?></option>
238
- <option value="ja" <?php selected('ja', $reviews_lang); ?>><?php echo grw_i('Japanese'); ?></option>
239
- <option value="kn" <?php selected('kn', $reviews_lang); ?>><?php echo grw_i('Kannada'); ?></option>
240
- <option value="ko" <?php selected('ko', $reviews_lang); ?>><?php echo grw_i('Korean'); ?></option>
241
- <option value="lt" <?php selected('lt', $reviews_lang); ?>><?php echo grw_i('Lithuanian'); ?></option>
242
- <option value="lv" <?php selected('lv', $reviews_lang); ?>><?php echo grw_i('Latvian'); ?></option>
243
- <option value="ml" <?php selected('ml', $reviews_lang); ?>><?php echo grw_i('Malayalam'); ?></option>
244
- <option value="mr" <?php selected('mr', $reviews_lang); ?>><?php echo grw_i('Marathi'); ?></option>
245
- <option value="nl" <?php selected('nl', $reviews_lang); ?>><?php echo grw_i('Dutch'); ?></option>
246
- <option value="no" <?php selected('no', $reviews_lang); ?>><?php echo grw_i('Norwegian'); ?></option>
247
- <option value="pl" <?php selected('pl', $reviews_lang); ?>><?php echo grw_i('Polish'); ?></option>
248
- <option value="pt" <?php selected('pt', $reviews_lang); ?>><?php echo grw_i('Portuguese'); ?></option>
249
- <option value="pt-BR" <?php selected('pt-BR', $reviews_lang); ?>><?php echo grw_i('Portuguese (Brazil)'); ?></option>
250
- <option value="pt-PT" <?php selected('pt-PT', $reviews_lang); ?>><?php echo grw_i('Portuguese (Portugal)'); ?></option>
251
- <option value="ro" <?php selected('ro', $reviews_lang); ?>><?php echo grw_i('Romanian'); ?></option>
252
- <option value="ru" <?php selected('ru', $reviews_lang); ?>><?php echo grw_i('Russian'); ?></option>
253
- <option value="sk" <?php selected('sk', $reviews_lang); ?>><?php echo grw_i('Slovak'); ?></option>
254
- <option value="sl" <?php selected('sl', $reviews_lang); ?>><?php echo grw_i('Slovenian'); ?></option>
255
- <option value="sr" <?php selected('sr', $reviews_lang); ?>><?php echo grw_i('Serbian'); ?></option>
256
- <option value="sv" <?php selected('sv', $reviews_lang); ?>><?php echo grw_i('Swedish'); ?></option>
257
- <option value="ta" <?php selected('ta', $reviews_lang); ?>><?php echo grw_i('Tamil'); ?></option>
258
- <option value="te" <?php selected('te', $reviews_lang); ?>><?php echo grw_i('Telugu'); ?></option>
259
- <option value="th" <?php selected('th', $reviews_lang); ?>><?php echo grw_i('Thai'); ?></option>
260
- <option value="tl" <?php selected('tl', $reviews_lang); ?>><?php echo grw_i('Tagalog'); ?></option>
261
- <option value="tr" <?php selected('tr', $reviews_lang); ?>><?php echo grw_i('Turkish'); ?></option>
262
- <option value="uk" <?php selected('uk', $reviews_lang); ?>><?php echo grw_i('Ukrainian'); ?></option>
263
- <option value="vi" <?php selected('vi', $reviews_lang); ?>><?php echo grw_i('Vietnamese'); ?></option>
264
- <option value="zh-CN" <?php selected('zh-CN', $reviews_lang); ?>><?php echo grw_i('Chinese (Simplified)'); ?></option>
265
- <option value="zh-TW" <?php selected('zh-TW', $reviews_lang); ?>><?php echo grw_i('Chinese (Traditional)'); ?></option>
266
- </select>
267
- </div>
268
  </div>
269
- </div>
 
 
 
 
 
 
 
 
 
 
1
  <?php global $wp_version; if (version_compare($wp_version, '3.5', '>=')) { wp_enqueue_media(); ?>
2
  <div class="form-group">
3
  <div class="col-sm-12">
20
  </div>
21
  </div>
22
 
23
+ <div class="form-group">
24
+ <div class="col-sm-12">
25
+ <input type="text" id="<?php echo $this->get_field_id('reviews_lang'); ?>" name="<?php echo $this->get_field_name('reviews_lang'); ?>" value="<?php echo $reviews_lang; ?>" class="form-control grw-place-lang" placeholder="<?php echo grw_i('Language'); ?>" readonly />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  </div>
27
  </div>
28
 
29
+ <?php if (isset($title)) { ?>
30
+ <div class="form-group">
31
+ <div class="col-sm-12">
32
+ <label><?php echo grw_i('Title'); ?></label>
33
+ <input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" class="form-control" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </div>
35
+ </div>
36
+ <?php } ?>
37
+
38
+ <div class="form-group">
39
+ <div class="col-sm-12">
40
+ <label><?php echo grw_i('Pagination'); ?></label>
41
+ <input type="text" id="<?php echo $this->get_field_id('pagination'); ?>" name="<?php echo $this->get_field_name('pagination'); ?>" value="<?php echo $pagination; ?>" class="form-control"/>
42
  </div>
43
+ </div>
44
+
45
+ <div class="form-group">
46
+ <div class="col-sm-12">
47
+ <label><?php echo grw_i('Characters before \'read more\' link'); ?></label>
48
+ <input type="text" id="<?php echo $this->get_field_id('text_size'); ?>" name="<?php echo $this->get_field_name('text_size'); ?>" value="<?php echo $text_size; ?>" class="form-control"/>
 
 
 
 
 
 
49
  </div>
50
+ </div>
51
+
52
+ <div class="form-group">
53
+ <div class="col-sm-12">
54
+ <label for="<?php echo $this->get_field_id('max_width'); ?>"><?php echo grw_i('Widget width'); ?></label>
55
+ <input id="<?php echo $this->get_field_id('max_width'); ?>" name="<?php echo $this->get_field_name('max_width'); ?>" value="<?php echo $max_width; ?>" class="form-control" type="text" />
56
  </div>
57
+ </div>
58
+
59
+ <div class="form-group">
60
+ <div class="col-sm-12">
61
+ <label for="<?php echo $this->get_field_id('max_height'); ?>"><?php echo grw_i('Widget height'); ?></label>
62
+ <input id="<?php echo $this->get_field_id('max_height'); ?>" name="<?php echo $this->get_field_name('max_height'); ?>" value="<?php echo $max_height; ?>" class="form-control" type="text" />
63
  </div>
64
+ </div>
65
+
66
+ <div class="form-group">
67
+ <div class="col-sm-12">
68
+ <label>
69
+ <input id="<?php echo $this->get_field_id('centered'); ?>" name="<?php echo $this->get_field_name('centered'); ?>" type="checkbox" value="1" <?php checked('1', $centered); ?> class="form-control" />
70
+ <?php echo grw_i('Place by center (only if Width is set)'); ?>
71
+ </label>
72
  </div>
73
  </div>
74
 
75
+ <div class="form-group">
76
+ <div class="col-sm-12">
77
+ <label>
78
+ <input id="<?php echo $this->get_field_id('dark_theme'); ?>" name="<?php echo $this->get_field_name('dark_theme'); ?>" type="checkbox" value="1" <?php checked('1', $dark_theme); ?> class="form-control" />
79
+ <?php echo grw_i('Dark background'); ?>
80
+ </label>
 
 
 
 
81
  </div>
82
  </div>
83
 
84
+ <div class="form-group">
85
+ <div class="col-sm-12">
86
+ <label>
87
+ <input id="<?php echo $this->get_field_id('open_link'); ?>" name="<?php echo $this->get_field_name('open_link'); ?>" type="checkbox" value="1" <?php checked('1', $open_link); ?> class="form-control" />
88
+ <?php echo grw_i('Open links in new Window'); ?>
89
+ </label>
 
 
 
 
90
  </div>
91
+ </div>
92
+
93
+ <div class="form-group">
94
+ <div class="col-sm-12">
95
+ <label>
96
+ <input id="<?php echo $this->get_field_id('nofollow_link'); ?>" name="<?php echo $this->get_field_name('nofollow_link'); ?>" type="checkbox" value="1" <?php checked('1', $nofollow_link); ?> class="form-control" />
97
+ <?php echo grw_i('Use no follow links'); ?>
98
+ </label>
99
  </div>
100
+ </div>
101
+
102
+ <div class="form-group">
103
+ <div class="rplg-pro">
104
+ <?php echo grw_i('Try more features in the Business version: '); ?>
105
+ <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
106
+ <?php echo grw_i('Upgrade to Business'); ?>
107
+ </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  </div>
109
+ </div>
110
+
111
+ <input id="<?php echo $this->get_field_id('view_mode'); ?>" name="<?php echo $this->get_field_name('view_mode'); ?>" type="hidden" value="list" />
grw-reviews-helper.php CHANGED
@@ -75,8 +75,7 @@ function grw_place_reviews($place, $reviews, $place_id, $text_size, $pagination)
75
  <?php echo grw_i('Next Reviews'); ?>
76
  </a>
77
  <?php } else {
78
- $seeAllReviews = grw_i('See All Reviews');
79
- grw_anchor($place->url, 'wp-google-url', $seeAllReviews, true, true);
80
  }
81
  }
82
 
75
  <?php echo grw_i('Next Reviews'); ?>
76
  </a>
77
  <?php } else {
78
+ grw_anchor('https://search.google.com/local/reviews?placeid=' . $place_id, 'wp-google-url', grw_i('See All Reviews'), true, true);
 
79
  }
80
  }
81
 
grw-reviews.php CHANGED
@@ -23,6 +23,13 @@ if ($place->rating > 0) {
23
  }
24
  $rating = number_format((float)$rating, 1, '.', '');
25
  $place_img = strlen($place_photo) > 0 ? $place_photo : (strlen($place->photo) > 0 ? $place->photo : $place->icon);
 
 
 
 
 
 
 
26
  ?>
27
 
28
  <?php if ($view_mode != 'list') { ?>
@@ -76,7 +83,7 @@ $place_img = strlen($place_photo) > 0 ? $place_photo : (strlen($place->photo) >
76
 
77
  <?php } else { ?>
78
 
79
- <div class="wp-gr wpac" style="<?php if (isset($max_width) && strlen($max_width) > 0) { ?>max-width:<?php echo $max_width;?>!important;<?php } ?><?php if (isset($max_height) && strlen($max_height) > 0) { ?>max-height:<?php echo $max_height;?>!important;overflow-y:auto!important;<?php } ?>">
80
  <div class="wp-google-list<?php if ($dark_theme) { ?> wp-dark<?php } ?>">
81
  <div class="wp-google-place">
82
  <?php grw_place($rating, $place, $place_img, $reviews, $dark_theme); ?>
23
  }
24
  $rating = number_format((float)$rating, 1, '.', '');
25
  $place_img = strlen($place_photo) > 0 ? $place_photo : (strlen($place->photo) > 0 ? $place->photo : $place->icon);
26
+
27
+ if (is_numeric($max_width)) {
28
+ $max_width = $max_width . 'px';
29
+ }
30
+ if (is_numeric($max_height)) {
31
+ $max_height = $max_height . 'px';
32
+ }
33
  ?>
34
 
35
  <?php if ($view_mode != 'list') { ?>
83
 
84
  <?php } else { ?>
85
 
86
+ <div class="wp-gr wpac" style="<?php if (isset($max_width) && strlen($max_width) > 0) { ?>width:<?php echo $max_width;?>!important;<?php } ?><?php if (isset($max_height) && strlen($max_height) > 0) { ?>height:<?php echo $max_height;?>!important;overflow-y:auto!important;<?php } ?><?php if ($centered) { ?>margin:0 auto!important;<?php } ?>">
87
  <div class="wp-google-list<?php if ($dark_theme) { ?> wp-dark<?php } ?>">
88
  <div class="wp-google-place">
89
  <?php grw_place($rating, $place, $place_img, $reviews, $dark_theme); ?>
grw-setting.php CHANGED
@@ -5,7 +5,7 @@ if (!current_user_can('manage_options')) {
5
  }
6
 
7
  function grw_has_valid_nonce() {
8
- $nonce_actions = array('grw_reset', 'grw_settings', 'grw_active');
9
  $nonce_form_prefix = 'grw-form_nonce_';
10
  $nonce_action_prefix = 'grw-wpnonce_';
11
  foreach ($nonce_actions as $key => $value) {
@@ -41,7 +41,7 @@ if (!empty($_POST)) {
41
  }
42
 
43
  // Reset
44
- if (isset($_POST['reset'])) {
45
  grw_reset(isset($_POST['reset_db']));
46
  unset($_POST);
47
  ?>
@@ -109,8 +109,7 @@ if (isset($_POST['grw_active']) && isset($_GET['grw_active'])) {
109
  }
110
 
111
  if (isset($_POST['grw_setting'])) {
112
- update_option('grw_language', $_POST['grw_language']);
113
- update_option('grw_google_api_key', $_POST['grw_google_api_key']);
114
 
115
  /*$grw_google_api_key = $_POST['grw_google_api_key'];
116
  if (strlen($grw_google_api_key) > 0) {
@@ -123,67 +122,58 @@ if (isset($_POST['grw_setting'])) {
123
  }
124
  update_option('grw_google_api_key', $grw_google_api_key);
125
  }*/
126
- $grw_setting_page = true;
127
- } else {
128
- $grw_setting_page = false;
129
  }
130
 
131
- if (isset($_GET['setting_tab'])) {
132
- $grw_setting_page = true;
133
- }
134
-
135
- if (isset($_POST['grw_install_db'])) {
136
  grw_install_db();
137
  }
138
 
139
- wp_register_style('twitter_bootstrap3_css', plugins_url('/static/css/bootstrap.min.css', __FILE__));
140
- wp_enqueue_style('twitter_bootstrap3_css', plugins_url('/static/css/bootstrap.min.css', __FILE__));
 
 
141
 
142
  wp_register_style('rplg_setting_css', plugins_url('/static/css/rplg-setting.css', __FILE__));
143
  wp_enqueue_style('rplg_setting_css', plugins_url('/static/css/rplg-setting.css', __FILE__));
144
 
145
  wp_enqueue_script('jquery');
146
 
147
- $grw_enabled = get_option('grw_active') == '1';
 
148
  $grw_google_api_key = get_option('grw_google_api_key');
149
- $grw_language = get_option('grw_language');
150
  ?>
151
 
152
  <span class="rplg-version"><?php echo grw_i('Free Version: %s', esc_html(GRW_VERSION)); ?></span>
153
- <div class="rplg-setting container-fluid">
154
- <img src="<?php echo GRW_PLUGIN_URL . '/static/img/google.png'; ?>" alt="Google">
155
- <ul class="nav nav-tabs" role="tablist">
156
- <li role="presentation"<?php if (!$grw_setting_page) { ?> class="active"<?php } ?>>
157
- <a href="#about" aria-controls="about" role="tab" data-toggle="tab"><?php echo grw_i('About'); ?></a>
158
- </li>
159
- <li role="presentation"<?php if ($grw_setting_page) { ?> class="active"<?php } ?>>
160
- <a href="#setting" aria-controls="setting" role="tab" data-toggle="tab"><?php echo grw_i('Setting'); ?></a>
161
- </li>
162
- <li role="presentation">
163
- <a href="#shortcode" aria-controls="shortcode" role="tab" data-toggle="tab"><?php echo grw_i('Shortcode Builder'); ?></a>
164
- </li>
165
- <li role="presentation">
166
- <a href="#mod" aria-controls="mod" role="tab" data-toggle="tab"><?php echo grw_i('Review Moderation'); ?></a>
167
- </li>
168
- </ul>
169
- <div class="tab-content">
170
- <div role="tabpanel" class="tab-pane<?php if (!$grw_setting_page) { ?> active<?php } ?>" id="about">
171
- <div class="row">
172
- <div class="col-sm-6">
173
- <h4><?php echo grw_i('Google Reviews Widget for WordPress'); ?></h4>
174
- <p><?php echo grw_i('Google Reviews plugin is an easy and fast way to integrate Google business reviews right into your WordPress website. This plugin works instantly and keep all Google places and reviews in WordPress database thus it has no depend on external services.'); ?></p>
175
- <p><?php echo grw_i('To use a widget, please do follow:'); ?></p>
176
- <ol>
177
- <li>Go to menu <b>"Appearance"</b> -> <b>"Widgets"</b></li>
178
- <li>Move "Google Reviews Widget" widget to sidebar</li>
179
- <li>Enter search query of your business place in "Location of place" field and click "Search Place"</li>
180
- <li>Select your found place in the panel below and click "Save Place and Reviews"</li>
181
- <li>"Google Place Name" and "Google Place ID" must be filled, if so click "Save" button to save the widget</li>
182
- </ol>
183
- <p><?php echo grw_i('Feel free to contact us by email <a href="mailto:support@richplugins.com">support@richplugins.com</a>.'); ?></p>
184
- <p><?php echo grw_i('<b>Like this plugin? Give it a like on social:</b>'); ?></p>
185
- <div class="row">
186
- <div class="col-sm-4">
187
  <div id="fb-root"></div>
188
  <script>(function(d, s, id) {
189
  var js, fjs = d.getElementsByTagName(s)[0];
@@ -193,20 +183,7 @@ $grw_language = get_option('grw_language');
193
  fjs.parentNode.insertBefore(js, fjs);
194
  }(document, 'script', 'facebook-jssdk'));</script>
195
  <div class="fb-like" data-href="https://richplugins.com/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>
196
- </div>
197
- <div class="col-sm-4 twitter">
198
- <a href="https://twitter.com/richplugins" class="twitter-follow-button" data-show-count="false">Follow @RichPlugins</a>
199
- <script>!function (d, s, id) {
200
- var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
201
- if (!d.getElementById(id)) {
202
- js = d.createElement(s);
203
- js.id = id;
204
- js.src = p + '://platform.twitter.com/widgets.js';
205
- fjs.parentNode.insertBefore(js, fjs);
206
- }
207
- }(document, 'script', 'twitter-wjs');</script>
208
- </div>
209
- <div class="col-sm-4 googleplus">
210
  <div class="g-plusone" data-size="medium" data-annotation="inline" data-width="200" data-href="https://plus.google.com/101080686931597182099"></div>
211
  <script type="text/javascript">
212
  window.___gcfg = { lang: 'en-US' };
@@ -221,185 +198,172 @@ $grw_language = get_option('grw_language');
221
  </script>
222
  </div>
223
  </div>
224
- </div>
225
- <div class="col-sm-6">
226
- <br>
227
- <div class="embed-responsive embed-responsive-16by9">
228
- <iframe class="embed-responsive-item" src="//www.youtube.com/embed/lmaTBmvDPKk?rel=0" allowfullscreen=""></iframe>
229
  </div>
230
  </div>
231
  </div>
232
- <hr>
233
- <h4>Get More Features with Google Reviews Business!</h4>
234
- <p><a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;">Upgrade to Google Reviews Business</a></p>
235
- <p>* Trying to get more than 5 Google reviews</p>
236
- <p>* Google Rich Snippets (schema.org)</p>
237
- <p>* Support shortcode</p>
238
- <p>* Powerful <b>Shortcode Builder</b></p>
239
- <p>* Slider/Grid theme to show G+ reviews in testimonials section</p>
240
- <p>* Google Trust Badge (right/left fixed or inner)</p>
241
- <p>* 'Write a review' button to available leave Google review directly on your website</p>
242
- <p>* Trim long reviews with "read more" link</p>
243
- <p>* Show/hide business photo and avatars</p>
244
- <p>* Custom business place photo</p>
245
- <p>* Minimum rating filter</p>
246
- <p>* Pagination, Sorting</p>
247
- <p>* Moderation G+ reviews</p>
248
- <p>* Priority support</p>
249
- </div>
250
- <div role="tabpanel" class="tab-pane<?php if ($grw_setting_page) { ?> active<?php } ?>" id="setting">
251
- <h4><?php echo grw_i('Google Reviews Widget Setting'); ?></h4>
252
- <!-- Configuration form -->
253
- <form method="POST" enctype="multipart/form-data">
254
- <?php wp_nonce_field('grw-wpnonce_grw_settings', 'grw-form_nonce_grw_settings'); ?>
255
- <div class="form-group">
256
- <label class="control-label" for="grw_google_api_key"><?php echo grw_i('Google Places API Key'); ?></label>
257
- <input class="form-control" type="text" id="grw_google_api_key" name="grw_google_api_key" value="<?php echo esc_attr($grw_google_api_key); ?>">
258
- <?php if (isset($grw_google_api_key_error)) {?>
259
- <div class="alert alert-dismissible alert-danger">
260
- The Google API Key is wrong, error message: <?php echo $grw_google_api_key_error; ?><br>
261
- Please get the correct key by instruction below ↓
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
  </div>
263
- <?php } ?>
264
- <div style="margin-top:10px">
265
- <p><b>Instruction: how to create Google Places API key</b></p>
266
- <p>1. Go to the <a href="https://console.developers.google.com/apis/dashboard?pli=1" target="_blank">Google Console</a></p>
267
- <p>2. Click '<b>Create Project</b>' or '<b>Select Project</b>' button</p>
268
- <p>3. Create new project or select existing</p>
269
- <p>4. On the project page click '<b>ENABLE APIS AND SERVICES</b>'</p>
270
- <p>5. Type '<b>Places API</b>' in the search area</p>
271
- <p>6. Select the first result '<b>Places API</b>' and click '<b>ENABLE</b>' button</p>
272
- <p>7. On the 'Places API' page select '<b>Credential</b>' tab and '<b>Create credential</b>' / '<b>API key</b>' option</p>
273
- <p>8. Copy created API key, paste to this setting and save</p>
274
- <p><b>Video instruction</b></p>
275
- <iframe src="//www.youtube.com/embed/Kf_bkg7WeC0?rel=0" allowfullscreen=""></iframe>
276
  </div>
277
  </div>
278
- <div class="form-group">
279
- <label class="control-label"><?php echo grw_i('Google Places API language'); ?></label>
280
- <select class="form-control" id="grw_language" name="grw_language">
281
- <option value="" <?php selected('', $grw_language); ?>><?php echo grw_i('Disable'); ?></option>
282
- <option value="ar" <?php selected('ar', $grw_language); ?>><?php echo grw_i('Arabic'); ?></option>
283
- <option value="bg" <?php selected('bg', $grw_language); ?>><?php echo grw_i('Bulgarian'); ?></option>
284
- <option value="bn" <?php selected('bn', $grw_language); ?>><?php echo grw_i('Bengali'); ?></option>
285
- <option value="ca" <?php selected('ca', $grw_language); ?>><?php echo grw_i('Catalan'); ?></option>
286
- <option value="cs" <?php selected('cs', $grw_language); ?>><?php echo grw_i('Czech'); ?></option>
287
- <option value="da" <?php selected('da', $grw_language); ?>><?php echo grw_i('Danish'); ?></option>
288
- <option value="de" <?php selected('de', $grw_language); ?>><?php echo grw_i('German'); ?></option>
289
- <option value="el" <?php selected('el', $grw_language); ?>><?php echo grw_i('Greek'); ?></option>
290
- <option value="en" <?php selected('en', $grw_language); ?>><?php echo grw_i('English'); ?></option>
291
- <option value="en-AU" <?php selected('en-AU', $grw_language); ?>><?php echo grw_i('English (Australian)'); ?></option>
292
- <option value="en-GB" <?php selected('en-GB', $grw_language); ?>><?php echo grw_i('English (Great Britain)'); ?></option>
293
- <option value="es" <?php selected('es', $grw_language); ?>><?php echo grw_i('Spanish'); ?></option>
294
- <option value="eu" <?php selected('eu', $grw_language); ?>><?php echo grw_i('Basque'); ?></option>
295
- <option value="eu" <?php selected('eu', $grw_language); ?>><?php echo grw_i('Basque'); ?></option>
296
- <option value="fa" <?php selected('fa', $grw_language); ?>><?php echo grw_i('Farsi'); ?></option>
297
- <option value="fi" <?php selected('fi', $grw_language); ?>><?php echo grw_i('Finnish'); ?></option>
298
- <option value="fil" <?php selected('fil', $grw_language); ?>><?php echo grw_i('Filipino'); ?></option>
299
- <option value="fr" <?php selected('fr', $grw_language); ?>><?php echo grw_i('French'); ?></option>
300
- <option value="gl" <?php selected('gl', $grw_language); ?>><?php echo grw_i('Galician'); ?></option>
301
- <option value="gu" <?php selected('gu', $grw_language); ?>><?php echo grw_i('Gujarati'); ?></option>
302
- <option value="hi" <?php selected('hi', $grw_language); ?>><?php echo grw_i('Hindi'); ?></option>
303
- <option value="hr" <?php selected('hr', $grw_language); ?>><?php echo grw_i('Croatian'); ?></option>
304
- <option value="hu" <?php selected('hu', $grw_language); ?>><?php echo grw_i('Hungarian'); ?></option>
305
- <option value="id" <?php selected('id', $grw_language); ?>><?php echo grw_i('Indonesian'); ?></option>
306
- <option value="it" <?php selected('it', $grw_language); ?>><?php echo grw_i('Italian'); ?></option>
307
- <option value="iw" <?php selected('iw', $grw_language); ?>><?php echo grw_i('Hebrew'); ?></option>
308
- <option value="ja" <?php selected('ja', $grw_language); ?>><?php echo grw_i('Japanese'); ?></option>
309
- <option value="kn" <?php selected('kn', $grw_language); ?>><?php echo grw_i('Kannada'); ?></option>
310
- <option value="ko" <?php selected('ko', $grw_language); ?>><?php echo grw_i('Korean'); ?></option>
311
- <option value="lt" <?php selected('lt', $grw_language); ?>><?php echo grw_i('Lithuanian'); ?></option>
312
- <option value="lv" <?php selected('lv', $grw_language); ?>><?php echo grw_i('Latvian'); ?></option>
313
- <option value="ml" <?php selected('ml', $grw_language); ?>><?php echo grw_i('Malayalam'); ?></option>
314
- <option value="mr" <?php selected('mr', $grw_language); ?>><?php echo grw_i('Marathi'); ?></option>
315
- <option value="nl" <?php selected('nl', $grw_language); ?>><?php echo grw_i('Dutch'); ?></option>
316
- <option value="no" <?php selected('no', $grw_language); ?>><?php echo grw_i('Norwegian'); ?></option>
317
- <option value="pl" <?php selected('pl', $grw_language); ?>><?php echo grw_i('Polish'); ?></option>
318
- <option value="pt" <?php selected('pt', $grw_language); ?>><?php echo grw_i('Portuguese'); ?></option>
319
- <option value="pt-BR" <?php selected('pt-BR', $grw_language); ?>><?php echo grw_i('Portuguese (Brazil)'); ?></option>
320
- <option value="pt-PT" <?php selected('pt-PT', $grw_language); ?>><?php echo grw_i('Portuguese (Portugal)'); ?></option>
321
- <option value="ro" <?php selected('ro', $grw_language); ?>><?php echo grw_i('Romanian'); ?></option>
322
- <option value="ru" <?php selected('ru', $grw_language); ?>><?php echo grw_i('Russian'); ?></option>
323
- <option value="sk" <?php selected('sk', $grw_language); ?>><?php echo grw_i('Slovak'); ?></option>
324
- <option value="sl" <?php selected('sl', $grw_language); ?>><?php echo grw_i('Slovenian'); ?></option>
325
- <option value="sr" <?php selected('sr', $grw_language); ?>><?php echo grw_i('Serbian'); ?></option>
326
- <option value="sv" <?php selected('sv', $grw_language); ?>><?php echo grw_i('Swedish'); ?></option>
327
- <option value="ta" <?php selected('ta', $grw_language); ?>><?php echo grw_i('Tamil'); ?></option>
328
- <option value="te" <?php selected('te', $grw_language); ?>><?php echo grw_i('Telugu'); ?></option>
329
- <option value="th" <?php selected('th', $grw_language); ?>><?php echo grw_i('Thai'); ?></option>
330
- <option value="tl" <?php selected('tl', $grw_language); ?>><?php echo grw_i('Tagalog'); ?></option>
331
- <option value="tr" <?php selected('tr', $grw_language); ?>><?php echo grw_i('Turkish'); ?></option>
332
- <option value="uk" <?php selected('uk', $grw_language); ?>><?php echo grw_i('Ukrainian'); ?></option>
333
- <option value="vi" <?php selected('vi', $grw_language); ?>><?php echo grw_i('Vietnamese'); ?></option>
334
- <option value="zh-CN" <?php selected('zh-CN', $grw_language); ?>><?php echo grw_i('Chinese (Simplified)'); ?></option>
335
- <option value="zh-TW" <?php selected('zh-TW', $grw_language); ?>><?php echo grw_i('Chinese (Traditional)'); ?></option>
336
- </select>
337
  </div>
338
- <div class="form-group">
339
- <input class="form-control" type="checkbox" id="grw_install_db" name="grw_install_db" >
340
- <label class="control-label" for="grw_install_db"><?php echo grw_i('Re-create the DB tables for the plugin (service option)'); ?></label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
  </div>
342
- <p class="submit" style="text-align: left">
343
- <input name="grw_setting" type="submit" value="Save" class="button-primary button" tabindex="4">
344
- </p>
345
- </form>
346
- <hr>
347
- <!-- Enable/disable Google Reviews Widget toggle -->
348
- <form method="POST" action="?page=grw&amp;grw_active=<?php echo (string)((int)($grw_enabled != true)); ?>">
349
- <?php wp_nonce_field('grw-wpnonce_grw_active', 'grw-form_nonce_grw_active'); ?>
350
- <span class="status">
351
- <?php echo grw_i('Google Reviews Widget is currently '). '<b>' .($grw_enabled ? grw_i('enabled') : grw_i('disabled')). '</b>'; ?>
352
- </span>
353
- <input type="submit" name="grw_active" class="button" value="<?php echo $grw_enabled ? grw_i('Disable') : grw_i('Enable'); ?>" />
354
- </form>
355
- <hr>
356
- <!-- Debug information -->
357
- <button class="btn btn-primary btn-small" type="button" data-toggle="collapse" data-target="#debug" aria-expanded="false" aria-controls="debug">
358
- <?php echo grw_i('Debug Information'); ?>
359
- </button>
360
- <div id="debug" class="collapse">
361
- <textarea style="width:90%; height:200px;" onclick="this.select();return false;" readonly><?php
362
- rplg_debug(GRW_VERSION, grw_options(), 'widget_grw_widget');
363
- grw_debug();
364
- ?></textarea>
365
  </div>
366
- <div style="max-width:700px"><?php echo grw_i('Feel free to contact support team by support@richplugins.com for any issues but please don\'t forget to provide debug information that you can get by click on \'Debug Information\' button.'); ?></div>
367
- <hr>
368
- <!-- Reset form -->
369
- <form action="?page=grw" method="POST">
370
- <?php wp_nonce_field('grw-wpnonce_grw_reset', 'grw-form_nonce_grw_reset'); ?>
371
- <p>
372
- <input type="submit" value="Reset" name="reset" onclick="return confirm('<?php echo grw_i('Are you sure you want to reset the Google Reviews Widget plugin?'); ?>')" class="button" />
373
- <?php echo grw_i('This removes all plugin-specific settings.') ?>
374
- </p>
375
- <p>
376
- <input type="checkbox" id="reset_db" name="reset_db">
377
- <label for="reset_db"><?php echo grw_i('Remove all data including Google Reviews'); ?></label>
378
- </p>
379
- </form>
380
- </div>
381
- <div role="tabpanel" class="tab-pane" id="mod">
382
- <h4><?php echo grw_i('Moderation available in Google Reviews Business plugin:'); ?></h4>
383
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Business'); ?></a>
384
- </div>
385
- <div role="tabpanel" class="tab-pane" id="shortcode">
386
- <h4><?php echo grw_i('Shortcode Builder available in Google Reviews Business plugin:'); ?></h4>
387
- <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Business'); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
388
  </div>
 
389
  </div>
 
390
  </div>
391
  <script type="text/javascript">
392
  jQuery(document).ready(function($) {
393
- $('a[data-toggle="tab"]').on('click', function(e) {
394
- var active = $(this).attr('href');
395
- $('.tab-content ' + active).addClass('active').show().siblings().hide();
396
- $(this).parent('li').addClass('active').siblings().removeClass('active');
397
  e.preventDefault();
398
  });
399
- $('button[data-toggle="collapse"]').click(function () {
400
- $target = $(this);
401
- $collapse = $target.next();
402
- $collapse.slideToggle(500);
403
- });
404
  });
405
  </script>
5
  }
6
 
7
  function grw_has_valid_nonce() {
8
+ $nonce_actions = array('grw_reset', 'grw_settings', 'grw_active', 'grw_advance');
9
  $nonce_form_prefix = 'grw-form_nonce_';
10
  $nonce_action_prefix = 'grw-wpnonce_';
11
  foreach ($nonce_actions as $key => $value) {
41
  }
42
 
43
  // Reset
44
+ if (isset($_POST['reset_all'])) {
45
  grw_reset(isset($_POST['reset_db']));
46
  unset($_POST);
47
  ?>
109
  }
110
 
111
  if (isset($_POST['grw_setting'])) {
112
+ update_option('grw_google_api_key', trim($_POST['grw_google_api_key']));
 
113
 
114
  /*$grw_google_api_key = $_POST['grw_google_api_key'];
115
  if (strlen($grw_google_api_key) > 0) {
122
  }
123
  update_option('grw_google_api_key', $grw_google_api_key);
124
  }*/
 
 
 
125
  }
126
 
127
+ if (isset($_POST['create_db'])) {
 
 
 
 
128
  grw_install_db();
129
  }
130
 
131
+ if (isset($_POST['install'])) {
132
+ grw_reset(true);
133
+ grw_install();
134
+ }
135
 
136
  wp_register_style('rplg_setting_css', plugins_url('/static/css/rplg-setting.css', __FILE__));
137
  wp_enqueue_style('rplg_setting_css', plugins_url('/static/css/rplg-setting.css', __FILE__));
138
 
139
  wp_enqueue_script('jquery');
140
 
141
+ $tab = isset($_GET['grw_tab']) && strlen($_GET['grw_tab']) > 0 ? $_GET['grw_tab'] : 'about';
142
+ $grw_enabled = get_option('grw_active') == '1';
143
  $grw_google_api_key = get_option('grw_google_api_key');
 
144
  ?>
145
 
146
  <span class="rplg-version"><?php echo grw_i('Free Version: %s', esc_html(GRW_VERSION)); ?></span>
147
+
148
+ <div class="rplg-setting">
149
+
150
+ <div class="rplg-page-title">
151
+ <img src="<?php echo GRW_PLUGIN_URL . '/static/img/google.png'; ?>" alt="Google"> Reviews Widget
152
+ </div>
153
+
154
+ <div class="rplg-settings-workspace">
155
+
156
+ <div data-nav-tabs="">
157
+ <div class="nav-tab-wrapper">
158
+ <a href="#about" class="nav-tab<?php if ($tab == 'about') { ?> nav-tab-active<?php } ?>"><?php echo grw_i('About'); ?></a>
159
+ <a href="#setting" class="nav-tab<?php if ($tab == 'setting') { ?> nav-tab-active<?php } ?>"><?php echo grw_i('Settings'); ?></a>
160
+ <a href="#shortcode" class="nav-tab<?php if ($tab == 'shortcode') { ?> nav-tab-active<?php } ?>"><?php echo grw_i('Shortcode Builder'); ?></a>
161
+ <a href="#support" class="nav-tab<?php if ($tab == 'support') { ?> nav-tab-active<?php } ?>"><?php echo grw_i('Support'); ?></a>
162
+ <a href="#advance" class="nav-tab<?php if ($tab == 'advance') { ?> nav-tab-active<?php } ?>"><?php echo grw_i('Advance'); ?></a>
163
+ </div>
164
+
165
+ <div id="about" class="tab-content" style="display:<?php echo $tab == 'about' ? 'block' : 'none'?>;">
166
+ <h3>Google Reviews Widget for WordPress</h3>
167
+ <div class="rplg-flex-row">
168
+ <div class="rplg-flex-col">
169
+ <span>Google Reviews plugin is an easy and fast way to integrate Google business reviews right into your WordPress website. This plugin works instantly and keep all Google places and reviews in WordPress database thus it has no depend on external services.</span>
170
+ <p>Please see Introduction Video to understand how it works. Also you can find most common answers and solutions for most common questions and issues in next tabs.</p>
171
+ <div class="rplg-alert rplg-alert-success">
172
+ <strong>Try more features in the Business version</strong>: Merge Google, Facebook and Yelp reviews, Beautiful themes (Slider, Grid, Trust Badges), Shortcode support, Rich Snippets, Rating filter, Any sorting, Include/Exclude words filter, Hide/Show any elements, Priority support and many others.
173
+ <a class="button-primary button" href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="margin-left:10px">Upgrade to Business</a>
174
+ </div>
175
+ <br>
176
+ <div class="rplg-socials">
 
 
 
 
177
  <div id="fb-root"></div>
178
  <script>(function(d, s, id) {
179
  var js, fjs = d.getElementsByTagName(s)[0];
183
  fjs.parentNode.insertBefore(js, fjs);
184
  }(document, 'script', 'facebook-jssdk'));</script>
185
  <div class="fb-like" data-href="https://richplugins.com/" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>
186
+ <a href="https://twitter.com/richplugins?ref_src=twsrc%5Etfw" class="twitter-follow-button" data-show-count="false">Follow @richplugins</a><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  <div class="g-plusone" data-size="medium" data-annotation="inline" data-width="200" data-href="https://plus.google.com/101080686931597182099"></div>
188
  <script type="text/javascript">
189
  window.___gcfg = { lang: 'en-US' };
198
  </script>
199
  </div>
200
  </div>
201
+ <div class="rplg-flex-col">
202
+ <iframe width="100%" height="315" src="https://www.youtube.com/embed/lmaTBmvDPKk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
 
 
 
203
  </div>
204
  </div>
205
  </div>
206
+
207
+ <div id="setting" class="tab-content" style="display:<?php echo $tab == 'setting' ? 'block' : 'none'?>;">
208
+ <h3>General Settings</h3>
209
+ <form method="post" action="?page=grw&amp;grw_tab=setting&amp;grw_active=<?php echo (string)((int)($grw_enabled != true)); ?>">
210
+ <div class="rplg-field">
211
+ <div class="rplg-field-label">
212
+ <label>The plugin is currently <b><?php echo $grw_enabled ? 'enabled' : 'disabled' ?></b></label>
213
+ </div>
214
+ <div class="wp-review-field-option">
215
+ <?php wp_nonce_field('grw-wpnonce_grw_active', 'grw-form_nonce_grw_active'); ?>
216
+ <input type="submit" name="grw_active" class="button" value="<?php echo $grw_enabled ? grw_i('Disable') : grw_i('Enable'); ?>" />
217
+ </div>
218
+ </div>
219
+ </form>
220
+ <form method="POST" action="?page=grw&amp;grw_tab=setting" enctype="multipart/form-data">
221
+ <?php wp_nonce_field('grw-wpnonce_grw_settings', 'grw-form_nonce_grw_settings'); ?>
222
+ <div class="rplg-field">
223
+ <div class="rplg-field-label">
224
+ <label>Google Places API key</label>
225
+ </div>
226
+ <div class="wp-review-field-option">
227
+ <input type="text" id="grw_google_api_key" name="grw_google_api_key" class="regular-text" value="<?php echo esc_attr($grw_google_api_key); ?>">
228
+ <div style="padding-top:15px">
229
+ <input type="submit" value="Save" name="grw_setting" class="button" />
230
+ </div>
231
+ </div>
232
+ </div>
233
+ <div class="rplg-field">
234
+ <div class="rplg-field-label">
235
+ <label>Instruction: how to create Google Places API key</label>
236
+ </div>
237
+ <div class="wp-review-field-option">
238
+ <p>1. Go to your <a href="https://console.developers.google.com/apis/dashboard?pli=1" target="_blank">Google Console</a></p>
239
+ <p>2. Click '<b>Create Project</b>' or '<b>Select Project</b>' button</p>
240
+ <p>3. Create new project or select existing</p>
241
+ <p>4. On the project page click '<b>ENABLE APIS AND SERVICES</b>'</p>
242
+ <p>5. Type '<b>Places API</b>' in the search area</p>
243
+ <p>6. Select the first result '<b>Places API</b>' and click '<b>ENABLE</b>' button</p>
244
+ <p>7. On the 'Places API' page select '<b>Credential</b>' tab and '<b>Create credential</b>' / '<b>API key</b>' option</p>
245
+ <p>8. Copy created API key, paste to this setting and save</p>
246
+ <h3>Video instruction</h3>
247
+ <iframe src="//www.youtube.com/embed/Kf_bkg7WeC0?rel=0" allowfullscreen=""></iframe>
248
+ </div>
249
+ </div>
250
+ </form>
251
+ </div>
252
+
253
+ <div id="shortcode" class="tab-content" style="display:<?php echo $tab == 'shortcode' ? 'block' : 'none'?>;">
254
+ <h3>Shortcode Builder is available in the Business version of the plugin</h3>
255
+ <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank" style="color:#00bf54;font-size:16px;text-decoration:underline;"><?php echo grw_i('Upgrade to Business'); ?></a>
256
+ </div>
257
+
258
+ <div id="support" class="tab-content" style="display:<?php echo $tab == 'support' ? 'block' : 'none'?>;">
259
+ <h3>Most Common Questions</h3>
260
+ <div class="brb-flex-row">
261
+ <div class="brb-flex-col">
262
+ <div class="brb-support-question">
263
+ <h3>I can't connect my Google Place.</h3>
264
+ <p>Please check that you correctly found the Place ID of your Google business. It should look like <b>ChIJ</b>3TH9CwFZwokRI... This instruction helps to find any Place ID regardless of whether it has a physical address or it is an area: <a href="https://www.launch2success.com/guide/find-any-google-id/" target="_blank">how to find Place ID of any Google business</a></p>
265
+ </div>
266
  </div>
267
+ <div class="brb-flex-col">
268
+ <div class="brb-support-question">
269
+ <h3>I have some error messages about the Google API key.</h3>
270
+ <p>Please make sure that your correctly created the Google Places API key with <b>Places API library and without any restrictions (IP or Referrer)</b>. It should look like <b>AIzaS</b>yB3k4oWDJPF... On the <b>Settings</b> tab there is a detailed instruction and video tutorial how to create the free and correct Google Places API key.</p>
271
+ </div>
 
 
 
 
 
 
 
 
272
  </div>
273
  </div>
274
+ <div class="brb-flex-row">
275
+ <div class="brb-flex-col">
276
+ <div class="brb-support-question">
277
+ <h3>Why I see only 5 Google reviews?</h3>
278
+ <p>The plugin uses the Google Places API to get your reviews. The API only returns the 5 most helpful reviews. Unfortunately, it is a limitation of Google, not specifically the plugin.</p>
279
+ </div>
280
+ </div>
281
+ <div class="brb-flex-col">
282
+ <div class="brb-support-question">
283
+ <h3>Is the plugin compatible with the latest version of PHP? I saw warnings about the compatibility with PHP 7 in the checker plugin.</h3>
284
+ <p>Yes, the plugin is absolutely compatible with PHP 7 and by the way, we are using PHP 7 on the demo site.</p>
285
+ <p>The warnings come from the code which is needed for compatible with old versions of PHP (&lt; 5.0) which is sometimes found in some users and without this code, the plugin will not work.</p>
286
+ <p>The problem is that the plugin which you’re using to test compatibility with PHP 7 cannot understand that this code is not used under PHP 7 or greater. The compatibility plugin just search some keywords which deprecated in the latest version PHP and show warnings about it (without understanding that this is not used).</p>
287
+ </div>
288
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  </div>
290
+ <div class="brb-flex-row">
291
+ <div class="brb-flex-col">
292
+ <div class="brb-support-question">
293
+ <h3>If you need support</h3>
294
+ <p>You can contact us directly by email <a href="mailto:support@richplugins.com">support@richplugins.com</a> and would be great and save us a lot of time if each request to the support will contain the following data:</p>
295
+ <ul>
296
+ <li><b>1.</b> Clear and understandable description of the issue;</li>
297
+ <li><b>2.</b> Direct links to your reviews on: Google map;</li>
298
+ <li><b>3.</b> Link to the page of your site where the plugin installed;</li>
299
+ <li><b>4.</b> Better if you attach a screenshot(s) (or screencast) how you determine the issue;</li>
300
+ <li><b>5. The most important:</b> please always copy & paste the DEBUG INFORMATION from the <b>Advance</b> tab.</li>
301
+ </ul>
302
+ </div>
303
+ </div>
304
+ <div class="brb-flex-col">
305
+ <div class="brb-support-question">
306
+ </div>
307
+ </div>
308
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  </div>
310
+
311
+ <div id="advance" class="tab-content" style="display:<?php echo $tab == 'advance' ? 'block' : 'none'?>;">
312
+ <h3>Advance Options</h3>
313
+ <form method="post" action="?page=grw&amp;grw_tab=advance">
314
+ <?php wp_nonce_field('grw-wpnonce_grw_advance', 'grw-form_nonce_grw_advance'); ?>
315
+ <div class="rplg-field">
316
+ <div class="rplg-field-label">
317
+ <label>Re-create the database tables of the plugin (service option)</label>
318
+ </div>
319
+ <div class="wp-review-field-option">
320
+ <input type="submit" value="Re-create Database" name="create_db" onclick="return confirm('Are you sure you want to re-create database tables?')" class="button" />
321
+ </div>
322
+ </div>
323
+ <div class="rplg-field">
324
+ <div class="rplg-field-label">
325
+ <label><b>Please be careful</b>: this removes all settings, reviews and install the plugin from scratch</label>
326
+ </div>
327
+ <div class="wp-review-field-option">
328
+ <input type="submit" value="Install from scratch" name="install" onclick="return confirm('It will delete all current reviews, are you sure you want to install the plugin from scratch?')" class="button" />
329
+ </div>
330
+ </div>
331
+ <div class="rplg-field">
332
+ <div class="rplg-field-label">
333
+ <label><b>Please be careful</b>: this removes all plugin-specific settings (and reviews if 'Remove all reviews' checkbox is set)</label>
334
+ </div>
335
+ <div class="wp-review-field-option">
336
+ <input type="submit" value="Delete the plugin" name="reset_all" onclick="return confirm('Are you sure you want to reset all plugin data' + (window.reset_db.checked ? ' including reviews' : '') + '?')" class="button" />
337
+ <br><br>
338
+ <label>
339
+ <input type="checkbox" id="reset_db" name="reset_db"> Remove all reviews
340
+ </label>
341
+ </div>
342
+ </div>
343
+ <div id="debug_info" class="rplg-field">
344
+ <div class="rplg-field-label">
345
+ <label>DEBUG INFORMATION</label>
346
+ </div>
347
+ <div class="wp-review-field-option">
348
+ <input type="button" value="Copy Debug Information" name="reset_all" onclick="window.rplg_debug_info.select();document.execCommand('copy');window.rplg_debug_msg.innerHTML='Debug Information copied, please paste it to your email to support';" class="button" />
349
+ <textarea id="rplg_debug_info" style="display:block;width:30em;height:100px;margin-top:10px" onclick="window.rplg_debug_info.select();document.execCommand('copy');window.rplg_debug_msg.innerHTML='Debug Information copied, please paste it to your email to support';" readonly><?php rplg_debug(GRW_VERSION, grw_options(), 'widget_grw_widget'); grw_debug(); ?></textarea>
350
+ <p id="rplg_debug_msg"></p>
351
+ </div>
352
+ </div>
353
+ </form>
354
+ </div>
355
  </div>
356
+
357
  </div>
358
+
359
  </div>
360
  <script type="text/javascript">
361
  jQuery(document).ready(function($) {
362
+ $('a.nav-tab').on('click', function(e) {
363
+ var $this = $(this), activeId = $this.attr('href');
364
+ $(activeId).show().siblings('.tab-content').hide();
365
+ $this.addClass('nav-tab-active').siblings().removeClass('nav-tab-active');
366
  e.preventDefault();
367
  });
 
 
 
 
 
368
  });
369
  </script>
grw-widget.php CHANGED
@@ -19,12 +19,13 @@ class Goog_Reviews_Widget extends WP_Widget {
19
  'place_name' => '',
20
  'place_id' => '',
21
  'place_photo' => '',
22
- 'text_size' => '',
23
  'dark_theme' => '',
24
- 'view_mode' => '',
25
  'pagination' => '',
26
  'max_width' => '',
27
  'max_height' => '',
 
28
  'open_link' => true,
29
  'nofollow_link' => true,
30
  'reviews_lang' => '',
@@ -138,7 +139,7 @@ class Goog_Reviews_Widget extends WP_Widget {
138
  <?php
139
  } else {
140
  ?>
141
- <h4 class="text-left">First of all, please create and save the Google API Key on <a href="<?php echo admin_url('options-general.php?page=grw&setting_tab=active'); ?>">the setting page</a> of the plugin</h4>
142
  <script type="text/javascript">
143
  var apikey = document.querySelectorAll('.grw-apikey');
144
  if (apikey) {
19
  'place_name' => '',
20
  'place_id' => '',
21
  'place_photo' => '',
22
+ 'text_size' => '120',
23
  'dark_theme' => '',
24
+ 'view_mode' => 'list',
25
  'pagination' => '',
26
  'max_width' => '',
27
  'max_height' => '',
28
+ 'centered' => false,
29
  'open_link' => true,
30
  'nofollow_link' => true,
31
  'reviews_lang' => '',
139
  <?php
140
  } else {
141
  ?>
142
+ <h4 class="text-left">First of all, please create and save the Google API Key on <a href="<?php echo admin_url('options-general.php?page=grw&grw_tab=setting'); ?>">the setting page</a> of the plugin</h4>
143
  <script type="text/javascript">
144
  var apikey = document.querySelectorAll('.grw-apikey');
145
  if (apikey) {
grw.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Reviews Widget
4
  Plugin URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
5
  Description: Instantly Google Places Reviews on your website to increase user confidence and SEO.
6
  Author: RichPlugins <support@richplugins.com>
7
- Version: 1.6.8
8
  Author URI: https://richplugins.com
9
  */
10
 
@@ -13,10 +13,10 @@ require(ABSPATH . 'wp-includes/version.php');
13
  include_once(dirname(__FILE__) . '/api/urlopen.php');
14
  include_once(dirname(__FILE__) . '/helper/debug.php');
15
 
16
- define('GRW_VERSION', '1.6.8');
17
- define('GRW_GOOGLE_PLACE_API', 'https://maps.googleapis.com/maps/api/place/');
18
- define('GRW_GOOGLE_AVATAR', 'https://lh3.googleusercontent.com/-8hepWJzFXpE/AAAAAAAAAAI/AAAAAAAAAAA/I80WzYfIxCQ/s64-c/114307615494839964028.jpg');
19
- define('GRW_PLUGIN_URL', plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
20
 
21
  function grw_options() {
22
  return array(
@@ -76,7 +76,7 @@ function grw_plugin_row_meta($input, $file) {
76
 
77
  $links = array(
78
  '<a href="' . esc_url('https://richplugins.com/documentation') . '" target="_blank">' . grw_i('View Documentation') . '</a>',
79
- '<a href="' . esc_url('https://richplugins.com/google-reviews-pro-wordpress-plugin') . '" target="_blank">' . grw_i('Upgrade to Pro') . ' &raquo;</a>',
80
  );
81
  $input = array_merge($input, $links);
82
  return $input;
@@ -84,34 +84,40 @@ function grw_plugin_row_meta($input, $file) {
84
  add_filter('plugin_row_meta', 'grw_plugin_row_meta', 10, 2);
85
 
86
  /*-------------------------------- Database --------------------------------*/
87
- function grw_activation($network_wide) {
 
88
  if (grw_does_need_update()) {
89
- grw_install($network_wide);
90
  }
91
  }
92
  register_activation_hook(__FILE__, 'grw_activation');
93
 
94
- function grw_install($network_wide, $allow_db_install=true) {
95
- global $wpdb, $userdata;
96
 
97
  $version = (string)get_option('grw_version');
98
  if (!$version) {
99
  $version = '0';
100
  }
101
 
102
- if ($allow_db_install) {
103
- if (function_exists('is_multisite') && is_multisite() && $network_wide) {
104
- $current_blog_id = get_current_blog_id();
105
- $blog_ids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
106
- foreach ($blog_ids as $blog_id) {
107
- switch_to_blog($blog_id);
108
- grw_install_db();
109
- }
110
- switch_to_blog($current_blog_id);
111
- } else {
112
- grw_install_db();
113
  }
 
 
114
  }
 
 
 
 
115
 
116
  if (version_compare($version, GRW_VERSION, '=')) {
117
  return;
@@ -188,8 +194,8 @@ function grw_reset_data($reset_db) {
188
  delete_option($opt);
189
  }
190
  if ($reset_db) {
191
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "grp_google_place;");
192
- $wpdb->query("DROP TABLE " . $wpdb->prefix . "grp_google_review;");
193
  }
194
  }
195
 
@@ -282,7 +288,7 @@ function grw_request_handler() {
282
  } else {
283
  check_admin_referer('grw_wpnonce', 'grw_wpnonce');
284
 
285
- $url = grw_api_url($_POST['placeid']);
286
 
287
  $response = rplg_urlopen($url);
288
 
4
  Plugin URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
5
  Description: Instantly Google Places Reviews on your website to increase user confidence and SEO.
6
  Author: RichPlugins <support@richplugins.com>
7
+ Version: 1.6.9
8
  Author URI: https://richplugins.com
9
  */
10
 
13
  include_once(dirname(__FILE__) . '/api/urlopen.php');
14
  include_once(dirname(__FILE__) . '/helper/debug.php');
15
 
16
+ define('GRW_VERSION', '1.6.9');
17
+ define('GRW_GOOGLE_PLACE_API', 'https://maps.googleapis.com/maps/api/place/');
18
+ define('GRW_GOOGLE_AVATAR', 'https://lh3.googleusercontent.com/-8hepWJzFXpE/AAAAAAAAAAI/AAAAAAAAAAA/I80WzYfIxCQ/s64-c/114307615494839964028.jpg');
19
+ define('GRW_PLUGIN_URL', plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
20
 
21
  function grw_options() {
22
  return array(
76
 
77
  $links = array(
78
  '<a href="' . esc_url('https://richplugins.com/documentation') . '" target="_blank">' . grw_i('View Documentation') . '</a>',
79
+ '<a href="' . esc_url('https://richplugins.com/google-reviews-pro-wordpress-plugin') . '" target="_blank">' . grw_i('Upgrade to Business') . ' &raquo;</a>',
80
  );
81
  $input = array_merge($input, $links);
82
  return $input;
84
  add_filter('plugin_row_meta', 'grw_plugin_row_meta', 10, 2);
85
 
86
  /*-------------------------------- Database --------------------------------*/
87
+ function grw_activation($network_wide = false) {
88
+ add_option('grw_is_multisite', $network_wide);
89
  if (grw_does_need_update()) {
90
+ grw_install();
91
  }
92
  }
93
  register_activation_hook(__FILE__, 'grw_activation');
94
 
95
+ function grw_install() {
 
96
 
97
  $version = (string)get_option('grw_version');
98
  if (!$version) {
99
  $version = '0';
100
  }
101
 
102
+ $network_wide = get_option('grw_is_multisite');
103
+
104
+ if ($network_wide) {
105
+ $site_ids = get_sites(array(
106
+ 'fields' => 'ids',
107
+ 'network_id' => get_current_network_id()
108
+ ));
109
+ foreach($site_ids as $site_id) {
110
+ switch_to_blog($site_id);
111
+ grw_install_single_site($version);
112
+ restore_current_blog();
113
  }
114
+ } else {
115
+ grw_install_single_site($version);
116
  }
117
+ }
118
+
119
+ function grw_install_single_site($version) {
120
+ grw_install_db();
121
 
122
  if (version_compare($version, GRW_VERSION, '=')) {
123
  return;
194
  delete_option($opt);
195
  }
196
  if ($reset_db) {
197
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "grp_google_place;");
198
+ $wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "grp_google_review;");
199
  }
200
  }
201
 
288
  } else {
289
  check_admin_referer('grw_wpnonce', 'grw_wpnonce');
290
 
291
+ $url = grw_api_url($_POST['placeid'], $_POST['lang']);
292
 
293
  $response = rplg_urlopen($url);
294
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://richplugins.com/google-reviews-pro-wordpress-plugin
4
  Tags: google, reviews, google reviews, google places, google places reviews, testimonials, google review widget, google business reviews, slider, google review, review, google place review, google map reviews, google reviews pro, facebook reviews, facebook page reviews, yelp reviews, yelp business reviews
5
  Requires at least: 2.8
6
  Tested up to: 5.0
7
- Stable tag: 1.6.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -24,10 +24,12 @@ This plugin display Google Business Reviews on your websites in sidebar widget.
24
 
25
  * Free!
26
  * SEO
 
27
  * Display up to 5 Google business reviews per location
28
  * Keep all reviews in WordPress database
29
  * Shows real reviews from G+ users to increase user confidence
30
  * Easy search of place and instantly show reviews
 
31
  * Review list theme
32
  * Pagination
33
  * Support dark websites
@@ -35,23 +37,21 @@ This plugin display Google Business Reviews on your websites in sidebar widget.
35
  * Zero load time regardless of your site
36
  * Works even if Google is unavailable
37
 
38
- = Get More Features with Google Reviews Business! =
39
 
40
- [Upgrade to Google Reviews Business](https://richplugins.com/google-reviews-pro-wordpress-plugin)
41
 
 
42
  * Trying to get more than 5 Google reviews
43
  * Google Rich Snippets (schema.org)
44
  * Support shortcode, powerful <b>Shortcode Builder</b>
45
  * Slider/Grid themes to show G+ reviews like testimonials
46
- * Google Trust Badge (right/left fixed or embed)
47
  * 'Write a review' button to available leave Google review directly on your website
48
- * Trim long reviews with "read more" link
49
- * Show/hide business photo and avatars
50
- * Disable profile G+ links
51
- * Custom business place photo
52
  * Minimum rating filter
53
- * Pagination, Sorting
54
- * Moderation G+ reviews
55
  * Priority support
56
 
57
  = Additional Business Reviews Plugins =
@@ -74,6 +74,14 @@ Why limit your reviews to just Google Reviews? Check out our other free business
74
 
75
  == Changelog ==
76
 
 
 
 
 
 
 
 
 
77
  = 1.6.8 =
78
  * Update plugin to WordPress 5.0
79
  * Improve: added a default sorting by recent
4
  Tags: google, reviews, google reviews, google places, google places reviews, testimonials, google review widget, google business reviews, slider, google review, review, google place review, google map reviews, google reviews pro, facebook reviews, facebook page reviews, yelp reviews, yelp business reviews
5
  Requires at least: 2.8
6
  Tested up to: 5.0
7
+ Stable tag: 1.6.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
24
 
25
  * Free!
26
  * SEO
27
+ * Trim long reviews with "read more" link
28
  * Display up to 5 Google business reviews per location
29
  * Keep all reviews in WordPress database
30
  * Shows real reviews from G+ users to increase user confidence
31
  * Easy search of place and instantly show reviews
32
+ * Custom business place photo
33
  * Review list theme
34
  * Pagination
35
  * Support dark websites
37
  * Zero load time regardless of your site
38
  * Works even if Google is unavailable
39
 
40
+ = Get More Features with Business version! =
41
 
42
+ [Upgrade to Business](https://richplugins.com/google-reviews-pro-wordpress-plugin)
43
 
44
+ * Merge reviews between each other from different platforms (Google, Facebook, Yelp) and places
45
  * Trying to get more than 5 Google reviews
46
  * Google Rich Snippets (schema.org)
47
  * Support shortcode, powerful <b>Shortcode Builder</b>
48
  * Slider/Grid themes to show G+ reviews like testimonials
49
+ * Google Trust Badge (right/left fixed or embedded)
50
  * 'Write a review' button to available leave Google review directly on your website
51
+ * Show/hide any elements (business, reviews, avatars, names, time and etc)
52
+ * Any Sorting: recent, oldest, rating, striped
53
+ * Include/Exclude words filter
 
54
  * Minimum rating filter
 
 
55
  * Priority support
56
 
57
  = Additional Business Reviews Plugins =
74
 
75
  == Changelog ==
76
 
77
+ = 1.6.9 =
78
+ * Improve: 'read more' link feature
79
+ * Improve: direct link to reviews on Google map
80
+ * Improve: language support of Google reviews
81
+ * Improve: added centered option
82
+ * Improve: update widget design
83
+ * Improve: update setting page design
84
+
85
  = 1.6.8 =
86
  * Update plugin to WordPress 5.0
87
  * Improve: added a default sorting by recent
static/css/rplg-setting.css CHANGED
@@ -1,4 +1,4 @@
1
- #wpcontent {
2
  font-size: 14px;
3
  background-color:#fafafa;
4
  }
@@ -213,4 +213,153 @@ input[type="checkbox"]:checked:before {
213
  .bs-sidebar.affix,.bs-sidebar.affix-bottom {
214
  width:263px
215
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  }
1
+ /*#wpcontent {
2
  font-size: 14px;
3
  background-color:#fafafa;
4
  }
213
  .bs-sidebar.affix,.bs-sidebar.affix-bottom {
214
  width:263px
215
  }
216
+ }*/
217
+
218
+ #wpcontent {
219
+ padding: 0;
220
+ }
221
+
222
+ .rplg-version {
223
+ position: absolute;
224
+ top: 6px;
225
+ right: 16px;
226
+ -webkit-border-radius: 3px;
227
+ -moz-border-radius: 3px;
228
+ border-radius: 3px;
229
+ display: inline-block;
230
+ margin: 20px 0 0;
231
+ padding: 6px 10px;
232
+ font-size: 12px;
233
+ line-height: 14px;
234
+ color: #FFF;
235
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
236
+ white-space: nowrap;
237
+ vertical-align: baseline;
238
+ background-color: #999;
239
+ }
240
+
241
+ .rplg-page-title {
242
+ font-size: 23px;
243
+ font-weight: 400;
244
+ margin: 0;
245
+ padding: 20px 0 0 20px;
246
+ line-height: 29px;
247
+ }
248
+
249
+ .rplg-page-title img {
250
+ vertical-align: middle;
251
+ }
252
+
253
+ .rplg-settings-workspace {
254
+ font-size: 14px;
255
+ margin: 20px;
256
+ padding: 20px;
257
+ background: #fff;
258
+ }
259
+
260
+ .rplg-settings-workspace p {
261
+ font-size: 14px;
262
+ }
263
+
264
+ .nav-tab.nav-tab-active {
265
+ box-shadow: none;
266
+ background: #fff;
267
+ border-bottom-color: #fff;
268
+ }
269
+
270
+ .rplg-field,
271
+ .rplg-field * {
272
+ box-sizing: border-box;
273
+ }
274
+
275
+ .rplg-field {
276
+ padding: 0 0 15px 0;
277
+ margin-top: 1em;
278
+ margin-bottom: 1em;
279
+ border-bottom: 1px dashed #ddd;
280
+ }
281
+
282
+ @media (min-width: 600px) {
283
+ .rplg-field {
284
+ display: flex;
285
+ flex-wrap: wrap;
286
+ }
287
+ .rplg-field-label {
288
+ flex: 0 0 25%;
289
+ padding-right: 4%;
290
+ }
291
+ .rplg-field-option {
292
+ flex: 0 0 75%;
293
+ }
294
+ }
295
+
296
+ .rplg-field input[type="text"] {
297
+ margin: 0;
298
+ padding: 5px 8px;
299
+ border-radius: 2px;
300
+ }
301
+
302
+ .rplg-field select {
303
+ width: 15em;
304
+ margin-left: 0;
305
+ }
306
+
307
+ .rplg-flex-row {
308
+ display: flex;
309
+ flex-flow: row wrap;
310
+ width: 100%;
311
+ }
312
+
313
+ .rplg-flex-col,
314
+ .rplg-flex-col3 {
315
+ box-sizing: border-box;
316
+ }
317
+
318
+ .rplg-flex-col:first-child,
319
+ .rplg-flex-col3:first-child {
320
+ padding-right: 10px;
321
+ }
322
+
323
+ @media (min-width: 700px) {
324
+ .rplg-flex-col {
325
+ width: 50%;
326
+ }
327
+ .rplg-flex-col3 {
328
+ width: 33.3%;
329
+ }
330
+ }
331
+
332
+ .rplg-support-question {
333
+ padding-bottom: 10px;
334
+ }
335
+
336
+ .rplg-alert {
337
+ font-size: 14px;
338
+ line-height: 1.846;
339
+ border: none;
340
+ color: #fff;
341
+ padding: 15px;
342
+ border: 1px solid transparent;
343
+ border-radius: 3px;
344
+ }
345
+
346
+ .rplg-alert-dismissable,
347
+ .rplg-alert-dismissible {
348
+ padding-right: 35px;
349
+ }
350
+
351
+ .rplg-alert-success {
352
+ color: #fff;
353
+ border-color: #d6e9c6;
354
+ background-color: #4caf50;
355
+ }
356
+
357
+ .rplg-alert a:not(.close),
358
+ .rplg-alert .alert-link {
359
+ color: #fff;
360
+ font-weight: bold;
361
+ }
362
+
363
+ .rplg-socials > * {
364
+ vertical-align: middle!important;
365
  }
static/js/grw-finder.js CHANGED
@@ -55,12 +55,16 @@ function grw_init(data) {
55
  return false;
56
  }
57
 
 
 
 
58
  connectBtn.innerHTML = 'Please wait...';
59
  connectBtn.disabled = true;
60
 
61
  jQuery.post(grw_request_url('save'), {
62
- placeid: placeId,
63
- grw_wpnonce: jQuery('#grw_nonce').val()
 
64
  }, function(res) {
65
 
66
  console.log('grw_debug:', res);
@@ -74,10 +78,12 @@ function grw_init(data) {
74
 
75
  var nameEl = el.querySelector('.grw-google-place-name'),
76
  placeIdEl = el.querySelector('.grw-google-place-id'),
 
77
  photoEl = el.querySelector('.grw-place-photo');
78
 
79
  nameEl.value = res.result.name;
80
  placeIdEl.value = res.result.place_id;
 
81
  photoEl.value = res.result.business_photo || res.result.icon;
82
 
83
  var img = el.querySelector('.grw-place-photo-img');
55
  return false;
56
  }
57
 
58
+ var langEl = el.querySelector('.grw-lang'),
59
+ lang = langEl.options[langEl.selectedIndex].value;
60
+
61
  connectBtn.innerHTML = 'Please wait...';
62
  connectBtn.disabled = true;
63
 
64
  jQuery.post(grw_request_url('save'), {
65
+ placeid : placeId,
66
+ lang : lang,
67
+ grw_wpnonce : jQuery('#grw_nonce').val()
68
  }, function(res) {
69
 
70
  console.log('grw_debug:', res);
78
 
79
  var nameEl = el.querySelector('.grw-google-place-name'),
80
  placeIdEl = el.querySelector('.grw-google-place-id'),
81
+ langEl = el.querySelector('.grw-place-lang'),
82
  photoEl = el.querySelector('.grw-place-photo');
83
 
84
  nameEl.value = res.result.name;
85
  placeIdEl.value = res.result.place_id;
86
+ langEl.value = lang;
87
  photoEl.value = res.result.business_photo || res.result.icon;
88
 
89
  var img = el.querySelector('.grw-place-photo-img');