Google Reviews Widget - Version 1.5.2

Version Description

  • Full refactoring of widget code
  • Bugfix: widget options check
  • Bugfix: SSL unverify connection
  • Bugfix: remove line breaks to prevent wrapped it by paragraph editor's plugins
  • Added debug information
Download this release

Release Info

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

Code changes from version 1.5 to 1.5.2

api/grw-api.php DELETED
@@ -1,139 +0,0 @@
1
- <?php
2
-
3
- require_once(dirname(__FILE__) . '/grw-url.php');
4
-
5
- if (!extension_loaded('json')) {
6
- require_once(dirname(__FILE__) . '/json.php');
7
- function grw_json_decode($data) {
8
- $json = new JSON;
9
- return $json->unserialize($data);
10
- }
11
- } else {
12
- function grw_json_decode($data) {
13
- return json_decode($data);
14
- }
15
- }
16
-
17
- class GoogleReviewsWidgetAPI {
18
-
19
- function GoogleReviewsWidgetAPI() {
20
- $this->last_error = null;
21
- }
22
-
23
- function textsearch($params=array()) {
24
- $date = $this->call('textsearch', $params);
25
- if (!$date) {
26
- $error = $this->last_error;
27
- return compact('error');
28
- }
29
-
30
- $places = array();
31
- if ($date->results) {
32
- $google_places = $date->results;
33
- foreach ($google_places as $place) {
34
- array_push($places, array(
35
- 'icon' => $place->icon,
36
- 'name' => $place->name,
37
- 'rating' => isset($place->rating) ? $place->rating : null,
38
- 'formatted_address' => $place->formatted_address,
39
- 'place_id' => $place->place_id,
40
- 'reference' => $place->reference,
41
- 'url' => isset($place->url) ? $place->url : null,
42
- 'website' => isset($place->website) ? $place->website : null
43
- ));
44
- }
45
- }
46
- return compact('places');
47
- }
48
-
49
- function details($params=array()) {
50
- $date = $this->call('details', $params);
51
- if (!$date) {
52
- $error = $this->last_error;
53
- return compact('error');
54
- }
55
-
56
- $reviews = array();
57
- if ($date->result) {
58
- $result = $date->result;
59
- if ($result->reviews) {
60
- $google_reviews = $result->reviews;
61
- foreach ($google_reviews as $review) {
62
- array_push($reviews, array(
63
- 'author_name' => $review->author_name,
64
- 'author_url' => $review->author_url,
65
- 'profile_photo_url' => isset($review->profile_photo_url) ? $review->profile_photo_url : null,
66
- 'rating' => $review->rating,
67
- 'text' => $review->text,
68
- 'time' => $review->time,
69
- 'language' => $review->language
70
- ));
71
- }
72
- }
73
- $place = array(
74
- 'icon' => $result->icon,
75
- 'name' => $result->name,
76
- 'rating' => isset($result->rating) ? $result->rating : null,
77
- 'formatted_address' => $result->formatted_address,
78
- 'place_id' => $result->place_id,
79
- 'reference' => $result->reference,
80
- 'url' => $result->url,
81
- 'website' => isset($result->website) ? $result->website : null,
82
- 'reviews' => $reviews
83
- );
84
- }
85
- return compact('place');
86
- }
87
-
88
- function call($method, $args=array(), $post=false) {
89
- $url = GRW_GOOGLE_PLACE_API . $method . '/json';
90
-
91
- foreach ($args as $key=>$value) {
92
- if (empty($value)) unset($args[$key]);
93
- }
94
-
95
- if (!$post) {
96
- $url .= '?' . grw_get_query_string($args);
97
- $args = null;
98
- }
99
-
100
- if (!($response = grw_urlopen($url, $args)) || !$response['code']) {
101
- $this->last_error = 'GOOGLE_COULDNT_CONNECT';
102
- return false;
103
- }
104
-
105
- if ($response['code'] != 200) {
106
- if ($response['code'] == 500) {
107
- if (!empty($response['headers']['X-Error-ID'])) {
108
- $this->last_error = 'Returned a bad response (HTTP '.$response['code'].', ReferenceID: '.$response['headers']['X-Error-ID'].')';
109
- return false;
110
- }
111
- } elseif ($response['code'] == 400) {
112
- $data = grw_json_decode($response['data']);
113
- if ($data && $data->message) {
114
- $this->last_error = $data->message;
115
- } else {
116
- $this->last_error = "Returned a bad response (HTTP ".$response['code'].")";
117
- }
118
- return false;
119
- }
120
- $this->last_error = "Returned a bad response (HTTP ".$response['code'].")";
121
- return false;
122
- }
123
-
124
- $data = grw_json_decode($response['data']);
125
-
126
- if (!$data) {
127
- $this->last_error = 'No valid JSON content returned from Google';
128
- return false;
129
- }
130
- if ($data->status == 'OVER_QUERY_LIMIT') {
131
- $this->last_error = $data->status;
132
- return false;
133
- }
134
- $this->last_error = null;
135
- return $data;
136
- }
137
- }
138
-
139
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
api/grw-url.php DELETED
@@ -1,247 +0,0 @@
1
- <?php
2
- define('GRW_USER_AGENT', 'GRW-WPPlugin/1.0');
3
- define('GRW_SOCKET_TIMEOUT', 10);
4
-
5
- function grw_get_query_string($params) {
6
- $query = '';
7
-
8
- if($params) {
9
- foreach($params as $key=>$value) {
10
- $query .= urlencode($key) . '=' . urlencode($value) . '&';
11
- }
12
- }
13
- return $query;
14
- }
15
-
16
- /*-------------------------------- urlopen --------------------------------*/
17
- function grw_urlopen($url, $postdata=false, $file=false) {
18
- $response = array(
19
- 'data' => '',
20
- 'code' => 0
21
- );
22
-
23
- if($file) {
24
- extract($file, EXTR_PREFIX_ALL, 'file');
25
- }
26
- if(empty($file_name) || empty($file_field)) {
27
- $file_name = false;
28
- $file_field = false;
29
- }
30
-
31
- if(function_exists('curl_init')) {
32
- if (!function_exists('curl_setopt_array')) {
33
- function curl_setopt_array(&$ch, $curl_options) {
34
- foreach ($curl_options as $option => $value) {
35
- if (!curl_setopt($ch, $option, $value)) {
36
- return false;
37
- }
38
- }
39
- return true;
40
- }
41
- }
42
- _grw_curl_urlopen($url, $postdata, $response, $file_name, $file_field);
43
- } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
44
- _grw_fopen_urlopen($url, $postdata, $response, $file_name, $file_field);
45
- } else {
46
- _grw_fsockopen_urlopen($url, $postdata, $response, $file_name, $file_field);
47
- }
48
- return $response;
49
- }
50
-
51
- /*-------------------------------- CURL --------------------------------*/
52
- function _grw_curl_urlopen($url, $postdata, &$response, $file_name, $file_field) {
53
- $c = curl_init($url);
54
- $postdata_str = grw_get_query_string($postdata);
55
-
56
- $c_options = array(
57
- CURLOPT_USERAGENT => GRW_USER_AGENT,
58
- CURLOPT_RETURNTRANSFER => true,
59
- CURLOPT_POST => ($postdata_str ? 1 : 0),
60
- CURLOPT_HEADER => true,
61
- CURLOPT_HTTPHEADER => array('Expect:'),
62
- CURLOPT_TIMEOUT => GRW_SOCKET_TIMEOUT
63
- );
64
- if($postdata) {
65
- $c_options[CURLOPT_POSTFIELDS] = $postdata_str;
66
- }
67
- if($file_name && $file_field) {
68
- $postdata[$file_field] = '@' . $file_name;
69
- $c_options[CURLOPT_POSTFIELDS] = $postdata;
70
- $c_options[CURLOPT_RETURNTRANSFER] = 1;
71
- }
72
- curl_setopt_array($c, $c_options);
73
-
74
- $data = curl_exec($c);
75
- list($headers, $response['data']) = explode("\r\n\r\n", $data, 2);
76
-
77
- $response['headers'] = _grw_get_response_headers($headers, $response);
78
- $response['code'] = curl_getinfo($c, CURLINFO_HTTP_CODE);
79
- curl_close($c);
80
- }
81
-
82
- /*-------------------------------- fopen --------------------------------*/
83
- function _grw_fopen_urlopen($url, $postdata, &$response, $file_name, $file_field) {
84
- $params = array();
85
- if($file_name && $file_field) {
86
- $boundary = '----------' . md5(time());
87
- $content = grw_get_post_content($boundary, $postdata, $file_name, $file_field);
88
- $header = grw_get_http_headers_for_request($boundary, $content, $file_name, $file_field);
89
-
90
- $params = array('http' => array(
91
- 'method' => 'POST',
92
- 'header' => $header,
93
- 'content' => $content,
94
- 'timeout' => GRW_SOCKET_TIMEOUT
95
- ));
96
- } else {
97
- if($postdata) {
98
- $params = array('http' => array(
99
- 'method' => 'POST',
100
- 'header' => 'Content-Type: application/x-www-form-urlencoded',
101
- 'content' => grw_get_query_string($postdata),
102
- 'timeout' => GRW_SOCKET_TIMEOUT
103
- ));
104
- }
105
- }
106
-
107
- ini_set('user_agent', GRW_USER_AGENT);
108
- $ctx = stream_context_create($params);
109
- $fp = fopen($url, 'rb', false, $ctx);
110
- if(!$fp) {
111
- return false;
112
- }
113
-
114
- list($unused, $response['code'], $unused) = explode(' ', $http_response_header[0], 3);
115
- $headers = array_slice($http_response_header, 1);
116
-
117
- foreach($headers as $unused=>$header) {
118
- $header = explode(':', $header);
119
- $header[0] = trim($header[0]);
120
- $header[1] = trim($header[1]);
121
- $headers[strtolower($header[0])] = strtolower($header[1]);
122
- }
123
- $response['data'] = stream_get_contents($fp);
124
- $response['headers'] = $headers;
125
- }
126
-
127
- /*-------------------------------- fsockpen --------------------------------*/
128
- function _grw_fsockopen_urlopen($url, $postdata, &$response, $file_name, $file_field) {
129
- $buf = '';
130
- $req = '';
131
- $length = 0;
132
- $boundary = '----------' . md5(time());
133
- $postdata_str = grw_get_post_content($boundary, $postdata, $file_name, $file_field);
134
- $url_pieces = parse_url($url);
135
-
136
- if(!isset($url_pieces['port'])) {
137
- switch($url_pieces['scheme']) {
138
- case 'http':
139
- $url_pieces['port'] = 80;
140
- break;
141
- case 'https':
142
- $url_pieces['port'] = 443;
143
- $url_pieces['host'] = 'ssl://' . $url_pieces['host'];
144
- break;
145
- }
146
- }
147
-
148
- if(!isset($url_pieces['path'])) { $url_pieces['path'] = '/'; }
149
-
150
- if(($url_pieces['port'] == 80 && $url_pieces['scheme'] == 'http') ||
151
- ($url_pieces['port'] == 443 && $url_pieces['scheme'] == 'https')) {
152
- $host = $url_pieces['host'];
153
- } else {
154
- $host = $url_pieces['host'] . ':' . $url_pieces['port'];
155
- }
156
-
157
- $fp = @fsockopen($url_pieces['host'], $url_pieces['port'], $errno, $errstr, GRW_SOCKET_TIMEOUT);
158
- if(!$fp) { return false; }
159
-
160
- $path = $url_pieces['path'];
161
- if ($url_pieces['query']) $path .= '?'.$url_pieces['query'];
162
-
163
- $req .= ($postdata_str ? 'POST' : 'GET') . ' ' . $path . " HTTP/1.1\r\n";
164
- $req .= 'Host: ' . $host . "\r\n";
165
- $req .= grw_get_http_headers_for_request($boundary, $postdata_str, $file_name, $file_field);
166
- if($postdata_str) {
167
- $req .= "\r\n\r\n" . $postdata_str;
168
- }
169
- $req .= "\r\n\r\n";
170
-
171
- fwrite($fp, $req);
172
- while(!feof($fp)) {
173
- $buf .= fgets($fp, 4096);
174
- }
175
-
176
- list($headers, $response['data']) = explode("\r\n\r\n", $buf, 2);
177
-
178
- $headers = _grw_get_response_headers($headers, $response);
179
-
180
- if(isset($headers['transfer-encoding']) && 'chunked' == strtolower($headers['transfer-encoding'])) {
181
- $chunk_data = $response['data'];
182
- $joined_data = '';
183
- while(true) {
184
- list($chunk_length, $chunk_data) = explode("\r\n", $chunk_data, 2);
185
- $chunk_length = hexdec($chunk_length);
186
- if(!$chunk_length || !strlen($chunk_data)) { break; }
187
-
188
- $joined_data .= substr($chunk_data, 0, $chunk_length);
189
- $chunk_data = substr($chunk_data, $chunk_length + 1);
190
- $length += $chunk_length;
191
- }
192
- $response['data'] = $joined_data;
193
- } else {
194
- $length = $headers['content-length'];
195
- }
196
- $response['headers'] = $headers;
197
- }
198
-
199
- /*-------------------------------- Helpers --------------------------------*/
200
- function _grw_get_response_headers($headers, &$response) {
201
- $headers = explode("\r\n", $headers);
202
- list($unused, $response['code'], $unused) = explode(' ', $headers[0], 3);
203
- $headers = array_slice($headers, 1);
204
- foreach($headers as $unused=>$header) {
205
- $header = explode(':', $header);
206
- $header[0] = trim($header[0]);
207
- $header[1] = trim($header[1]);
208
- $headers[strtolower($header[0])] = $header[1];
209
- }
210
- return $headers;
211
- }
212
-
213
- function grw_get_post_content($boundary, $postdata, $file_name, $file_field) {
214
- if(empty($file_name) || empty($file_field)) {
215
- return grw_get_query_string($postdata);
216
- }
217
-
218
- $content = array();
219
- $content[] = '--' . $boundary;
220
- foreach($postdata as $key=>$value) {
221
- $content[] = 'Content-Disposition: form-data; name="' . $key . '"' . "\r\n\r\n" . $value;
222
- $content[] = '--' . $boundary;
223
- }
224
- $content[] = 'Content-Disposition: form-data; name="' . $file_field . '"; filename="' . $file_name . '"';
225
- // HACK: We only need to handle text/plain files right now.
226
- $content[] = "Content-Type: text/plain\r\n";
227
- $content[] = file_get_contents($file_name);
228
- $content[] = '--' . $boundary . '--';
229
- $content = implode("\r\n", $content);
230
- return $content;
231
- }
232
-
233
- function grw_get_http_headers_for_request($boundary, $content, $file_name, $file_field) {
234
- $headers = array();
235
- $headers[] = 'User-Agent: ' . GRW_USER_AGENT;
236
- $headers[] = 'Connection: close';
237
- if($content) {
238
- $headers[] = 'Content-Length: ' . strlen($content);
239
- if($file_name && $file_field) {
240
- $headers[] = 'Content-Type: multipart/form-data; boundary=' . $boundary;
241
- } else {
242
- $headers[] = 'Content-Type: application/x-www-form-urlencoded';
243
- }
244
- }
245
- return implode("\r\n", $headers);
246
- }
247
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
api/urlopen.php ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!function_exists('rplg_urlopen')) {
4
+
5
+ define('RPLG_USER_AGENT', 'RPLG-WPPlugin/1.0');
6
+ define('RPLG_SOCKET_TIMEOUT', 10);
7
+
8
+ if (!extension_loaded('json')) {
9
+ require_once(dirname(__FILE__) . '/json.php');
10
+ function rplg_json_decode($data) {
11
+ $json = new JSON;
12
+ return $json->unserialize($data);
13
+ }
14
+ } else {
15
+ function rplg_json_decode($data) {
16
+ return json_decode($data);
17
+ }
18
+ }
19
+
20
+ function rplg_json_urlopen($url, $postdata=false, $headers=array()) {
21
+ if (!($response = rplg_urlopen($url, $postdata, $headers)) || !$response['code']) {
22
+ //$this->last_error = 'COULDNT_CONNECT';
23
+ return false;
24
+ }
25
+ return rplg_json_decode($response['data']);
26
+ }
27
+
28
+ function rplg_urlopen($url, $postdata=false, $headers=array()) {
29
+ $response = array(
30
+ 'data' => '',
31
+ 'code' => 0
32
+ );
33
+
34
+ $url = preg_replace('/\s+/', '+', $url);
35
+
36
+ if(function_exists('curl_init')) {
37
+ if (!function_exists('curl_setopt_array')) {
38
+ function curl_setopt_array(&$ch, $curl_options) {
39
+ foreach ($curl_options as $option => $value) {
40
+ if (!curl_setopt($ch, $option, $value)) {
41
+ return false;
42
+ }
43
+ }
44
+ return true;
45
+ }
46
+ }
47
+ _rplg_curl_urlopen($url, $postdata, $headers, $response);
48
+ } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
49
+ _rplg_fopen_urlopen($url, $postdata, $headers, $response);
50
+ } else {
51
+ _rplg_fsockopen_urlopen($url, $postdata, $headers, $response);
52
+ }
53
+ return $response;
54
+ }
55
+
56
+ /*-------------------------------- curl --------------------------------*/
57
+ function _rplg_curl_urlopen($url, $postdata, $headers, &$response) {
58
+ $c = curl_init($url);
59
+ $postdata_str = rplg_get_query_string($postdata);
60
+
61
+ $c_options = array(
62
+ CURLOPT_USERAGENT => RPLG_USER_AGENT,
63
+ CURLOPT_RETURNTRANSFER => true,
64
+ CURLOPT_POST => ($postdata_str ? 1 : 0),
65
+ CURLOPT_HEADER => true,
66
+ CURLOPT_HTTPHEADER => array_merge(array('Expect:'), $headers),
67
+ CURLOPT_TIMEOUT => RPLG_SOCKET_TIMEOUT
68
+ );
69
+ if($postdata) {
70
+ $c_options[CURLOPT_POSTFIELDS] = $postdata_str;
71
+ }
72
+ curl_setopt_array($c, $c_options);
73
+
74
+ curl_setopt($c, CURLOPT_FOLLOWLOCATION, true);
75
+ curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
76
+
77
+ $data = curl_exec($c);
78
+ list($resp_headers, $response['data']) = explode("\r\n\r\n", $data, 2);
79
+
80
+ $response['headers'] = _rplg_get_response_headers($resp_headers, $response);
81
+ $response['code'] = curl_getinfo($c, CURLINFO_HTTP_CODE);
82
+ curl_close($c);
83
+ }
84
+
85
+ /*-------------------------------- fopen --------------------------------*/
86
+ function _rplg_fopen_urlopen($url, $postdata, $headers, &$response) {
87
+ $params = array();
88
+
89
+ if($postdata) {
90
+ $params = array('http' => array(
91
+ 'method' => 'POST',
92
+ 'header' => implode("\r\n", array_merge(array('Content-Type: application/x-www-form-urlencoded'), $headers)),
93
+ 'content' => rplg_get_query_string($postdata),
94
+ 'timeout' => RPLG_SOCKET_TIMEOUT
95
+ ));
96
+ } else {
97
+ $params = array('http' => array(
98
+ 'header' => implode("\r\n", $headers)
99
+ ));
100
+ }
101
+
102
+ ini_set('user_agent', RPLG_USER_AGENT);
103
+ $ctx = stream_context_create($params);
104
+ $fp = fopen($url, 'rb', false, $ctx);
105
+ if(!$fp) { return false; }
106
+
107
+ list($unused, $response['code'], $unused) = explode(' ', $http_response_header[0], 3);
108
+ $resp_headers = array_slice($http_response_header, 1);
109
+
110
+ foreach($resp_headers as $unused=>$header) {
111
+ $header = explode(':', $header);
112
+ $header[0] = trim($header[0]);
113
+ $header[1] = trim($header[1]);
114
+ $resp_headers[strtolower($header[0])] = strtolower($header[1]);
115
+ }
116
+ $response['data'] = stream_get_contents($fp);
117
+ $response['headers'] = $resp_headers;
118
+ }
119
+
120
+ /*-------------------------------- fsockpen --------------------------------*/
121
+ function _rplg_fsockopen_urlopen($url, $postdata, $headers, &$response) {
122
+ $buf = '';
123
+ $req = '';
124
+ $length = 0;
125
+ $postdata_str = rplg_get_query_string($postdata);
126
+ $url_pieces = parse_url($url);
127
+ $host = $url_pieces['host'];
128
+
129
+ if(!isset($url_pieces['port'])) {
130
+ switch($url_pieces['scheme']) {
131
+ case 'http':
132
+ $url_pieces['port'] = 80;
133
+ break;
134
+ case 'https':
135
+ $url_pieces['port'] = 443;
136
+ $host = 'ssl://' . $url_pieces['host'];
137
+ break;
138
+ }
139
+ }
140
+
141
+ if(!isset($url_pieces['path'])) { $url_pieces['path'] = '/'; }
142
+
143
+ if(($url_pieces['port'] == 80 && $url_pieces['scheme'] == 'http') ||
144
+ ($url_pieces['port'] == 443 && $url_pieces['scheme'] == 'https')) {
145
+ $req_host = $url_pieces['host'];
146
+ } else {
147
+ $req_host = $url_pieces['host'] . ':' . $url_pieces['port'];
148
+ }
149
+
150
+ $fp = @fsockopen($host, $url_pieces['port'], $errno, $errstr, RPLG_SOCKET_TIMEOUT);
151
+ if(!$fp) { return false; }
152
+
153
+ $path = $url_pieces['path'];
154
+ if (isset($url_pieces['query'])) $path .= '?'.$url_pieces['query'];
155
+
156
+ $req .= ($postdata_str ? 'POST' : 'GET') . ' ' . $path . " HTTP/1.1\r\n";
157
+ $req .= 'Host: ' . $req_host . "\r\n";
158
+ $req .= rplg_get_http_headers_for_request($postdata_str, $headers);
159
+ if($postdata_str) {
160
+ $req .= "\r\n\r\n" . $postdata_str;
161
+ }
162
+ $req .= "\r\n\r\n";
163
+
164
+ fwrite($fp, $req);
165
+ while(!feof($fp)) {
166
+ $buf .= fgets($fp, 4096);
167
+ }
168
+
169
+ list($headers, $response['data']) = explode("\r\n\r\n", $buf, 2);
170
+
171
+ $headers = _rplg_get_response_headers($headers, $response);
172
+
173
+ if(isset($headers['transfer-encoding']) && 'chunked' == strtolower($headers['transfer-encoding'])) {
174
+ $chunk_data = $response['data'];
175
+ $joined_data = '';
176
+ while(true) {
177
+ list($chunk_length, $chunk_data) = explode("\r\n", $chunk_data, 2);
178
+ $chunk_length = hexdec($chunk_length);
179
+ if(!$chunk_length || !strlen($chunk_data)) { break; }
180
+
181
+ $joined_data .= substr($chunk_data, 0, $chunk_length);
182
+ $chunk_data = substr($chunk_data, $chunk_length + 1);
183
+ $length += $chunk_length;
184
+ }
185
+ $response['data'] = $joined_data;
186
+ } else {
187
+ $length = $headers['content-length'];
188
+ }
189
+ $response['headers'] = $headers;
190
+ }
191
+
192
+ /*-------------------------------- helpers --------------------------------*/
193
+ function rplg_get_query_string($params) {
194
+ $query = '';
195
+
196
+ if($params) {
197
+ foreach($params as $key=>$value) {
198
+ $query .= urlencode($key) . '=' . urlencode($value) . '&';
199
+ }
200
+ }
201
+ return $query;
202
+ }
203
+
204
+ function _rplg_get_response_headers($headers, &$response) {
205
+ $headers = explode("\r\n", $headers);
206
+ list($unused, $response['code'], $unused) = explode(' ', $headers[0], 3);
207
+ $headers = array_slice($headers, 1);
208
+ foreach($headers as $unused=>$header) {
209
+ $header = explode(':', $header);
210
+ $header[0] = trim($header[0]);
211
+ $header[1] = trim($header[1]);
212
+ $headers[strtolower($header[0])] = $header[1];
213
+ }
214
+ return $headers;
215
+ }
216
+
217
+ function rplg_get_http_headers_for_request($content, $headers) {
218
+ $req_headers = array();
219
+ $req_headers[] = 'User-Agent: ' . RPLG_USER_AGENT;
220
+ $req_headers[] = 'Connection: close';
221
+ if($content) {
222
+ $req_headers[] = 'Content-Length: ' . strlen($content);
223
+ $req_headers[] = 'Content-Type: application/x-www-form-urlencoded';
224
+ }
225
+ return implode("\r\n", array_merge($req_headers, $headers));
226
+ }
227
+
228
+ function rplg_url_method() {
229
+ if(function_exists('curl_init')) {
230
+ return 'curl';
231
+ } else if(ini_get('allow_url_fopen') && function_exists('stream_get_contents')) {
232
+ return 'fopen';
233
+ } else {
234
+ return 'fsockopen';
235
+ }
236
+ }
237
+ }
238
+
239
+ ?>
grw-finder.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- 1. Find Place -->
2
+ <div class="form-group">
3
+ <div class="col-sm-12">
4
+ <h4 class="text-left"><span class="grw-step">1</span><?php echo grw_i('Find Place'); ?></h4>
5
+ <input type="text" class="grw-place-search form-control" value="" placeholder="Location of place (e.g. name, address)" />
6
+ </div>
7
+ </div>
8
+ <div class="form-group">
9
+ <div class="col-sm-12">
10
+ <button class="grw-search-btn btn btn-block btn-primary"><?php echo grw_i('Search Place'); ?></button>
11
+ </div>
12
+ </div>
13
+ <!-- 2. Select Place -->
14
+ <div class="form-group">
15
+ <div class="col-sm-12">
16
+ <h4 class="text-left"><span class="grw-step">2</span><?php echo grw_i('Select Place'); ?></h4>
17
+ <div class="grw-places"></div>
18
+ </div>
19
+ </div>
20
+ <!-- 3. Save Reviews -->
21
+ <div class="form-group">
22
+ <div class="col-sm-12">
23
+ <h4 class="text-left"><span class="grw-step">3</span><?php echo grw_i('Save Place and Reviews'); ?></h4>
24
+ <div class="grw-reviews"></div>
25
+ <div class="grw-five-reviews-note" style="display:none"><?php echo grw_i('Google returns 5 reviews only'); ?></div>
26
+ <div class="grw-save-reviews-container"></div>
27
+ </div>
28
+ </div>
grw-options.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ <div class="form-group">
10
+ <div class="col-sm-12">
11
+ <input type="text" id="<?php echo $this->get_field_id('place_name'); ?>" name="<?php echo $this->get_field_name('place_name'); ?>" value="<?php echo $place_name; ?>" class="form-control grw-google-place-name" placeholder="<?php echo grw_i('Google Place Name'); ?>" readonly />
12
+ </div>
13
+ </div>
14
+
15
+ <div class="form-group">
16
+ <div class="col-sm-12">
17
+ <input type="text" id="<?php echo $this->get_field_id('place_id'); ?>" name="<?php echo $this->get_field_name('place_id'); ?>" value="<?php echo $place_id; ?>" class="form-control grw-google-place-id" placeholder="<?php echo grw_i('Google Place ID'); ?>" readonly />
18
+ </div>
19
+ </div>
20
+
21
+ <!-- Review Options -->
22
+ <h4 class="rplg-options-toggle"><?php echo grw_i('Review Options'); ?></h4>
23
+ <div class="rplg-options" style="display:none">
24
+ <div class="form-group rplg-disabled">
25
+ <div class="col-sm-12">
26
+ <label>
27
+ <input class="form-control" type="checkbox" disabled />
28
+ <?php echo grw_i('Try to get more than 5 Google reviews'); ?>
29
+ </label>
30
+ </div>
31
+ </div>
32
+ <div class="form-group rplg-disabled">
33
+ <div class="col-sm-12">
34
+ <label>
35
+ <input class="form-control" type="checkbox" disabled />
36
+ <?php echo grw_i('Enable Google Rich Snippet (schema.org)'); ?>
37
+ </label>
38
+ </div>
39
+ </div>
40
+ <div class="form-group rplg-disabled">
41
+ <div class="col-sm-12">
42
+ <?php echo grw_i('Pagination'); ?>
43
+ <select class="form-control" disabled >
44
+ <option value=""><?php echo grw_i('Disabled'); ?></option>
45
+ <option value="10"><?php echo grw_i('10'); ?></option>
46
+ <option value="5"><?php echo grw_i('5'); ?></option>
47
+ <option value="4"><?php echo grw_i('4'); ?></option>
48
+ <option value="3"><?php echo grw_i('3'); ?></option>
49
+ <option value="2"><?php echo grw_i('2'); ?></option>
50
+ <option value="1"><?php echo grw_i('1'); ?></option>
51
+ </select>
52
+ </div>
53
+ </div>
54
+ <div class="form-group rplg-disabled">
55
+ <div class="col-sm-12">
56
+ <?php echo grw_i('Sorting'); ?>
57
+ <select class="form-control" disabled >
58
+ <option value=""><?php echo grw_i('Default'); ?></option>
59
+ <option value="1"><?php echo grw_i('Most recent'); ?></option>
60
+ <option value="2"><?php echo grw_i('Most oldest'); ?></option>
61
+ <option value="3"><?php echo grw_i('Highest score'); ?></option>
62
+ <option value="4"><?php echo grw_i('Lowest score'); ?></option>
63
+ </select>
64
+ </div>
65
+ </div>
66
+ <div class="form-group rplg-disabled">
67
+ <div class="col-sm-12">
68
+ <?php echo grw_i('Minimum Review Rating'); ?>
69
+ <select class="form-control" disabled >
70
+ <option value=""><?php echo grw_i('No filter'); ?></option>
71
+ <option value="5"><?php echo grw_i('5 Stars'); ?></option>
72
+ <option value="4"><?php echo grw_i('4 Stars'); ?></option>
73
+ <option value="3"><?php echo grw_i('3 Stars'); ?></option>
74
+ <option value="2"><?php echo grw_i('2 Stars'); ?></option>
75
+ <option value="1"><?php echo grw_i('1 Star'); ?></option>
76
+ </select>
77
+ </div>
78
+ </div>
79
+ <div class="form-group">
80
+ <div class="rplg-pro">
81
+ <?php echo grw_i('These features available in Google Reviews Pro plugin: '); ?>
82
+ <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
83
+ <?php echo grw_i('Upgrade to Pro'); ?>
84
+ </a>
85
+ </div>
86
+ </div>
87
+ </div>
88
+
89
+ <!-- Display Options -->
90
+ <h4 class="rplg-options-toggle"><?php echo grw_i('Display Options'); ?></h4>
91
+ <div class="rplg-options" style="display:none">
92
+ <div class="form-group rplg-disabled">
93
+ <div class="col-sm-12">
94
+ <label>
95
+ <?php echo grw_i('Custom Place photo'); ?>
96
+ </label>
97
+ </div>
98
+ </div>
99
+ <div class="form-group rplg-disabled">
100
+ <div class="col-sm-12">
101
+ <label>
102
+ <input class="form-control" type="checkbox" disabled />
103
+ <?php echo grw_i('Hide business photo'); ?>
104
+ </label>
105
+ </div>
106
+ </div>
107
+ <div class="form-group rplg-disabled">
108
+ <div class="col-sm-12">
109
+ <label>
110
+ <input class="form-control" type="checkbox" disabled />
111
+ <?php echo grw_i('Hide user avatars'); ?>
112
+ </label>
113
+ </div>
114
+ </div>
115
+ <div class="form-group rplg-disabled">
116
+ <div class="col-sm-12">
117
+ <label>
118
+ <input class="form-control" type="checkbox" disabled />
119
+ <?php echo grw_i('Disable links to G+ user profile'); ?>
120
+ </label>
121
+ </div>
122
+ </div>
123
+ <div class="form-group rplg-disabled">
124
+ <div class="col-sm-12">
125
+ <label>
126
+ <input class="form-control" type="checkbox" disabled />
127
+ <?php echo grw_i('Enable \'Write a review\' button'); ?>
128
+ </label>
129
+ </div>
130
+ </div>
131
+ <div class="form-group">
132
+ <div class="col-sm-12">
133
+ <label>
134
+ <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" />
135
+ <?php echo grw_i('Dark background'); ?>
136
+ </label>
137
+ </div>
138
+ </div>
139
+ <div class="form-group rplg-disabled">
140
+ <div class="col-sm-12">
141
+ <label><?php echo grw_i('Review limit before \'read more\' link'); ?></label>
142
+ <input class="form-control" type="text" placeholder="for instance: 120" disabled />
143
+ </div>
144
+ </div>
145
+ <div class="form-group">
146
+ <div class="col-sm-12">
147
+ <?php echo grw_i('Widget theme'); ?>
148
+ <select id="<?php echo $this->get_field_id('view_mode'); ?>" name="<?php echo $this->get_field_name('view_mode'); ?>" class="form-control">
149
+ <option value="list" <?php selected('list', $view_mode); ?>><?php echo grw_i('Review list'); ?></option>
150
+ <option value="grid" <?php selected('grid', $view_mode); ?> disabled><?php echo grw_i('Reviews grid'); ?></option>
151
+ <option value="badge" <?php selected('badge', $view_mode); ?> disabled><?php echo grw_i('Google badge: right'); ?></option>
152
+ <option value="badge_left" <?php selected('badge_left', $view_mode); ?> disabled><?php echo grw_i('Google badge: left'); ?></option>
153
+ <option value="badge_inner" <?php selected('badge_inner', $view_mode); ?> disabled><?php echo grw_i('Inner badge'); ?></option>
154
+ </select>
155
+ </div>
156
+ </div>
157
+ <div class="form-group">
158
+ <div class="rplg-pro">
159
+ <?php echo grw_i('<b>Grid</b>, <b>Badge</b> themes and other features available in Google Reviews Pro plugin: '); ?>
160
+ <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank">
161
+ <?php echo grw_i('Upgrade to Pro'); ?>
162
+ </a>
163
+ </div>
164
+ </div>
165
+ <?php if (isset($max_width)) { ?>
166
+ <div class="form-group">
167
+ <div class="col-sm-12">
168
+ <label for="<?php echo $this->get_field_id('max_width'); ?>"><?php echo grw_i('Maximum width'); ?></label>
169
+ <input id="<?php echo $this->get_field_id('max_width'); ?>" name="<?php echo $this->get_field_name('max_width'); ?>" class="form-control" type="text" placeholder="for instance: 300px" />
170
+ </div>
171
+ </div>
172
+ <?php } ?>
173
+ <?php if (isset($max_height)) { ?>
174
+ <div class="form-group">
175
+ <div class="col-sm-12">
176
+ <label for="<?php echo $this->get_field_id('max_height'); ?>"><?php echo grw_i('Maximum height'); ?></label>
177
+ <input id="<?php echo $this->get_field_id('max_height'); ?>" name="<?php echo $this->get_field_name('max_height'); ?>" class="form-control" type="text" placeholder="for instance: 500px" />
178
+ </div>
179
+ </div>
180
+ <?php } ?>
181
+ </div>
182
+
183
+ <!-- Advance Options -->
184
+ <h4 class="rplg-options-toggle"><?php echo grw_i('Advance Options'); ?></h4>
185
+ <div class="rplg-options" style="display:none">
186
+ <div class="form-group">
187
+ <div class="col-sm-12">
188
+ <label>
189
+ <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" />
190
+ <?php echo grw_i('Open links in new Window'); ?>
191
+ </label>
192
+ </div>
193
+ </div>
194
+ <div class="form-group">
195
+ <div class="col-sm-12">
196
+ <label>
197
+ <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" />
198
+ <?php echo grw_i('Use no follow links'); ?>
199
+ </label>
200
+ </div>
201
+ </div>
202
+ </div>
grw-reviews-helper.php CHANGED
@@ -79,27 +79,11 @@ function grw_stars($rating) {
79
  foreach (array(1,2,3,4,5) as $val) {
80
  $score = $rating - $val;
81
  if ($score >= 0) {
82
- ?>
83
- <span class="wp-star">
84
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="16" viewBox="0 0 1792 1792">
85
- <path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#e7711b"></path>
86
- </svg>
87
- </span>
88
- <?php
89
  } else if ($score > -1 && $score < 0) {
90
- ?>
91
- <span class="wp-star">
92
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="16" viewBox="0 0 1792 1792">
93
- <path d="M1250 957l257-250-356-52-66-10-30-60-159-322v963l59 31 318 168-60-355-12-66zm452-262l-363 354 86 500q5 33-6 51.5t-34 18.5q-17 0-40-12l-449-236-449 236q-23 12-40 12-23 0-34-18.5t-6-51.5l86-500-364-354q-32-32-23-59.5t54-34.5l502-73 225-455q20-41 49-41 28 0 49 41l225 455 502 73q45 7 54 34.5t-24 59.5z" fill="#e7711b"></path>
94
- </svg>
95
- </span>
96
- <?php
97
  } else {
98
- ?>
99
- <span class="wp-star">
100
- <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="16" height="16" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ccc"></path></svg>
101
- </span>
102
- <?php
103
  }
104
  }
105
  ?></span><?php
@@ -145,17 +129,14 @@ function grw_anchor($url, $class, $text, $open_link, $nofollow_link) {
145
  var n = navigator;
146
  return (n.language || n.systemLanguage || n.userLanguage || 'en').substr(0, 2).toLowerCase();
147
  }
148
-
149
  function grw_nextES(el) {
150
  do { el = el.nextSibling; } while (el && el.nodeType !== 1);
151
  return el;
152
  }
153
-
154
  function grw_next(el) {
155
  return el.nextElementSibling || grw_nextES(el);
156
  }
157
-
158
- jQuery(document).ready(function($) {
159
  var reviewTimes = document.querySelectorAll('.wp-google-review .wp-google-time');
160
  for (var i = 0; i < reviewTimes.length; i++) {
161
  var time = reviewTimes[i].getAttribute('data-time');
79
  foreach (array(1,2,3,4,5) as $val) {
80
  $score = $rating - $val;
81
  if ($score >= 0) {
82
+ ?><span class="wp-star"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="17" height="17" viewBox="0 0 1792 1792"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#e7711b"></path></svg></span><?php
 
 
 
 
 
 
83
  } else if ($score > -1 && $score < 0) {
84
+ ?><span class="wp-star"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="17" height="17" viewBox="0 0 1792 1792"><path d="M1250 957l257-250-356-52-66-10-30-60-159-322v963l59 31 318 168-60-355-12-66zm452-262l-363 354 86 500q5 33-6 51.5t-34 18.5q-17 0-40-12l-449-236-449 236q-23 12-40 12-23 0-34-18.5t-6-51.5l86-500-364-354q-32-32-23-59.5t54-34.5l502-73 225-455q20-41 49-41 28 0 49 41l225 455 502 73q45 7 54 34.5t-24 59.5z" fill="#e7711b"></path></svg></span><?php
 
 
 
 
 
 
85
  } else {
86
+ ?><span class="wp-star"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="17" height="17" viewBox="0 0 1792 1792"><path d="M1201 1004l306-297-422-62-189-382-189 382-422 62 306 297-73 421 378-199 377 199zm527-357q0 22-26 48l-363 354 86 500q1 7 1 20 0 50-41 50-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z" fill="#ccc"></path></svg></span><?php
 
 
 
 
87
  }
88
  }
89
  ?></span><?php
129
  var n = navigator;
130
  return (n.language || n.systemLanguage || n.userLanguage || 'en').substr(0, 2).toLowerCase();
131
  }
 
132
  function grw_nextES(el) {
133
  do { el = el.nextSibling; } while (el && el.nodeType !== 1);
134
  return el;
135
  }
 
136
  function grw_next(el) {
137
  return el.nextElementSibling || grw_nextES(el);
138
  }
139
+ document.addEventListener('DOMContentLoaded', function() {
 
140
  var reviewTimes = document.querySelectorAll('.wp-google-review .wp-google-time');
141
  for (var i = 0; i < reviewTimes.length; i++) {
142
  var time = reviewTimes[i].getAttribute('data-time');
grw-reviews.php CHANGED
@@ -22,7 +22,7 @@ $rating = number_format((float)$rating, 1, '.', '');
22
  <div class="wp-google-badge<?php if ($view_mode == 'badge') { ?> wp-google-badge-fixed<?php } ?>" onclick="grw_next(this).style.display='block'">
23
  <div class="wp-google-border"></div>
24
  <div class="wp-google-badge-btn">
25
- <img class="wp-google-logo" src="<?php echo GRW_PLUGIN_URL; ?>/static/img/google_rating_logo_36.png" alt="powered by Google">
26
  <div class="wp-google-badge-score">
27
  <div><?php echo grw_i('Google Rating'); ?></div>
28
  <span class="wp-google-rating"><?php echo $rating; ?></span>
22
  <div class="wp-google-badge<?php if ($view_mode == 'badge') { ?> wp-google-badge-fixed<?php } ?>" onclick="grw_next(this).style.display='block'">
23
  <div class="wp-google-border"></div>
24
  <div class="wp-google-badge-btn">
25
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" height="44" width="44"><g fill="none" fill-rule="evenodd"><path d="M482.56 261.36c0-16.73-1.5-32.83-4.29-48.27H256v91.29h127.01c-5.47 29.5-22.1 54.49-47.09 71.23v59.21h76.27c44.63-41.09 70.37-101.59 70.37-173.46z" fill="#4285f4"/><path d="M256 492c63.72 0 117.14-21.13 156.19-57.18l-76.27-59.21c-21.13 14.16-48.17 22.53-79.92 22.53-61.47 0-113.49-41.51-132.05-97.3H45.1v61.15c38.83 77.13 118.64 130.01 210.9 130.01z" fill="#34a853"/><path d="M123.95 300.84c-4.72-14.16-7.4-29.29-7.4-44.84s2.68-30.68 7.4-44.84V150.01H45.1C29.12 181.87 20 217.92 20 256c0 38.08 9.12 74.13 25.1 105.99l78.85-61.15z" fill="#fbbc05"/><path d="M256 113.86c34.65 0 65.76 11.91 90.22 35.29l67.69-67.69C373.03 43.39 319.61 20 256 20c-92.25 0-172.07 52.89-210.9 130.01l78.85 61.15c18.56-55.78 70.59-97.3 132.05-97.3z" fill="#ea4335"/><path d="M20 20h472v472H20V20z"/></g></svg>
26
  <div class="wp-google-badge-score">
27
  <div><?php echo grw_i('Google Rating'); ?></div>
28
  <span class="wp-google-rating"><?php echo $rating; ?></span>
grw-setting.php CHANGED
@@ -17,6 +17,22 @@ function grw_has_valid_nonce() {
17
  return false;
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  if (!empty($_POST)) {
21
  $nonce_result_check = grw_has_valid_nonce();
22
  if ($nonce_result_check === false) {
@@ -68,12 +84,12 @@ foreach ($valid_fields as $key) {
68
  $_POST[$key['key_name']] = trim(sanitize_text_field($_POST[$key['key_name']]));
69
 
70
  // Validate
71
- if ($key['regexp']) {
72
  if (!preg_match($key['regexp'], $_POST[$key['key_name']])) {
73
  unset($_POST[$key['key_name']]);
74
  }
75
 
76
- } else if ($key['type'] == 'int') {
77
  if (!intval($_POST[$key['key_name']])) {
78
  unset($_POST[$key['key_name']]);
79
  }
@@ -101,30 +117,26 @@ if (isset($_POST['grw_setting'])) {
101
  update_option('grw_google_api_key', $_POST['grw_google_api_key']);
102
  }
103
 
104
- wp_enqueue_script('jquery');
 
 
105
 
106
- wp_register_script('grp_bootstrap_js', plugins_url('/static/js/bootstrap.min.js', __FILE__));
107
- wp_enqueue_script('grp_bootstrap_js', plugins_url('/static/js/bootstrap.min.js', __FILE__));
108
- wp_register_style('grp_bootstrap_css', plugins_url('/static/css/bootstrap.min.css', __FILE__));
109
- wp_enqueue_style('grp_bootstrap_css', plugins_url('/static/css/bootstrap.min.css', __FILE__));
110
 
111
- wp_register_script('grp_place_finder_js', plugins_url('/static/js/grp-place-finder.js', __FILE__));
112
- wp_enqueue_script('grp_place_finder_js', plugins_url('/static/js/grp-place-finder.js', __FILE__));
 
 
113
 
114
- wp_register_style('grp_setting_css', plugins_url('/static/css/grp-setting.css', __FILE__));
115
- wp_enqueue_style('grp_setting_css', plugins_url('/static/css/grp-setting.css', __FILE__));
116
- wp_register_style('grp_place_widget_css', plugins_url('/static/css/grp-place-widget.css', __FILE__));
117
- wp_enqueue_style('grp_place_widget_css', plugins_url('/static/css/grp-place-widget.css', __FILE__));
118
 
119
  $grw_enabled = get_option('grw_active') == '1';
120
  $grw_google_api_key = get_option('grw_google_api_key');
121
- if (strlen($grw_google_api_key) == 0) {
122
- $grw_google_api_key = grw_google_api_key();
123
- }
124
  ?>
125
 
126
  <span class="version"><?php echo grw_i('Free Version: %s', esc_html(GRW_VERSION)); ?></span>
127
- <div class="grp-setting container-fluid">
128
  <img src="<?php echo GRW_PLUGIN_URL . '/static/img/google.png'; ?>" alt="Google">
129
  <ul class="nav nav-tabs" role="tablist">
130
  <li role="presentation" class="active">
@@ -146,19 +158,14 @@ if (strlen($grw_google_api_key) == 0) {
146
  <div class="col-sm-6">
147
  <h4><?php echo grw_i('Google Reviews Widget for WordPress'); ?></h4>
148
  <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>
149
- <h4>Use cases</h4>
150
- <p>There have two main use cases of using Google Reviews Widget. Use as widget in sidebar or shortcode in any side.</p>
151
- <h5>Sidebar widget</h5>
152
- <p>To use it as a widget, please do follow:</p>
153
  <ol>
154
  <li>Go to menu <b>"Appearance"</b> -> <b>"Widgets"</b></li>
155
  <li>Move "Google Reviews Widget" widget to sidebar</li>
156
- <li>Enter search query of your business place in "Google Place Search Query" field and click "Search Place"</li>
157
  <li>Select your found place in the panel below and click "Save Place and Reviews"</li>
158
- <li>"Google Place Name" and "Google Place ID" must be filled, if so click "Save" button below</li>
159
  </ol>
160
- <h5>Shortcode</h5>
161
- <p>Available in Google Reviews Pro version: <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 Pro'); ?></a></p>
162
  <p><?php echo grw_i('Feel free to contact us by email <a href="mailto:support@richplugins.com">support@richplugins.com</a>.'); ?></p>
163
  <p><?php echo grw_i('<b>Like this plugin? Give it a like on social:</b>'); ?></p>
164
  <div class="row">
@@ -211,15 +218,19 @@ if (strlen($grw_google_api_key) == 0) {
211
  <hr>
212
  <h4>Get More Features with Google Reviews Pro!</h4>
213
  <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 Pro or Business version</a></p>
214
- <p>* Pure self-hosted plugin, keep all reviews in WordPress database</p>
215
- <p>* Auto-download new Google reviews daily</p>
216
- <p>* Collect more than 5 Google reviews</p>
217
- <p>* Supports Google Rich Snippets (schema.org)</p>
218
  <p>* Grid theme to show G+ reviews in testimonials section</p>
 
219
  <p>* 'Write a review' button to available leave Google review directly on your website</p>
 
 
220
  <p>* Custom business place photo</p>
221
  <p>* Minimum rating filter</p>
222
  <p>* Pagination, Sorting</p>
 
223
  <p>* Priority support</p>
224
  </div>
225
  <div role="tabpanel" class="tab-pane" id="setting">
@@ -239,6 +250,10 @@ if (strlen($grw_google_api_key) == 0) {
239
  <iframe src="//www.youtube.com/embed/uW-PTKeZAXs?rel=0" allowfullscreen=""></iframe>
240
  </small>
241
  </div>
 
 
 
 
242
  <p class="submit" style="text-align: left">
243
  <input name="grw_setting" type="submit" value="Save" class="button-primary button" tabindex="4">
244
  </p>
@@ -253,6 +268,19 @@ if (strlen($grw_google_api_key) == 0) {
253
  <input type="submit" name="grw_active" class="button" value="<?php echo $grw_enabled ? grw_i('Disable') : grw_i('Enable'); ?>" />
254
  </form>
255
  <hr>
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  <form action="?page=grw" method="POST">
257
  <?php wp_nonce_field('grw-wpnonce_grw_reset', 'grw-form_nonce_grw_reset'); ?>
258
  <p>
17
  return false;
18
  }
19
 
20
+ function grw_debug() {
21
+ global $wpdb;
22
+ $places = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "grp_google_place");
23
+ $places_error = $wpdb->last_error;
24
+ $reviews = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "grp_google_review");
25
+ $reviews_error = $wpdb->last_error; ?>
26
+
27
+ DB Places: <?php echo print_r($places); ?>
28
+
29
+ DB Places error: <?php echo $places_error; ?>
30
+
31
+ DB Reviews: <?php echo print_r($reviews); ?>
32
+
33
+ DB Reviews error: <?php echo $reviews_error;
34
+ }
35
+
36
  if (!empty($_POST)) {
37
  $nonce_result_check = grw_has_valid_nonce();
38
  if ($nonce_result_check === false) {
84
  $_POST[$key['key_name']] = trim(sanitize_text_field($_POST[$key['key_name']]));
85
 
86
  // Validate
87
+ if (isset($key['regexp']) && $key['regexp']) {
88
  if (!preg_match($key['regexp'], $_POST[$key['key_name']])) {
89
  unset($_POST[$key['key_name']]);
90
  }
91
 
92
+ } else if (isset($key['type']) && $key['type'] == 'int') {
93
  if (!intval($_POST[$key['key_name']])) {
94
  unset($_POST[$key['key_name']]);
95
  }
117
  update_option('grw_google_api_key', $_POST['grw_google_api_key']);
118
  }
119
 
120
+ if (isset($_POST['grw_install_db'])) {
121
+ grw_install_db();
122
+ }
123
 
124
+ wp_enqueue_script('jquery');
 
 
 
125
 
126
+ wp_register_script('twitter_bootstrap3_js', plugins_url('/static/js/bootstrap.min.js', __FILE__));
127
+ wp_enqueue_script('twitter_bootstrap3_js', plugins_url('/static/js/bootstrap.min.js', __FILE__));
128
+ wp_register_style('twitter_bootstrap3_css', plugins_url('/static/css/bootstrap.min.css', __FILE__));
129
+ wp_enqueue_style('twitter_bootstrap3_css', plugins_url('/static/css/bootstrap.min.css', __FILE__));
130
 
131
+ wp_register_style('grw_setting_css', plugins_url('/static/css/grw-setting.css', __FILE__));
132
+ wp_enqueue_style('grw_setting_css', plugins_url('/static/css/grw-setting.css', __FILE__));
 
 
133
 
134
  $grw_enabled = get_option('grw_active') == '1';
135
  $grw_google_api_key = get_option('grw_google_api_key');
 
 
 
136
  ?>
137
 
138
  <span class="version"><?php echo grw_i('Free Version: %s', esc_html(GRW_VERSION)); ?></span>
139
+ <div class="grw-setting container-fluid">
140
  <img src="<?php echo GRW_PLUGIN_URL . '/static/img/google.png'; ?>" alt="Google">
141
  <ul class="nav nav-tabs" role="tablist">
142
  <li role="presentation" class="active">
158
  <div class="col-sm-6">
159
  <h4><?php echo grw_i('Google Reviews Widget for WordPress'); ?></h4>
160
  <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>
161
+ <p><?php echo grw_i('To use a widget, please do follow:'); ?></p>
 
 
 
162
  <ol>
163
  <li>Go to menu <b>"Appearance"</b> -> <b>"Widgets"</b></li>
164
  <li>Move "Google Reviews Widget" widget to sidebar</li>
165
+ <li>Enter search query of your business place in "Location of place" field and click "Search Place"</li>
166
  <li>Select your found place in the panel below and click "Save Place and Reviews"</li>
167
+ <li>"Google Place Name" and "Google Place ID" must be filled, if so click "Save" button to save the widget</li>
168
  </ol>
 
 
169
  <p><?php echo grw_i('Feel free to contact us by email <a href="mailto:support@richplugins.com">support@richplugins.com</a>.'); ?></p>
170
  <p><?php echo grw_i('<b>Like this plugin? Give it a like on social:</b>'); ?></p>
171
  <div class="row">
218
  <hr>
219
  <h4>Get More Features with Google Reviews Pro!</h4>
220
  <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 Pro or Business version</a></p>
221
+ <p>* Trying to get more than 5 Google reviews</p>
222
+ <p>* Google Rich Snippets (schema.org)</p>
223
+ <p>* Support shortcode</p>
224
+ <p>* Powerful <b>Shortcode Builder</b></p>
225
  <p>* Grid theme to show G+ reviews in testimonials section</p>
226
+ <p>* Google Trust Badge (right/left fixed or inner)</p>
227
  <p>* 'Write a review' button to available leave Google review directly on your website</p>
228
+ <p>* Trim long reviews with "read more" link</p>
229
+ <p>* Show/hide business photo and avatars</p>
230
  <p>* Custom business place photo</p>
231
  <p>* Minimum rating filter</p>
232
  <p>* Pagination, Sorting</p>
233
+ <p>* Moderation G+ reviews</p>
234
  <p>* Priority support</p>
235
  </div>
236
  <div role="tabpanel" class="tab-pane" id="setting">
250
  <iframe src="//www.youtube.com/embed/uW-PTKeZAXs?rel=0" allowfullscreen=""></iframe>
251
  </small>
252
  </div>
253
+ <div class="form-group">
254
+ <input class="form-control" type="checkbox" id="grw_install_db" name="grw_install_db" >
255
+ <label class="control-label" for="grw_install_db"><?php echo grw_i('Create database'); ?></label>
256
+ </div>
257
  <p class="submit" style="text-align: left">
258
  <input name="grw_setting" type="submit" value="Save" class="button-primary button" tabindex="4">
259
  </p>
268
  <input type="submit" name="grw_active" class="button" value="<?php echo $grw_enabled ? grw_i('Disable') : grw_i('Enable'); ?>" />
269
  </form>
270
  <hr>
271
+ <!-- Debug information -->
272
+ <button class="btn btn-primary btn-small" type="button" data-toggle="collapse" data-target="#debug" aria-expanded="false" aria-controls="debug">
273
+ <?php echo grw_i('Debug Information'); ?>
274
+ </button>
275
+ <div id="debug" class="collapse">
276
+ <textarea style="width:90%; height:200px;" onclick="this.select();return false;" readonly><?php
277
+ rplg_debug(GRW_VERSION, grw_options(), 'widget_grw_widget');
278
+ grw_debug();
279
+ ?></textarea>
280
+ </div>
281
+ <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>
282
+ <hr>
283
+ <!-- Reset form -->
284
  <form action="?page=grw" method="POST">
285
  <?php wp_nonce_field('grw-wpnonce_grw_reset', 'grw-form_nonce_grw_reset'); ?>
286
  <p>
grw-widget.php CHANGED
@@ -21,6 +21,8 @@ class Goog_Reviews_Widget extends WP_Widget {
21
  'text_size' => '',
22
  'dark_theme' => '',
23
  'view_mode' => '',
 
 
24
  );
25
 
26
  public function __construct() {
@@ -35,19 +37,35 @@ class Goog_Reviews_Widget extends WP_Widget {
35
 
36
  add_action('admin_enqueue_scripts', array($this, 'grw_widget_scripts'));
37
 
38
- wp_register_script('grp_time_js', plugins_url('/static/js/grp-time.js', __FILE__));
39
- wp_enqueue_script('grp_time_js', plugins_url('/static/js/grp-time.js', __FILE__));
40
- wp_register_style('grp_widget_css', plugins_url('/static/css/grp-widget.css', __FILE__));
41
- wp_enqueue_style('grp_widget_css', plugins_url('/static/css/grp-widget.css', __FILE__));
 
42
  }
43
 
44
  function grw_widget_scripts($hook) {
45
  if ($hook == 'widgets.php' || ($hook == 'customize.php' && defined('SITEORIGIN_PANELS_VERSION'))) {
 
46
  wp_enqueue_script('jquery');
47
- wp_register_script('grp_place_finder_js', plugins_url('/static/js/grp-place-finder.js', __FILE__));
48
- wp_enqueue_script('grp_place_finder_js', plugins_url('/static/js/grp-place-finder.js', __FILE__));
49
- wp_register_style('grp_place_widget_css', plugins_url('/static/css/grp-place-widget.css', __FILE__));
50
- wp_enqueue_style('grp_place_widget_css', plugins_url('/static/css/grp-place-widget.css', __FILE__));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
  }
53
 
@@ -57,12 +75,14 @@ class Goog_Reviews_Widget extends WP_Widget {
57
  if (grw_enabled()) {
58
  extract($args);
59
  foreach ($instance as $variable => $value) {
60
- ${$variable} = !isset($instance[$variable]) ? $this->widget_fields[$variable] : esc_attr($instance[$variable]);
 
 
61
  }
62
 
63
  echo $before_widget;
64
  if ($place_id) {
65
- if ($title) { ?><h2 class="grp-widget-title widget-title"><?php echo $title; ?></h2><?php }
66
  include(dirname(__FILE__) . '/grw-reviews.php');
67
  if ($view_mode == 'badge') {
68
  ?>
@@ -76,7 +96,7 @@ class Goog_Reviews_Widget extends WP_Widget {
76
  <?php
77
  }
78
  } else { ?>
79
- <div class="grp-error" style="padding:10px;color:#B94A48;background-color:#F2DEDE;border-color:#EED3D7;">
80
  <?php echo grw_i('Please check that this widget <b>Google Reviews</b> has a Google Place ID set.'); ?>
81
  </div>
82
  <?php }
@@ -95,217 +115,74 @@ class Goog_Reviews_Widget extends WP_Widget {
95
  function form($instance) {
96
  global $wp_version;
97
  foreach ($this->widget_fields as $field => $value) {
98
- ${$field} = !isset($instance[$field]) ? $value : esc_attr($instance[$field]);
99
- } ?>
100
- <div class="form-group">
101
- <input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $title; ?>" placeholder="<?php echo grw_i('Widget title'); ?>" />
102
- </div>
103
-
104
- <?php wp_nonce_field('grw-wpnonce_grw_textsearch', 'grw-form_nonce_grw_textsearch'); ?>
105
-
106
- <div id="<?php echo $this->id; ?>"></div>
107
- <script type="text/javascript">
108
- function sidebar_widget(widgetData) {
109
-
110
- var widgetId = widgetData.widgetId,
111
- placeId = widgetData.placeId,
112
- placeName = widgetData.placeName;
113
-
114
- function set_fields(place) {
115
- var place_id_el = document.getElementById(placeId);
116
- var place_name_el = document.getElementById(placeName);
117
- place_id_el.value = place.place_id;
118
- place_name_el.value = place.name;
119
  }
 
120
 
121
- function show_tooltip() {
122
- var el = document.getElementById(widgetId);
123
- var insideEl = WPacFastjs.parents(el, 'widget-inside');
124
- if (insideEl) {
125
- var controlEl = insideEl.querySelector('.widget-control-actions');
126
- if (controlEl) {
127
- var tooltip = WPacFastjs.create('div', 'grp-tooltip');
128
- tooltip.innerHTML = '<div class="grp-corn1"></div>' +
129
- '<div class="grp-corn2"></div>' +
130
- '<div class="grp-close">×</div>' +
131
- '<div class="grp-text">Please don\'t forget to <b>Save</b> the widget.</div>';
132
- controlEl.appendChild(tooltip);
133
- setTimeout(function() {
134
- WPacFastjs.addcl(tooltip, 'grp-tooltip-visible');
135
- }, 100);
136
- WPacFastjs.on2(tooltip, '.grp-close', 'click', function() {
137
- WPacFastjs.rm(tooltip);
138
- });
139
- }
140
  }
141
- }
142
-
143
- function google_key_save_listener(params, cb) {
144
- var gkey = document.querySelector('#' + widgetId + ' .wp-gkey');
145
- if (gkey) {
146
- WPacFastjs.on(gkey, 'change', function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  if (!this.value) return;
148
- jQuery.post('<?php echo admin_url('options-general.php?page=grw&cf_action=grw_google_api_key'); ?>', {
149
  key: this.value,
150
- _textsearch_wpnonce: jQuery('#grw-form_nonce_grw_textsearch').val()
151
- });
 
 
152
  });
153
  }
154
- }
155
-
156
- <?php if (!$place_id) { ?>
157
- GRPPlaceFinder.main({
158
- el: widgetId,
159
- app_host: '<?php echo admin_url('options-general.php?page=grw'); ?>',
160
- nonce: '#grw-form_nonce_grw_textsearch',
161
- callback: {
162
- add: [function(place) {
163
- set_fields(place);
164
- show_tooltip();
165
- }],
166
- ready: [function(arg) {
167
- var placeInput = document.querySelector('#' + widgetId + ' .wp-place');
168
- if (placeInput) {
169
- placeInput.focus();
170
- }
171
- google_key_save_listener();
172
- }]
173
- }
174
- });
175
- <?php } else { ?>
176
- jQuery('.grp-tooltip').remove();
177
- <?php } ?>
178
-
179
- jQuery(document).ready(function($) {
180
- var $widgetContent = $('#' + widgetId).parent();
181
- $('.grp-options-toggle', $widgetContent).click(function () {
182
- $(this).toggleClass('toggled');
183
- $(this).next().slideToggle();
184
- });
185
- });
186
  }
187
- </script>
188
- <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
189
- data-widget-id="<?php echo $this->id; ?>"
190
- data-place-id="<?php echo $this->get_field_id("place_id"); ?>"
191
- data-place-name="<?php echo $this->get_field_id("place_name"); ?>"
192
- onload="sidebar_widget({
193
- widgetId: this.getAttribute('data-widget-id'),
194
- placeId: this.getAttribute('data-place-id'),
195
- placeName: this.getAttribute('data-place-name')
196
- })" style="display:none">
197
-
198
- <div class="form-group">
199
- <input type="text" id="<?php echo $this->get_field_id('place_name'); ?>" name="<?php echo $this->get_field_name('place_name'); ?>" value="<?php echo $place_name; ?>" placeholder="<?php echo grw_i('Google Place Name'); ?>" readonly />
200
- </div>
201
-
202
- <div class="form-group">
203
- <input type="text" id="<?php echo $this->get_field_id('place_id'); ?>" name="<?php echo $this->get_field_name('place_id'); ?>" value="<?php echo $place_id; ?>" placeholder="<?php echo grw_i('Google Place ID'); ?>" readonly />
204
- </div>
205
-
206
- <h4 class="grp-options-toggle"><?php echo grw_i('Review Options'); ?></h4>
207
- <div class="grp-options" style="display:none">
208
- <div class="form-group wpgrev-disabled">
209
- <input type="checkbox" disabled />
210
- <label><?php echo grw_i('Save Google reviews to my WordPress database'); ?></label>
211
- </div>
212
- <div class="form-group wpgrev-disabled">
213
- <input type="checkbox" disabled />
214
- <label><?php echo grw_i('Auto-download new reviews from Google'); ?></label>
215
- </div>
216
- <div class="form-group wpgrev-disabled">
217
- <input type="checkbox" disabled />
218
- <label><?php echo grw_i('Enable Google Rich Snippets (schema.org)'); ?></label>
219
- </div>
220
- <div class="form-group">
221
- <?php echo grw_i('Pagination'); ?>
222
- <select disabled>
223
- <option><?php echo grw_i('Show all reviews'); ?></option>
224
- <option><?php echo grw_i('10'); ?></option>
225
- <option><?php echo grw_i('5'); ?></option>
226
- <option><?php echo grw_i('4'); ?></option>
227
- <option><?php echo grw_i('3'); ?></option>
228
- <option><?php echo grw_i('2'); ?></option>
229
- <option><?php echo grw_i('1'); ?></option>
230
- </select>
231
- </div>
232
- <div class="form-group">
233
- <?php echo grw_i('Sorting'); ?>
234
- <select disabled>
235
- <option><?php echo grw_i('Default'); ?></option>
236
- <option><?php echo grw_i('Most recent'); ?></option>
237
- <option><?php echo grw_i('Most oldest'); ?></option>
238
- <option><?php echo grw_i('Highest score'); ?></option>
239
- <option><?php echo grw_i('Lowest score'); ?></option>
240
- </select>
241
- </div>
242
- <div class="form-group">
243
- <?php echo grw_i('Minimum Review Rating'); ?>
244
- <select disabled>
245
- <option><?php echo grw_i('No filter'); ?></option>
246
- <option><?php echo grw_i('5 Stars'); ?></option>
247
- <option><?php echo grw_i('4 Stars'); ?></option>
248
- <option><?php echo grw_i('3 Stars'); ?></option>
249
- <option><?php echo grw_i('2 Stars'); ?></option>
250
- <option><?php echo grw_i('1 Star'); ?></option>
251
- </select>
252
- </div>
253
-
254
- <div class="form-group">
255
- <div class="wpgrev-pro"><?php echo grw_i('These features available in Google Reviews Pro plugin: '); ?> <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank"><?php echo grw_i('Upgrade to Pro'); ?></a></div>
256
- </div>
257
- </div>
258
-
259
- <h4 class="grp-options-toggle"><?php echo grw_i('Display Options'); ?></h4>
260
- <div class="grp-options" style="display:none">
261
- <div class="form-group wpgrev-disabled">
262
- <label><?php echo grw_i('Change place photo'); ?></label>
263
- </div>
264
- <div class="form-group wpgrev-disabled">
265
- <input type="text" placeholder="<?php echo grw_i('Review text limit before \'read more\' link: 200'); ?>" disabled />
266
- </div>
267
- <div class="form-group">
268
- <div class="wpgrev-pro"><?php echo grw_i('Custom photo and review concatenation available in Pro version: '); ?> <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank"><?php echo grw_i('Upgrade to Pro'); ?></a></div>
269
- </div>
270
- <div class="form-group">
271
- <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); ?> />
272
- <label for="<?php echo $this->get_field_id('dark_theme'); ?>"><?php echo grw_i('Dark theme'); ?></label>
273
- </div>
274
- <div class="form-group">
275
- <?php echo grw_i('Widget theme'); ?>
276
- <select id="<?php echo $this->get_field_id('view_mode'); ?>" name="<?php echo $this->get_field_name('view_mode'); ?>">
277
- <option value="list" <?php selected('list', $view_mode); ?>><?php echo grw_i('Review list'); ?></option>
278
- <option value="badge" <?php selected('badge', $view_mode); ?>><?php echo grw_i('Google badge'); ?></option>
279
- <option value="badge_inner" <?php selected('badge_inner', $view_mode); ?>><?php echo grw_i('Inner badge'); ?></option>
280
- </select>
281
- </div>
282
- </div>
283
-
284
- <h4 class="grp-options-toggle"><?php echo grw_i('Advance Options'); ?></h4>
285
- <div class="grp-options" style="display:none">
286
- <div class="form-group wpgrev-disabled">
287
- <input type="text" placeholder="<?php echo grw_i('Write a review link'); ?>" disabled />
288
- <small><?php echo grw_i('Allows to write Google reviews straight in widget on your website'); ?></small>
289
- </div>
290
- <div class="form-group wpgrev-disabled">
291
- <input type="checkbox" disabled />
292
- <label><?php echo grw_i('Disable G+ profile links'); ?></label>
293
- </div>
294
- <div class="form-group wpgrev-disabled">
295
- <input type="checkbox" disabled />
296
- <label><?php echo grw_i('Open links in new Window'); ?></label>
297
- </div>
298
- <div class="form-group wpgrev-disabled">
299
- <input type="checkbox" disabled />
300
- <label><?php echo grw_i('User no follow links'); ?></label>
301
- </div>
302
- <div class="form-group">
303
- <div class="wpgrev-pro"><?php echo grw_i('These features available in Google Reviews Pro plugin: '); ?> <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin" target="_blank"><?php echo grw_i('Upgrade to Pro'); ?></a></div>
304
- </div>
305
- </div>
306
-
307
- <br>
308
- <?php
309
  }
310
  }
311
  ?>
21
  'text_size' => '',
22
  'dark_theme' => '',
23
  'view_mode' => '',
24
+ 'open_link' => true,
25
+ 'nofollow_link' => true,
26
  );
27
 
28
  public function __construct() {
37
 
38
  add_action('admin_enqueue_scripts', array($this, 'grw_widget_scripts'));
39
 
40
+ wp_register_script('wpac_time_js', plugins_url('/static/js/wpac-time.js', __FILE__));
41
+ wp_enqueue_script('wpac_time_js', plugins_url('/static/js/wpac-time.js', __FILE__));
42
+
43
+ wp_register_style('grw_css', plugins_url('/static/css/google-review.css', __FILE__));
44
+ wp_enqueue_style('grw_css', plugins_url('/static/css/google-review.css', __FILE__));
45
  }
46
 
47
  function grw_widget_scripts($hook) {
48
  if ($hook == 'widgets.php' || ($hook == 'customize.php' && defined('SITEORIGIN_PANELS_VERSION'))) {
49
+
50
  wp_enqueue_script('jquery');
51
+
52
+ wp_register_script('wpac_js', plugins_url('/static/js/wpac.js', __FILE__));
53
+ wp_enqueue_script('wpac_js', plugins_url('/static/js/wpac.js', __FILE__));
54
+
55
+ $finder_vars = array(
56
+ 'GOOGLE_AVATAR' => GRW_GOOGLE_AVATAR,
57
+ 'handlerUrl' => admin_url('options-general.php?page=grw'),
58
+ 'actionPrefix' => 'grw'
59
+ );
60
+ wp_register_script('grw_finder_js', plugins_url('/static/js/grw-finder.js', __FILE__));
61
+ wp_localize_script('grw_finder_js', 'grwVars', $finder_vars );
62
+ wp_enqueue_script('grw_finder_js', plugins_url('/static/js/grw-finder.js', __FILE__));
63
+
64
+ wp_register_style('grw_widget_css', plugins_url('/static/css/grw-widget.css', __FILE__));
65
+ wp_enqueue_style('grw_widget_css', plugins_url('/static/css/grw-widget.css', __FILE__));
66
+
67
+ wp_register_style('rplg_css', plugins_url('/static/css/rplg.css', __FILE__));
68
+ wp_enqueue_style('rplg_css', plugins_url('/static/css/rplg.css', __FILE__));
69
  }
70
  }
71
 
75
  if (grw_enabled()) {
76
  extract($args);
77
  foreach ($instance as $variable => $value) {
78
+ if (array_key_exists($variable, $this->widget_fields)) {
79
+ ${$variable} = !isset($instance[$variable]) ? $this->widget_fields[$variable] : esc_attr($instance[$variable]);
80
+ }
81
  }
82
 
83
  echo $before_widget;
84
  if ($place_id) {
85
+ if ($title) { ?><h2 class="grw-widget-title widget-title"><?php echo $title; ?></h2><?php }
86
  include(dirname(__FILE__) . '/grw-reviews.php');
87
  if ($view_mode == 'badge') {
88
  ?>
96
  <?php
97
  }
98
  } else { ?>
99
+ <div class="grw-error" style="padding:10px;color:#B94A48;background-color:#F2DEDE;border-color:#EED3D7;">
100
  <?php echo grw_i('Please check that this widget <b>Google Reviews</b> has a Google Place ID set.'); ?>
101
  </div>
102
  <?php }
115
  function form($instance) {
116
  global $wp_version;
117
  foreach ($this->widget_fields as $field => $value) {
118
+ if (array_key_exists($field, $this->widget_fields)) {
119
+ ${$field} = !isset($instance[$field]) ? $value : esc_attr($instance[$field]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
121
+ }
122
 
123
+ wp_nonce_field('grw_wpnonce', 'grw_nonce');
124
+
125
+ $grw_google_api_key = get_option('grw_google_api_key');
126
+ if ($grw_google_api_key) {
127
+ ?>
128
+ <div id="<?php echo $this->id; ?>" class="rplg-widget"><?php
129
+ if (!$place_id) {
130
+ include(dirname(__FILE__) . '/grw-finder.php');
131
+ } else { ?>
132
+ <script type="text/javascript">
133
+ jQuery('.grw-tooltip').remove();
134
+ </script> <?php
 
 
 
 
 
 
 
135
  }
136
+ include(dirname(__FILE__) . '/grw-options.php'); ?>
137
+ </div>
138
+ <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-widget-id="<?php echo $this->id; ?>"
139
+ onload="grw_init({widgetId: this.getAttribute('data-widget-id')})" style="display:none">
140
+ <?php
141
+ } else {
142
+ ?>
143
+ <h4 class="text-left"><?php echo grw_i('First configure Google API Key'); ?></h4>
144
+ <ul style="line-height:20px">
145
+ <li>
146
+ <span class="grw-step">1</span>
147
+ <?php echo grw_i('Go to '); ?>
148
+ <a href="https://developers.google.com/places/web-service/get-api-key" target="_blank">
149
+ <?php echo grw_i('Google Places API Key'); ?>
150
+ </a>
151
+ </li>
152
+ <li>
153
+ <span class="grw-step">2</span>
154
+ <?php echo grw_i('Find the topic \'<b>If you are using the standard Google Places API Web Service</b>\' and click by \'<b>GET A KEY</b>\' button'); ?>
155
+ </li>
156
+ <li>
157
+ <span class="grw-step">3</span>
158
+ <?php echo grw_i('Agree term and click by \'<b>CREATE AND ENABLE API</b>\''); ?>
159
+ </li>
160
+ <li>
161
+ <span class="grw-step">4</span>
162
+ <?php echo grw_i('Copy & paste generated key to the field: '); ?>
163
+ <input type="text" class="grw-apikey" name="grw_google_api_key" placeholder="<?php echo grw_i('Google Places API Key'); ?>" />
164
+ </li>
165
+ <li>
166
+ <span class="grw-step">5</span>
167
+ <?php echo grw_i('Save the widget'); ?>
168
+ </li>
169
+ </ul>
170
+ <script type="text/javascript">
171
+ var apikey = document.querySelectorAll('.grw-apikey');
172
+ if (apikey) {
173
+ WPacFastjs.onall(apikey, 'change', function() {
174
  if (!this.value) return;
175
+ jQuery.post('<?php echo admin_url('options-general.php?page=grw'); ?>&cf_action=' + this.getAttribute('name'), {
176
  key: this.value,
177
+ grw_wpnonce: jQuery('#grw_nonce').val()
178
+ }, function(res) {
179
+ console.log('RESPONSE', res);
180
+ }, 'json');
181
  });
182
  }
183
+ </script>
184
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  }
187
  }
188
  ?>
grw.php CHANGED
@@ -4,43 +4,20 @@ 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.5
8
  Author URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
9
  */
10
 
11
  require(ABSPATH . 'wp-includes/version.php');
12
 
13
- require_once(dirname(__FILE__) . '/api/grw-api.php');
 
14
 
15
- define('GRW_VERSION', '1.5');
16
  define('GRW_GOOGLE_PLACE_API', 'https://maps.googleapis.com/maps/api/place/');
17
  define('GRW_GOOGLE_AVATAR', 'https://lh3.googleusercontent.com/-8hepWJzFXpE/AAAAAAAAAAI/AAAAAAAAAAA/I80WzYfIxCQ/s64-c/114307615494839964028.jpg');
18
  define('GRW_PLUGIN_URL', plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
19
 
20
- function grw_google_api_key() {
21
- $keys = array(
22
- 'AIzaSyAi0nomk8c1CBMRiKWuFxdfyF3QFFXZSUM',
23
- 'AIzaSyA_7b55nlagZcTLT8Fiz_x8Hae-D93H5_g',
24
- 'AIzaSyALYBD3qLHSyI86bRtrh_5vr_4Tr2fLoIM',
25
- 'AIzaSyB84O9Qy34aHpilZT2wrDYtWc6X8j2q-XM',
26
- 'AIzaSyB6S2Rl0iczRwO_8udMuGqaQA1ttCE1NgA',
27
- 'AIzaSyBuUPywXpgXMu-RTsuEIBB5gQgp0N114cI',
28
- 'AIzaSyAETBwpe6xxwNXN6fa6q0ray9g5nAq8Dl0',
29
- 'AIzaSyDLTEEEUBSdmeCbps5rLKKBRCC14KmcXv4',
30
- 'AIzaSyDcxWMaaAhpeOFikmam_s3xwXJF7iSlJsc',
31
- 'AIzaSyC12ZI0DTBuvfTbxw7IAkFdhuuaaRsX6lw',
32
- 'AIzaSyCQ2rPW43kyRmlAh1x9k17dQfNi0BDm5Ds',
33
- 'AIzaSyDhhxmCvkORZxJ7Fpo4pElNuDkfV_r74Jc',
34
- 'AIzaSyB3k4oWDJPFR30LLjj27k5MdupZ9yMfXqE',
35
- 'AIzaSyAw9xnTPxpBnYvFuE73_Son-Yy_-opo9Fs',
36
- 'AIzaSyA42G8C-Q0Kr3uLJHmNcngYHaIK5kB6geg',
37
- 'AIzaSyBuXKuG_ITnAg92vsLdyExiY56TEXUphnE',
38
- 'AIzaSyDrYf4yX5Wf5ugvbljgnMfyd8kRhi9hoik'
39
- );
40
- $idx = array_rand($keys);
41
- return $keys[$idx];
42
- }
43
-
44
  function grw_options() {
45
  return array(
46
  'grw_version',
@@ -49,8 +26,6 @@ function grw_options() {
49
  );
50
  }
51
 
52
- $grw_api = new GoogleReviewsWidgetAPI();
53
-
54
  /*-------------------------------- Widget --------------------------------*/
55
  function grw_init_widget() {
56
  if (!class_exists('Goog_Reviews_Widget' ) ) {
@@ -121,7 +96,7 @@ function grw_install($allow_db_install=true) {
121
  function grw_install_db() {
122
  global $wpdb;
123
 
124
- $wpdb->query("CREATE TABLE " . $wpdb->prefix . "grp_google_place (".
125
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
126
  "place_id VARCHAR(80) NOT NULL,".
127
  "name VARCHAR(255) NOT NULL,".
@@ -136,7 +111,7 @@ function grw_install_db() {
136
  "UNIQUE INDEX grp_place_id (`place_id`)".
137
  ");");
138
 
139
- $wpdb->query("CREATE TABLE " . $wpdb->prefix . "grp_google_review (".
140
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
141
  "google_place_id BIGINT(20) UNSIGNED NOT NULL,".
142
  "hash VARCHAR(40) NOT NULL,".
@@ -162,115 +137,88 @@ function grw_reset_db() {
162
 
163
  /*-------------------------------- Request --------------------------------*/
164
  function grw_request_handler() {
165
- global $grw_api;
166
  global $wpdb;
167
 
168
  if (!empty($_GET['cf_action'])) {
169
 
170
- if (!empty($_GET['key'])) {
171
- $google_api_key = $_GET['key'];
172
- } else {
173
- $google_api_key = get_option('grw_google_api_key');
174
- }
175
- if (!$google_api_key) {
176
- $google_api_key = grw_google_api_key();
177
- }
178
-
179
  switch ($_GET['cf_action']) {
180
  case 'grw_google_api_key':
181
  if (current_user_can('manage_options')) {
182
- if (isset($_POST['_textsearch_wpnonce']) === false) {
183
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
184
  $response = compact('error');
185
  } else {
186
- check_admin_referer('grw-wpnonce_grw_textsearch', '_textsearch_wpnonce');
187
- update_option('grw_google_api_key', $_POST['key']);
 
188
  $status = 'success';
189
  $response = compact('status');
 
190
  }
191
  header('Content-type: text/javascript');
192
  echo cf_json_encode($response);
193
  die();
194
  }
195
  break;
196
- case 'textsearch':
197
- if (current_user_can('manage_options')) {
198
- if (isset($_GET['_textsearch_wpnonce']) === false) {
199
- $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
200
- $response = compact('error');
201
- } else {
202
- check_admin_referer('grw-wpnonce_grw_textsearch', '_textsearch_wpnonce');
203
- $response = $grw_api->textsearch(array(
204
- 'query' => $_GET['query'],
205
- 'key' => $google_api_key,
206
- ));
207
- }
208
- header('Content-type: text/javascript');
209
- echo cf_json_encode($response);
210
- die();
211
- }
212
- break;
213
- case 'details':
214
  if (current_user_can('manage_options')) {
215
- if (isset($_GET['_textsearch_wpnonce']) === false) {
216
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
217
  $response = compact('error');
218
  } else {
219
- check_admin_referer('grw-wpnonce_grw_textsearch', '_textsearch_wpnonce');
220
- $response = $grw_api->details(array(
221
- 'placeid' => $_GET['placeid'],
222
- 'key' => $google_api_key,
223
- ));
 
 
 
 
224
  }
225
  header('Content-type: text/javascript');
226
- echo cf_json_encode($response);
227
  die();
228
  }
229
  break;
230
- case 'save':
231
  if (current_user_can('manage_options')) {
232
- if (isset($_POST['_textsearch_wpnonce']) === false) {
233
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
234
  $response = compact('error');
235
  } else {
236
- check_admin_referer('grw-wpnonce_grw_textsearch', '_textsearch_wpnonce');
237
- $result = $grw_api->details(array(
238
- 'placeid' => $_POST['placeid'],
239
- 'key' => $google_api_key,
240
- ));
241
- if ($result['place']) {
242
- grw_save_reviews($result['place']);
243
- $status = 'success';
244
- } else {
245
- $status = 'failed';
246
- }
247
- $response = compact('status');
248
  }
249
  header('Content-type: text/javascript');
250
- echo cf_json_encode($response);
251
  die();
252
  }
253
  break;
254
- case 'save_json':
255
  if (current_user_can('manage_options')) {
256
- if (isset($_POST['_textsearch_wpnonce']) === false) {
257
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
258
  $response = compact('error');
259
  } else {
260
- check_admin_referer('grw-wpnonce_grw_textsearch', '_textsearch_wpnonce');
261
-
262
- $place_json = stripslashes($_POST['place']);
263
- $reviews_json = stripslashes($_POST['reviews']);
264
- $place = grw_json_decode($place_json);
265
- $reviews = grw_json_decode($reviews_json);
266
- $place_array = get_object_vars($place);
267
- $place_array['reviews'] = array();
268
- foreach ($reviews as $review) {
269
- array_push($place_array['reviews'], get_object_vars($review));
270
- }
271
 
272
- if ($place_array && strlen($place_array['place_id']) > 0) {
273
- grw_save_reviews($place_array);
274
  $status = 'success';
275
  } else {
276
  $status = 'failed';
@@ -290,45 +238,45 @@ add_action('init', 'grw_request_handler');
290
  function grw_save_reviews($place, $min_filter = 0) {
291
  global $wpdb;
292
 
293
- $google_place_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "grp_google_place WHERE place_id = %s", $place['place_id']));
294
  if ($google_place_id) {
295
- $wpdb->update($wpdb->prefix . 'grp_google_place', array('rating' => $place['rating']), array('ID' => $google_place_id));
296
  } else {
297
  $wpdb->insert($wpdb->prefix . 'grp_google_place', array(
298
- 'place_id' => $place['place_id'],
299
- 'name' => $place['name'],
300
- 'photo' => $place['photo'],
301
- 'icon' => $place['icon'],
302
- 'address' => $place['formatted_address'],
303
- 'rating' => $place['rating'],
304
- 'url' => $place['url'],
305
- 'website' => $place['website']
306
  ));
307
  $google_place_id = $wpdb->insert_id;
308
  }
309
 
310
- if ($place['reviews']) {
311
- $reviews = $place['reviews'];
312
  foreach ($reviews as $review) {
313
- if ($min_filter > 0 && $min_filter > $review['rating']) {
314
  continue;
315
  }
316
- if (strlen($review['author_url']) < 1) {
317
  continue;
318
  }
319
- $hash = sha1($place['place_id'] . $review['author_url']);
320
  $google_review_hash = $wpdb->get_var($wpdb->prepare("SELECT hash FROM " . $wpdb->prefix . "grp_google_review WHERE hash = %s", $hash));
321
  if (!$google_review_hash) {
322
  $wpdb->insert($wpdb->prefix . 'grp_google_review', array(
323
  'google_place_id' => $google_place_id,
324
  'hash' => $hash,
325
- 'rating' => $review['rating'],
326
- 'text' => $review['text'],
327
- 'time' => $review['time'],
328
- 'language' => $review['language'],
329
- 'author_name' => $review['author_name'],
330
- 'author_url' => $review['author_url'],
331
- 'profile_photo_url' => $review['profile_photo_url']
332
  ));
333
  }
334
  }
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.5.2
8
  Author URI: https://richplugins.com/google-reviews-pro-wordpress-plugin
9
  */
10
 
11
  require(ABSPATH . 'wp-includes/version.php');
12
 
13
+ include_once(dirname(__FILE__) . '/api/urlopen.php');
14
+ include_once(dirname(__FILE__) . '/helper/debug.php');
15
 
16
+ define('GRW_VERSION', '1.5.2');
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(
23
  'grw_version',
26
  );
27
  }
28
 
 
 
29
  /*-------------------------------- Widget --------------------------------*/
30
  function grw_init_widget() {
31
  if (!class_exists('Goog_Reviews_Widget' ) ) {
96
  function grw_install_db() {
97
  global $wpdb;
98
 
99
+ $wpdb->query("CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "grp_google_place (".
100
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
101
  "place_id VARCHAR(80) NOT NULL,".
102
  "name VARCHAR(255) NOT NULL,".
111
  "UNIQUE INDEX grp_place_id (`place_id`)".
112
  ");");
113
 
114
+ $wpdb->query("CREATE TABLE IF NOT EXISTS " . $wpdb->prefix . "grp_google_review (".
115
  "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
116
  "google_place_id BIGINT(20) UNSIGNED NOT NULL,".
117
  "hash VARCHAR(40) NOT NULL,".
137
 
138
  /*-------------------------------- Request --------------------------------*/
139
  function grw_request_handler() {
 
140
  global $wpdb;
141
 
142
  if (!empty($_GET['cf_action'])) {
143
 
 
 
 
 
 
 
 
 
 
144
  switch ($_GET['cf_action']) {
145
  case 'grw_google_api_key':
146
  if (current_user_can('manage_options')) {
147
+ if (isset($_POST['grw_wpnonce']) === false) {
148
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
149
  $response = compact('error');
150
  } else {
151
+ check_admin_referer('grw_wpnonce', 'grw_wpnonce');
152
+
153
+ update_option('grw_google_api_key', trim(sanitize_text_field($_POST['key'])));
154
  $status = 'success';
155
  $response = compact('status');
156
+
157
  }
158
  header('Content-type: text/javascript');
159
  echo cf_json_encode($response);
160
  die();
161
  }
162
  break;
163
+ case 'grw_search':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  if (current_user_can('manage_options')) {
165
+ if (isset($_GET['grw_wpnonce']) === false) {
166
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
167
  $response = compact('error');
168
  } else {
169
+ check_admin_referer('grw_wpnonce', 'grw_wpnonce');
170
+
171
+ $grw_google_api_key = get_option('grw_google_api_key');
172
+ $url = GRW_GOOGLE_PLACE_API . 'textsearch/json?query=' . $_GET['query'] . '&key=' . $grw_google_api_key;
173
+ $response = rplg_urlopen($url);
174
+
175
+ $response_data = $response['data'];
176
+ $response_json = rplg_json_decode($response_data);
177
+
178
  }
179
  header('Content-type: text/javascript');
180
+ echo cf_json_encode($response_json->results);
181
  die();
182
  }
183
  break;
184
+ case 'grw_reviews':
185
  if (current_user_can('manage_options')) {
186
+ if (isset($_GET['grw_wpnonce']) === false) {
187
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
188
  $response = compact('error');
189
  } else {
190
+ check_admin_referer('grw_wpnonce', 'grw_wpnonce');
191
+
192
+ $grw_google_api_key = get_option('grw_google_api_key');
193
+ $url = GRW_GOOGLE_PLACE_API . 'details/json?placeid=' . $_GET['placeid'] . '&key=' . $grw_google_api_key;
194
+ $response = rplg_urlopen($url);
195
+
196
+ $response_data = $response['data'];
197
+ $response_json = rplg_json_decode($response_data);
198
+
 
 
 
199
  }
200
  header('Content-type: text/javascript');
201
+ echo cf_json_encode($response_json->result);
202
  die();
203
  }
204
  break;
205
+ case 'grw_save':
206
  if (current_user_can('manage_options')) {
207
+ if (isset($_POST['grw_wpnonce']) === false) {
208
  $error = grw_i('Unable to call request. Make sure you are accessing this page from the Wordpress dashboard.');
209
  $response = compact('error');
210
  } else {
211
+ check_admin_referer('grw_wpnonce', 'grw_wpnonce');
212
+
213
+ $grw_google_api_key = get_option('grw_google_api_key');
214
+ $url = GRW_GOOGLE_PLACE_API . 'details/json?placeid=' . $_POST['placeid'] . '&key=' . $grw_google_api_key;
215
+ $response = rplg_urlopen($url);
216
+
217
+ $response_data = $response['data'];
218
+ $response_json = rplg_json_decode($response_data);
 
 
 
219
 
220
+ if ($response_json && $response_json->result) {
221
+ grw_save_reviews($response_json->result);
222
  $status = 'success';
223
  } else {
224
  $status = 'failed';
238
  function grw_save_reviews($place, $min_filter = 0) {
239
  global $wpdb;
240
 
241
+ $google_place_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "grp_google_place WHERE place_id = %s", $place->place_id));
242
  if ($google_place_id) {
243
+ $wpdb->update($wpdb->prefix . 'grp_google_place', array('rating' => $place->rating), array('ID' => $google_place_id));
244
  } else {
245
  $wpdb->insert($wpdb->prefix . 'grp_google_place', array(
246
+ 'place_id' => $place->place_id,
247
+ 'name' => $place->name,
248
+ //'photo' => $place->photo,
249
+ 'icon' => $place->icon,
250
+ 'address' => $place->formatted_address,
251
+ 'rating' => isset($place->rating) ? $place->rating : null,
252
+ 'url' => isset($place->url) ? $place->url : null,
253
+ 'website' => isset($place->website) ? $place->website : null
254
  ));
255
  $google_place_id = $wpdb->insert_id;
256
  }
257
 
258
+ if ($place->reviews) {
259
+ $reviews = $place->reviews;
260
  foreach ($reviews as $review) {
261
+ if ($min_filter > 0 && $min_filter > $review->rating) {
262
  continue;
263
  }
264
+ if (!isset($review->author_url) || strlen($review->author_url) < 1) {
265
  continue;
266
  }
267
+ $hash = sha1($place->place_id . $review->author_url);
268
  $google_review_hash = $wpdb->get_var($wpdb->prepare("SELECT hash FROM " . $wpdb->prefix . "grp_google_review WHERE hash = %s", $hash));
269
  if (!$google_review_hash) {
270
  $wpdb->insert($wpdb->prefix . 'grp_google_review', array(
271
  'google_place_id' => $google_place_id,
272
  'hash' => $hash,
273
+ 'rating' => $review->rating,
274
+ 'text' => $review->text,
275
+ 'time' => $review->time,
276
+ 'language' => $review->language,
277
+ 'author_name' => $review->author_name,
278
+ 'author_url' => $review->author_url,
279
+ 'profile_photo_url' => isset($review->profile_photo_url) ? $review->profile_photo_url : null
280
  ));
281
  }
282
  }
helper/debug.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!function_exists('rplg_debug')) {
4
+
5
+ function rplg_debug($version, $options, $widget_name) {
6
+ global $wp_version; ?>
7
+ URL: <?php echo esc_url(get_option('siteurl')); ?>
8
+
9
+ PHP Version: <?php echo esc_html(phpversion()); ?>
10
+
11
+ WP Version: <?php echo esc_html($wp_version); ?>
12
+
13
+ Active Theme:
14
+ <?php
15
+ if (!function_exists('wp_get_theme')) {
16
+ $theme = get_theme(get_current_theme());
17
+ echo esc_html($theme['Name'] . ' ' . $theme['Version']);
18
+ } else {
19
+ $theme = wp_get_theme();
20
+ echo esc_html($theme->Name . ' ' . $theme->Version);
21
+ }
22
+ ?>
23
+
24
+ URLOpen Method: <?php echo esc_html(rplg_url_method()); ?>
25
+
26
+ URLOpen allow: <?php $urlopen = rplg_json_urlopen('https://graph.facebook.com/2/ratings');
27
+ echo ($urlopen && $urlopen->error) ? strlen($urlopen->error->message) > 0 : false; ?>
28
+
29
+ Plugin Version: <?php echo esc_html($version); ?>
30
+
31
+ Settings:
32
+ <?php foreach ($options as $opt) {
33
+ echo esc_html($opt.': '.get_option($opt)."\n");
34
+ }
35
+ ?>
36
+
37
+ Widgets: <?php $widget = get_option($widget_name); echo ($widget ? print_r($widget) : '')."\n"; ?>
38
+
39
+ Plugins:
40
+ <?php
41
+ foreach (get_plugins() as $key => $plugin) {
42
+ $isactive = "";
43
+ if (is_plugin_active($key)) {
44
+ $isactive = "(active)";
45
+ }
46
+ echo esc_html($plugin['Name'].' '.$plugin['Version'].' '.$isactive."\n");
47
+ }
48
+ }
49
+
50
+ }
51
+ ?>
languages/grw-ca.mo ADDED
Binary file
languages/grw-ca.po ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Language: ca\n"
4
+ "MIME-Version: 1.0\n"
5
+ "Content-Type: text/plain; charset=UTF-8\n"
6
+ "Content-Transfer-Encoding: 8bit\n"
7
+ "X-Generator: Poedit 1.8.11\n"
8
+ "Project-Id-Version: \n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: \n"
12
+ "Language-Team: \n"
13
+
14
+ msgid "Google Rating"
15
+ msgstr "Valoració a google"
16
+
17
+ msgid "See All Reviews"
18
+ msgstr "Mostra els comentaris"
19
+
20
+ msgid "Google User"
21
+ msgstr "Usuari de Google"
22
+
23
+ msgid "read more"
24
+ msgstr "Més"
25
+
26
+ msgid "Next Reviews"
27
+ msgstr "Següents"
28
+
29
+ msgid "Write a review"
30
+ msgstr "Escriu un comentari"
languages/grw-es_ES.mo ADDED
Binary file
languages/grw-es_ES.po ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Language: es_ES\n"
4
+ "MIME-Version: 1.0\n"
5
+ "Content-Type: text/plain; charset=UTF-8\n"
6
+ "Content-Transfer-Encoding: 8bit\n"
7
+ "X-Generator: Poedit 1.8.11\n"
8
+ "Project-Id-Version: \n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: \n"
12
+ "Language-Team: \n"
13
+
14
+ msgid "Google Rating"
15
+ msgstr "Valoración en google"
16
+
17
+ msgid "See All Reviews"
18
+ msgstr "Ver todos los comentarios"
19
+
20
+ msgid "Google User"
21
+ msgstr "Usuario de Google"
22
+
23
+ msgid "read more"
24
+ msgstr "leer más"
25
+
26
+ msgid "Next Reviews"
27
+ msgstr "Siguientes"
28
+
29
+ msgid "Write a review"
30
+ msgstr "Escribir un comentario"
languages/grw-tr_TR.mo ADDED
Binary file
languages/grw-tr_TR.po ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Language: tr_TR\n"
4
+ "MIME-Version: 1.0\n"
5
+ "Content-Type: text/plain; charset=UTF-8\n"
6
+ "Content-Transfer-Encoding: 8bit\n"
7
+ "X-Generator: Poedit 1.8.11\n"
8
+ "Project-Id-Version: \n"
9
+ "POT-Creation-Date: \n"
10
+ "PO-Revision-Date: \n"
11
+ "Last-Translator: \n"
12
+ "Language-Team: \n"
13
+
14
+ msgid "Google Rating"
15
+ msgstr "Google Değerlendirme Notu"
16
+
17
+ msgid "See All Reviews"
18
+ msgstr "Tüm Değerlendirmeleri Oku"
19
+
20
+ msgid "Google User"
21
+ msgstr "Google Kullanıcısı"
22
+
23
+ msgid "read more"
24
+ msgstr "Devamını Oku"
25
+
26
+ msgid "Next Reviews"
27
+ msgstr "Diğer Değerlendirmeler"
28
+
29
+ msgid "Write a review"
30
+ msgstr "Değerlendirme Yap"
readme.txt CHANGED
@@ -1,103 +1,124 @@
1
- === Google Reviews Widget ===
2
- Contributors: richplugins
3
- Donate link: https://richplugins.com/
4
- Tags: google, google reviews, google business reviews, google place review, Google Places, google places reviews, google review widget, google review, google map reviews, map reviews, review, reviews, google reviews widget, google plus reviews, g+ reviews, comment, comments, sidebar, widget, widgetpack, richplugins, facebook, facebook reviews, facebook business reviews, google reviews pro
5
- Requires at least: 2.8
6
- Tested up to: 4.7
7
- Stable tag: 1.5
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- Google Reviews Widget show Google Places Reviews on your WordPress website to increase user confidence and SEO.
12
-
13
- == Description ==
14
-
15
- > > To get more unique features we have <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin">Pro and Business version</a> plugin
16
-
17
- This plugin display Google Business Reviews on your websites in sidebar widget. A unique feature of the plugin is that it save all reviews in WordPress database and have no depend on any services like Google to show these reviews.
18
-
19
- [youtube https://www.youtube.com/watch?v=YccWFCkz6H4]
20
-
21
- [Online demo](http://demo.richplugins.com/)
22
-
23
- = Plugin Features =
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
- * Work without Google Places API key
31
- * Easy search of place and instantly show reviews
32
- * Themes: review list and fixed badge rating box
33
- * Support dark websites
34
- * Zero load time regardless of your site
35
- * Works even if Google is unavailable
36
-
37
- = Get More Features with Google Reviews Pro! =
38
-
39
- [Upgrade to Google Reviews Pro](https://richplugins.com/google-reviews-pro-wordpress-plugin)
40
-
41
- * Auto-download new Google reviews daily
42
- * Collect and display more than 5 Google reviews
43
- * Supports Google Rich Snippets (schema.org)
44
- * 'Write a review' button to available leave Google review directly on your website
45
- * Grid theme to show G+ reviews in testimonials section
46
- * Trim long reviews and add "read more" link
47
- * Powerful <b>Shortcode Builder</b>
48
- * Moderation panel, delete any reviews
49
- * Change business place photo
50
- * Minimum review rating filter
51
- * Pagination, Sorting (by default, recent, oldest, highest score, lowest score)
52
- * Disable profile G+ links, nofollow, target="_blank"
53
- * Priority support
54
-
55
- == Installation ==
56
-
57
- 1. Unpack archive to this archive to the 'wp-content/plugins/' directory inside of WordPress
58
- 2. Activate the plugin through the 'Plugins' menu in WordPress
59
-
60
- == Screenshots ==
61
-
62
- 1. Google Reviews widget
63
- 2. Google Reviews badge
64
- 3. Google Reviews sidebar
65
-
66
- == Changelog ==
67
-
68
- = 1.5 =
69
- * Remove 'Live Support' tab from setting page
70
- * Added instruction and video how to get Google Places API Key
71
- * Added Dutch language (nl_NL)
72
-
73
- = 1.49 =
74
- * Bugfix: time-ago on English by default, update readme, added fr_FR locale
75
-
76
- = 1.48 =
77
- * Bugfix, update readme
78
-
79
- = 1.47 =
80
- * Added localization for German (de_DE)
81
-
82
- = 1.46 =
83
- * Bugfix: remove unused variable
84
-
85
- = 1.45 =
86
- * Bugfix: auto-updating existing place rating
87
-
88
- = 1.44 =
89
- * Update readme
90
-
91
- = 1.43 =
92
- * Bugfix, Added search by Google Place ID
93
-
94
- = 1.42 =
95
- * Bugfix: update path images in reviews helper
96
-
97
- = 1.4 =
98
- * Bugfix: update path images
99
-
100
- == Support ==
101
-
102
- * Email support support@richplugins.com
103
- * Live support https://richplugins.com/forum
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Google Reviews Widget ===
2
+ Contributors: richplugins
3
+ Donate link: https://richplugins.com/google-reviews-pro-wordpress-plugin
4
+ Tags: google, google reviews, google business reviews, google place review, Google Places, google places reviews, google review widget, google review, google map reviews, map reviews, review, reviews, google reviews widget, google plus reviews, g+ reviews, comment, comments, sidebar, widget, richplugins, facebook, facebook reviews, facebook page reviews, facebook business reviews, google reviews pro, yelp, yelp reviews, yelp business reviews
5
+ Requires at least: 2.8
6
+ Tested up to: 4.7
7
+ Stable tag: 1.5.2
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ Google Reviews Widget show Google Places Reviews on your WordPress website to increase user confidence and SEO.
12
+
13
+ == Description ==
14
+
15
+ > > To get more unique features we have <a href="https://richplugins.com/google-reviews-pro-wordpress-plugin">Pro and Business version</a> plugin
16
+
17
+ This plugin display Google Business Reviews on your websites in sidebar widget. A unique feature of the plugin is that it save all reviews in WordPress database and have no depend on any services like Google to show these reviews.
18
+
19
+ [youtube https://www.youtube.com/watch?v=YccWFCkz6H4]
20
+
21
+ [Online demo](http://demo.richplugins.com/)
22
+
23
+ = Plugin Features =
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
+ * Support dark websites
33
+ * Nofollow, target="_blank" links
34
+ * Zero load time regardless of your site
35
+ * Works even if Google is unavailable
36
+
37
+ = Get More Features with Google Reviews Pro! =
38
+
39
+ [Upgrade to Google Reviews Pro](https://richplugins.com/google-reviews-pro-wordpress-plugin)
40
+
41
+ * Trying to get more than 5 Google reviews
42
+ * Google Rich Snippets (schema.org)
43
+ * Support shortcode
44
+ * Powerful <b>Shortcode Builder</b>
45
+ * Grid theme to show G+ reviews in testimonials section
46
+ * Google Trust Badge (right/left fixed or inner)
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 =
58
+
59
+ Why limit your reviews to just Google Reviews? Check out our other free business reviews plugins to add to your site as well:
60
+
61
+ * [Facebook Reviews Pro](https://richplugins.com/facebook-reviews-pro-wordpress-plugin "Facebook Reviews Pro")
62
+ * [Yelp Reviews Pro](https://richplugins.com/yelp-reviews-pro-wordpress-plugin "Yelp Reviews Pro")
63
+
64
+ == Installation ==
65
+
66
+ 1. Unpack archive to this archive to the 'wp-content/plugins/' directory inside of WordPress
67
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
68
+
69
+ == Screenshots ==
70
+
71
+ 1. Google Reviews widget
72
+ 2. Google Reviews badge
73
+ 3. Google Reviews sidebar
74
+
75
+ == Changelog ==
76
+
77
+ = 1.5.2 =
78
+ * Full refactoring of widget code
79
+ * Bugfix: widget options check
80
+ * Bugfix: SSL unverify connection
81
+ * Bugfix: remove line breaks to prevent wrapped it by paragraph editor's plugins
82
+ * Added debug information
83
+
84
+ = 1.5.1 =
85
+ * Added Catalan language (ca)
86
+ * Added Spanish language (es_ES)
87
+ * Added Turkish language (tr_TR)
88
+
89
+ = 1.5 =
90
+ * Remove 'Live Support' tab from setting page
91
+ * Added instruction and video how to get Google Places API Key
92
+ * Added Dutch language (nl_NL)
93
+
94
+ = 1.49 =
95
+ * Bugfix: time-ago on English by default, update readme, added fr_FR locale
96
+
97
+ = 1.48 =
98
+ * Bugfix, update readme
99
+
100
+ = 1.47 =
101
+ * Added localization for German (de_DE)
102
+
103
+ = 1.46 =
104
+ * Bugfix: remove unused variable
105
+
106
+ = 1.45 =
107
+ * Bugfix: auto-updating existing place rating
108
+
109
+ = 1.44 =
110
+ * Update readme
111
+
112
+ = 1.43 =
113
+ * Bugfix, Added search by Google Place ID
114
+
115
+ = 1.42 =
116
+ * Bugfix: update path images in reviews helper
117
+
118
+ = 1.4 =
119
+ * Bugfix: update path images
120
+
121
+ == Support ==
122
+
123
+ * Email support support@richplugins.com
124
+ * Live support https://richplugins.com/forum
static/css/{grp-widget.css → google-review.css} RENAMED
@@ -1 +1 @@
1
- .wpac,.wpac h1,.wpac h2,.wpac h3,.wpac h4,.wpac h5,.wpac h6,.wpac p,.wpac td,.wpac dl,.wpac tr,.wpac dt,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac table,.wpac th,.wpac tbody,.wpac tfoot,.wpac caption,.wpac thead,.wpac ul,.wpac li,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac li,.wpac strong,.wpac legend,.wpac em,.wpac s,.wpac cite,.wpac span,.wpac input,.wpac sup,.wpac label,.wpac dfn,.wpac object,.wpac big,.wpac q,.wpac font,.wpac samp,.wpac acronym,.wpac small,.wpac img,.wpac strike,.wpac code,.wpac sub,.wpac ins,.wpac textarea,.wpac var,.wpac a,.wpac abbr,.wpac applet,.wpac del,.wpac kbd,.wpac tt,.wpac b,.wpac i,.wpac hr{background-attachment:scroll!important;background-color:transparent!important;background-image:none!important;background-position:0 0!important;background-repeat:repeat!important;border-color:black!important;border-color:currentColor!important;border-radius:0!important;border-style:none!important;border-width:medium!important;bottom:auto!important;clear:none!important;clip:auto!important;color:inherit!important;counter-increment:none!important;counter-reset:none!important;cursor:auto!important;direction:inherit!important;display:inline;float:none!important;font-family:inherit!important;font-size:inherit!important;font-style:inherit!important;font-variant:normal!important;font-weight:inherit!important;height:auto;left:auto!important;letter-spacing:normal!important;line-height:inherit!important;list-style-type:inherit!important;list-style-position:outside!important;list-style-image:none!important;margin:0!important;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:1;outline:invert none medium!important;overflow:visible!important;padding:0!important;position:static!important;quotes:"" ""!important;right:auto!important;table-layout:auto!important;text-align:inherit!important;text-decoration:inherit!important;text-indent:0!important;text-transform:none!important;top:auto!important;unicode-bidi:normal!important;vertical-align:baseline!important;visibility:inherit!important;white-space:normal!important;width:auto!important;word-spacing:normal!important;z-index:auto!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;box-sizing:border-box!important;text-shadow:none!important;-webkit-transition:none!important;transition:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.wpac,.wpac h3,.wpac h5,.wpac p,.wpac h1,.wpac dl,.wpac dt,.wpac h6,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac h2,.wpac caption,.wpac h4,.wpac ul,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac textarea,.wpac hr{display:block}.wpac table{display:table}.wpac tbody{display:table-row-group}.wpac tr{display:table-row}.wpac td{display:table-cell}.wpac ul{list-style-type:none!important}.wpac li{display:list-item;min-height:auto!important;min-width:auto!important}.wpac a,.wpac a *,.wpac input[type=submit],.wpac input[type=radio],.wpac input[type=checkbox],.wpac select{cursor:pointer!important}.wpac a:hover{text-decoration:none!important}.wpac button,.wpac input[type=submit]{height:auto!important;text-align:center!important}.wpac input[type=hidden]{display:none}.wpac select{-webkit-appearance:menulist!important;-moz-appearance:menulist!important;appearance:menulist!important}.wpac input[type=checkbox]{-webkit-appearance:checkbox!important;-moz-appearance:checkbox!important;appearance:checkbox!important}.wpac input[type="checkbox"]:before,.wpac input[type="checkbox"]:after{content:none!important;border:0!important}.wpac input[type=radio]{-webkit-appearance:radio!important;-moz-appearance:radio!important;appearance:radio!important}.wpac input[type="radio"]:before,.wpac input[type="radio"]:after{content:none!important;border:0!important}.wpac li:before,.wpac li:after{content:""!important}.wpac input,.wpac select{vertical-align:middle!important}.wpac select,.wpac textarea,.wpac input{border:1px solid #ccc!important}.wpac table{border-collapse:collapse!important;border-spacing:0!important}.wpac *[dir=rtl]{direction:rtl!important}.wpac img{border:0!important}.wpac svg{vertical-align:middle!important;-moz-box-sizing:content-box!important;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}.wpac{font-size:14px!important;line-height:20px!important;direction:ltr!important;text-align:left!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important;color:#333!important;font-style:normal!important;font-weight:normal!important;text-decoration:none!important;list-style-type:disc!important}.wpac .wp-sheet{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:1999999000!important;transition:all .2s ease-in-out!important}@media(max-width:460px){.wpac .wp-sheet{width:100%!important}}.wpac .wp-sheet-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:48px!important;background:#fff!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:1999999002!important}.wpac .wp-sheet-head-inner{position:absolute!important;left:20px!important;top:0!important;width:100%!important;height:100%!important;line-height:48px!important;z-index:1999999000!important}.wpac .wp-sheet-head-close{position:relative!important;height:49px!important;float:right!important;color:#aaa!important;font-size:28px!important;line-height:48px!important;margin:0 20px 0 15px!important;z-index:1999999001!important;transition:all .2s ease-in-out!important}.wpac .wp-sheet-head-close:hover{color:#555!important}.wpac .wp-sheet-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:1999999000!important}.wpac .wp-sheet-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;opacity:0!important;overflow-y:auto!important;z-index:1999999001!important;transition:all .2s ease-in-out!important;-webkit-transform:translateZ(0)!important}.wpac .wp-sheet-content.wp-sheet-ready{opacity:1.0!important}.wpac .wp-sheet-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wpac .wp-sheet-footer{position:absolute!important;bottom:0!important;right:0!important;left:1px!important;width:100%!important;z-index:1999999002!important;background:rgba(250,250,251,.98)!important}.wp-gr .wp-google-badge{display:inline-block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important}.wp-gr .wp-google-badge-fixed{position:fixed!important;right:30px!important;bottom:30px!important;max-width:none!important;z-index:2147482999!important}.wp-gr .wp-google-badge *{cursor:pointer!important}.wp-gr .wp-google-border{width:100%!important;height:6px!important;background:#4fce6a!important}.wp-gr .wp-google-badge-btn{position:relative!important;padding:6px 6px 2px 6px!important;background:#fff!important;transition:all .2s ease-in-out!important}.wp-gr .wp-google-badge-btn:hover{background:#f3f3f5!important}.wp-gr .wp-google-logo{position:absolute!important;top:10px!important}.wp-gr .wp-google-badge-score{margin:0 0 4px 46px!important}.wp-gr .wp-google-rating{color:#e7711b!important;font-size:20px!important;margin:0 6px 0 0!important;vertical-align:middle!important}.wp-gr .wp-google-stars .wp-star{padding:0 4px 0 0!important;line-height:22px!important}.wp-gr .wp-google-powered{margin:6px 0 0!important}.wp-gr .wp-google-form .wp-google-reviews{padding:16px 16px 0!important}.wp-gr .wp-google-review{margin-top:15px!important}.wp-gr .wp-google-left{display:table-cell!important;padding-right:10px!important;vertical-align:top!important}.wp-gr .wp-google-left img{border:none!important;float:left!important;height:50px!important;width:50px!important;margin-right:5px!important;border-radius:50%!important}.wp-gr .wp-google-reviews img{border-radius:50%!important}.wp-gr .wp-google-right{display:table-cell!important;vertical-align:top!important;width:10000px!important}.wp-gr .wp-google-place .wp-star svg{width:18px!important;height:18px!important}.wp-gr .wp-google-review .wp-star svg{width:16px!important;height:16px!important}.wp-gr .wp-google-name{color:black!important;font-size:100%!important;font-weight:bold!important;margin:0 0 2px!important;padding-right:6px!important;text-decoration:none!important}.wp-gr a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr .wp-google-time{color:#999!important;font-size:13px!important}.wp-gr .wp-google-text{color:#222!important;font-size:13px!important;line-height:18px!important;max-width:100%!important;overflow:hidden!important;white-space:pre-wrap!important}.wp-gr .wp-google-text .wp-google-stars{padding-right:7px!important}.wp-gr .wp-more{display:none}.wp-gr .wp-more-toggle{color:#136aaf!important;cursor:pointer!important;text-decoration:underline!important}.wp-gr .wp-google-url{display:block;margin:10px 0!important;color:#2c7cff!important;text-align:center!important}.wp-gr .wp-google-form{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:2147483000!important}@media(max-width:460px){.wp-gr .wp-google-form{width:100%!important}}.wp-gr .wp-google-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:80px!important;background:#fff!important;padding:10px 16px!important;overflow:hidden!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:2147483002!important}.wp-gr .wp-google-head-inner{z-index:2147483000!important;position:absolute!important;left:20px!important;top:20px!important;width:100%!important;height:100%!important;pointer-events:none!important}.wp-gr .wp-google-close{padding:0!important;cursor:pointer!important;outline:0!important;border:0!important;background:0 0!important;min-height:0!important;width:auto!important;float:right!important;font-size:32px!important;font-weight:500!important;line-height:.6!important;color:#999!important;-webkit-appearance:none!important}.wp-gr .wp-google-close:hover{color:#555!important}.wp-gr .wp-google-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:2147483000!important}.wp-gr .wp-google-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;overflow-y:auto!important;z-index:2147483001!important;-webkit-transform:translateZ(0)!important}.wp-gr .wp-google-content{top:80px!important;bottom:48px!important}.wp-gr .wp-google-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wp-gr .wp-google-footer{position:absolute!important;bottom:0!important;right:0!important;width:100%!important;height:48px!important;text-align:center!important;z-index:2147483002!important;background:#fff!important;box-shadow:0 -1px 2px 0 rgba(0,0,0,.06)!important;-moz-text-align-last:center!important;text-align-last:center!important}.wp-gr .wp-google-footer img{float:right!important;padding:16px!important}.wp-gr .wp-dark .wp-google-name{color:#eee!important}.wp-gr .wp-dark .wp-google-time{color:#bbb!important}.wp-gr .wp-dark .wp-google-text{color:#ececec!important}.wp-gr.wpac .wp-google-name{font-size:100%!important}.wp-gr.wpac .wp-google-hide{display:none}.wp-gr.wpac .wp-google-name a{color:#333!important;font-size:100%!important;text-decoration:none!important}.wp-gr.wpac .wp-google-left img{width:50px!important;height:50px!important;border-radius:50%!important}.wp-gr.wpac a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr.wpac .wp-google-place .wp-star svg{width:18px;height:18px}.wp-gr.wpac .wp-google-review .wp-google-stars{display:inline-block;margin-right:4px!important}.wp-gr.wpac .wp-google-stars .wp-star{padding:0!important;line-height:normal!important}.wp-gr.wpac .wp-google-review .wp-star svg{width:16px;height:16px}.wp-gr.wpac .wp-dark .wp-google-name a{color:#eee!important}
1
+ .wpac,.wpac h1,.wpac h2,.wpac h3,.wpac h4,.wpac h5,.wpac h6,.wpac p,.wpac td,.wpac dl,.wpac tr,.wpac dt,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac table,.wpac th,.wpac tbody,.wpac tfoot,.wpac caption,.wpac thead,.wpac ul,.wpac li,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac li,.wpac strong,.wpac legend,.wpac em,.wpac s,.wpac cite,.wpac span,.wpac input,.wpac sup,.wpac label,.wpac dfn,.wpac object,.wpac big,.wpac q,.wpac font,.wpac samp,.wpac acronym,.wpac small,.wpac img,.wpac strike,.wpac code,.wpac sub,.wpac ins,.wpac textarea,.wpac var,.wpac a,.wpac abbr,.wpac applet,.wpac del,.wpac kbd,.wpac tt,.wpac b,.wpac i,.wpac hr{background-attachment:scroll!important;background-color:transparent!important;background-image:none!important;background-position:0 0!important;background-repeat:repeat!important;border-color:black!important;border-color:currentColor!important;border-radius:0!important;border-style:none!important;border-width:medium!important;bottom:auto!important;clear:none!important;clip:auto!important;color:inherit!important;counter-increment:none!important;counter-reset:none!important;cursor:auto!important;direction:inherit!important;display:inline;float:none!important;font-family:inherit!important;font-size:inherit!important;font-style:inherit!important;font-variant:normal!important;font-weight:inherit!important;height:auto;left:auto!important;letter-spacing:normal!important;line-height:inherit!important;list-style-type:inherit!important;list-style-position:outside!important;list-style-image:none!important;margin:0!important;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:1;outline:invert none medium!important;overflow:visible!important;padding:0!important;position:static!important;quotes:"" ""!important;right:auto!important;table-layout:auto!important;text-align:inherit!important;text-decoration:inherit!important;text-indent:0!important;text-transform:none!important;top:auto!important;unicode-bidi:normal!important;vertical-align:baseline!important;visibility:inherit!important;white-space:normal!important;width:auto!important;word-spacing:normal!important;z-index:auto!important;-moz-border-radius:0!important;-webkit-border-radius:0!important;-moz-box-sizing:border-box!important;-webkit-box-sizing:border-box!important;box-sizing:border-box!important;text-shadow:none!important;-webkit-transition:none!important;transition:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.wpac,.wpac h3,.wpac h5,.wpac p,.wpac h1,.wpac dl,.wpac dt,.wpac h6,.wpac ol,.wpac form,.wpac select,.wpac option,.wpac pre,.wpac div,.wpac h2,.wpac caption,.wpac h4,.wpac ul,.wpac address,.wpac blockquote,.wpac dd,.wpac fieldset,.wpac textarea,.wpac hr{display:block}.wpac table{display:table}.wpac tbody{display:table-row-group}.wpac tr{display:table-row}.wpac td{display:table-cell}.wpac ul{list-style-type:none!important}.wpac li{display:list-item;min-height:auto!important;min-width:auto!important}.wpac a,.wpac a *,.wpac input[type=submit],.wpac input[type=radio],.wpac input[type=checkbox],.wpac select{cursor:pointer!important}.wpac a:hover{text-decoration:none!important}.wpac button,.wpac input[type=submit]{height:auto!important;text-align:center!important}.wpac input[type=hidden]{display:none}.wpac select{-webkit-appearance:menulist!important;-moz-appearance:menulist!important;appearance:menulist!important}.wpac input[type=checkbox]{-webkit-appearance:checkbox!important;-moz-appearance:checkbox!important;appearance:checkbox!important}.wpac input[type="checkbox"]:before,.wpac input[type="checkbox"]:after{content:none!important;border:0!important}.wpac input[type=radio]{-webkit-appearance:radio!important;-moz-appearance:radio!important;appearance:radio!important}.wpac input[type="radio"]:before,.wpac input[type="radio"]:after{content:none!important;border:0!important}.wpac li:before,.wpac li:after{content:""!important}.wpac input,.wpac select{vertical-align:middle!important}.wpac select,.wpac textarea,.wpac input{border:1px solid #ccc!important}.wpac table{border-collapse:collapse!important;border-spacing:0!important}.wpac *[dir=rtl]{direction:rtl!important}.wpac img{border:0!important}.wpac svg{vertical-align:middle!important;-moz-box-sizing:content-box!important;-webkit-box-sizing:content-box!important;box-sizing:content-box!important}.wpac{font-size:14px!important;line-height:20px!important;direction:ltr!important;text-align:left!important;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif!important;color:#333!important;font-style:normal!important;font-weight:normal!important;text-decoration:none!important;list-style-type:disc!important}.wpac .wp-sheet{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:1999999000!important;transition:all .2s ease-in-out!important}@media(max-width:460px){.wpac .wp-sheet{width:100%!important}}.wpac .wp-sheet-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:48px!important;background:#fff!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:1999999002!important}.wpac .wp-sheet-head-inner{position:absolute!important;left:20px!important;top:0!important;width:100%!important;height:100%!important;line-height:48px!important;z-index:1999999000!important}.wpac .wp-sheet-head-close{position:relative!important;height:49px!important;float:right!important;color:#aaa!important;font-size:28px!important;line-height:48px!important;margin:0 20px 0 15px!important;z-index:1999999001!important;transition:all .2s ease-in-out!important}.wpac .wp-sheet-head-close:hover{color:#555!important}.wpac .wp-sheet-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:1999999000!important}.wpac .wp-sheet-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;opacity:0!important;overflow-y:auto!important;z-index:1999999001!important;transition:all .2s ease-in-out!important;-webkit-transform:translateZ(0)!important}.wpac .wp-sheet-content.wp-sheet-ready{opacity:1.0!important}.wpac .wp-sheet-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wpac .wp-sheet-footer{position:absolute!important;bottom:0!important;right:0!important;left:1px!important;width:100%!important;z-index:1999999002!important;background:rgba(250,250,251,.98)!important}.wp-gr .wp-google-badge{display:inline-block;font-family:Helvetica Neue,Helvetica,Arial,sans-serif!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important;}.wp-gr .wp-google-badge-fixed{position:fixed!important;right:30px!important;bottom:30px!important;max-width:none!important;z-index:2147482999!important;box-shadow:0 2px 5px 0 rgba(0,0,0,.26)!important;}.wp-gr .wp-google-badge *{cursor:pointer!important}.wp-gr .wp-google-border{width:100%!important;height:6px!important;background:#4fce6a!important;border-radius:2px 2px 0 0!important;}.wp-gr .wp-google-badge-btn{position:relative!important;padding:10px!important;background:#fff!important;transition:all .2s ease-in-out!important;border-radius:2px!important;}.wp-gr .wp-google-badge-btn:hover{background:#f3f3f5!important}.wp-gr .wp-google-logo{position:absolute!important;top:10px!important}.wp-gr .wp-google-badge-score{display:inline-block;margin:0 0 0 4px!important;vertical-align:middle!important;}.wp-gr .wp-google-rating{color:#e7711b!important;font-size:20px!important;margin:0 6px 0 0!important;vertical-align:middle!important}.wp-gr .wp-google-stars .wp-star{padding:0 4px 0 0!important;line-height:22px!important}.wp-gr .wp-google-powered{margin:6px 0 0!important}.wp-gr .wp-google-form .wp-google-reviews{padding:16px 16px 0!important}.wp-gr .wp-google-review{margin-top:15px!important}.wp-gr .wp-google-left{display:table-cell!important;padding-right:10px!important;vertical-align:top!important}.wp-gr .wp-google-left img{border:none!important;float:left!important;height:50px!important;width:50px!important;margin-right:5px!important;border-radius:50%!important}.wp-gr .wp-google-reviews img{border-radius:50%!important}.wp-gr .wp-google-right{display:table-cell!important;vertical-align:top!important;width:10000px!important}.wp-gr .wp-google-place .wp-star svg{width:18px!important;height:18px!important}.wp-gr .wp-google-review .wp-star svg{width:16px!important;height:16px!important}.wp-gr .wp-google-name{color:black!important;font-size:100%!important;font-weight:bold!important;margin:0 0 2px!important;padding-right:6px!important;text-decoration:none!important}.wp-gr a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr .wp-google-time{color:#999!important;font-size:13px!important}.wp-gr .wp-google-text{color:#222!important;font-size:13px!important;line-height:18px!important;max-width:100%!important;overflow:hidden!important;white-space:pre-wrap!important}.wp-gr .wp-google-text .wp-google-stars{padding-right:7px!important}.wp-gr .wp-more{display:none}.wp-gr .wp-more-toggle{color:#136aaf!important;cursor:pointer!important;text-decoration:underline!important}.wp-gr .wp-google-url{display:block;margin:10px 0!important;color:#2c7cff!important;text-align:center!important}.wp-gr .wp-google-form{position:fixed!important;bottom:0!important;right:0!important;height:100%!important;width:368px!important;z-index:2147483000!important}@media(max-width:460px){.wp-gr .wp-google-form{width:100%!important}}.wp-gr .wp-google-head{position:absolute!important;top:0!important;right:0!important;width:100%!important;height:80px!important;background:#fff!important;padding:10px 16px!important;overflow:hidden!important;box-shadow:0 1px 2px 0 rgba(0,0,0,.12)!important;z-index:2147483002!important}.wp-gr .wp-google-head-inner{z-index:2147483000!important;position:absolute!important;left:20px!important;top:20px!important;width:100%!important;height:100%!important;pointer-events:none!important}.wp-gr .wp-google-close{padding:0!important;cursor:pointer!important;outline:0!important;border:0!important;background:0 0!important;min-height:0!important;width:auto!important;float:right!important;font-size:32px!important;font-weight:500!important;line-height:.6!important;color:#999!important;-webkit-appearance:none!important}.wp-gr .wp-google-close:hover{color:#555!important}.wp-gr .wp-google-body{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;background:rgba(250,250,251,.98)!important;border-left:1px solid #dadee2!important;box-shadow:0 0 4px 1px rgba(0,0,0,.08)!important;z-index:2147483000!important}.wp-gr .wp-google-content{position:absolute!important;top:0!important;right:0!important;bottom:0!important;width:100%!important;overflow-y:auto!important;z-index:2147483001!important;-webkit-transform:translateZ(0)!important}.wp-gr .wp-google-content{top:80px!important;bottom:48px!important}.wp-gr .wp-google-content-inner{position:relative!important;min-height:100%!important;margin:0 auto!important}.wp-gr .wp-google-footer{position:absolute!important;bottom:0!important;right:0!important;width:100%!important;height:48px!important;text-align:center!important;z-index:2147483002!important;background:#fff!important;box-shadow:0 -1px 2px 0 rgba(0,0,0,.06)!important;-moz-text-align-last:center!important;text-align-last:center!important}.wp-gr .wp-google-footer img{float:right!important;padding:16px!important}.wp-gr .wp-dark .wp-google-name{color:#eee!important}.wp-gr .wp-dark .wp-google-time{color:#bbb!important}.wp-gr .wp-dark .wp-google-text{color:#ececec!important}.wp-gr.wpac .wp-google-name{font-size:100%!important}.wp-gr.wpac .wp-google-hide{display:none}.wp-gr.wpac .wp-google-name a{color:#333!important;font-size:100%!important;text-decoration:none!important}.wp-gr.wpac .wp-google-left img{width:50px!important;height:50px!important;border-radius:50%!important}.wp-gr.wpac a.wp-google-name{color:#427fed!important;text-decoration:none!important}.wp-gr.wpac .wp-google-place .wp-star svg{width:18px;height:18px}.wp-gr.wpac .wp-google-review .wp-google-stars{display:inline-block;margin-right:4px!important}.wp-gr.wpac .wp-google-review .wp-star svg{width:16px;height:16px}.wp-gr.wpac .wp-dark .wp-google-name a{color:#eee!important}.wp-gr .wp-google-richsnippet{color:#999!important;font-size:12px!important;line-height:16px!important;margin-top:6px!important;border-top:1px solid #eee!important;padding-top:4px!important;}
static/css/grp-place-widget.css DELETED
@@ -1,287 +0,0 @@
1
- .wp-gri .wp-grating {
2
- color: #e7711b;
3
- font-size: 20px;
4
- margin: 0 6px 0 0;
5
- }
6
-
7
- .wp-gri .wp-step {
8
- display: inline-block;
9
- width: 30px;
10
- padding: 2px;
11
- margin: 0 6px 0 0;
12
- text-align: center;
13
- background: #ffe045;
14
- border-radius: 50%;
15
- }
16
-
17
- .wp-gri .wp-places .wp-place-info {
18
- margin: 0 -20px;
19
- padding: 7px 20px 7px;
20
- cursor: pointer;
21
- }
22
-
23
- .wp-gri .wp-places .wp-place-info:hover {
24
- background-color: #fafafa;
25
- }
26
-
27
- .wp-gri .wp-places .wp-place-info.wp-active {
28
- background-color: #eee;
29
- }
30
-
31
- .wp-gri .wp-place-info img {
32
- border: none;
33
- float: left;
34
- height: 40px;
35
- margin-right: 5px;
36
- width: 40px;
37
- }
38
-
39
- .wp-gri .wp-reviews .wp-place-info img {
40
- border-radius: 50%;
41
- }
42
-
43
- .wp-gri .wp-place-info .media-heading {
44
- margin: 0;
45
- padding-right: 6px;
46
- font-size: 13px;
47
- font-weight: bold;
48
- }
49
-
50
- .wp-gri .wp-place-info .media-heading a {
51
- color: black;
52
- text-decoration: none;
53
- }
54
-
55
- .wp-gri .wp-place-info .wp-gtime {
56
- color: #999;
57
- font-size: 13px;
58
- text-decoration: none;
59
- }
60
-
61
- .wp-gri .wp-place-info .wp-star {
62
- line-height: 16px !important;
63
- }
64
-
65
- .wp-gri .wp-place-info .wp-gtext {
66
- color: #222;
67
- font-size: 13px;
68
- line-height: 18px;
69
- max-width: 100%;
70
- overflow: hidden;
71
- white-space: pre-wrap;
72
- }
73
-
74
- .wp-gri .wp-place-info .wp-gstars {
75
- padding-right: 7px;
76
- }
77
-
78
- .wp-gri .wp-glogo {
79
- text-align: right;
80
- }
81
-
82
- .wp-gri select.form-control {
83
- box-shadow: inset 0 -1px 0 #ddd !important;
84
- }
85
-
86
- .wp-gri .wp-more {
87
- display: none;
88
- }
89
-
90
- .wp-gri .wp-more-toggle {
91
- color: #136aaf !important;
92
- cursor: pointer !important;
93
- text-decoration: underline !important;
94
- }
95
-
96
- .wp-gri .has-error small {
97
- color: #e51c23;
98
- }
99
-
100
- /*-------------------------------- sidebar widget --------------------------------*/
101
- .widget-content input[type="text"],
102
- .widget-content select,
103
- .widget-content button {
104
- border-spacing: 0;
105
- width: 100%;
106
- clear: both;
107
- }
108
-
109
- .widget-content .form-group {
110
- margin: 10px 0 0;
111
- }
112
-
113
- .widget-content .form-group label {
114
- vertical-align: baseline;
115
- }
116
-
117
- .widget-content .form-group img {
118
- vertical-align: middle;
119
- }
120
-
121
- .widget-content .wp-gri .has-error {
122
- color: #e61010;
123
- }
124
-
125
- .widget-content .wp-gri .has-error input {
126
- border: 1px solid #e61010;
127
- }
128
-
129
- .widget-content .wp-gri .wp-step {
130
- width: 20px;
131
- line-height: 20px;
132
- }
133
-
134
- .widget-content .wp-gri button {
135
- cursor: pointer;
136
- }
137
-
138
- .widget-content .wp-gri h4 {
139
- margin: 20px 0 10px;
140
- }
141
-
142
- .wp-places,
143
- .wp-reviews {
144
- max-height: 200px;
145
- overflow: auto;
146
- border: 1px solid #f3f3f3;
147
- }
148
-
149
- .wp-gri .wp-place-info {
150
- margin: 0 !important;
151
- padding: 6px !important;
152
- }
153
-
154
- .wp-place-info img {
155
- width: 20px !important;
156
- height: 20px !important;
157
- }
158
-
159
- .wp-place-info .media-body {
160
- overflow: hidden;
161
- }
162
-
163
- .wp-place-info .media-heading {
164
- font-size: 12px;
165
- }
166
-
167
- .wp-place-info .wp-grating {
168
- font-size: 12px;
169
- font-weight: 700;
170
- }
171
-
172
- .wp-place-info svg {
173
- width: 12px;
174
- height: 12px;
175
- }
176
-
177
- .wp-place-info small {
178
- display: block;
179
- font-size: 11px;
180
- overflow: hidden;
181
- white-space: nowrap;
182
- text-overflow: ellipsis;
183
- }
184
-
185
- .wp-gr {
186
- margin-top: 15px !important;
187
- }
188
-
189
- .widget-control-actions {
190
- position: relative;
191
- }
192
-
193
- .grp-tooltip {
194
- position: absolute;
195
- top: 44px;
196
- right: 0;
197
- width: 100%;
198
- color: #333;
199
- outline: none;
200
- border: 1px solid #ccc;
201
- border-color: rgba(0,0,0,.2);
202
- -webkit-border-radius: 2px;
203
- border-radius: 2px;
204
- opacity: 0;
205
- z-index: 99999;
206
- background: #ffe045;
207
- box-shadow: 0 2px 10px rgba(0,0,0,.2);
208
- transition: all .5s ease-in-out;
209
- }
210
-
211
- .grp-tooltip.grp-tooltip-visible {
212
- opacity: 1;
213
- }
214
-
215
- .grp-tooltip .grp-corn1 {
216
- position: absolute;
217
- top: -9px;
218
- right: 16px;
219
- height: 0;
220
- width: 0;
221
- z-index: 1;
222
- border-color: transparent;
223
- border-style: dashed dashed solid;
224
- border-width: 0 8.5px 8.5px;
225
- border-bottom-color: #ccc;
226
- border-bottom-color: rgba(0,0,0,.2);
227
- }
228
-
229
- .grp-tooltip .grp-corn2 {
230
- position: absolute;
231
- top: -8px;
232
- right: 16px;
233
- height: 0;
234
- width: 0;
235
- z-index: 1;
236
- border-color: transparent;
237
- border-bottom-color: #ffe045;
238
- border-style: dashed dashed solid;
239
- border-width: 0 8.5px 8.5px;
240
- }
241
-
242
- .grp-tooltip .grp-text {
243
- padding: 10px;
244
- }
245
-
246
- .grp-tooltip .grp-close {
247
- position: absolute;
248
- top: 6px;
249
- right: 6px;
250
- color: #777;
251
- padding: 2px;
252
- font-size: 22px;
253
- cursor: pointer;
254
- }
255
-
256
- .grp-tooltip .grp-close:hover {
257
- color: #444;
258
- }
259
-
260
- .grp-options-toggle {
261
- padding: 10px;
262
- margin: 10px 0 0;
263
- cursor: pointer;
264
- border: 1px solid #dbdbdb;
265
- background: #eee url('../img/button-down-black.svg') no-repeat right;
266
- }
267
-
268
- .grp-options {
269
- padding: 0px 4px;
270
- }
271
-
272
- .wpgrev-disabled label,
273
- .wpgrev-disabled small {
274
- opacity: .7;
275
- }
276
-
277
- .wpgrev-pro {
278
- color: #fff;
279
- padding: 6px;
280
- border-radius: 3px;
281
- background: #00bf54;
282
- }
283
-
284
- .wpgrev-pro a {
285
- color: #fff;
286
- text-decoration: underline;
287
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
static/css/{grp-setting.css → grw-setting.css} RENAMED
@@ -1,184 +1,184 @@
1
- #wpcontent {
2
- font-size: 14px;
3
- background-color:#fafafa;
4
- }
5
-
6
- a:hover {
7
- text-decoration: none;
8
- }
9
-
10
- .form {
11
- padding: 20px;
12
- background-color: #fff;
13
- box-shadow: 0 1px 3px rgba(0,0,0,0.12);
14
- }
15
-
16
- .form400 {
17
- margin: 0 auto;
18
- max-width: 400px;
19
- }
20
-
21
- .grp-setting {
22
- position: relative;
23
- margin: 20px 0 0;
24
- }
25
-
26
- .nav-tabs {
27
- margin: 13px 0 0;
28
- }
29
-
30
- .version {
31
- position: absolute;
32
- top: 6px;
33
- right: 16px;
34
- -webkit-border-radius: 3px;
35
- -moz-border-radius: 3px;
36
- border-radius: 3px;
37
- display: inline-block;
38
- margin: 20px 0 0;
39
- padding: 6px 10px;
40
- font-size: 12px;
41
- line-height: 14px;
42
- color: #FFF;
43
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
44
- white-space: nowrap;
45
- vertical-align: baseline;
46
- background-color: #999;
47
- }
48
-
49
- .twitter > iframe {
50
- vertical-align: bottom !important;
51
- }
52
-
53
- .googleplus > div {
54
- vertical-align: bottom !important;
55
- }
56
-
57
- #grp-shortcode,
58
- #grp-mod-shortcode {
59
- width: 100%;
60
- overflow: auto;
61
- border: 0;
62
- outline: 0;
63
- min-height: 184px;
64
- padding: 0;
65
- color: #555;
66
- font-size: 13px;
67
- resize: none;
68
- background-color: #fff;
69
- box-shadow: none !important;
70
- }
71
-
72
- .bs-sidebar.affix {
73
- position: static
74
- }
75
-
76
- @media (min-width: 768px) {
77
- .bs-sidebar {
78
- padding-left:20px
79
- }
80
- }
81
-
82
- .bs-sidenav {
83
- margin-top: 20px;
84
- margin-bottom: 20px
85
- }
86
-
87
- .bs-sidebar .nav>li>a {
88
- display: block;
89
- padding: 4px 20px;
90
- font-size: 13px;
91
- color: #767676
92
- }
93
-
94
- .bs-sidebar .nav>.active:focus>a,.bs-sidebar .nav>.active:hover>a,.bs-sidebar .nav>.active>a {
95
- padding-left: 18px;
96
- font-weight: 500;
97
- color: #563d7c;
98
- background-color: transparent;
99
- border-left: 2px solid #563d7c
100
- }
101
-
102
- .bs-sidebar .nav .nav {
103
- padding-bottom: 10px
104
- }
105
-
106
- .bs-sidebar .nav .nav>li>a {
107
- padding-top: 1px;
108
- padding-bottom: 1px;
109
- padding-left: 30px;
110
- font-size: 12px;
111
- }
112
-
113
- .bs-sidebar .nav .nav>li>a:focus,.bs-sidebar .nav .nav>li>a:hover {
114
- padding-left: 29px
115
- }
116
-
117
- .bs-sidebar .nav .nav>.active:focus>a,.bs-sidebar .nav .nav>.active:hover>a,.bs-sidebar .nav .nav>.active>a {
118
- padding-left: 28px;
119
- font-weight: 500
120
- }
121
-
122
- @media (min-width: 992px) {
123
- .bs-sidebar .nav>.active>ul {
124
- display:block
125
- }
126
-
127
- .bs-sidebar.affix,.bs-sidebar.affix-bottom {
128
- width: 213px
129
- }
130
-
131
- .bs-sidebar.affix {
132
- position: fixed;
133
- top: 20px
134
- }
135
-
136
- .bs-sidebar.affix-bottom {
137
- position: absolute
138
- }
139
-
140
- .bs-sidebar.affix .bs-sidenav,.bs-sidebar.affix-bottom .bs-sidenav {
141
- margin-top: 0;
142
- margin-bottom: 0
143
- }
144
- }
145
-
146
- @media (min-width: 1200px) {
147
- .bs-sidebar.affix,.bs-sidebar.affix-bottom {
148
- width:263px
149
- }
150
- }
151
-
152
- #doc h2, #doc h3, #doc h4, #doc h5 {
153
- padding-top: 40px;
154
- }
155
-
156
- #doc h4:first-child {
157
- padding-top: 0;
158
- }
159
-
160
- #setting input[type="text"] {
161
- height: 30px;
162
- width: 400px;
163
- box-shadow: none;
164
- padding: 4px;
165
- }
166
-
167
- input[type="checkbox"] {
168
- margin-right: 6px;
169
- vertical-align: baseline !important;
170
- }
171
-
172
- input[type="checkbox"]:checked:before {
173
- margin: 0 !important;
174
- }
175
-
176
- #mod .wp-places,
177
- #mod .wp-reviews {
178
- max-height: none;
179
- border: none;
180
- }
181
-
182
- #shortcode .form {
183
- min-height: 335px;
184
  }
1
+ #wpcontent {
2
+ font-size: 14px;
3
+ background-color:#fafafa;
4
+ }
5
+
6
+ a:hover {
7
+ text-decoration: none;
8
+ }
9
+
10
+ .form {
11
+ padding: 20px;
12
+ background-color: #fff;
13
+ box-shadow: 0 1px 3px rgba(0,0,0,0.12);
14
+ }
15
+
16
+ .form400 {
17
+ margin: 0 auto;
18
+ max-width: 400px;
19
+ }
20
+
21
+ .grw-setting {
22
+ position: relative;
23
+ margin: 20px 0 0;
24
+ }
25
+
26
+ .nav-tabs {
27
+ margin: 13px 0 0;
28
+ }
29
+
30
+ .version {
31
+ position: absolute;
32
+ top: 6px;
33
+ right: 16px;
34
+ -webkit-border-radius: 3px;
35
+ -moz-border-radius: 3px;
36
+ border-radius: 3px;
37
+ display: inline-block;
38
+ margin: 20px 0 0;
39
+ padding: 6px 10px;
40
+ font-size: 12px;
41
+ line-height: 14px;
42
+ color: #FFF;
43
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
44
+ white-space: nowrap;
45
+ vertical-align: baseline;
46
+ background-color: #999;
47
+ }
48
+
49
+ .twitter > iframe {
50
+ vertical-align: bottom !important;
51
+ }
52
+
53
+ .googleplus > div {
54
+ vertical-align: bottom !important;
55
+ }
56
+
57
+ #grw-shortcode,
58
+ #grw-mod-shortcode {
59
+ width: 100%;
60
+ overflow: auto;
61
+ border: 0;
62
+ outline: 0;
63
+ min-height: 184px;
64
+ padding: 0;
65
+ color: #555;
66
+ font-size: 13px;
67
+ resize: none;
68
+ background-color: #fff;
69
+ box-shadow: none !important;
70
+ }
71
+
72
+ .bs-sidebar.affix {
73
+ position: static
74
+ }
75
+
76
+ @media (min-width: 768px) {
77
+ .bs-sidebar {
78
+ padding-left:20px
79
+ }
80
+ }
81
+
82
+ .bs-sidenav {
83
+ margin-top: 20px;
84
+ margin-bottom: 20px
85
+ }
86
+
87
+ .bs-sidebar .nav>li>a {
88
+ display: block;
89
+ padding: 4px 20px;
90
+ font-size: 13px;
91
+ color: #767676
92
+ }
93
+
94
+ .bs-sidebar .nav>.active:focus>a,.bs-sidebar .nav>.active:hover>a,.bs-sidebar .nav>.active>a {
95
+ padding-left: 18px;
96
+ font-weight: 500;
97
+ color: #563d7c;
98
+ background-color: transparent;
99
+ border-left: 2px solid #563d7c
100
+ }
101
+
102
+ .bs-sidebar .nav .nav {
103
+ padding-bottom: 10px
104
+ }
105
+
106
+ .bs-sidebar .nav .nav>li>a {
107
+ padding-top: 1px;
108
+ padding-bottom: 1px;
109
+ padding-left: 30px;
110
+ font-size: 12px;
111
+ }
112
+
113
+ .bs-sidebar .nav .nav>li>a:focus,.bs-sidebar .nav .nav>li>a:hover {
114
+ padding-left: 29px
115
+ }
116
+
117
+ .bs-sidebar .nav .nav>.active:focus>a,.bs-sidebar .nav .nav>.active:hover>a,.bs-sidebar .nav .nav>.active>a {
118
+ padding-left: 28px;
119
+ font-weight: 500
120
+ }
121
+
122
+ @media (min-width: 992px) {
123
+ .bs-sidebar .nav>.active>ul {
124
+ display:block
125
+ }
126
+
127
+ .bs-sidebar.affix,.bs-sidebar.affix-bottom {
128
+ width: 213px
129
+ }
130
+
131
+ .bs-sidebar.affix {
132
+ position: fixed;
133
+ top: 20px
134
+ }
135
+
136
+ .bs-sidebar.affix-bottom {
137
+ position: absolute
138
+ }
139
+
140
+ .bs-sidebar.affix .bs-sidenav,.bs-sidebar.affix-bottom .bs-sidenav {
141
+ margin-top: 0;
142
+ margin-bottom: 0
143
+ }
144
+ }
145
+
146
+ @media (min-width: 1200px) {
147
+ .bs-sidebar.affix,.bs-sidebar.affix-bottom {
148
+ width:263px
149
+ }
150
+ }
151
+
152
+ #doc h2, #doc h3, #doc h4, #doc h5 {
153
+ padding-top: 40px;
154
+ }
155
+
156
+ #doc h4:first-child {
157
+ padding-top: 0;
158
+ }
159
+
160
+ #setting input[type="text"] {
161
+ height: 30px;
162
+ width: 400px;
163
+ box-shadow: none;
164
+ padding: 4px;
165
+ }
166
+
167
+ input[type="checkbox"] {
168
+ margin-right: 6px;
169
+ vertical-align: baseline !important;
170
+ }
171
+
172
+ input[type="checkbox"]:checked:before {
173
+ margin: 0 !important;
174
+ }
175
+
176
+ #mod .wp-places,
177
+ #mod .wp-reviews {
178
+ max-height: none;
179
+ border: none;
180
+ }
181
+
182
+ #shortcode .form {
183
+ min-height: 335px;
184
  }
static/css/grw-widget.css ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*-------------------------------- widget options --------------------------------*/
2
+ .grw-step {
3
+ display: inline-block;
4
+ width: 20px;
5
+ line-height: 20px;
6
+ padding: 2px;
7
+ margin: 0 6px 0 0;
8
+ text-align: center;
9
+ background: #ffe045;
10
+ border-radius: 50%;
11
+ }
12
+
13
+ .grw-places, .grw-reviews {
14
+ max-height: 200px;
15
+ overflow: auto;
16
+ border: 1px solid #f3f3f3;
17
+ }
18
+
19
+ .grw-place {
20
+ margin: 0;
21
+ padding: 6px;
22
+ cursor: pointer;
23
+ }
24
+
25
+ .grw-place img {
26
+ border: none;
27
+ float: left;
28
+ height: 40px;
29
+ margin-right: 5px;
30
+ width: 40px;
31
+ width: 20px;
32
+ height: 20px;
33
+ border-radius: 50%;
34
+ }
35
+
36
+ .grw-place .media-body {
37
+ overflow: hidden;
38
+ }
39
+
40
+ .grw-place .media-heading {
41
+ margin: 0;
42
+ padding-right: 6px;
43
+ font-size: 13px;
44
+ font-weight: bold;
45
+ }
46
+
47
+ .grw-place .grw-grating {
48
+ font-size: 12px;
49
+ font-weight: 700;
50
+ color: #e7711b;
51
+ margin: 0 6px 0 0;
52
+ }
53
+
54
+ .grw-place .grw-gstars {
55
+ padding-left: 7px;
56
+ }
57
+
58
+ .grw-place small {
59
+ display: block;
60
+ font-size: 11px;
61
+ overflow: hidden;
62
+ white-space: nowrap;
63
+ text-overflow: ellipsis;
64
+ }
65
+
66
+ .grw-place:hover {
67
+ background-color: #fafafa;
68
+ }
69
+
70
+ .grw-place.grw-active {
71
+ background-color: #eee;
72
+ }
73
+
74
+ .grw-place .grw-gtime {
75
+ color: #999;
76
+ font-size: 13px;
77
+ text-decoration: none;
78
+ }
79
+
80
+ .grw-place .grw-gtext {
81
+ color: #222;
82
+ font-size: 13px;
83
+ line-height: 18px;
84
+ max-width: 100%;
85
+ overflow: hidden;
86
+ white-space: pre-wrap;
87
+ }
88
+
89
+ .grw-five-reviews-note {
90
+ margin: 4px 0;
91
+ color: #d32323;
92
+ text-align: center;
93
+ }
94
+
95
+ .grw-save-reviews-container {
96
+ position: relative;
97
+ }
98
+
99
+ .grw-tooltip {
100
+ position: absolute;
101
+ top: 40px;
102
+ right: 0;
103
+ width: 100%;
104
+ color: #333;
105
+ outline: none;
106
+ border: 1px solid #ccc;
107
+ border-color: rgba(0,0,0,.2);
108
+ -webkit-border-radius: 2px;
109
+ border-radius: 2px;
110
+ opacity: 0;
111
+ z-index: 99999;
112
+ background: #ffe045;
113
+ box-shadow: 0 2px 10px rgba(0,0,0,.2);
114
+ transition: all .5s ease-in-out;
115
+ }
116
+
117
+ .grw-tooltip.grw-tooltip-visible {
118
+ opacity: 1;
119
+ }
120
+
121
+ .grw-tooltip .grw-corn1 {
122
+ position: absolute;
123
+ top: -9px;
124
+ right: 16px;
125
+ height: 0;
126
+ width: 0;
127
+ z-index: 1;
128
+ border-color: transparent;
129
+ border-style: dashed dashed solid;
130
+ border-width: 0 8.5px 8.5px;
131
+ border-bottom-color: #ccc;
132
+ border-bottom-color: rgba(0,0,0,.2);
133
+ }
134
+
135
+ .grw-tooltip .grw-corn2 {
136
+ position: absolute;
137
+ top: -8px;
138
+ right: 16px;
139
+ height: 0;
140
+ width: 0;
141
+ z-index: 1;
142
+ border-color: transparent;
143
+ border-bottom-color: #ffe045;
144
+ border-style: dashed dashed solid;
145
+ border-width: 0 8.5px 8.5px;
146
+ }
147
+
148
+ .grw-tooltip .grw-text {
149
+ padding: 10px;
150
+ }
151
+
152
+ .grw-tooltip .grw-close {
153
+ position: absolute;
154
+ top: 6px;
155
+ right: 6px;
156
+ color: #777;
157
+ padding: 2px;
158
+ font-size: 22px;
159
+ cursor: pointer;
160
+ }
161
+
162
+ .grw-tooltip .grw-close:hover {
163
+ color: #444;
164
+ }
static/css/rplg.css ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*-------------------------------- WP overrides --------------------------------*/
2
+ .widget-content input[type="text"],
3
+ .widget-content select,
4
+ .widget-content button {
5
+ border-spacing: 0;
6
+ width: 100%;
7
+ clear: both;
8
+ }
9
+
10
+ .widget-content .form-group {
11
+ margin: 10px 0 0;
12
+ }
13
+
14
+ .widget-content .form-group label {
15
+ vertical-align: baseline;
16
+ }
17
+
18
+ .widget-content .form-group img {
19
+ vertical-align: middle;
20
+ }
21
+
22
+ .widget-control-actions {
23
+ position: relative;
24
+ }
25
+
26
+ /*-------------------------------- Commons --------------------------------*/
27
+ .rplg-widget {
28
+ margin: 10px 0;
29
+ }
30
+
31
+ .rplg-options-toggle {
32
+ padding: 10px;
33
+ margin: 10px 0 0;
34
+ cursor: pointer;
35
+ border: 1px solid #dbdbdb;
36
+ background: #eee url('../img/button-down-black.svg') no-repeat right;
37
+ }
38
+
39
+ .rplg-options {
40
+ padding: 0px 4px;
41
+ }
42
+
43
+ .rplg-disabled label,
44
+ .rplg-disabled small {
45
+ opacity: .7;
46
+ }
47
+
48
+ .rplg-pro {
49
+ color: #fff;
50
+ padding: 6px;
51
+ border-radius: 3px;
52
+ background: #00bf54;
53
+ }
54
+
55
+ .rplg-pro a {
56
+ color: #fff;
57
+ text-decoration: underline;
58
+ }
static/js/grw-finder.js ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function grw_init(data) {
2
+
3
+ var el = document.querySelector('#' + data.widgetId);
4
+ if (!el) return;
5
+
6
+ var searchBtn = el.querySelector('.grw-search-btn');
7
+ WPacFastjs.on(searchBtn, 'click', function() {
8
+ var queryEl = el.querySelector('.grw-place-search');
9
+
10
+ if (!queryEl.value) {
11
+ queryEl.focus();
12
+ return false;
13
+ }
14
+
15
+ if (/^ChIJ.*$/.test(queryEl.value)) {
16
+ jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_reviews', {
17
+ placeid: queryEl.value,
18
+ grw_wpnonce: jQuery('#grw_nonce').val()
19
+ }, function(place) {
20
+ grw_addPlaces(el, [place], data.cb);
21
+ }, 'json');
22
+ } else {
23
+ grw_textsearch(el, queryEl.value, data.cb);
24
+ }
25
+ return false;
26
+ });
27
+
28
+ jQuery(document).ready(function($) {
29
+ $('.rplg-options-toggle', el).unbind('click').click(function () {
30
+ $(this).toggleClass('toggled');
31
+ $(this).next().slideToggle();
32
+ });
33
+ });
34
+ }
35
+
36
+ function grw_textsearch(el, query, cb) {
37
+ jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_search', {
38
+ query: query,
39
+ grw_wpnonce: jQuery('#grw_nonce').val()
40
+ }, function(places) {
41
+ grw_addPlaces(el, places, cb);
42
+ }, 'json');
43
+ }
44
+
45
+ function grw_addPlaces(el, places, cb) {
46
+ var placesEl = el.querySelector('.grw-places');
47
+ if (places && places.length) {
48
+ placesEl.innerHTML = '';
49
+ WPacFastjs.each(places, function(place) {
50
+ var placeEl = document.createElement('div');
51
+ placeEl.className = 'grw-place media';
52
+ placeEl.innerHTML = grw_renderPlace(place);
53
+ placeEl.title = place.formatted_address;
54
+ placesEl.appendChild(placeEl);
55
+
56
+ var stars = placeEl.querySelector('.grw-gstars');
57
+ stars.innerHTML = WPacStars.rating_render(place.rating, 14, 'e7711b');
58
+
59
+ grw_selectPlace(el, place.place_id, placeEl, cb);
60
+
61
+ if (places.length == 1) {
62
+ placeEl.className = 'grw-place grw-active media';
63
+ jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_reviews', {
64
+ placeid: place.place_id,
65
+ grw_wpnonce: jQuery('#grw_nonce').val()
66
+ }, function(place) {
67
+ grw_addReviews(el, place, cb);
68
+ }, 'json');
69
+ } else {
70
+ el.querySelector('.grw-reviews').innerHTML = '';
71
+ }
72
+ });
73
+ } else {
74
+ placesEl.innerHTML = '' +
75
+ '<div class="wp-place-info">' +
76
+ 'Google Place not found.<br><br>' +
77
+ 'Please check that this place can be found in ' +
78
+ '<a href="https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder" target="_blank">Google PlaceID Finder</a>, ' +
79
+ 'if so, then copy <b>Place ID</b> to a search field and try to find again.' +
80
+ '</div>';
81
+ }
82
+ }
83
+
84
+ function grw_selectPlace(el, place_id, placeEl, cb) {
85
+ WPacFastjs.on(placeEl, 'click', function() {
86
+ var activeEl = placeEl.parentNode.querySelector('.grw-active');
87
+ WPacFastjs.remcl(activeEl, 'grw-active');
88
+ WPacFastjs.addcl(placeEl, 'grw-active');
89
+
90
+ jQuery.get(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_reviews', {
91
+ placeid: place_id,
92
+ grw_wpnonce: jQuery('#grw_nonce').val()
93
+ }, function(place) {
94
+ grw_addReviews(el, place, cb);
95
+ }, 'json');
96
+
97
+ return false;
98
+ });
99
+ }
100
+
101
+ function grw_addReviews(el, place, cb) {
102
+ var reviewsEl = el.querySelector('.grw-reviews');
103
+ if (place && place.reviews && place.reviews.length) {
104
+ reviewsEl.innerHTML = '';
105
+ for (var i = 0; i < place.reviews.length; i++) {
106
+ var reviewEl = document.createElement('div');
107
+ reviewEl.className = 'grw-place media';
108
+ reviewEl.innerHTML = grw_renderReview(place.reviews[i]);
109
+ reviewsEl.appendChild(reviewEl);
110
+
111
+ var stars = reviewEl.querySelector('.grw-gstars');
112
+ stars.innerHTML = WPacStars.rating_render(place.reviews[i].rating, 14, 'e7711b');
113
+ }
114
+ WPacFastjs.show2(el.querySelector('.grw-five-reviews-note'));
115
+ grw_saveReviews(el, place, cb);
116
+ } else {
117
+ reviewsEl.innerHTML = 'There are no reviews yet.';
118
+ }
119
+ }
120
+
121
+ function grw_saveReviews(el, place, cb) {
122
+
123
+ var saveBtnContainer = el.querySelector('.grw-save-reviews-container');
124
+ saveBtnContainer.innerHTML = '';
125
+
126
+ var saveBtn = document.createElement('button');
127
+ saveBtn.innerHTML = 'Save Place and Reviews';
128
+ saveBtn.className = 'grw-save-reviews btn btn-primary btn-block';
129
+ saveBtnContainer.appendChild(saveBtn);
130
+
131
+ var placeTooltip = grw_show_tooltip(saveBtnContainer, 'Please click by \'Save Place and Reviews\' button.');
132
+
133
+ WPacFastjs.on(saveBtn, 'click', function() {
134
+ saveBtn.disabled = true;
135
+ jQuery.post(grwVars.handlerUrl + '&cf_action=' + grwVars.actionPrefix + '_save', {
136
+ placeid: place.place_id,
137
+ grw_wpnonce: jQuery('#grw_nonce').val()
138
+ }, function(res) {
139
+ saveBtn.disabled = false;
140
+ WPacFastjs.rm(placeTooltip);
141
+
142
+ el.querySelector('.grw-google-place-name').value = place.name;
143
+ el.querySelector('.grw-google-place-id').value = place.place_id;
144
+
145
+ var insideEl = WPacFastjs.parents(el, 'widget-inside');
146
+ if (insideEl) {
147
+ var controlEl = insideEl.querySelector('.widget-control-actions');
148
+ if (controlEl) {
149
+ grw_show_tooltip(controlEl, 'Please don\'t forget to <b>Save</b> the widget.');
150
+ }
151
+ }
152
+
153
+ cb && cb(el, place);
154
+ }, 'json');
155
+ return false;
156
+ });
157
+ }
158
+
159
+ function grw_renderPlace(place) {
160
+ return '' +
161
+ '<div class="media-left">' +
162
+ '<img class="media-object" src="' + place.icon + '" alt="' + place.name + '" style="width:32px;height:32px;">' +
163
+ '</div>' +
164
+ '<div class="media-body">' +
165
+ '<h5 class="media-heading">' + place.name + '</h5>' +
166
+ '<div>' +
167
+ '<span class="grw-grating">' + place.rating + '</span>' +
168
+ '<span class="grw-gstars"></span>' +
169
+ '</div>' +
170
+ '<small class="text-muted">' + place.formatted_address + '</small>' +
171
+ '</div>';
172
+ }
173
+
174
+ function grw_renderReview(review) {
175
+ return '' +
176
+ '<div class="media-left">' +
177
+ '<img class="media-object" src="' + review.profile_photo_url + '" alt="' + review.author_name + '" ' +
178
+ 'onerror="if(this.src!=\'' + grwVars.GOOGLE_AVATAR + '\')this.src=\'' + grwVars.GOOGLE_AVATAR + '\';">' +
179
+ '</div>' +
180
+ '<div class="media-body">' +
181
+ '<div class="media-heading">' +
182
+ '<a href="' + review.author_url + '" target="_blank">' + review.author_name + '</a>' +
183
+ '</div>' +
184
+ '<div class="grw-gtime">' + WPacTime.getTime(parseInt(review.time) * 1000, 'en', 'ago') + '</div>' +
185
+ '<div class="grw-gtext">' +
186
+ '<span class="grw-gstars"></span> ' + grw_small_text(review.text) +
187
+ '</div>' +
188
+ '</div>';
189
+ }
190
+
191
+ function grw_show_tooltip(el, msg) {
192
+ var tooltip = WPacFastjs.create('div', 'grw-tooltip');
193
+ tooltip.innerHTML = '<div class="grw-corn1"></div>' +
194
+ '<div class="grw-corn2"></div>' +
195
+ '<div class="grw-close">×</div>' +
196
+ '<div class="grw-text">' + msg + '</div>';
197
+ el.appendChild(tooltip);
198
+ setTimeout(function() {
199
+ WPacFastjs.addcl(tooltip, 'grw-tooltip-visible');
200
+ }, 100);
201
+ WPacFastjs.on2(tooltip, '.grw-close', 'click', function() {
202
+ WPacFastjs.rm(tooltip);
203
+ });
204
+ return tooltip;
205
+ }
206
+
207
+ function grw_small_text(text) {
208
+ var size = 100, t = text, h = !1;
209
+ if (text && text.length > size) {
210
+ var idx = text.lastIndexOf(' ', size);
211
+ idx = idx > 0 ? idx : size;
212
+ if (idx > 0) {
213
+ t = text.substring(0, idx);
214
+ h = text.substring(idx, text.length);
215
+ }
216
+ }
217
+ var params = {t: t, h: h};
218
+ return (doT.template(
219
+ '{{!it.t}} ' +
220
+ '{{?it.h}}' +
221
+ '<span class="wp-more" style="display:none">{{!it.h}}</span>' +
222
+ '<span class="wp-more-toggle" ' +
223
+ 'onclick="this.previousSibling.style=\'\';this.textContent=\'\';" ' +
224
+ 'style="color:#136aaf;cursor:pointer;text-decoration:underline">read more</span>' +
225
+ '{{?}}'))(params);
226
+ }
static/js/{grp-time.js → wpac-time.js} RENAMED
@@ -22,13 +22,15 @@ years:function(a){return WPacTime.declineNum(Math.round(a),"\u0436\u044b\u043b \
22
  "\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc","\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc")}},hy:{second:"\u0574\u056b \u0584\u0576\u056b \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576 \u0561\u057c\u0561\u057b",minute:"\u0574\u0565\u056f \u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b",minutes:function(a){return WPacTime.declineNum(Math.round(a),"\u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b","\u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b","\u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b")},
23
  hour:"\u0574\u0565\u056f \u056a\u0561\u0574 \u0561\u057c\u0561\u057b",hours:function(a){return WPacTime.declineNum(Math.round(a),"\u056a\u0561\u0574 \u0561\u057c\u0561\u057b","\u056a\u0561\u0574 \u0561\u057c\u0561\u057b","\u056a\u0561\u0574 \u0561\u057c\u0561\u057b")},day:"\u0574\u0565\u056f \u0585\u0580 \u0561\u057c\u0561\u057b",days:function(a){return WPacTime.declineNum(Math.round(a),"\u0585\u0580 \u0561\u057c\u0561\u057b","\u0585\u0580 \u0561\u057c\u0561\u057b","\u0585\u0580 \u0561\u057c\u0561\u057b")},
24
  month:"\u0574\u0565\u056f \u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b",months:function(a){return WPacTime.declineNum(Math.round(a/30),"\u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b","\u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b","\u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b")},year:"\u0574\u0565\u056f \u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b",years:function(a){return WPacTime.declineNum(Math.round(a),"\u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b","\u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b",
25
- "\u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b")}},fr:{second:"tout \u00e0 l'heure",minute:"environ une minute",minutes:function(a){return Math.round(a)+" minutes"},hour:"environ une heure",hours:function(a){return"environ "+Math.round(a)+" heures"},day:"un jour",days:function(a){return Math.round(a)+" jours"},month:"environ un mois",months:function(a){return Math.round(a/30)+" mois"},year:"environ un an",years:function(a){return Math.round(a)+" ans"}},es:{second:"en este momento",minute:"hace un minuto",
26
- minutes:function(a){return WPacTime.declineNum(Math.round(a),"hace un minuto","minutos atr\u00e1s","minutos atr\u00e1s")},hour:"una hora atr\u00e1s",hours:function(a){return WPacTime.declineNum(Math.round(a),"una hora atr\u00e1s","horas atr\u00e1s","horas atr\u00e1s")},day:"hace un d\u00eda",days:function(a){return WPacTime.declineNum(Math.round(a),"un d\u00eda atr\u00e1s","d\u00edas atr\u00e1s","d\u00edas atr\u00e1s")},month:"Hace un mes",months:function(a){return WPacTime.declineNum(Math.round(a/
27
- 30),"un mes atr\u00e1s","meses atr\u00e1s","meses atr\u00e1s")},year:"Hace un a\u00f1o",years:function(a){return WPacTime.declineNum(Math.round(a),"hace un a\u00f1o","a\u00f1os atr\u00e1s","a\u00f1os atr\u00e1s")}},el:{second:"\u03bb\u03b9\u03b3\u03cc\u03c4\u03b5\u03c1\u03bf \u03b1\u03c0\u03cc \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",minute:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03bf \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",minutes:function(a){return Math.round(a)+" minutes"},
28
- hour:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03b7\u03bd \u03bc\u03b9\u03b1 \u03ce\u03c1\u03b1",hours:function(a){return"about "+Math.round(a)+" hours"},day:"\u03bc\u03b9\u03b1 \u03bc\u03ad\u03c1\u03b1",days:function(a){return Math.round(a)+" days"},month:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03bf\u03bd \u03ad\u03bd\u03b1 \u03bc\u03ae\u03bd\u03b1",months:function(a){return Math.round(a/30)+" months"},year:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03bf\u03bd \u03ad\u03bd\u03b1 \u03c7\u03c1\u03cc\u03bd\u03bf",
29
- years:function(a){return Math.round(a)+" years"}},de:{second:"soeben",minute:"vor einer Minute",minutes:function(a){return"vor "+Math.round(a)+" Minuten"},hour:"vor einer Stunde",hours:function(a){return"vor "+Math.round(a)+" Stunden"},day:"vor einem Tag",days:function(a){return"vor "+Math.round(a)+" Tagen"},month:"vor einem Monat",months:function(a){return"vor "+Math.round(a/30)+" Monaten"},year:"vor einem Jahr",years:function(a){return"vor "+Math.round(a)+" Jahren"}},be:{second:"\u043c\u0435\u043d\u0448 \u0437\u0430 \u0445\u0432\u0456\u043b\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",
30
- minute:"\u0445\u0432\u0456\u043b\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",minutes:function(a){return WPacTime.declineNum(Math.round(a),"\u0445\u0432\u0456\u043b\u0456\u043d\u0430 \u0442\u0430\u043c\u0443","\u0445\u0432\u0456\u043b\u0456\u043d\u044b \u0442\u0430\u043c\u0443","\u0445\u0432\u0456\u043b\u0456\u043d \u0442\u0430\u043c\u0443")},hour:"\u0433\u0430\u0434\u0437\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",hours:function(a){return WPacTime.declineNum(Math.round(a),"\u0433\u0430\u0434\u0437\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",
31
- "\u0433\u0430\u0434\u0437\u0456\u043d\u044b \u0442\u0430\u043c\u0443","\u0433\u0430\u0434\u0437\u0456\u043d \u0442\u0430\u043c\u0443")},day:"\u0434\u0437\u0435\u043d\u044c \u0442\u0430\u043c\u0443",days:function(a){return WPacTime.declineNum(Math.round(a),"\u0434\u0437\u0435\u043d\u044c \u0442\u0430\u043c\u0443","\u0434\u043d\u0456 \u0442\u0430\u043c\u0443","\u0434\u0437\u0451\u043d \u0442\u0430\u043c\u0443")},month:"\u043c\u0435\u0441\u044f\u0446 \u0442\u0430\u043c\u0443",months:function(a){return WPacTime.declineNum(Math.round(a/
32
- 30),"\u043c\u0435\u0441\u044f\u0446 \u0442\u0430\u043c\u0443","\u043c\u0435\u0441\u044f\u0446\u0430 \u0442\u0430\u043c\u0443","\u043c\u0435\u0441\u044f\u0446\u0430\u045e \u0442\u0430\u043c\u0443")},year:"\u0433\u043e\u0434 \u0442\u0430\u043c\u0443",years:function(a){return WPacTime.declineNum(Math.round(a),"\u0433\u043e\u0434 \u0442\u0430\u043c\u0443","\u0433\u0430\u0434\u044b \u0442\u0430\u043c\u0443","\u0433\u043e\u0434 \u0442\u0430\u043c\u0443")}},it:{second:"proprio ora",minute:"un minuto fa",
33
- minutes:function(a){return WPacTime.declineNum(Math.round(a),"un minuto fa","minuti fa","minuti fa")},hour:"un'ora fa",hours:function(a){return WPacTime.declineNum(Math.round(a),"un'ora fa","ore fa","ore fa")},day:"un giorno fa",days:function(a){return WPacTime.declineNum(Math.round(a),"un giorno fa","giorni fa","giorni fa")},month:"un mese fa",months:function(a){return WPacTime.declineNum(Math.round(a/30),"un mese fa","mesi fa","mesi fa")},year:"un anno fa",years:function(a){return WPacTime.declineNum(Math.round(a),
34
- "un anno fa","anni fa","anni fa")}}};
 
 
22
  "\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc","\u10ec\u10da\u10d8\u10e1 \u10ec\u10d8\u10dc")}},hy:{second:"\u0574\u056b \u0584\u0576\u056b \u057e\u0561\u0575\u0580\u056f\u0575\u0561\u0576 \u0561\u057c\u0561\u057b",minute:"\u0574\u0565\u056f \u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b",minutes:function(a){return WPacTime.declineNum(Math.round(a),"\u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b","\u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b","\u0580\u0578\u057a\u0565 \u0561\u057c\u0561\u057b")},
23
  hour:"\u0574\u0565\u056f \u056a\u0561\u0574 \u0561\u057c\u0561\u057b",hours:function(a){return WPacTime.declineNum(Math.round(a),"\u056a\u0561\u0574 \u0561\u057c\u0561\u057b","\u056a\u0561\u0574 \u0561\u057c\u0561\u057b","\u056a\u0561\u0574 \u0561\u057c\u0561\u057b")},day:"\u0574\u0565\u056f \u0585\u0580 \u0561\u057c\u0561\u057b",days:function(a){return WPacTime.declineNum(Math.round(a),"\u0585\u0580 \u0561\u057c\u0561\u057b","\u0585\u0580 \u0561\u057c\u0561\u057b","\u0585\u0580 \u0561\u057c\u0561\u057b")},
24
  month:"\u0574\u0565\u056f \u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b",months:function(a){return WPacTime.declineNum(Math.round(a/30),"\u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b","\u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b","\u0561\u0574\u056b\u057d \u0561\u057c\u0561\u057b")},year:"\u0574\u0565\u056f \u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b",years:function(a){return WPacTime.declineNum(Math.round(a),"\u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b","\u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b",
25
+ "\u057f\u0561\u0580\u056b \u0561\u057c\u0561\u057b")}},fr:{second:"tout \u00e0 l'heure",minute:"environ une minute",minutes:function(a){return Math.round(a)+" minutes"},hour:"environ une heure",hours:function(a){return"environ "+Math.round(a)+" heures"},day:"un jour",days:function(a){return Math.round(a)+" jours"},month:"environ un mois",months:function(a){return Math.round(a/30)+" mois"},year:"environ un an",years:function(a){return Math.round(a)+" ans"}},es:{second:"ahora",minute:"hace un minuto",
26
+ minutes:function(a){return"hace "+Math.round(a)+" minuts"},hour:"hace una hora",hours:function(a){return"hace "+Math.round(a)+" horas"},day:"hace un dia",days:function(a){return"hace "+Math.round(a)+" d\u00edas"},month:"hace un mes",months:function(a){return"hace "+Math.round(a/30)+" meses"},year:"hace a\u00f1os",years:function(a){return"hace "+Math.round(a)+" a\u00f1os"}},el:{second:"\u03bb\u03b9\u03b3\u03cc\u03c4\u03b5\u03c1\u03bf \u03b1\u03c0\u03cc \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",
27
+ minute:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03bf \u03ad\u03bd\u03b1 \u03bb\u03b5\u03c0\u03c4\u03cc",minutes:function(a){return Math.round(a)+" minutes"},hour:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03b7\u03bd \u03bc\u03b9\u03b1 \u03ce\u03c1\u03b1",hours:function(a){return"about "+Math.round(a)+" hours"},day:"\u03bc\u03b9\u03b1 \u03bc\u03ad\u03c1\u03b1",days:function(a){return Math.round(a)+" days"},month:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03bf\u03bd \u03ad\u03bd\u03b1 \u03bc\u03ae\u03bd\u03b1",
28
+ months:function(a){return Math.round(a/30)+" months"},year:"\u03b3\u03cd\u03c1\u03c9 \u03c3\u03c4\u03bf\u03bd \u03ad\u03bd\u03b1 \u03c7\u03c1\u03cc\u03bd\u03bf",years:function(a){return Math.round(a)+" years"}},de:{second:"soeben",minute:"vor einer Minute",minutes:function(a){return"vor "+Math.round(a)+" Minuten"},hour:"vor einer Stunde",hours:function(a){return"vor "+Math.round(a)+" Stunden"},day:"vor einem Tag",days:function(a){return"vor "+Math.round(a)+" Tagen"},month:"vor einem Monat",months:function(a){return"vor "+
29
+ Math.round(a/30)+" Monaten"},year:"vor einem Jahr",years:function(a){return"vor "+Math.round(a)+" Jahren"}},be:{second:"\u043c\u0435\u043d\u0448 \u0437\u0430 \u0445\u0432\u0456\u043b\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",minute:"\u0445\u0432\u0456\u043b\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",minutes:function(a){return WPacTime.declineNum(Math.round(a),"\u0445\u0432\u0456\u043b\u0456\u043d\u0430 \u0442\u0430\u043c\u0443","\u0445\u0432\u0456\u043b\u0456\u043d\u044b \u0442\u0430\u043c\u0443",
30
+ "\u0445\u0432\u0456\u043b\u0456\u043d \u0442\u0430\u043c\u0443")},hour:"\u0433\u0430\u0434\u0437\u0456\u043d\u0443 \u0442\u0430\u043c\u0443",hours:function(a){return WPacTime.declineNum(Math.round(a),"\u0433\u0430\u0434\u0437\u0456\u043d\u0443 \u0442\u0430\u043c\u0443","\u0433\u0430\u0434\u0437\u0456\u043d\u044b \u0442\u0430\u043c\u0443","\u0433\u0430\u0434\u0437\u0456\u043d \u0442\u0430\u043c\u0443")},day:"\u0434\u0437\u0435\u043d\u044c \u0442\u0430\u043c\u0443",days:function(a){return WPacTime.declineNum(Math.round(a),
31
+ "\u0434\u0437\u0435\u043d\u044c \u0442\u0430\u043c\u0443","\u0434\u043d\u0456 \u0442\u0430\u043c\u0443","\u0434\u0437\u0451\u043d \u0442\u0430\u043c\u0443")},month:"\u043c\u0435\u0441\u044f\u0446 \u0442\u0430\u043c\u0443",months:function(a){return WPacTime.declineNum(Math.round(a/30),"\u043c\u0435\u0441\u044f\u0446 \u0442\u0430\u043c\u0443","\u043c\u0435\u0441\u044f\u0446\u0430 \u0442\u0430\u043c\u0443","\u043c\u0435\u0441\u044f\u0446\u0430\u045e \u0442\u0430\u043c\u0443")},year:"\u0433\u043e\u0434 \u0442\u0430\u043c\u0443",
32
+ years:function(a){return WPacTime.declineNum(Math.round(a),"\u0433\u043e\u0434 \u0442\u0430\u043c\u0443","\u0433\u0430\u0434\u044b \u0442\u0430\u043c\u0443","\u0433\u043e\u0434 \u0442\u0430\u043c\u0443")}},it:{second:"proprio ora",minute:"un minuto fa",minutes:function(a){return WPacTime.declineNum(Math.round(a),"un minuto fa","minuti fa","minuti fa")},hour:"un'ora fa",hours:function(a){return WPacTime.declineNum(Math.round(a),"un'ora fa","ore fa","ore fa")},day:"un giorno fa",days:function(a){return WPacTime.declineNum(Math.round(a),
33
+ "un giorno fa","giorni fa","giorni fa")},month:"un mese fa",months:function(a){return WPacTime.declineNum(Math.round(a/30),"un mese fa","mesi fa","mesi fa")},year:"un anno fa",years:function(a){return WPacTime.declineNum(Math.round(a),"un anno fa","anni fa","anni fa")}},nb:{second:"n\u00e5 nettopp",minute:"ett minutt siden",minutes:function(a){return Math.round(a)+" minutter siden"},hour:"en time siden",hours:function(a){return Math.round(a)+" timer siden"},day:"en dag siden",days:function(a){return Math.round(a)+
34
+ " dager siden"},month:"en m\u00e5ned siden",months:function(a){return Math.round(a/30)+" m\u00e5neder siden"},year:"ett \u00e5r siden",years:function(a){return Math.round(a)+" \u00e5r siden"}},da:{second:"just now",minute:"minute ago",minutes:function(a){return Math.round(a)+" minutter siden"},hour:"hour ago",hours:function(a){return Math.round(a)+" timer siden"},day:"day ago",days:function(a){return Math.round(a)+" dage siden"},month:"month ago",months:function(a){return Math.round(a/30)+" m\u00e5neder siden"},
35
+ year:"year ago",years:function(a){return Math.round(a)+" \u00e5r siden"}},nl:{second:"zojuist",minute:"minuten geleden",minutes:function(a){return Math.round(a)+" minuten geleden"},hour:"uur geleden",hours:function(a){return Math.round(a)+" uur geleden"},day:"dagen geleden",days:function(a){return Math.round(a)+" dagen geleden"},month:"maand geleden",months:function(a){return Math.round(a/30)+" maanden geleden"},year:"jaar geleden",years:function(a){return Math.round(a)+" jaar geleden"}},ca:{second:"ara mateix",
36
+ minute:"fa un minut",minutes:function(a){return"fa "+Math.round(a)+" minuts"},hour:"fa una hora",hours:function(a){return"fa "+Math.round(a)+" hores"},day:"fa un dia",days:function(a){return"fa "+Math.round(a)+" dies"},month:"fa un mes",months:function(a){return"fa "+Math.round(a/30)+" mesos"},year:"fa un any",years:function(a){return"fa "+Math.round(a)+" anys"}}};
static/js/{grp-place-finder.js → wpac.js} RENAMED
@@ -212,16 +212,4 @@ minutes:function(a){return WPacTime.declineNum(Math.round(a),"un minuto fa","min
212
  main:function(a){var b=this,c=(a.cnt||document).querySelector(a.el);c.innerHTML=this.stars_render(a.size,a.color,a.stars,a.sum,a.count);if(!a.readonly){var c=c.querySelector(".wp-stars"),d=c.querySelectorAll(".wp-star");WPacFastjs.on(c,"mouseleave",function(a){WPacFastjs.each(d,function(a){var b=a.querySelector("path");a.setAttribute("data-hover","");b.setAttribute("d",WPacSVGIcon.path[a.getAttribute("data-origin")]);b.setAttribute("fill",a.getAttribute("data-color"))})});WPacFastjs.onall(d,"mouseout",
213
  function(){b.prevHover(a,this);b.nextHover(a,this)});WPacFastjs.onall(d,"click",function(){var c=parseInt(this.getAttribute("data-star"));a.clickable&&(this.parentNode.setAttribute("data-star",c),WPacFastjs.each(d,function(d){d.getAttribute("data-star")<=c?(d.setAttribute("data-origin","star"),d.setAttribute("data-color",b.color(a.color))):(d.setAttribute("data-origin","star_o"),d.setAttribute("data-color","#ccc"))}));a.cb&&a.cb(c)})}},stars_render:function(a,b,c,d,e){return this.render("html",{size:a,
214
  color:this.color(b),stars:this.stars(c||5),rating:this.rating(d,e)})},rating_render:function(a,b,c,d){return this.render("html",{size:b,color:this.color(c),stars:this.stars(d||5),rating:a})},color:function(a){return a?a.match(/^#[0-9a-zA-Z]+$/)?a:"#"+a:"#ff9800"},render:function(a,b){b.svg=WPacSVGIcon;return doT.template(this[a]||a)(b)},stars:function(a){for(var b=[],c=1;c<=a;c++)b.push(c);return b},rating:function(a,b){b=b||0;return 0<b?((a||0)/b).toFixed(1):0},prevHover:function(a,b){if(b){var c=
215
- b.getAttribute("data-hover");c&&"off"!=c||(c=b.querySelector("path"),c.setAttribute("d",WPacSVGIcon.path.star),c.setAttribute("fill",this.color(a.color)),b.setAttribute("data-hover","on"));this.prevHover(a,WPacFastjs.prev(b))}},nextHover:function(a,b){var c=WPacFastjs.next(b);if(c){var d=c.getAttribute("data-hover");d&&"on"!=d||(d=c.querySelector("path"),d.setAttribute("d",WPacSVGIcon.path.star_o),d.setAttribute("fill","#ccc"),c.setAttribute("data-hover","off"));this.nextHover(a,c)}}};var GRPPlaceFinder=GRPPlaceFinder||{_HTML:'<div class="wp-gri"><div class="row"><div class="col-sm-4"><div class="form form400 form-horizontal"><h4 class="text-left"><span class="wp-step">1</span>Find Place</h4><div class="form-group"><div class="col-sm-12"><input type="text" class="wp-place form-control" placeholder="Google Place Search Query"></div></div><div class="form-group wp-gkey-cnt" style="display:none"><div class="col-sm-12"><input type="text" class="wp-gkey form-control" placeholder="Google Places API Key" {{?it.google_api_key}}value="{{=it.google_api_key}}"{{?}}><small>Please register your own Google Places API server key:<br>1. Go to <a href="https://developers.google.com/places/web-service/get-api-key" target="_blank">Google Places API</a><br>2. Click by \'GET A KEY\' button<br>3. Agree term and click by \'CREATE AND ENABLE API\'<br>4. Copy key to plugin field<br><iframe src="//www.youtube.com/embed/uW-PTKeZAXs?rel=0" allowfullscreen="" style="width:100%"></iframe></small></div></div><div class="form-group"><div class="col-sm-12"><button class="wp-get-place btn btn-block btn-primary">Search Place</button></div></div><div class="form-group"><div class="col-sm-12"><h4 class="text-left"><span class="wp-step">2</span>Choice Place</h4><div class="wp-places"></div></div></div><div class="form-group"><div class="col-sm-12"><h4 class="text-left"><span class="wp-step">3</span>Save Place</h4><div class="wp-reviews"></div></div></div></div></div>{{?it.post_content}}{{=it.post_content}}{{?}}</div></div>',
216
- _PLACE_HTML:'<div class="media-left"><img class="media-object" src="{{=it.place.icon}}" alt="{{=it.place.name}}" style="width:32px;height:32px;"></div><div class="media-body"><h5 class="media-heading">{{=it.place.name}}</h5><div>{{?it.place.rating}}<span class="wp-grating">{{=it.place.rating}}</span><span class="wp-gstars"></span>{{?}}</div><small class="text-muted">{{=it.place.formatted_address}}</small></div>',_REVIEW_HTML:'<div class="media-left"><img class="media-object" src="{{=it.review.profile_photo_url || it.defava}}" alt="{{=it.review.author_name}}" onerror="if(this.src!=\'{{=it.defava}}\')this.src=\'{{=it.defava}}\';"></div><div class="media-body"><div class="media-heading"><a href="{{=it.review.author_url}}" target="_blank">{{=it.review.author_name}}</a></div><div class="wp-gtime">{{=it.time}}</div><div class="wp-gtext"><span class="wp-gstars"></span> {{=it.text}}</div></div>',
217
- _TEXT_HTML:'{{!it.t}} {{?it.h}}<span class="wp-more">{{!it.h}}</span><span class="wp-more-toggle" onclick="this.previousSibling.className=\'\';this.textContent=\'\';">read more</span>{{?}}',main:function(a){var b=this,c=document.getElementById(a.el||"wpac-greview-install");c.innerHTML=doT.template(b._HTML)({post_content:a.post_content,google_api_key:a.google_api_key});WPacFastjs.on2(c,".wp-get-place","click",function(){var d=c.querySelector(".wp-place").value;/^ChIJ.*$/.test(d)?(c.querySelector(".wp-places").innerHTML=
218
- "",b.details(a,c,d,!0)):b.textsearch(a,c,d);return!1});WPacFastjs.cbs(a,"ready")},textsearch:function(a,b,c){var d=this,e=b.querySelector(".wp-gkey").value,f=this.getLang();jQuery.get(a.app_host,{cf_action:"textsearch",query:c,key:e,lang:f,_textsearch_wpnonce:jQuery(a.nonce).val()},function(g){if("GOOGLE_COULDNT_CONNECT"==g.error)WPacXDM.post("https://embed.widgetpack.com","https://app.widgetpack.com/widget/google-review/place",{query:c,key:e,lang:f},function(c){return d.textsearchCallback(a,b,c.error,
219
- c)});else return d.textsearchCallback(a,b,g.error,g.places)},"json")},textsearchCallback:function(a,b,c,d){var e=b.querySelector(".wp-gkey").parentNode.parentNode;if("OVER_QUERY_LIMIT"==c)WPacFastjs.show2(e),WPacFastjs.addcl(e,"has-error");else if(WPacFastjs.remcl(e,"has-error"),c=b.querySelector(".wp-places"),!d||1>d.length)c.innerHTML='<div class="wp-place-info">Business place not found.<br><br>Please check that this place can be found in <a href="https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder" target="_blank">Google PlaceID Finder</a>, if so just a copy <b>Place ID</b> to a search field and search again.</div>';
220
- else{c.innerHTML="";var f=this;WPacFastjs.each(d,function(c){f.place(a,b,c,function(c,d){WPacFastjs.on(d,"click",function(){var e=b.querySelector(".wp-place-info.wp-active");WPacFastjs.remcl(e,"wp-active");WPacFastjs.addcl(d,"wp-active");f.details(a,b,c.place_id,!1)})})});c.appendChild(f.powered_by_google(a))}},place:function(a,b,c,d){a=b.querySelector(".wp-places");b=WPacFastjs.create("div","wp-place-info media",c.formatted_address);b.innerHTML=doT.template(this._PLACE_HTML)({place:c});a.appendChild(b);
221
- c.rating&&(b.querySelector(".wp-gstars").innerHTML=WPacStars.rating_render(c.rating,16,"e7711b"));return d&&d(c,b)},details:function(a,b,c,d){var e=this,f=b.querySelector(".wp-gkey").value,g=this.getLang();jQuery.get(a.app_host,{cf_action:"details",placeid:c,key:f,lang:g,_textsearch_wpnonce:jQuery(a.nonce).val()},function(h){if("GOOGLE_COULDNT_CONNECT"==h.error)WPacXDM.post("https://embed.widgetpack.com","https://app.widgetpack.com/widget/google-review/review",{placeid:c,key:f,lang:g},function(c){return e.detailsCallback(a,
222
- b,c,d,e.saveJSON)});else return e.detailsCallback(a,b,h,d,e.save)},"json")},detailsCallback:function(a,b,c,d,e){var f=b.querySelector(".wp-gkey").parentNode.parentNode;if("OVER_QUERY_LIMIT"==c.error)WPacFastjs.show2(f),WPacFastjs.addcl(f,"has-error");else{WPacFastjs.remcl(f,"has-error");var g=b.querySelector(".wp-reviews");if(c.place&&(!c.place.reviews||1>c.place.reviews.length))g.innerHTML='<div class="wp-place-info">There are no reviews yet for this business</div>';else{g.innerHTML="";d&&this.place(a,
223
- b,c.place,function(a,b){WPacFastjs.addcl(b,"wp-active")});var h=this;WPacFastjs.each(c.place.reviews,function(b){var c=WPacFastjs.create("div","wp-place-info media");c.innerHTML=doT.template(h._REVIEW_HTML)({review:b,text:h.text(a,b.text),time:WPacTime.getTime(parseInt(1E3*b.time),a.lang,"ago"),defava:"https://lh3.googleusercontent.com/-8hepWJzFXpE/AAAAAAAAAAI/AAAAAAAAAAA/I80WzYfIxCQ/s64-c/114307615494839964028.jpg"});g.appendChild(c);c.querySelector(".wp-gstars").innerHTML=WPacStars.rating_render(b.rating,
224
- 14,"e7711b")});g.appendChild(h.powered_by_google(a));(d=WPacFastjs.next(g))&&WPacFastjs.rm(d);d=WPacFastjs.create("button","btn btn-block btn-primary");d.innerHTML="Save Place and Reviews";WPacFastjs.after(g,d);WPacFastjs.on(d,"click",function(){e(a,b,c);return!1})}}},save:function(a,b,c){jQuery.post(a.app_host+"&cf_action=save",{placeid:c.place.place_id,key:b.querySelector(".wp-gkey").value,_textsearch_wpnonce:jQuery(a.nonce).val()},function(d){var e=b.querySelector(".wp-gkey").parentNode.parentNode;
225
- "OVER_QUERY_LIMIT"==d.error?(WPacFastjs.show2(e),WPacFastjs.addcl(e,"has-error")):(WPacFastjs.remcl(e,"has-error"),WPacFastjs.cbs(a,"add",c.place))},"json")},saveJSON:function(a,b,c){jQuery.post(a.app_host+"&cf_action=save_json",{place:JSON.stringify(c.place),reviews:JSON.stringify(c.place.reviews),_textsearch_wpnonce:jQuery(a.nonce).val()},function(d){var e=b.querySelector(".wp-gkey").parentNode.parentNode;"OVER_QUERY_LIMIT"==d.error?(WPacFastjs.show2(e),WPacFastjs.addcl(e,"has-error")):(WPacFastjs.remcl(e,
226
- "has-error"),WPacFastjs.cbs(a,"add",c.place))},"json")},text:function(a,b){var c=a.text_size||100,d=b,e=!1;if(b&&b.length>c){var f=b.lastIndexOf(" ",c),f=0<f?f:c;0<f&&(d=b.substring(0,f),e=b.substring(f,b.length))}return doT.template(this._TEXT_HTML)({t:d,h:e})},powered_by_google:function(a){a=WPacFastjs.create("div","wp-glogo");a.innerHTML='<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAAASCAYAAAC0PldrAAAIHElEQVR4Ae3ZBXDbWB7H8efglpmZGW0HlhzJDpSZmZkZ3W3s2DpmZmbmKx0zM/NdoGhotxTf9x9LHY027paW85v5bBRQopn32weqasqzk5Jw7BE9nHijHo5/Rw/HfqaHYl/keldZ8GJ7qBeqZ/6PNGlPUT5DeVKNqkyc18PJ6VDPtfEfnvUJz0dmpbwfmzMW6k5YFy96pBRTkCnL4MUDiy94oS0F+ZVZlD/5qxLLfNFkz0D0fBtfKOkpCcffrFfG6vVQ4hDUc6ypQLdDFmMdMiWIcjywaOHEB8zynPEFa1pCOWnHLw2Bej5oKtDzqEC+cGyoWZ5YaTDeGer57r4LRPLRCi40liy0QR4eVB5CG2QhU3KQneG+TM/qQhvk424L1Bwt73P22d9QoFD8bVB3KxVUWTX+gqW1mvvLtbr7Z7V+z6frNM/UlFIuKAD83I2v5y69eiL3y9dPZP/s2tdyPn39ZN7UVEq5oCz8x+WvjC/SQrEv8/u/z/O9siSUKNfC8agWSbrRaIH+p3lH1Pg976jxe38gz8JzzLM/g2QhpmIuIjCwB/0cg6HjGAxEsQQtIZmCtbBnLbY4BngZptkGaQmiMHAUhbCyEJMxCxGsh6QFltruOwIv7BmEfTAQwWwsvYMCTcMqGKat6AJJCXYjD1ZcWIdZsEdK8K50gZLroez4+l4G8j1PURlfAJWaMye7Vvd+otbvTVVr7hvVmvc/ci0YyNdAidTHVPa1EzmfuH4iN0WBbnD9H7lu8PXc10CJYDCVxanvffI8nAZvloQTNenZMXYt/YyJ5Y3tgar9nkCt5n2y4Tl073+5TprPEIYSknW2ARpkWosQOkFSiijK0BtuHME2ZGMMDLSDpBMMU29bYaIYBxfW4wBGojcmw8BIWM8Vwjq40QMubMR+231TYGAYJN1QhVUYgEHYgMgdFCiCBeiLYdiJI2iO9og6St4XBgZnKpAWjm2AsmNZO+E8jdlnqzrdvS49aO4fndWLekDVlbmHMoB/MQewAorCrDML86P6E816QD35lbyhzER/SZcouwJKq0oskd9PSX9aVnm5F1RJVbKQr13IVKCU251b7Xf/WwpcqxfMkVnngm9MW+sZ6gJeD24N1BHkwUouDmI28hDGBNjTDwZGIR9hFEOiYyu2YRIkY1GFhzAABvrCnpVYbyvQAeTAyiBHKa2sNUnmY5/jvnwcvYMCbXDMmG1QBR2SJdhu+5l52NXYMsqA7EsXI/5OKBvEhnMKK7LwtePpgYy9HIpB+lbDIGmFbihLTcAzs6FAuueDUJTkW0hdO5XrhrJc/1reTPk6BfsgZMY7iZS/KumFsmihxIFMBaoNeHxmiT/6H5+7Y41esJcl7K/pmdD9N64n4tZALYQzs7EDvTMMmgtBW7GWYyUk26DDj/1wYYHt+z7bUhixMXDMVqDFznG5zX1HIdmDGbDnTvdAGpzZhGWO/2n6ojnCKIIzDNClwQ1LRmU8ETCS3aEysU5r7FHmQckAyUD9sWJgPpSlNlA4SL7O0vJNqGtfz/6bFKX+SyofyvLk1/IGNcxAX8v9JpS8QpDfX/Ha+nwoC8vplIwFYq/TUFbN+w9Zxqr93vpq3fOFWn/BJFlioYQ1UEvgzHxsRQ8Y6NdIgY6jDBI3wugGA53QxVa+IAogeQwR9EB3h27IVGwfqjLc1xWSnZgNZ5bdQYECcGabrcgubMUCPIZjtztQWPsOZpjvPRq52A7KSatKTpV3QfxcXenL61tASUFk8M7q7gIoiywl6UF1fwBKCmLONAVQlhsn8+aYX/8AVEll4pQ8h7x7grLIRj9TgWo0z8Ppsnqv1eqeyP98hX2hZClrrEDH0QpWWuIYJiMbQcx1TNWjYWCQbY8TwQbshJXdWI+obdPdEwbGwJ7ipylQH2vZdN5nK9AMHEVzx1JUeQcF2uVY+rojimJYGY8q7MdEZIy8MGTwfmHuhf5JkTbJex/fyxJdtcpLDzNob5JNrbn/mQMl2ECvNpeKn1sDV6MVjGEz/U9zWSmFYuO82tzr/PzK6fy+UFdP5o6hNP9M742ySyFL1VJrDxSIXu4NJUunvAXPVCApCfufP5p7rg1y2pMZkeswX/u+zIawF0jtwyOmvThiK5UXBhbDgwkIY7mjVKthoBRWymE0MngLbXsrN+bbS5WhQC4sRggVjvtGQ9IWQexGMR7BfjxxBwV6AptRgBIcxU7kwkoODiOCtrhtZOZhkD52m3/KiFGs+VCAdYT3fsicAer5WIcU4DGghPzcta/nfKjhFPa13HrUybW5fBlQQk5hWmXi/fL3rNnuTk5hdX6Pl79/wTwNXrJOYbIXOh9w98atgVqAx7EPx7AUHWDPSGy2la0MOY38zCp0gZWuWNXIbJONAPYhhK0YDSsTocGZbJRmuM9KJ6zAceyHD489zYyxCGMwGYdts24LOLMWi3DHkQ0sg/QqWU5KwvEf4HPMDHseDcc6QTnJUiH7EGajz8g7GPYiH2EWKoOyk/c9vAeax6zzGcryAz5+5PrJ7DIoO37QxTufhRT0C+zLvst11FrC5JQG5f7IrJd5Pjzzx56Pzh4CJc76CnryHugVPMe3OcqfYTkLymkMCpk30RnTlG62jfQLIr5gKkf+wVY29lAWWULTM2HsMah70VSgu888bIULL4hw2pqRPhEmfiMbadmbyWzE/utqSSj2nznBVB7UvWgq0N2lLSIYhxdOWL5k+Xzq/it2mdcGAah7ZV00eQlgxvFRpNfJeyc+Bn2RK32h7sf/AesqcHB02e65AAAAAElFTkSuQmCC" alt="powered by Google">';
227
- return a},getLang:function(){var a=navigator;return(a.language||a.systemLanguage||a.userLanguage||"en").substr(0,2).toLowerCase()}};
212
  main:function(a){var b=this,c=(a.cnt||document).querySelector(a.el);c.innerHTML=this.stars_render(a.size,a.color,a.stars,a.sum,a.count);if(!a.readonly){var c=c.querySelector(".wp-stars"),d=c.querySelectorAll(".wp-star");WPacFastjs.on(c,"mouseleave",function(a){WPacFastjs.each(d,function(a){var b=a.querySelector("path");a.setAttribute("data-hover","");b.setAttribute("d",WPacSVGIcon.path[a.getAttribute("data-origin")]);b.setAttribute("fill",a.getAttribute("data-color"))})});WPacFastjs.onall(d,"mouseout",
213
  function(){b.prevHover(a,this);b.nextHover(a,this)});WPacFastjs.onall(d,"click",function(){var c=parseInt(this.getAttribute("data-star"));a.clickable&&(this.parentNode.setAttribute("data-star",c),WPacFastjs.each(d,function(d){d.getAttribute("data-star")<=c?(d.setAttribute("data-origin","star"),d.setAttribute("data-color",b.color(a.color))):(d.setAttribute("data-origin","star_o"),d.setAttribute("data-color","#ccc"))}));a.cb&&a.cb(c)})}},stars_render:function(a,b,c,d,e){return this.render("html",{size:a,
214
  color:this.color(b),stars:this.stars(c||5),rating:this.rating(d,e)})},rating_render:function(a,b,c,d){return this.render("html",{size:b,color:this.color(c),stars:this.stars(d||5),rating:a})},color:function(a){return a?a.match(/^#[0-9a-zA-Z]+$/)?a:"#"+a:"#ff9800"},render:function(a,b){b.svg=WPacSVGIcon;return doT.template(this[a]||a)(b)},stars:function(a){for(var b=[],c=1;c<=a;c++)b.push(c);return b},rating:function(a,b){b=b||0;return 0<b?((a||0)/b).toFixed(1):0},prevHover:function(a,b){if(b){var c=
215
+ b.getAttribute("data-hover");c&&"off"!=c||(c=b.querySelector("path"),c.setAttribute("d",WPacSVGIcon.path.star),c.setAttribute("fill",this.color(a.color)),b.setAttribute("data-hover","on"));this.prevHover(a,WPacFastjs.prev(b))}},nextHover:function(a,b){var c=WPacFastjs.next(b);if(c){var d=c.getAttribute("data-hover");d&&"on"!=d||(d=c.querySelector("path"),d.setAttribute("d",WPacSVGIcon.path.star_o),d.setAttribute("fill","#ccc"),c.setAttribute("data-hover","off"));this.nextHover(a,c)}}};