@@ -1,552 +1,552 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'settings.general.style' => [ |
|
5 | - 'default' => 'default', |
|
6 | - 'description' => __('Site Reviews relies on the CSS of your theme to style the submission form. If your theme does not provide proper CSS rules for form elements and you are using a WordPress plugin/theme or CSS Framework listed here, please try selecting it, otherwise choose "Site Reviews (default)".', 'site-reviews'), |
|
7 | - 'label' => __('Plugin Style', 'site-reviews'), |
|
8 | - 'options' => [ |
|
9 | - 'bootstrap_4' => 'CSS Framework: Bootstrap 4', |
|
10 | - 'bootstrap_4_custom' => 'CSS Framework: Bootstrap 4 (Custom Forms)', |
|
11 | - 'contact_form_7' => 'Plugin: Contact Form 7 (v5)', |
|
12 | - 'ninja_forms' => 'Plugin: Ninja Forms (v3)', |
|
13 | - 'wpforms' => 'Plugin: WPForms Lite (v1)', |
|
14 | - 'default' => __('Site Reviews (default)', 'site-reviews'), |
|
15 | - 'minimal' => __('Site Reviews (minimal)', 'site-reviews'), |
|
16 | - 'divi' => 'Theme: Divi (v3)', |
|
17 | - 'materialize' => 'Theme: Materialize', |
|
18 | - 'twentyfifteen' => 'Theme: Twenty Fifteen', |
|
19 | - 'twentyseventeen' => 'Theme: Twenty Seventeen', |
|
20 | - 'twentynineteen' => 'Theme: Twenty Nineteen', |
|
21 | - ], |
|
22 | - 'type' => 'select', |
|
23 | - ], |
|
24 | - 'settings.general.require.approval' => [ |
|
25 | - 'default' => 'no', |
|
26 | - 'description' => __('Set the status of new review submissions to "unapproved".', 'site-reviews'), |
|
27 | - 'label' => __('Require Approval', 'site-reviews'), |
|
28 | - 'type' => 'yes_no', |
|
29 | - ], |
|
30 | - 'settings.general.require.login' => [ |
|
31 | - 'default' => 'no', |
|
32 | - 'description' => __('Only allow review submissions from registered users.', 'site-reviews'), |
|
33 | - 'label' => __('Require Login', 'site-reviews'), |
|
34 | - 'type' => 'yes_no', |
|
35 | - ], |
|
36 | - 'settings.general.require.login_register' => [ |
|
37 | - 'default' => 'no', |
|
38 | - 'depends_on' => [ |
|
39 | - 'settings.general.require.login' => 'yes', |
|
40 | - ], |
|
41 | - 'description' => sprintf(__('Show a link for a new user to register. The %s Membership option must be enabled in General Settings for this to work.', 'site-reviews'), |
|
42 | - '<a href="'.admin_url('options-general.php#users_can_register').'">'.__('Anyone can register', 'site-reviews').'</a>' |
|
43 | - ), |
|
44 | - 'label' => __('Show Registration Link', 'site-reviews'), |
|
45 | - 'type' => 'yes_no', |
|
46 | - ], |
|
47 | - 'settings.general.multilingual' => [ |
|
48 | - 'default' => '', |
|
49 | - 'description' => __('Integrate with a multilingual plugin to calculate ratings for all languages of a post.', 'site-reviews'), |
|
50 | - 'label' => __('Multilingual', 'site-reviews'), |
|
51 | - 'options' => [ |
|
52 | - '' => __('No Integration', 'site-reviews'), |
|
53 | - 'polylang' => __('Integrate with Polylang', 'site-reviews'), |
|
54 | - 'wpml' => __('Integrate with WPML', 'site-reviews'), |
|
55 | - ], |
|
56 | - 'type' => 'select', |
|
57 | - ], |
|
58 | - 'settings.general.rebusify' => [ |
|
59 | - 'default' => 'no', |
|
60 | - 'description' => sprintf(__('Integrate with the %s and validate your reviews on the blockchain to increase online reputation, trust, and transparency.', 'site-reviews'), |
|
61 | - '<a href="https://rebusify.com/plans?ref=105" target="_blank">Rebusify Confidence System</a>' |
|
62 | - ), |
|
63 | - 'label' => __('Blockchain Validation', 'site-reviews'), |
|
64 | - 'type' => 'yes_no', |
|
65 | - ], |
|
66 | - 'settings.general.rebusify_email' => [ |
|
67 | - 'default' => '', |
|
68 | - 'depends_on' => [ |
|
69 | - 'settings.general.rebusify' => ['yes'], |
|
70 | - ], |
|
71 | - 'description' => __('Enter your Rebusify account email here.', 'site-reviews'), |
|
72 | - 'label' => __('Rebusify Email', 'site-reviews'), |
|
73 | - 'type' => 'text', |
|
74 | - ], |
|
75 | - 'settings.general.rebusify_serial' => [ |
|
76 | - 'default' => '', |
|
77 | - 'depends_on' => [ |
|
78 | - 'settings.general.rebusify' => ['yes'], |
|
79 | - ], |
|
80 | - 'description' => __('Enter your Rebusify account serial key here.', 'site-reviews'), |
|
81 | - 'label' => __('Rebusify Serial Key', 'site-reviews'), |
|
82 | - 'type' => 'password', |
|
83 | - ], |
|
84 | - 'settings.general.notifications' => [ |
|
85 | - 'default' => [], |
|
86 | - 'label' => __('Notifications', 'site-reviews'), |
|
87 | - 'options' => [ |
|
88 | - 'admin' => __('Send to administrator', 'site-reviews').' <code>'.(string) get_option('admin_email').'</code>', |
|
89 | - 'author' => __('Send to author of the page that the review is assigned to', 'site-reviews'), |
|
90 | - 'custom' => __('Send to one or more email addresses', 'site-reviews'), |
|
91 | - 'slack' => __('Send to <a href="https://slack.com/">Slack</a>', 'site-reviews'), |
|
92 | - ], |
|
93 | - 'type' => 'checkbox', |
|
94 | - ], |
|
95 | - 'settings.general.notification_email' => [ |
|
96 | - 'default' => '', |
|
97 | - 'depends_on' => [ |
|
98 | - 'settings.general.notifications' => ['custom'], |
|
99 | - ], |
|
100 | - 'label' => __('Send Notification Emails To', 'site-reviews'), |
|
101 | - 'placeholder' => __('Separate multiple emails with a comma', 'site-reviews'), |
|
102 | - 'type' => 'text', |
|
103 | - ], |
|
104 | - 'settings.general.notification_slack' => [ |
|
105 | - 'default' => '', |
|
106 | - 'depends_on' => [ |
|
107 | - 'settings.general.notifications' => ['slack'], |
|
108 | - ], |
|
109 | - 'description' => sprintf(__('To send notifications to Slack, create a new %s and then paste the provided Webhook URL in the field above.', 'site-reviews'), |
|
110 | - '<a href="https://api.slack.com/incoming-webhooks">'.__('Incoming WebHook', 'site-reviews').'</a>' |
|
111 | - ), |
|
112 | - 'label' => __('Slack Webhook URL', 'site-reviews'), |
|
113 | - 'type' => 'text', |
|
114 | - ], |
|
115 | - 'settings.general.notification_message' => [ |
|
116 | - 'default' => glsr('Modules\Html\Template')->build('templates/email-notification'), |
|
117 | - 'depends_on' => [ |
|
118 | - 'settings.general.notifications' => ['admin', 'author', 'custom', 'slack'], |
|
119 | - ], |
|
120 | - 'description' => __( |
|
121 | - 'To restore the default text, save an empty template. '. |
|
122 | - 'If you are sending notifications to Slack then this template will only be used as a fallback in the event that <a href="https://api.slack.com/docs/attachments">Message Attachments</a> have been disabled. Available template tags:'. |
|
123 | - '<br><code>{review_rating}</code> The review rating number (1-5)'. |
|
124 | - '<br><code>{review_title}</code> The review title'. |
|
125 | - '<br><code>{review_content}</code> The review content'. |
|
126 | - '<br><code>{review_author}</code> The review author'. |
|
127 | - '<br><code>{review_email}</code> The email of the review author'. |
|
128 | - '<br><code>{review_ip}</code> The IP address of the review author'. |
|
129 | - '<br><code>{review_link}</code> The link to edit/view a review', |
|
130 | - 'site-reviews' |
|
131 | - ), |
|
132 | - 'label' => __('Notification Template', 'site-reviews'), |
|
133 | - 'rows' => 10, |
|
134 | - 'type' => 'code', |
|
135 | - ], |
|
136 | - 'settings.reviews.date.format' => [ |
|
137 | - 'default' => '', |
|
138 | - 'description' => sprintf(__('The default date format is the one set in your %s.', 'site-reviews'), |
|
139 | - '<a href="'.admin_url('options-general.php#date_format_custom').'">'.__('WordPress settings', 'site-reviews').'</a>' |
|
140 | - ), |
|
141 | - 'label' => __('Date Format', 'site-reviews'), |
|
142 | - 'options' => [ |
|
143 | - '' => __('Use the default date format', 'site-reviews'), |
|
144 | - 'relative' => __('Use a relative date format', 'site-reviews'), |
|
145 | - 'custom' => __('Use a custom date format', 'site-reviews'), |
|
146 | - ], |
|
147 | - 'type' => 'select', |
|
148 | - ], |
|
149 | - 'settings.reviews.date.custom' => [ |
|
150 | - 'default' => get_option('date_format'), |
|
151 | - 'depends_on' => [ |
|
152 | - 'settings.reviews.date.format' => 'custom', |
|
153 | - ], |
|
154 | - 'description' => __('Enter a custom date format (<a href="https://codex.wordpress.org/Formatting_Date_and_Time">documentation on date and time formatting</a>).', 'site-reviews'), |
|
155 | - 'label' => __('Custom Date Format', 'site-reviews'), |
|
156 | - 'type' => 'text', |
|
157 | - ], |
|
158 | - 'settings.reviews.name.format' => [ |
|
159 | - 'default' => '', |
|
160 | - 'description' => __('Choose how names are shown in your reviews.', 'site-reviews'), |
|
161 | - 'label' => __('Name Format', 'site-reviews'), |
|
162 | - 'options' => [ |
|
163 | - '' => __('Use the name as given', 'site-reviews'), |
|
164 | - 'first' => __('Use the first name only', 'site-reviews'), |
|
165 | - 'first_initial' => __('Convert first name to an initial', 'site-reviews'), |
|
166 | - 'last_initial' => __('Convert last name to an initial', 'site-reviews'), |
|
167 | - 'initials' => __('Convert to all initials', 'site-reviews'), |
|
168 | - ], |
|
169 | - 'type' => 'select', |
|
170 | - ], |
|
171 | - 'settings.reviews.name.initial' => [ |
|
172 | - 'default' => '', |
|
173 | - 'depends_on' => [ |
|
174 | - 'settings.reviews.name.format' => ['first_initial', 'last_initial', 'initials'], |
|
175 | - ], |
|
176 | - 'description' => __('Choose how the initial is displayed.', 'site-reviews'), |
|
177 | - 'label' => __('Initial Format', 'site-reviews'), |
|
178 | - 'options' => [ |
|
179 | - '' => __('Initial with a space', 'site-reviews'), |
|
180 | - 'period' => __('Initial with a period', 'site-reviews'), |
|
181 | - 'period_space' => __('Initial with a period and a space', 'site-reviews'), |
|
182 | - ], |
|
183 | - 'type' => 'select', |
|
184 | - ], |
|
185 | - 'settings.reviews.assigned_links' => [ |
|
186 | - 'default' => 'no', |
|
187 | - 'description' => __('Display a link to the assigned post of a review.', 'site-reviews'), |
|
188 | - 'label' => __('Enable Assigned Links', 'site-reviews'), |
|
189 | - 'type' => 'yes_no', |
|
190 | - ], |
|
191 | - 'settings.reviews.avatars' => [ |
|
192 | - 'default' => 'no', |
|
193 | - 'description' => __('Display reviewer avatars. These are generated from the email address of the reviewer using <a href="https://gravatar.com">Gravatar</a>.', 'site-reviews'), |
|
194 | - 'label' => __('Enable Avatars', 'site-reviews'), |
|
195 | - 'type' => 'yes_no', |
|
196 | - ], |
|
197 | - 'settings.reviews.avatars_regenerate' => [ |
|
198 | - 'default' => 'no', |
|
199 | - 'depends_on' => [ |
|
200 | - 'settings.reviews.avatars' => 'yes', |
|
201 | - ], |
|
202 | - 'description' => __('Regenerate the avatar whenever a local review is shown?', 'site-reviews'), |
|
203 | - 'label' => __('Regenerate Avatars', 'site-reviews'), |
|
204 | - 'type' => 'yes_no', |
|
205 | - ], |
|
206 | - 'settings.reviews.avatars_size' => [ |
|
207 | - 'default' => 40, |
|
208 | - 'depends_on' => [ |
|
209 | - 'settings.reviews.avatars' => 'yes', |
|
210 | - ], |
|
211 | - 'description' => __('Set the avatar size in pixels.', 'site-reviews'), |
|
212 | - 'label' => __('Avatar Size', 'site-reviews'), |
|
213 | - 'type' => 'number', |
|
214 | - ], |
|
215 | - 'settings.reviews.excerpts' => [ |
|
216 | - 'default' => 'yes', |
|
217 | - 'description' => __('Display an excerpt instead of the full review.', 'site-reviews'), |
|
218 | - 'label' => __('Enable Excerpts', 'site-reviews'), |
|
219 | - 'type' => 'yes_no', |
|
220 | - ], |
|
221 | - 'settings.reviews.excerpts_length' => [ |
|
222 | - 'default' => 55, |
|
223 | - 'depends_on' => [ |
|
224 | - 'settings.reviews.excerpts' => 'yes', |
|
225 | - ], |
|
226 | - 'description' => __('Set the excerpt word length.', 'site-reviews'), |
|
227 | - 'label' => __('Excerpt Length', 'site-reviews'), |
|
228 | - 'type' => 'number', |
|
229 | - ], |
|
230 | - 'settings.reviews.fallback' => [ |
|
231 | - 'default' => 'yes', |
|
232 | - 'description' => sprintf(__('Display the fallback text when there are no reviews to display. This can be changed on the %s page. You may also override this by using the "fallback" option on the shortcode. The default fallback text is: %s', 'site-reviews'), |
|
233 | - '<a href="'.admin_url('edit.php?post_type=site-review&page=settings#!translations').'">'.__('Translations', 'site-reviews').'</a>', |
|
234 | - '<code>'.__('There are no reviews yet. Be the first one to write one.', 'site-reviews').'</code>' |
|
235 | - ), |
|
236 | - 'label' => __('Enable Fallback Text', 'site-reviews'), |
|
237 | - 'type' => 'yes_no', |
|
238 | - ], |
|
239 | - 'settings.schema.type.default' => [ |
|
240 | - 'default' => 'LocalBusiness', |
|
241 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_type</code>', |
|
242 | - 'label' => __('Default Schema Type', 'site-reviews'), |
|
243 | - 'options' => [ |
|
244 | - 'LocalBusiness' => __('Local Business', 'site-reviews'), |
|
245 | - 'Product' => __('Product', 'site-reviews'), |
|
246 | - 'custom' => __('Custom', 'site-reviews'), |
|
247 | - ], |
|
248 | - 'type' => 'select', |
|
249 | - ], |
|
250 | - 'settings.schema.type.custom' => [ |
|
251 | - 'default' => '', |
|
252 | - 'depends_on' => [ |
|
253 | - 'settings.schema.type.default' => 'custom', |
|
254 | - ], |
|
255 | - 'description' => '<a href="https://schema.org/docs/schemas.html">'.__('View more information on schema types here', 'site-reviews').'</a>', |
|
256 | - 'label' => __('Custom Schema Type', 'site-reviews'), |
|
257 | - 'type' => 'text', |
|
258 | - ], |
|
259 | - 'settings.schema.name.default' => [ |
|
260 | - 'default' => 'post', |
|
261 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_name</code>', |
|
262 | - 'label' => __('Default Name', 'site-reviews'), |
|
263 | - 'options' => [ |
|
264 | - 'post' => __('Use the assigned or current page title', 'site-reviews'), |
|
265 | - 'custom' => __('Enter a custom title', 'site-reviews'), |
|
266 | - ], |
|
267 | - 'type' => 'select', |
|
268 | - ], |
|
269 | - 'settings.schema.name.custom' => [ |
|
270 | - 'default' => '', |
|
271 | - 'depends_on' => [ |
|
272 | - 'settings.schema.name.default' => 'custom', |
|
273 | - ], |
|
274 | - 'label' => __('Custom Name', 'site-reviews'), |
|
275 | - 'type' => 'text', |
|
276 | - ], |
|
277 | - 'settings.schema.description.default' => [ |
|
278 | - 'default' => 'post', |
|
279 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_description</code>', |
|
280 | - 'label' => __('Default Description', 'site-reviews'), |
|
281 | - 'options' => [ |
|
282 | - 'post' => __('Use the assigned or current page excerpt', 'site-reviews'), |
|
283 | - 'custom' => __('Enter a custom description', 'site-reviews'), |
|
284 | - ], |
|
285 | - 'type' => 'select', |
|
286 | - ], |
|
287 | - 'settings.schema.description.custom' => [ |
|
288 | - 'default' => '', |
|
289 | - 'depends_on' => [ |
|
290 | - 'settings.schema.description.default' => 'custom', |
|
291 | - ], |
|
292 | - 'label' => __('Custom Description', 'site-reviews'), |
|
293 | - 'type' => 'text', |
|
294 | - ], |
|
295 | - 'settings.schema.url.default' => [ |
|
296 | - 'default' => 'post', |
|
297 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_url</code>', |
|
298 | - 'label' => __('Default URL', 'site-reviews'), |
|
299 | - 'options' => [ |
|
300 | - 'post' => __('Use the assigned or current page URL', 'site-reviews'), |
|
301 | - 'custom' => __('Enter a custom URL', 'site-reviews'), |
|
302 | - ], |
|
303 | - 'type' => 'select', |
|
304 | - ], |
|
305 | - 'settings.schema.url.custom' => [ |
|
306 | - 'default' => '', |
|
307 | - 'depends_on' => [ |
|
308 | - 'settings.schema.url.default' => 'custom', |
|
309 | - ], |
|
310 | - 'label' => __('Custom URL', 'site-reviews'), |
|
311 | - 'type' => 'text', |
|
312 | - ], |
|
313 | - 'settings.schema.image.default' => [ |
|
314 | - 'default' => 'post', |
|
315 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_image</code>', |
|
316 | - 'label' => __('Default Image', 'site-reviews'), |
|
317 | - 'options' => [ |
|
318 | - 'post' => __('Use the featured image of the assigned or current page', 'site-reviews'), |
|
319 | - 'custom' => __('Enter a custom image URL', 'site-reviews'), |
|
320 | - ], |
|
321 | - 'type' => 'select', |
|
322 | - ], |
|
323 | - 'settings.schema.image.custom' => [ |
|
324 | - 'default' => '', |
|
325 | - 'depends_on' => [ |
|
326 | - 'settings.schema.image.default' => 'custom', |
|
327 | - ], |
|
328 | - 'label' => __('Custom Image URL', 'site-reviews'), |
|
329 | - 'type' => 'text', |
|
330 | - ], |
|
331 | - 'settings.schema.address' => [ |
|
332 | - 'default' => '', |
|
333 | - 'depends_on' => [ |
|
334 | - 'settings.schema.type.default' => 'LocalBusiness', |
|
335 | - ], |
|
336 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_address</code>', |
|
337 | - 'label' => __('Address', 'site-reviews'), |
|
338 | - 'placeholder' => '60 29th Street #343, San Francisco, CA 94110, US', |
|
339 | - 'type' => 'text', |
|
340 | - ], |
|
341 | - 'settings.schema.telephone' => [ |
|
342 | - 'default' => '', |
|
343 | - 'depends_on' => [ |
|
344 | - 'settings.schema.type.default' => 'LocalBusiness', |
|
345 | - ], |
|
346 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_telephone</code>', |
|
347 | - 'label' => __('Telephone Number', 'site-reviews'), |
|
348 | - 'placeholder' => '+1 (877) 273-3049', |
|
349 | - 'type' => 'text', |
|
350 | - ], |
|
351 | - 'settings.schema.pricerange' => [ |
|
352 | - 'default' => '', |
|
353 | - 'depends_on' => [ |
|
354 | - 'settings.schema.type.default' => 'LocalBusiness', |
|
355 | - ], |
|
356 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_pricerange</code>', |
|
357 | - 'label' => __('Price Range', 'site-reviews'), |
|
358 | - 'placeholder' => '$$-$$$', |
|
359 | - 'type' => 'text', |
|
360 | - ], |
|
361 | - 'settings.schema.offertype' => [ |
|
362 | - 'default' => 'AggregateOffer', |
|
363 | - 'depends_on' => [ |
|
364 | - 'settings.schema.type.default' => 'Product', |
|
365 | - ], |
|
366 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_offertype</code>', |
|
367 | - 'label' => __('Offer Type', 'site-reviews'), |
|
368 | - 'options' => [ |
|
369 | - 'AggregateOffer' => __('AggregateOffer', 'site-reviews'), |
|
370 | - 'Offer' => __('Offer', 'site-reviews'), |
|
371 | - ], |
|
372 | - 'type' => 'select', |
|
373 | - ], |
|
374 | - 'settings.schema.price' => [ |
|
375 | - 'default' => '', |
|
376 | - 'depends_on' => [ |
|
377 | - 'settings.schema.type.default' => 'Product', |
|
378 | - 'settings.schema.offertype' => 'Offer', |
|
379 | - ], |
|
380 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_price</code>', |
|
381 | - 'label' => __('Price', 'site-reviews'), |
|
382 | - 'placeholder' => '50.00', |
|
383 | - 'type' => 'text', |
|
384 | - ], |
|
385 | - 'settings.schema.lowprice' => [ |
|
386 | - 'default' => '', |
|
387 | - 'depends_on' => [ |
|
388 | - 'settings.schema.type.default' => 'Product', |
|
389 | - 'settings.schema.offertype' => 'AggregateOffer', |
|
390 | - ], |
|
391 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_lowprice</code>', |
|
392 | - 'label' => __('Low Price', 'site-reviews'), |
|
393 | - 'placeholder' => '10.00', |
|
394 | - 'type' => 'text', |
|
395 | - ], |
|
396 | - 'settings.schema.highprice' => [ |
|
397 | - 'default' => '', |
|
398 | - 'depends_on' => [ |
|
399 | - 'settings.schema.type.default' => 'Product', |
|
400 | - 'settings.schema.offertype' => 'AggregateOffer', |
|
401 | - ], |
|
402 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_highprice</code>', |
|
403 | - 'label' => __('High Price', 'site-reviews'), |
|
404 | - 'placeholder' => '100.00', |
|
405 | - 'type' => 'text', |
|
406 | - ], |
|
407 | - 'settings.schema.pricecurrency' => [ |
|
408 | - 'default' => '', |
|
409 | - 'depends_on' => [ |
|
410 | - 'settings.schema.type.default' => 'Product', |
|
411 | - ], |
|
412 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_pricecurrency</code>', |
|
413 | - 'label' => __('Price Currency', 'site-reviews'), |
|
414 | - 'placeholder' => 'USD', |
|
415 | - 'type' => 'text', |
|
416 | - ], |
|
417 | - 'settings.submissions.required' => [ |
|
418 | - 'default' => ['content', 'email', 'name', 'rating', 'terms', 'title'], |
|
419 | - 'description' => __('Choose which fields should be required in the submission form.', 'site-reviews'), |
|
420 | - 'label' => __('Required Fields', 'site-reviews'), |
|
421 | - 'options' => [ |
|
422 | - 'rating' => __('Rating', 'site-reviews'), |
|
423 | - 'title' => __('Title', 'site-reviews'), |
|
424 | - 'content' => __('Review', 'site-reviews'), |
|
425 | - 'name' => __('Name', 'site-reviews'), |
|
426 | - 'email' => __('Email', 'site-reviews'), |
|
427 | - 'terms' => __('Terms', 'site-reviews'), |
|
428 | - ], |
|
429 | - 'type' => 'checkbox', |
|
430 | - ], |
|
431 | - 'settings.submissions.limit' => [ |
|
432 | - 'default' => '', |
|
433 | - 'description' => __('Limits the number of reviews that can be submitted to one-per-person. If you are assigning reviews, then the limit will be applied to the assigned page or category.', 'site-reviews'), |
|
434 | - 'label' => __('Limit Reviews', 'site-reviews'), |
|
435 | - 'options' => [ |
|
436 | - '' => __('No Limit', 'site-reviews'), |
|
437 | - 'email' => __('By Email Address', 'site-reviews'), |
|
438 | - 'ip_address' => __('By IP Address', 'site-reviews'), |
|
439 | - 'username' => __('By Username (will only work for registered users)', 'site-reviews'), |
|
440 | - ], |
|
441 | - 'type' => 'select', |
|
442 | - ], |
|
443 | - 'settings.submissions.limit_whitelist.email' => [ |
|
444 | - 'default' => '', |
|
445 | - 'depends_on' => [ |
|
446 | - 'settings.submissions.limit' => ['email'], |
|
447 | - ], |
|
448 | - 'description' => __('One Email per line. All emails in the whitelist will be excluded from the review submission limit.', 'site-reviews'), |
|
449 | - 'label' => __('Email Whitelist', 'site-reviews'), |
|
450 | - 'rows' => 5, |
|
451 | - 'type' => 'code', |
|
452 | - ], |
|
453 | - 'settings.submissions.limit_whitelist.ip_address' => [ |
|
454 | - 'default' => '', |
|
455 | - 'depends_on' => [ |
|
456 | - 'settings.submissions.limit' => ['ip_address'], |
|
457 | - ], |
|
458 | - 'description' => __('One IP Address per line. All IP Addresses in the whitelist will be excluded from the review submission limit..', 'site-reviews'), |
|
459 | - 'label' => __('IP Address Whitelist', 'site-reviews'), |
|
460 | - 'rows' => 5, |
|
461 | - 'type' => 'code', |
|
462 | - ], |
|
463 | - 'settings.submissions.limit_whitelist.username' => [ |
|
464 | - 'default' => '', |
|
465 | - 'depends_on' => [ |
|
466 | - 'settings.submissions.limit' => ['username'], |
|
467 | - ], |
|
468 | - 'description' => __('One Username per line. All registered users with a Username in the whitelist will be excluded from the review submission limit.', 'site-reviews'), |
|
469 | - 'label' => __('Username Whitelist', 'site-reviews'), |
|
470 | - 'rows' => 5, |
|
471 | - 'type' => 'code', |
|
472 | - ], |
|
473 | - 'settings.submissions.recaptcha.integration' => [ |
|
474 | - 'default' => '', |
|
475 | - 'description' => __('Invisible reCAPTCHA is a free anti-spam service from Google. To use it, you will need to <a href="https://www.google.com/recaptcha/admin" target="_blank">sign up</a> for an API key pair for your site.', 'site-reviews'), |
|
476 | - 'label' => __('Invisible reCAPTCHA', 'site-reviews'), |
|
477 | - 'options' => [ |
|
478 | - '' => 'Do not use reCAPTCHA', |
|
479 | - 'all' => 'Use reCAPTCHA', |
|
480 | - 'guest' => 'Use reCAPTCHA only for guest users', |
|
481 | - ], |
|
482 | - 'type' => 'select', |
|
483 | - ], |
|
484 | - 'settings.submissions.recaptcha.key' => [ |
|
485 | - 'default' => '', |
|
486 | - 'depends_on' => [ |
|
487 | - 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
|
488 | - ], |
|
489 | - 'label' => __('Site Key', 'site-reviews'), |
|
490 | - 'type' => 'text', |
|
491 | - ], |
|
492 | - 'settings.submissions.recaptcha.secret' => [ |
|
493 | - 'default' => '', |
|
494 | - 'depends_on' => [ |
|
495 | - 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
|
496 | - ], |
|
497 | - 'label' => __('Site Secret', 'site-reviews'), |
|
498 | - 'type' => 'text', |
|
499 | - ], |
|
500 | - 'settings.submissions.recaptcha.position' => [ |
|
501 | - 'default' => 'bottomleft', |
|
502 | - 'depends_on' => [ |
|
503 | - 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
|
504 | - ], |
|
505 | - 'description' => __('This option may not work consistently if another plugin is loading reCAPTCHA on the same page as Site Reviews.', 'site-reviews'), |
|
506 | - 'label' => __('Badge Position', 'site-reviews'), |
|
507 | - 'options' => [ |
|
508 | - 'bottomleft' => 'Bottom Left', |
|
509 | - 'bottomright' => 'Bottom Right', |
|
510 | - 'inline' => 'Inline', |
|
511 | - ], |
|
512 | - 'type' => 'select', |
|
513 | - ], |
|
514 | - 'settings.submissions.akismet' => [ |
|
515 | - 'default' => 'no', |
|
516 | - 'description' => __('The <a href="https://akismet.com" target="_blank">Akismet plugin</a> integration provides spam-filtering for your reviews. In order for this setting to have any affect, you will need to first install and activate the Akismet plugin and set up a WordPress.com API key.', 'site-reviews'), |
|
517 | - 'label' => __('Enable Akismet Integration', 'site-reviews'), |
|
518 | - 'type' => 'yes_no', |
|
519 | - ], |
|
520 | - 'settings.submissions.blacklist.integration' => [ |
|
521 | - 'default' => '', |
|
522 | - 'description' => sprintf(__('Choose which Blacklist you would prefer to use for reviews. The %s can be found in the WordPress Discussion Settings page.', 'site-reviews'), |
|
523 | - '<a href="'.admin_url('options-discussion.php#users_can_register').'">'.__('Comment Blacklist', 'site-reviews').'</a>' |
|
524 | - ), |
|
525 | - 'label' => __('Blacklist', 'site-reviews'), |
|
526 | - 'options' => [ |
|
527 | - '' => 'Use the Site Reviews Blacklist', |
|
528 | - 'comments' => 'Use the WordPress Comment Blacklist', |
|
529 | - ], |
|
530 | - 'type' => 'select', |
|
531 | - ], |
|
532 | - 'settings.submissions.blacklist.entries' => [ |
|
533 | - 'default' => '', |
|
534 | - 'depends_on' => [ |
|
535 | - 'settings.submissions.blacklist.integration' => [''], |
|
536 | - ], |
|
537 | - 'description' => __('One entry or IP address per line. When a review contains any of these entries in its title, content, name, email, or IP address, it will be rejected. It is case-insensitive and will match partial words, so "press" will match "WordPress".', 'site-reviews'), |
|
538 | - 'label' => __('Review Blacklist', 'site-reviews'), |
|
539 | - 'rows' => 10, |
|
540 | - 'type' => 'code', |
|
541 | - ], |
|
542 | - 'settings.submissions.blacklist.action' => [ |
|
543 | - 'default' => 'unapprove', |
|
544 | - 'description' => __('Choose the action that should be taken when a review is blacklisted.', 'site-reviews'), |
|
545 | - 'label' => __('Blacklist Action', 'site-reviews'), |
|
546 | - 'options' => [ |
|
547 | - 'unapprove' => __('Require approval', 'site-reviews'), |
|
548 | - 'reject' => __('Reject submission', 'site-reviews'), |
|
549 | - ], |
|
550 | - 'type' => 'select', |
|
551 | - ], |
|
4 | + 'settings.general.style' => [ |
|
5 | + 'default' => 'default', |
|
6 | + 'description' => __('Site Reviews relies on the CSS of your theme to style the submission form. If your theme does not provide proper CSS rules for form elements and you are using a WordPress plugin/theme or CSS Framework listed here, please try selecting it, otherwise choose "Site Reviews (default)".', 'site-reviews'), |
|
7 | + 'label' => __('Plugin Style', 'site-reviews'), |
|
8 | + 'options' => [ |
|
9 | + 'bootstrap_4' => 'CSS Framework: Bootstrap 4', |
|
10 | + 'bootstrap_4_custom' => 'CSS Framework: Bootstrap 4 (Custom Forms)', |
|
11 | + 'contact_form_7' => 'Plugin: Contact Form 7 (v5)', |
|
12 | + 'ninja_forms' => 'Plugin: Ninja Forms (v3)', |
|
13 | + 'wpforms' => 'Plugin: WPForms Lite (v1)', |
|
14 | + 'default' => __('Site Reviews (default)', 'site-reviews'), |
|
15 | + 'minimal' => __('Site Reviews (minimal)', 'site-reviews'), |
|
16 | + 'divi' => 'Theme: Divi (v3)', |
|
17 | + 'materialize' => 'Theme: Materialize', |
|
18 | + 'twentyfifteen' => 'Theme: Twenty Fifteen', |
|
19 | + 'twentyseventeen' => 'Theme: Twenty Seventeen', |
|
20 | + 'twentynineteen' => 'Theme: Twenty Nineteen', |
|
21 | + ], |
|
22 | + 'type' => 'select', |
|
23 | + ], |
|
24 | + 'settings.general.require.approval' => [ |
|
25 | + 'default' => 'no', |
|
26 | + 'description' => __('Set the status of new review submissions to "unapproved".', 'site-reviews'), |
|
27 | + 'label' => __('Require Approval', 'site-reviews'), |
|
28 | + 'type' => 'yes_no', |
|
29 | + ], |
|
30 | + 'settings.general.require.login' => [ |
|
31 | + 'default' => 'no', |
|
32 | + 'description' => __('Only allow review submissions from registered users.', 'site-reviews'), |
|
33 | + 'label' => __('Require Login', 'site-reviews'), |
|
34 | + 'type' => 'yes_no', |
|
35 | + ], |
|
36 | + 'settings.general.require.login_register' => [ |
|
37 | + 'default' => 'no', |
|
38 | + 'depends_on' => [ |
|
39 | + 'settings.general.require.login' => 'yes', |
|
40 | + ], |
|
41 | + 'description' => sprintf(__('Show a link for a new user to register. The %s Membership option must be enabled in General Settings for this to work.', 'site-reviews'), |
|
42 | + '<a href="'.admin_url('options-general.php#users_can_register').'">'.__('Anyone can register', 'site-reviews').'</a>' |
|
43 | + ), |
|
44 | + 'label' => __('Show Registration Link', 'site-reviews'), |
|
45 | + 'type' => 'yes_no', |
|
46 | + ], |
|
47 | + 'settings.general.multilingual' => [ |
|
48 | + 'default' => '', |
|
49 | + 'description' => __('Integrate with a multilingual plugin to calculate ratings for all languages of a post.', 'site-reviews'), |
|
50 | + 'label' => __('Multilingual', 'site-reviews'), |
|
51 | + 'options' => [ |
|
52 | + '' => __('No Integration', 'site-reviews'), |
|
53 | + 'polylang' => __('Integrate with Polylang', 'site-reviews'), |
|
54 | + 'wpml' => __('Integrate with WPML', 'site-reviews'), |
|
55 | + ], |
|
56 | + 'type' => 'select', |
|
57 | + ], |
|
58 | + 'settings.general.rebusify' => [ |
|
59 | + 'default' => 'no', |
|
60 | + 'description' => sprintf(__('Integrate with the %s and validate your reviews on the blockchain to increase online reputation, trust, and transparency.', 'site-reviews'), |
|
61 | + '<a href="https://rebusify.com/plans?ref=105" target="_blank">Rebusify Confidence System</a>' |
|
62 | + ), |
|
63 | + 'label' => __('Blockchain Validation', 'site-reviews'), |
|
64 | + 'type' => 'yes_no', |
|
65 | + ], |
|
66 | + 'settings.general.rebusify_email' => [ |
|
67 | + 'default' => '', |
|
68 | + 'depends_on' => [ |
|
69 | + 'settings.general.rebusify' => ['yes'], |
|
70 | + ], |
|
71 | + 'description' => __('Enter your Rebusify account email here.', 'site-reviews'), |
|
72 | + 'label' => __('Rebusify Email', 'site-reviews'), |
|
73 | + 'type' => 'text', |
|
74 | + ], |
|
75 | + 'settings.general.rebusify_serial' => [ |
|
76 | + 'default' => '', |
|
77 | + 'depends_on' => [ |
|
78 | + 'settings.general.rebusify' => ['yes'], |
|
79 | + ], |
|
80 | + 'description' => __('Enter your Rebusify account serial key here.', 'site-reviews'), |
|
81 | + 'label' => __('Rebusify Serial Key', 'site-reviews'), |
|
82 | + 'type' => 'password', |
|
83 | + ], |
|
84 | + 'settings.general.notifications' => [ |
|
85 | + 'default' => [], |
|
86 | + 'label' => __('Notifications', 'site-reviews'), |
|
87 | + 'options' => [ |
|
88 | + 'admin' => __('Send to administrator', 'site-reviews').' <code>'.(string) get_option('admin_email').'</code>', |
|
89 | + 'author' => __('Send to author of the page that the review is assigned to', 'site-reviews'), |
|
90 | + 'custom' => __('Send to one or more email addresses', 'site-reviews'), |
|
91 | + 'slack' => __('Send to <a href="https://slack.com/">Slack</a>', 'site-reviews'), |
|
92 | + ], |
|
93 | + 'type' => 'checkbox', |
|
94 | + ], |
|
95 | + 'settings.general.notification_email' => [ |
|
96 | + 'default' => '', |
|
97 | + 'depends_on' => [ |
|
98 | + 'settings.general.notifications' => ['custom'], |
|
99 | + ], |
|
100 | + 'label' => __('Send Notification Emails To', 'site-reviews'), |
|
101 | + 'placeholder' => __('Separate multiple emails with a comma', 'site-reviews'), |
|
102 | + 'type' => 'text', |
|
103 | + ], |
|
104 | + 'settings.general.notification_slack' => [ |
|
105 | + 'default' => '', |
|
106 | + 'depends_on' => [ |
|
107 | + 'settings.general.notifications' => ['slack'], |
|
108 | + ], |
|
109 | + 'description' => sprintf(__('To send notifications to Slack, create a new %s and then paste the provided Webhook URL in the field above.', 'site-reviews'), |
|
110 | + '<a href="https://api.slack.com/incoming-webhooks">'.__('Incoming WebHook', 'site-reviews').'</a>' |
|
111 | + ), |
|
112 | + 'label' => __('Slack Webhook URL', 'site-reviews'), |
|
113 | + 'type' => 'text', |
|
114 | + ], |
|
115 | + 'settings.general.notification_message' => [ |
|
116 | + 'default' => glsr('Modules\Html\Template')->build('templates/email-notification'), |
|
117 | + 'depends_on' => [ |
|
118 | + 'settings.general.notifications' => ['admin', 'author', 'custom', 'slack'], |
|
119 | + ], |
|
120 | + 'description' => __( |
|
121 | + 'To restore the default text, save an empty template. '. |
|
122 | + 'If you are sending notifications to Slack then this template will only be used as a fallback in the event that <a href="https://api.slack.com/docs/attachments">Message Attachments</a> have been disabled. Available template tags:'. |
|
123 | + '<br><code>{review_rating}</code> The review rating number (1-5)'. |
|
124 | + '<br><code>{review_title}</code> The review title'. |
|
125 | + '<br><code>{review_content}</code> The review content'. |
|
126 | + '<br><code>{review_author}</code> The review author'. |
|
127 | + '<br><code>{review_email}</code> The email of the review author'. |
|
128 | + '<br><code>{review_ip}</code> The IP address of the review author'. |
|
129 | + '<br><code>{review_link}</code> The link to edit/view a review', |
|
130 | + 'site-reviews' |
|
131 | + ), |
|
132 | + 'label' => __('Notification Template', 'site-reviews'), |
|
133 | + 'rows' => 10, |
|
134 | + 'type' => 'code', |
|
135 | + ], |
|
136 | + 'settings.reviews.date.format' => [ |
|
137 | + 'default' => '', |
|
138 | + 'description' => sprintf(__('The default date format is the one set in your %s.', 'site-reviews'), |
|
139 | + '<a href="'.admin_url('options-general.php#date_format_custom').'">'.__('WordPress settings', 'site-reviews').'</a>' |
|
140 | + ), |
|
141 | + 'label' => __('Date Format', 'site-reviews'), |
|
142 | + 'options' => [ |
|
143 | + '' => __('Use the default date format', 'site-reviews'), |
|
144 | + 'relative' => __('Use a relative date format', 'site-reviews'), |
|
145 | + 'custom' => __('Use a custom date format', 'site-reviews'), |
|
146 | + ], |
|
147 | + 'type' => 'select', |
|
148 | + ], |
|
149 | + 'settings.reviews.date.custom' => [ |
|
150 | + 'default' => get_option('date_format'), |
|
151 | + 'depends_on' => [ |
|
152 | + 'settings.reviews.date.format' => 'custom', |
|
153 | + ], |
|
154 | + 'description' => __('Enter a custom date format (<a href="https://codex.wordpress.org/Formatting_Date_and_Time">documentation on date and time formatting</a>).', 'site-reviews'), |
|
155 | + 'label' => __('Custom Date Format', 'site-reviews'), |
|
156 | + 'type' => 'text', |
|
157 | + ], |
|
158 | + 'settings.reviews.name.format' => [ |
|
159 | + 'default' => '', |
|
160 | + 'description' => __('Choose how names are shown in your reviews.', 'site-reviews'), |
|
161 | + 'label' => __('Name Format', 'site-reviews'), |
|
162 | + 'options' => [ |
|
163 | + '' => __('Use the name as given', 'site-reviews'), |
|
164 | + 'first' => __('Use the first name only', 'site-reviews'), |
|
165 | + 'first_initial' => __('Convert first name to an initial', 'site-reviews'), |
|
166 | + 'last_initial' => __('Convert last name to an initial', 'site-reviews'), |
|
167 | + 'initials' => __('Convert to all initials', 'site-reviews'), |
|
168 | + ], |
|
169 | + 'type' => 'select', |
|
170 | + ], |
|
171 | + 'settings.reviews.name.initial' => [ |
|
172 | + 'default' => '', |
|
173 | + 'depends_on' => [ |
|
174 | + 'settings.reviews.name.format' => ['first_initial', 'last_initial', 'initials'], |
|
175 | + ], |
|
176 | + 'description' => __('Choose how the initial is displayed.', 'site-reviews'), |
|
177 | + 'label' => __('Initial Format', 'site-reviews'), |
|
178 | + 'options' => [ |
|
179 | + '' => __('Initial with a space', 'site-reviews'), |
|
180 | + 'period' => __('Initial with a period', 'site-reviews'), |
|
181 | + 'period_space' => __('Initial with a period and a space', 'site-reviews'), |
|
182 | + ], |
|
183 | + 'type' => 'select', |
|
184 | + ], |
|
185 | + 'settings.reviews.assigned_links' => [ |
|
186 | + 'default' => 'no', |
|
187 | + 'description' => __('Display a link to the assigned post of a review.', 'site-reviews'), |
|
188 | + 'label' => __('Enable Assigned Links', 'site-reviews'), |
|
189 | + 'type' => 'yes_no', |
|
190 | + ], |
|
191 | + 'settings.reviews.avatars' => [ |
|
192 | + 'default' => 'no', |
|
193 | + 'description' => __('Display reviewer avatars. These are generated from the email address of the reviewer using <a href="https://gravatar.com">Gravatar</a>.', 'site-reviews'), |
|
194 | + 'label' => __('Enable Avatars', 'site-reviews'), |
|
195 | + 'type' => 'yes_no', |
|
196 | + ], |
|
197 | + 'settings.reviews.avatars_regenerate' => [ |
|
198 | + 'default' => 'no', |
|
199 | + 'depends_on' => [ |
|
200 | + 'settings.reviews.avatars' => 'yes', |
|
201 | + ], |
|
202 | + 'description' => __('Regenerate the avatar whenever a local review is shown?', 'site-reviews'), |
|
203 | + 'label' => __('Regenerate Avatars', 'site-reviews'), |
|
204 | + 'type' => 'yes_no', |
|
205 | + ], |
|
206 | + 'settings.reviews.avatars_size' => [ |
|
207 | + 'default' => 40, |
|
208 | + 'depends_on' => [ |
|
209 | + 'settings.reviews.avatars' => 'yes', |
|
210 | + ], |
|
211 | + 'description' => __('Set the avatar size in pixels.', 'site-reviews'), |
|
212 | + 'label' => __('Avatar Size', 'site-reviews'), |
|
213 | + 'type' => 'number', |
|
214 | + ], |
|
215 | + 'settings.reviews.excerpts' => [ |
|
216 | + 'default' => 'yes', |
|
217 | + 'description' => __('Display an excerpt instead of the full review.', 'site-reviews'), |
|
218 | + 'label' => __('Enable Excerpts', 'site-reviews'), |
|
219 | + 'type' => 'yes_no', |
|
220 | + ], |
|
221 | + 'settings.reviews.excerpts_length' => [ |
|
222 | + 'default' => 55, |
|
223 | + 'depends_on' => [ |
|
224 | + 'settings.reviews.excerpts' => 'yes', |
|
225 | + ], |
|
226 | + 'description' => __('Set the excerpt word length.', 'site-reviews'), |
|
227 | + 'label' => __('Excerpt Length', 'site-reviews'), |
|
228 | + 'type' => 'number', |
|
229 | + ], |
|
230 | + 'settings.reviews.fallback' => [ |
|
231 | + 'default' => 'yes', |
|
232 | + 'description' => sprintf(__('Display the fallback text when there are no reviews to display. This can be changed on the %s page. You may also override this by using the "fallback" option on the shortcode. The default fallback text is: %s', 'site-reviews'), |
|
233 | + '<a href="'.admin_url('edit.php?post_type=site-review&page=settings#!translations').'">'.__('Translations', 'site-reviews').'</a>', |
|
234 | + '<code>'.__('There are no reviews yet. Be the first one to write one.', 'site-reviews').'</code>' |
|
235 | + ), |
|
236 | + 'label' => __('Enable Fallback Text', 'site-reviews'), |
|
237 | + 'type' => 'yes_no', |
|
238 | + ], |
|
239 | + 'settings.schema.type.default' => [ |
|
240 | + 'default' => 'LocalBusiness', |
|
241 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_type</code>', |
|
242 | + 'label' => __('Default Schema Type', 'site-reviews'), |
|
243 | + 'options' => [ |
|
244 | + 'LocalBusiness' => __('Local Business', 'site-reviews'), |
|
245 | + 'Product' => __('Product', 'site-reviews'), |
|
246 | + 'custom' => __('Custom', 'site-reviews'), |
|
247 | + ], |
|
248 | + 'type' => 'select', |
|
249 | + ], |
|
250 | + 'settings.schema.type.custom' => [ |
|
251 | + 'default' => '', |
|
252 | + 'depends_on' => [ |
|
253 | + 'settings.schema.type.default' => 'custom', |
|
254 | + ], |
|
255 | + 'description' => '<a href="https://schema.org/docs/schemas.html">'.__('View more information on schema types here', 'site-reviews').'</a>', |
|
256 | + 'label' => __('Custom Schema Type', 'site-reviews'), |
|
257 | + 'type' => 'text', |
|
258 | + ], |
|
259 | + 'settings.schema.name.default' => [ |
|
260 | + 'default' => 'post', |
|
261 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_name</code>', |
|
262 | + 'label' => __('Default Name', 'site-reviews'), |
|
263 | + 'options' => [ |
|
264 | + 'post' => __('Use the assigned or current page title', 'site-reviews'), |
|
265 | + 'custom' => __('Enter a custom title', 'site-reviews'), |
|
266 | + ], |
|
267 | + 'type' => 'select', |
|
268 | + ], |
|
269 | + 'settings.schema.name.custom' => [ |
|
270 | + 'default' => '', |
|
271 | + 'depends_on' => [ |
|
272 | + 'settings.schema.name.default' => 'custom', |
|
273 | + ], |
|
274 | + 'label' => __('Custom Name', 'site-reviews'), |
|
275 | + 'type' => 'text', |
|
276 | + ], |
|
277 | + 'settings.schema.description.default' => [ |
|
278 | + 'default' => 'post', |
|
279 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_description</code>', |
|
280 | + 'label' => __('Default Description', 'site-reviews'), |
|
281 | + 'options' => [ |
|
282 | + 'post' => __('Use the assigned or current page excerpt', 'site-reviews'), |
|
283 | + 'custom' => __('Enter a custom description', 'site-reviews'), |
|
284 | + ], |
|
285 | + 'type' => 'select', |
|
286 | + ], |
|
287 | + 'settings.schema.description.custom' => [ |
|
288 | + 'default' => '', |
|
289 | + 'depends_on' => [ |
|
290 | + 'settings.schema.description.default' => 'custom', |
|
291 | + ], |
|
292 | + 'label' => __('Custom Description', 'site-reviews'), |
|
293 | + 'type' => 'text', |
|
294 | + ], |
|
295 | + 'settings.schema.url.default' => [ |
|
296 | + 'default' => 'post', |
|
297 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_url</code>', |
|
298 | + 'label' => __('Default URL', 'site-reviews'), |
|
299 | + 'options' => [ |
|
300 | + 'post' => __('Use the assigned or current page URL', 'site-reviews'), |
|
301 | + 'custom' => __('Enter a custom URL', 'site-reviews'), |
|
302 | + ], |
|
303 | + 'type' => 'select', |
|
304 | + ], |
|
305 | + 'settings.schema.url.custom' => [ |
|
306 | + 'default' => '', |
|
307 | + 'depends_on' => [ |
|
308 | + 'settings.schema.url.default' => 'custom', |
|
309 | + ], |
|
310 | + 'label' => __('Custom URL', 'site-reviews'), |
|
311 | + 'type' => 'text', |
|
312 | + ], |
|
313 | + 'settings.schema.image.default' => [ |
|
314 | + 'default' => 'post', |
|
315 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_image</code>', |
|
316 | + 'label' => __('Default Image', 'site-reviews'), |
|
317 | + 'options' => [ |
|
318 | + 'post' => __('Use the featured image of the assigned or current page', 'site-reviews'), |
|
319 | + 'custom' => __('Enter a custom image URL', 'site-reviews'), |
|
320 | + ], |
|
321 | + 'type' => 'select', |
|
322 | + ], |
|
323 | + 'settings.schema.image.custom' => [ |
|
324 | + 'default' => '', |
|
325 | + 'depends_on' => [ |
|
326 | + 'settings.schema.image.default' => 'custom', |
|
327 | + ], |
|
328 | + 'label' => __('Custom Image URL', 'site-reviews'), |
|
329 | + 'type' => 'text', |
|
330 | + ], |
|
331 | + 'settings.schema.address' => [ |
|
332 | + 'default' => '', |
|
333 | + 'depends_on' => [ |
|
334 | + 'settings.schema.type.default' => 'LocalBusiness', |
|
335 | + ], |
|
336 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_address</code>', |
|
337 | + 'label' => __('Address', 'site-reviews'), |
|
338 | + 'placeholder' => '60 29th Street #343, San Francisco, CA 94110, US', |
|
339 | + 'type' => 'text', |
|
340 | + ], |
|
341 | + 'settings.schema.telephone' => [ |
|
342 | + 'default' => '', |
|
343 | + 'depends_on' => [ |
|
344 | + 'settings.schema.type.default' => 'LocalBusiness', |
|
345 | + ], |
|
346 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_telephone</code>', |
|
347 | + 'label' => __('Telephone Number', 'site-reviews'), |
|
348 | + 'placeholder' => '+1 (877) 273-3049', |
|
349 | + 'type' => 'text', |
|
350 | + ], |
|
351 | + 'settings.schema.pricerange' => [ |
|
352 | + 'default' => '', |
|
353 | + 'depends_on' => [ |
|
354 | + 'settings.schema.type.default' => 'LocalBusiness', |
|
355 | + ], |
|
356 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_pricerange</code>', |
|
357 | + 'label' => __('Price Range', 'site-reviews'), |
|
358 | + 'placeholder' => '$$-$$$', |
|
359 | + 'type' => 'text', |
|
360 | + ], |
|
361 | + 'settings.schema.offertype' => [ |
|
362 | + 'default' => 'AggregateOffer', |
|
363 | + 'depends_on' => [ |
|
364 | + 'settings.schema.type.default' => 'Product', |
|
365 | + ], |
|
366 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_offertype</code>', |
|
367 | + 'label' => __('Offer Type', 'site-reviews'), |
|
368 | + 'options' => [ |
|
369 | + 'AggregateOffer' => __('AggregateOffer', 'site-reviews'), |
|
370 | + 'Offer' => __('Offer', 'site-reviews'), |
|
371 | + ], |
|
372 | + 'type' => 'select', |
|
373 | + ], |
|
374 | + 'settings.schema.price' => [ |
|
375 | + 'default' => '', |
|
376 | + 'depends_on' => [ |
|
377 | + 'settings.schema.type.default' => 'Product', |
|
378 | + 'settings.schema.offertype' => 'Offer', |
|
379 | + ], |
|
380 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_price</code>', |
|
381 | + 'label' => __('Price', 'site-reviews'), |
|
382 | + 'placeholder' => '50.00', |
|
383 | + 'type' => 'text', |
|
384 | + ], |
|
385 | + 'settings.schema.lowprice' => [ |
|
386 | + 'default' => '', |
|
387 | + 'depends_on' => [ |
|
388 | + 'settings.schema.type.default' => 'Product', |
|
389 | + 'settings.schema.offertype' => 'AggregateOffer', |
|
390 | + ], |
|
391 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_lowprice</code>', |
|
392 | + 'label' => __('Low Price', 'site-reviews'), |
|
393 | + 'placeholder' => '10.00', |
|
394 | + 'type' => 'text', |
|
395 | + ], |
|
396 | + 'settings.schema.highprice' => [ |
|
397 | + 'default' => '', |
|
398 | + 'depends_on' => [ |
|
399 | + 'settings.schema.type.default' => 'Product', |
|
400 | + 'settings.schema.offertype' => 'AggregateOffer', |
|
401 | + ], |
|
402 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_highprice</code>', |
|
403 | + 'label' => __('High Price', 'site-reviews'), |
|
404 | + 'placeholder' => '100.00', |
|
405 | + 'type' => 'text', |
|
406 | + ], |
|
407 | + 'settings.schema.pricecurrency' => [ |
|
408 | + 'default' => '', |
|
409 | + 'depends_on' => [ |
|
410 | + 'settings.schema.type.default' => 'Product', |
|
411 | + ], |
|
412 | + 'description' => __('Custom Field name', 'site-reviews').': <code>schema_pricecurrency</code>', |
|
413 | + 'label' => __('Price Currency', 'site-reviews'), |
|
414 | + 'placeholder' => 'USD', |
|
415 | + 'type' => 'text', |
|
416 | + ], |
|
417 | + 'settings.submissions.required' => [ |
|
418 | + 'default' => ['content', 'email', 'name', 'rating', 'terms', 'title'], |
|
419 | + 'description' => __('Choose which fields should be required in the submission form.', 'site-reviews'), |
|
420 | + 'label' => __('Required Fields', 'site-reviews'), |
|
421 | + 'options' => [ |
|
422 | + 'rating' => __('Rating', 'site-reviews'), |
|
423 | + 'title' => __('Title', 'site-reviews'), |
|
424 | + 'content' => __('Review', 'site-reviews'), |
|
425 | + 'name' => __('Name', 'site-reviews'), |
|
426 | + 'email' => __('Email', 'site-reviews'), |
|
427 | + 'terms' => __('Terms', 'site-reviews'), |
|
428 | + ], |
|
429 | + 'type' => 'checkbox', |
|
430 | + ], |
|
431 | + 'settings.submissions.limit' => [ |
|
432 | + 'default' => '', |
|
433 | + 'description' => __('Limits the number of reviews that can be submitted to one-per-person. If you are assigning reviews, then the limit will be applied to the assigned page or category.', 'site-reviews'), |
|
434 | + 'label' => __('Limit Reviews', 'site-reviews'), |
|
435 | + 'options' => [ |
|
436 | + '' => __('No Limit', 'site-reviews'), |
|
437 | + 'email' => __('By Email Address', 'site-reviews'), |
|
438 | + 'ip_address' => __('By IP Address', 'site-reviews'), |
|
439 | + 'username' => __('By Username (will only work for registered users)', 'site-reviews'), |
|
440 | + ], |
|
441 | + 'type' => 'select', |
|
442 | + ], |
|
443 | + 'settings.submissions.limit_whitelist.email' => [ |
|
444 | + 'default' => '', |
|
445 | + 'depends_on' => [ |
|
446 | + 'settings.submissions.limit' => ['email'], |
|
447 | + ], |
|
448 | + 'description' => __('One Email per line. All emails in the whitelist will be excluded from the review submission limit.', 'site-reviews'), |
|
449 | + 'label' => __('Email Whitelist', 'site-reviews'), |
|
450 | + 'rows' => 5, |
|
451 | + 'type' => 'code', |
|
452 | + ], |
|
453 | + 'settings.submissions.limit_whitelist.ip_address' => [ |
|
454 | + 'default' => '', |
|
455 | + 'depends_on' => [ |
|
456 | + 'settings.submissions.limit' => ['ip_address'], |
|
457 | + ], |
|
458 | + 'description' => __('One IP Address per line. All IP Addresses in the whitelist will be excluded from the review submission limit..', 'site-reviews'), |
|
459 | + 'label' => __('IP Address Whitelist', 'site-reviews'), |
|
460 | + 'rows' => 5, |
|
461 | + 'type' => 'code', |
|
462 | + ], |
|
463 | + 'settings.submissions.limit_whitelist.username' => [ |
|
464 | + 'default' => '', |
|
465 | + 'depends_on' => [ |
|
466 | + 'settings.submissions.limit' => ['username'], |
|
467 | + ], |
|
468 | + 'description' => __('One Username per line. All registered users with a Username in the whitelist will be excluded from the review submission limit.', 'site-reviews'), |
|
469 | + 'label' => __('Username Whitelist', 'site-reviews'), |
|
470 | + 'rows' => 5, |
|
471 | + 'type' => 'code', |
|
472 | + ], |
|
473 | + 'settings.submissions.recaptcha.integration' => [ |
|
474 | + 'default' => '', |
|
475 | + 'description' => __('Invisible reCAPTCHA is a free anti-spam service from Google. To use it, you will need to <a href="https://www.google.com/recaptcha/admin" target="_blank">sign up</a> for an API key pair for your site.', 'site-reviews'), |
|
476 | + 'label' => __('Invisible reCAPTCHA', 'site-reviews'), |
|
477 | + 'options' => [ |
|
478 | + '' => 'Do not use reCAPTCHA', |
|
479 | + 'all' => 'Use reCAPTCHA', |
|
480 | + 'guest' => 'Use reCAPTCHA only for guest users', |
|
481 | + ], |
|
482 | + 'type' => 'select', |
|
483 | + ], |
|
484 | + 'settings.submissions.recaptcha.key' => [ |
|
485 | + 'default' => '', |
|
486 | + 'depends_on' => [ |
|
487 | + 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
|
488 | + ], |
|
489 | + 'label' => __('Site Key', 'site-reviews'), |
|
490 | + 'type' => 'text', |
|
491 | + ], |
|
492 | + 'settings.submissions.recaptcha.secret' => [ |
|
493 | + 'default' => '', |
|
494 | + 'depends_on' => [ |
|
495 | + 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
|
496 | + ], |
|
497 | + 'label' => __('Site Secret', 'site-reviews'), |
|
498 | + 'type' => 'text', |
|
499 | + ], |
|
500 | + 'settings.submissions.recaptcha.position' => [ |
|
501 | + 'default' => 'bottomleft', |
|
502 | + 'depends_on' => [ |
|
503 | + 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
|
504 | + ], |
|
505 | + 'description' => __('This option may not work consistently if another plugin is loading reCAPTCHA on the same page as Site Reviews.', 'site-reviews'), |
|
506 | + 'label' => __('Badge Position', 'site-reviews'), |
|
507 | + 'options' => [ |
|
508 | + 'bottomleft' => 'Bottom Left', |
|
509 | + 'bottomright' => 'Bottom Right', |
|
510 | + 'inline' => 'Inline', |
|
511 | + ], |
|
512 | + 'type' => 'select', |
|
513 | + ], |
|
514 | + 'settings.submissions.akismet' => [ |
|
515 | + 'default' => 'no', |
|
516 | + 'description' => __('The <a href="https://akismet.com" target="_blank">Akismet plugin</a> integration provides spam-filtering for your reviews. In order for this setting to have any affect, you will need to first install and activate the Akismet plugin and set up a WordPress.com API key.', 'site-reviews'), |
|
517 | + 'label' => __('Enable Akismet Integration', 'site-reviews'), |
|
518 | + 'type' => 'yes_no', |
|
519 | + ], |
|
520 | + 'settings.submissions.blacklist.integration' => [ |
|
521 | + 'default' => '', |
|
522 | + 'description' => sprintf(__('Choose which Blacklist you would prefer to use for reviews. The %s can be found in the WordPress Discussion Settings page.', 'site-reviews'), |
|
523 | + '<a href="'.admin_url('options-discussion.php#users_can_register').'">'.__('Comment Blacklist', 'site-reviews').'</a>' |
|
524 | + ), |
|
525 | + 'label' => __('Blacklist', 'site-reviews'), |
|
526 | + 'options' => [ |
|
527 | + '' => 'Use the Site Reviews Blacklist', |
|
528 | + 'comments' => 'Use the WordPress Comment Blacklist', |
|
529 | + ], |
|
530 | + 'type' => 'select', |
|
531 | + ], |
|
532 | + 'settings.submissions.blacklist.entries' => [ |
|
533 | + 'default' => '', |
|
534 | + 'depends_on' => [ |
|
535 | + 'settings.submissions.blacklist.integration' => [''], |
|
536 | + ], |
|
537 | + 'description' => __('One entry or IP address per line. When a review contains any of these entries in its title, content, name, email, or IP address, it will be rejected. It is case-insensitive and will match partial words, so "press" will match "WordPress".', 'site-reviews'), |
|
538 | + 'label' => __('Review Blacklist', 'site-reviews'), |
|
539 | + 'rows' => 10, |
|
540 | + 'type' => 'code', |
|
541 | + ], |
|
542 | + 'settings.submissions.blacklist.action' => [ |
|
543 | + 'default' => 'unapprove', |
|
544 | + 'description' => __('Choose the action that should be taken when a review is blacklisted.', 'site-reviews'), |
|
545 | + 'label' => __('Blacklist Action', 'site-reviews'), |
|
546 | + 'options' => [ |
|
547 | + 'unapprove' => __('Require approval', 'site-reviews'), |
|
548 | + 'reject' => __('Reject submission', 'site-reviews'), |
|
549 | + ], |
|
550 | + 'type' => 'select', |
|
551 | + ], |
|
552 | 552 | ]; |
@@ -3,16 +3,16 @@ discard block |
||
3 | 3 | return [ |
4 | 4 | 'settings.general.style' => [ |
5 | 5 | 'default' => 'default', |
6 | - 'description' => __('Site Reviews relies on the CSS of your theme to style the submission form. If your theme does not provide proper CSS rules for form elements and you are using a WordPress plugin/theme or CSS Framework listed here, please try selecting it, otherwise choose "Site Reviews (default)".', 'site-reviews'), |
|
7 | - 'label' => __('Plugin Style', 'site-reviews'), |
|
6 | + 'description' => __( 'Site Reviews relies on the CSS of your theme to style the submission form. If your theme does not provide proper CSS rules for form elements and you are using a WordPress plugin/theme or CSS Framework listed here, please try selecting it, otherwise choose "Site Reviews (default)".', 'site-reviews' ), |
|
7 | + 'label' => __( 'Plugin Style', 'site-reviews' ), |
|
8 | 8 | 'options' => [ |
9 | 9 | 'bootstrap_4' => 'CSS Framework: Bootstrap 4', |
10 | 10 | 'bootstrap_4_custom' => 'CSS Framework: Bootstrap 4 (Custom Forms)', |
11 | 11 | 'contact_form_7' => 'Plugin: Contact Form 7 (v5)', |
12 | 12 | 'ninja_forms' => 'Plugin: Ninja Forms (v3)', |
13 | 13 | 'wpforms' => 'Plugin: WPForms Lite (v1)', |
14 | - 'default' => __('Site Reviews (default)', 'site-reviews'), |
|
15 | - 'minimal' => __('Site Reviews (minimal)', 'site-reviews'), |
|
14 | + 'default' => __( 'Site Reviews (default)', 'site-reviews' ), |
|
15 | + 'minimal' => __( 'Site Reviews (minimal)', 'site-reviews' ), |
|
16 | 16 | 'divi' => 'Theme: Divi (v3)', |
17 | 17 | 'materialize' => 'Theme: Materialize', |
18 | 18 | 'twentyfifteen' => 'Theme: Twenty Fifteen', |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | ], |
24 | 24 | 'settings.general.require.approval' => [ |
25 | 25 | 'default' => 'no', |
26 | - 'description' => __('Set the status of new review submissions to "unapproved".', 'site-reviews'), |
|
27 | - 'label' => __('Require Approval', 'site-reviews'), |
|
26 | + 'description' => __( 'Set the status of new review submissions to "unapproved".', 'site-reviews' ), |
|
27 | + 'label' => __( 'Require Approval', 'site-reviews' ), |
|
28 | 28 | 'type' => 'yes_no', |
29 | 29 | ], |
30 | 30 | 'settings.general.require.login' => [ |
31 | 31 | 'default' => 'no', |
32 | - 'description' => __('Only allow review submissions from registered users.', 'site-reviews'), |
|
33 | - 'label' => __('Require Login', 'site-reviews'), |
|
32 | + 'description' => __( 'Only allow review submissions from registered users.', 'site-reviews' ), |
|
33 | + 'label' => __( 'Require Login', 'site-reviews' ), |
|
34 | 34 | 'type' => 'yes_no', |
35 | 35 | ], |
36 | 36 | 'settings.general.require.login_register' => [ |
@@ -38,29 +38,29 @@ discard block |
||
38 | 38 | 'depends_on' => [ |
39 | 39 | 'settings.general.require.login' => 'yes', |
40 | 40 | ], |
41 | - 'description' => sprintf(__('Show a link for a new user to register. The %s Membership option must be enabled in General Settings for this to work.', 'site-reviews'), |
|
42 | - '<a href="'.admin_url('options-general.php#users_can_register').'">'.__('Anyone can register', 'site-reviews').'</a>' |
|
41 | + 'description' => sprintf( __( 'Show a link for a new user to register. The %s Membership option must be enabled in General Settings for this to work.', 'site-reviews' ), |
|
42 | + '<a href="'.admin_url( 'options-general.php#users_can_register' ).'">'.__( 'Anyone can register', 'site-reviews' ).'</a>' |
|
43 | 43 | ), |
44 | - 'label' => __('Show Registration Link', 'site-reviews'), |
|
44 | + 'label' => __( 'Show Registration Link', 'site-reviews' ), |
|
45 | 45 | 'type' => 'yes_no', |
46 | 46 | ], |
47 | 47 | 'settings.general.multilingual' => [ |
48 | 48 | 'default' => '', |
49 | - 'description' => __('Integrate with a multilingual plugin to calculate ratings for all languages of a post.', 'site-reviews'), |
|
50 | - 'label' => __('Multilingual', 'site-reviews'), |
|
49 | + 'description' => __( 'Integrate with a multilingual plugin to calculate ratings for all languages of a post.', 'site-reviews' ), |
|
50 | + 'label' => __( 'Multilingual', 'site-reviews' ), |
|
51 | 51 | 'options' => [ |
52 | - '' => __('No Integration', 'site-reviews'), |
|
53 | - 'polylang' => __('Integrate with Polylang', 'site-reviews'), |
|
54 | - 'wpml' => __('Integrate with WPML', 'site-reviews'), |
|
52 | + '' => __( 'No Integration', 'site-reviews' ), |
|
53 | + 'polylang' => __( 'Integrate with Polylang', 'site-reviews' ), |
|
54 | + 'wpml' => __( 'Integrate with WPML', 'site-reviews' ), |
|
55 | 55 | ], |
56 | 56 | 'type' => 'select', |
57 | 57 | ], |
58 | 58 | 'settings.general.rebusify' => [ |
59 | 59 | 'default' => 'no', |
60 | - 'description' => sprintf(__('Integrate with the %s and validate your reviews on the blockchain to increase online reputation, trust, and transparency.', 'site-reviews'), |
|
60 | + 'description' => sprintf( __( 'Integrate with the %s and validate your reviews on the blockchain to increase online reputation, trust, and transparency.', 'site-reviews' ), |
|
61 | 61 | '<a href="https://rebusify.com/plans?ref=105" target="_blank">Rebusify Confidence System</a>' |
62 | 62 | ), |
63 | - 'label' => __('Blockchain Validation', 'site-reviews'), |
|
63 | + 'label' => __( 'Blockchain Validation', 'site-reviews' ), |
|
64 | 64 | 'type' => 'yes_no', |
65 | 65 | ], |
66 | 66 | 'settings.general.rebusify_email' => [ |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | 'depends_on' => [ |
69 | 69 | 'settings.general.rebusify' => ['yes'], |
70 | 70 | ], |
71 | - 'description' => __('Enter your Rebusify account email here.', 'site-reviews'), |
|
72 | - 'label' => __('Rebusify Email', 'site-reviews'), |
|
71 | + 'description' => __( 'Enter your Rebusify account email here.', 'site-reviews' ), |
|
72 | + 'label' => __( 'Rebusify Email', 'site-reviews' ), |
|
73 | 73 | 'type' => 'text', |
74 | 74 | ], |
75 | 75 | 'settings.general.rebusify_serial' => [ |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | 'depends_on' => [ |
78 | 78 | 'settings.general.rebusify' => ['yes'], |
79 | 79 | ], |
80 | - 'description' => __('Enter your Rebusify account serial key here.', 'site-reviews'), |
|
81 | - 'label' => __('Rebusify Serial Key', 'site-reviews'), |
|
80 | + 'description' => __( 'Enter your Rebusify account serial key here.', 'site-reviews' ), |
|
81 | + 'label' => __( 'Rebusify Serial Key', 'site-reviews' ), |
|
82 | 82 | 'type' => 'password', |
83 | 83 | ], |
84 | 84 | 'settings.general.notifications' => [ |
85 | 85 | 'default' => [], |
86 | - 'label' => __('Notifications', 'site-reviews'), |
|
86 | + 'label' => __( 'Notifications', 'site-reviews' ), |
|
87 | 87 | 'options' => [ |
88 | - 'admin' => __('Send to administrator', 'site-reviews').' <code>'.(string) get_option('admin_email').'</code>', |
|
89 | - 'author' => __('Send to author of the page that the review is assigned to', 'site-reviews'), |
|
90 | - 'custom' => __('Send to one or more email addresses', 'site-reviews'), |
|
91 | - 'slack' => __('Send to <a href="https://slack.com/">Slack</a>', 'site-reviews'), |
|
88 | + 'admin' => __( 'Send to administrator', 'site-reviews' ).' <code>'.(string)get_option( 'admin_email' ).'</code>', |
|
89 | + 'author' => __( 'Send to author of the page that the review is assigned to', 'site-reviews' ), |
|
90 | + 'custom' => __( 'Send to one or more email addresses', 'site-reviews' ), |
|
91 | + 'slack' => __( 'Send to <a href="https://slack.com/">Slack</a>', 'site-reviews' ), |
|
92 | 92 | ], |
93 | 93 | 'type' => 'checkbox', |
94 | 94 | ], |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | 'depends_on' => [ |
98 | 98 | 'settings.general.notifications' => ['custom'], |
99 | 99 | ], |
100 | - 'label' => __('Send Notification Emails To', 'site-reviews'), |
|
101 | - 'placeholder' => __('Separate multiple emails with a comma', 'site-reviews'), |
|
100 | + 'label' => __( 'Send Notification Emails To', 'site-reviews' ), |
|
101 | + 'placeholder' => __( 'Separate multiple emails with a comma', 'site-reviews' ), |
|
102 | 102 | 'type' => 'text', |
103 | 103 | ], |
104 | 104 | 'settings.general.notification_slack' => [ |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | 'depends_on' => [ |
107 | 107 | 'settings.general.notifications' => ['slack'], |
108 | 108 | ], |
109 | - 'description' => sprintf(__('To send notifications to Slack, create a new %s and then paste the provided Webhook URL in the field above.', 'site-reviews'), |
|
110 | - '<a href="https://api.slack.com/incoming-webhooks">'.__('Incoming WebHook', 'site-reviews').'</a>' |
|
109 | + 'description' => sprintf( __( 'To send notifications to Slack, create a new %s and then paste the provided Webhook URL in the field above.', 'site-reviews' ), |
|
110 | + '<a href="https://api.slack.com/incoming-webhooks">'.__( 'Incoming WebHook', 'site-reviews' ).'</a>' |
|
111 | 111 | ), |
112 | - 'label' => __('Slack Webhook URL', 'site-reviews'), |
|
112 | + 'label' => __( 'Slack Webhook URL', 'site-reviews' ), |
|
113 | 113 | 'type' => 'text', |
114 | 114 | ], |
115 | 115 | 'settings.general.notification_message' => [ |
116 | - 'default' => glsr('Modules\Html\Template')->build('templates/email-notification'), |
|
116 | + 'default' => glsr( 'Modules\Html\Template' )->build( 'templates/email-notification' ), |
|
117 | 117 | 'depends_on' => [ |
118 | 118 | 'settings.general.notifications' => ['admin', 'author', 'custom', 'slack'], |
119 | 119 | ], |
@@ -129,42 +129,42 @@ discard block |
||
129 | 129 | '<br><code>{review_link}</code> The link to edit/view a review', |
130 | 130 | 'site-reviews' |
131 | 131 | ), |
132 | - 'label' => __('Notification Template', 'site-reviews'), |
|
132 | + 'label' => __( 'Notification Template', 'site-reviews' ), |
|
133 | 133 | 'rows' => 10, |
134 | 134 | 'type' => 'code', |
135 | 135 | ], |
136 | 136 | 'settings.reviews.date.format' => [ |
137 | 137 | 'default' => '', |
138 | - 'description' => sprintf(__('The default date format is the one set in your %s.', 'site-reviews'), |
|
139 | - '<a href="'.admin_url('options-general.php#date_format_custom').'">'.__('WordPress settings', 'site-reviews').'</a>' |
|
138 | + 'description' => sprintf( __( 'The default date format is the one set in your %s.', 'site-reviews' ), |
|
139 | + '<a href="'.admin_url( 'options-general.php#date_format_custom' ).'">'.__( 'WordPress settings', 'site-reviews' ).'</a>' |
|
140 | 140 | ), |
141 | - 'label' => __('Date Format', 'site-reviews'), |
|
141 | + 'label' => __( 'Date Format', 'site-reviews' ), |
|
142 | 142 | 'options' => [ |
143 | - '' => __('Use the default date format', 'site-reviews'), |
|
144 | - 'relative' => __('Use a relative date format', 'site-reviews'), |
|
145 | - 'custom' => __('Use a custom date format', 'site-reviews'), |
|
143 | + '' => __( 'Use the default date format', 'site-reviews' ), |
|
144 | + 'relative' => __( 'Use a relative date format', 'site-reviews' ), |
|
145 | + 'custom' => __( 'Use a custom date format', 'site-reviews' ), |
|
146 | 146 | ], |
147 | 147 | 'type' => 'select', |
148 | 148 | ], |
149 | 149 | 'settings.reviews.date.custom' => [ |
150 | - 'default' => get_option('date_format'), |
|
150 | + 'default' => get_option( 'date_format' ), |
|
151 | 151 | 'depends_on' => [ |
152 | 152 | 'settings.reviews.date.format' => 'custom', |
153 | 153 | ], |
154 | - 'description' => __('Enter a custom date format (<a href="https://codex.wordpress.org/Formatting_Date_and_Time">documentation on date and time formatting</a>).', 'site-reviews'), |
|
155 | - 'label' => __('Custom Date Format', 'site-reviews'), |
|
154 | + 'description' => __( 'Enter a custom date format (<a href="https://codex.wordpress.org/Formatting_Date_and_Time">documentation on date and time formatting</a>).', 'site-reviews' ), |
|
155 | + 'label' => __( 'Custom Date Format', 'site-reviews' ), |
|
156 | 156 | 'type' => 'text', |
157 | 157 | ], |
158 | 158 | 'settings.reviews.name.format' => [ |
159 | 159 | 'default' => '', |
160 | - 'description' => __('Choose how names are shown in your reviews.', 'site-reviews'), |
|
161 | - 'label' => __('Name Format', 'site-reviews'), |
|
160 | + 'description' => __( 'Choose how names are shown in your reviews.', 'site-reviews' ), |
|
161 | + 'label' => __( 'Name Format', 'site-reviews' ), |
|
162 | 162 | 'options' => [ |
163 | - '' => __('Use the name as given', 'site-reviews'), |
|
164 | - 'first' => __('Use the first name only', 'site-reviews'), |
|
165 | - 'first_initial' => __('Convert first name to an initial', 'site-reviews'), |
|
166 | - 'last_initial' => __('Convert last name to an initial', 'site-reviews'), |
|
167 | - 'initials' => __('Convert to all initials', 'site-reviews'), |
|
163 | + '' => __( 'Use the name as given', 'site-reviews' ), |
|
164 | + 'first' => __( 'Use the first name only', 'site-reviews' ), |
|
165 | + 'first_initial' => __( 'Convert first name to an initial', 'site-reviews' ), |
|
166 | + 'last_initial' => __( 'Convert last name to an initial', 'site-reviews' ), |
|
167 | + 'initials' => __( 'Convert to all initials', 'site-reviews' ), |
|
168 | 168 | ], |
169 | 169 | 'type' => 'select', |
170 | 170 | ], |
@@ -173,25 +173,25 @@ discard block |
||
173 | 173 | 'depends_on' => [ |
174 | 174 | 'settings.reviews.name.format' => ['first_initial', 'last_initial', 'initials'], |
175 | 175 | ], |
176 | - 'description' => __('Choose how the initial is displayed.', 'site-reviews'), |
|
177 | - 'label' => __('Initial Format', 'site-reviews'), |
|
176 | + 'description' => __( 'Choose how the initial is displayed.', 'site-reviews' ), |
|
177 | + 'label' => __( 'Initial Format', 'site-reviews' ), |
|
178 | 178 | 'options' => [ |
179 | - '' => __('Initial with a space', 'site-reviews'), |
|
180 | - 'period' => __('Initial with a period', 'site-reviews'), |
|
181 | - 'period_space' => __('Initial with a period and a space', 'site-reviews'), |
|
179 | + '' => __( 'Initial with a space', 'site-reviews' ), |
|
180 | + 'period' => __( 'Initial with a period', 'site-reviews' ), |
|
181 | + 'period_space' => __( 'Initial with a period and a space', 'site-reviews' ), |
|
182 | 182 | ], |
183 | 183 | 'type' => 'select', |
184 | 184 | ], |
185 | 185 | 'settings.reviews.assigned_links' => [ |
186 | 186 | 'default' => 'no', |
187 | - 'description' => __('Display a link to the assigned post of a review.', 'site-reviews'), |
|
188 | - 'label' => __('Enable Assigned Links', 'site-reviews'), |
|
187 | + 'description' => __( 'Display a link to the assigned post of a review.', 'site-reviews' ), |
|
188 | + 'label' => __( 'Enable Assigned Links', 'site-reviews' ), |
|
189 | 189 | 'type' => 'yes_no', |
190 | 190 | ], |
191 | 191 | 'settings.reviews.avatars' => [ |
192 | 192 | 'default' => 'no', |
193 | - 'description' => __('Display reviewer avatars. These are generated from the email address of the reviewer using <a href="https://gravatar.com">Gravatar</a>.', 'site-reviews'), |
|
194 | - 'label' => __('Enable Avatars', 'site-reviews'), |
|
193 | + 'description' => __( 'Display reviewer avatars. These are generated from the email address of the reviewer using <a href="https://gravatar.com">Gravatar</a>.', 'site-reviews' ), |
|
194 | + 'label' => __( 'Enable Avatars', 'site-reviews' ), |
|
195 | 195 | 'type' => 'yes_no', |
196 | 196 | ], |
197 | 197 | 'settings.reviews.avatars_regenerate' => [ |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | 'depends_on' => [ |
200 | 200 | 'settings.reviews.avatars' => 'yes', |
201 | 201 | ], |
202 | - 'description' => __('Regenerate the avatar whenever a local review is shown?', 'site-reviews'), |
|
203 | - 'label' => __('Regenerate Avatars', 'site-reviews'), |
|
202 | + 'description' => __( 'Regenerate the avatar whenever a local review is shown?', 'site-reviews' ), |
|
203 | + 'label' => __( 'Regenerate Avatars', 'site-reviews' ), |
|
204 | 204 | 'type' => 'yes_no', |
205 | 205 | ], |
206 | 206 | 'settings.reviews.avatars_size' => [ |
@@ -208,14 +208,14 @@ discard block |
||
208 | 208 | 'depends_on' => [ |
209 | 209 | 'settings.reviews.avatars' => 'yes', |
210 | 210 | ], |
211 | - 'description' => __('Set the avatar size in pixels.', 'site-reviews'), |
|
212 | - 'label' => __('Avatar Size', 'site-reviews'), |
|
211 | + 'description' => __( 'Set the avatar size in pixels.', 'site-reviews' ), |
|
212 | + 'label' => __( 'Avatar Size', 'site-reviews' ), |
|
213 | 213 | 'type' => 'number', |
214 | 214 | ], |
215 | 215 | 'settings.reviews.excerpts' => [ |
216 | 216 | 'default' => 'yes', |
217 | - 'description' => __('Display an excerpt instead of the full review.', 'site-reviews'), |
|
218 | - 'label' => __('Enable Excerpts', 'site-reviews'), |
|
217 | + 'description' => __( 'Display an excerpt instead of the full review.', 'site-reviews' ), |
|
218 | + 'label' => __( 'Enable Excerpts', 'site-reviews' ), |
|
219 | 219 | 'type' => 'yes_no', |
220 | 220 | ], |
221 | 221 | 'settings.reviews.excerpts_length' => [ |
@@ -223,27 +223,27 @@ discard block |
||
223 | 223 | 'depends_on' => [ |
224 | 224 | 'settings.reviews.excerpts' => 'yes', |
225 | 225 | ], |
226 | - 'description' => __('Set the excerpt word length.', 'site-reviews'), |
|
227 | - 'label' => __('Excerpt Length', 'site-reviews'), |
|
226 | + 'description' => __( 'Set the excerpt word length.', 'site-reviews' ), |
|
227 | + 'label' => __( 'Excerpt Length', 'site-reviews' ), |
|
228 | 228 | 'type' => 'number', |
229 | 229 | ], |
230 | 230 | 'settings.reviews.fallback' => [ |
231 | 231 | 'default' => 'yes', |
232 | - 'description' => sprintf(__('Display the fallback text when there are no reviews to display. This can be changed on the %s page. You may also override this by using the "fallback" option on the shortcode. The default fallback text is: %s', 'site-reviews'), |
|
233 | - '<a href="'.admin_url('edit.php?post_type=site-review&page=settings#!translations').'">'.__('Translations', 'site-reviews').'</a>', |
|
234 | - '<code>'.__('There are no reviews yet. Be the first one to write one.', 'site-reviews').'</code>' |
|
232 | + 'description' => sprintf( __( 'Display the fallback text when there are no reviews to display. This can be changed on the %s page. You may also override this by using the "fallback" option on the shortcode. The default fallback text is: %s', 'site-reviews' ), |
|
233 | + '<a href="'.admin_url( 'edit.php?post_type=site-review&page=settings#!translations' ).'">'.__( 'Translations', 'site-reviews' ).'</a>', |
|
234 | + '<code>'.__( 'There are no reviews yet. Be the first one to write one.', 'site-reviews' ).'</code>' |
|
235 | 235 | ), |
236 | - 'label' => __('Enable Fallback Text', 'site-reviews'), |
|
236 | + 'label' => __( 'Enable Fallback Text', 'site-reviews' ), |
|
237 | 237 | 'type' => 'yes_no', |
238 | 238 | ], |
239 | 239 | 'settings.schema.type.default' => [ |
240 | 240 | 'default' => 'LocalBusiness', |
241 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_type</code>', |
|
242 | - 'label' => __('Default Schema Type', 'site-reviews'), |
|
241 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_type</code>', |
|
242 | + 'label' => __( 'Default Schema Type', 'site-reviews' ), |
|
243 | 243 | 'options' => [ |
244 | - 'LocalBusiness' => __('Local Business', 'site-reviews'), |
|
245 | - 'Product' => __('Product', 'site-reviews'), |
|
246 | - 'custom' => __('Custom', 'site-reviews'), |
|
244 | + 'LocalBusiness' => __( 'Local Business', 'site-reviews' ), |
|
245 | + 'Product' => __( 'Product', 'site-reviews' ), |
|
246 | + 'custom' => __( 'Custom', 'site-reviews' ), |
|
247 | 247 | ], |
248 | 248 | 'type' => 'select', |
249 | 249 | ], |
@@ -252,17 +252,17 @@ discard block |
||
252 | 252 | 'depends_on' => [ |
253 | 253 | 'settings.schema.type.default' => 'custom', |
254 | 254 | ], |
255 | - 'description' => '<a href="https://schema.org/docs/schemas.html">'.__('View more information on schema types here', 'site-reviews').'</a>', |
|
256 | - 'label' => __('Custom Schema Type', 'site-reviews'), |
|
255 | + 'description' => '<a href="https://schema.org/docs/schemas.html">'.__( 'View more information on schema types here', 'site-reviews' ).'</a>', |
|
256 | + 'label' => __( 'Custom Schema Type', 'site-reviews' ), |
|
257 | 257 | 'type' => 'text', |
258 | 258 | ], |
259 | 259 | 'settings.schema.name.default' => [ |
260 | 260 | 'default' => 'post', |
261 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_name</code>', |
|
262 | - 'label' => __('Default Name', 'site-reviews'), |
|
261 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_name</code>', |
|
262 | + 'label' => __( 'Default Name', 'site-reviews' ), |
|
263 | 263 | 'options' => [ |
264 | - 'post' => __('Use the assigned or current page title', 'site-reviews'), |
|
265 | - 'custom' => __('Enter a custom title', 'site-reviews'), |
|
264 | + 'post' => __( 'Use the assigned or current page title', 'site-reviews' ), |
|
265 | + 'custom' => __( 'Enter a custom title', 'site-reviews' ), |
|
266 | 266 | ], |
267 | 267 | 'type' => 'select', |
268 | 268 | ], |
@@ -271,16 +271,16 @@ discard block |
||
271 | 271 | 'depends_on' => [ |
272 | 272 | 'settings.schema.name.default' => 'custom', |
273 | 273 | ], |
274 | - 'label' => __('Custom Name', 'site-reviews'), |
|
274 | + 'label' => __( 'Custom Name', 'site-reviews' ), |
|
275 | 275 | 'type' => 'text', |
276 | 276 | ], |
277 | 277 | 'settings.schema.description.default' => [ |
278 | 278 | 'default' => 'post', |
279 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_description</code>', |
|
280 | - 'label' => __('Default Description', 'site-reviews'), |
|
279 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_description</code>', |
|
280 | + 'label' => __( 'Default Description', 'site-reviews' ), |
|
281 | 281 | 'options' => [ |
282 | - 'post' => __('Use the assigned or current page excerpt', 'site-reviews'), |
|
283 | - 'custom' => __('Enter a custom description', 'site-reviews'), |
|
282 | + 'post' => __( 'Use the assigned or current page excerpt', 'site-reviews' ), |
|
283 | + 'custom' => __( 'Enter a custom description', 'site-reviews' ), |
|
284 | 284 | ], |
285 | 285 | 'type' => 'select', |
286 | 286 | ], |
@@ -289,16 +289,16 @@ discard block |
||
289 | 289 | 'depends_on' => [ |
290 | 290 | 'settings.schema.description.default' => 'custom', |
291 | 291 | ], |
292 | - 'label' => __('Custom Description', 'site-reviews'), |
|
292 | + 'label' => __( 'Custom Description', 'site-reviews' ), |
|
293 | 293 | 'type' => 'text', |
294 | 294 | ], |
295 | 295 | 'settings.schema.url.default' => [ |
296 | 296 | 'default' => 'post', |
297 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_url</code>', |
|
298 | - 'label' => __('Default URL', 'site-reviews'), |
|
297 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_url</code>', |
|
298 | + 'label' => __( 'Default URL', 'site-reviews' ), |
|
299 | 299 | 'options' => [ |
300 | - 'post' => __('Use the assigned or current page URL', 'site-reviews'), |
|
301 | - 'custom' => __('Enter a custom URL', 'site-reviews'), |
|
300 | + 'post' => __( 'Use the assigned or current page URL', 'site-reviews' ), |
|
301 | + 'custom' => __( 'Enter a custom URL', 'site-reviews' ), |
|
302 | 302 | ], |
303 | 303 | 'type' => 'select', |
304 | 304 | ], |
@@ -307,16 +307,16 @@ discard block |
||
307 | 307 | 'depends_on' => [ |
308 | 308 | 'settings.schema.url.default' => 'custom', |
309 | 309 | ], |
310 | - 'label' => __('Custom URL', 'site-reviews'), |
|
310 | + 'label' => __( 'Custom URL', 'site-reviews' ), |
|
311 | 311 | 'type' => 'text', |
312 | 312 | ], |
313 | 313 | 'settings.schema.image.default' => [ |
314 | 314 | 'default' => 'post', |
315 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_image</code>', |
|
316 | - 'label' => __('Default Image', 'site-reviews'), |
|
315 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_image</code>', |
|
316 | + 'label' => __( 'Default Image', 'site-reviews' ), |
|
317 | 317 | 'options' => [ |
318 | - 'post' => __('Use the featured image of the assigned or current page', 'site-reviews'), |
|
319 | - 'custom' => __('Enter a custom image URL', 'site-reviews'), |
|
318 | + 'post' => __( 'Use the featured image of the assigned or current page', 'site-reviews' ), |
|
319 | + 'custom' => __( 'Enter a custom image URL', 'site-reviews' ), |
|
320 | 320 | ], |
321 | 321 | 'type' => 'select', |
322 | 322 | ], |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | 'depends_on' => [ |
326 | 326 | 'settings.schema.image.default' => 'custom', |
327 | 327 | ], |
328 | - 'label' => __('Custom Image URL', 'site-reviews'), |
|
328 | + 'label' => __( 'Custom Image URL', 'site-reviews' ), |
|
329 | 329 | 'type' => 'text', |
330 | 330 | ], |
331 | 331 | 'settings.schema.address' => [ |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | 'depends_on' => [ |
334 | 334 | 'settings.schema.type.default' => 'LocalBusiness', |
335 | 335 | ], |
336 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_address</code>', |
|
337 | - 'label' => __('Address', 'site-reviews'), |
|
336 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_address</code>', |
|
337 | + 'label' => __( 'Address', 'site-reviews' ), |
|
338 | 338 | 'placeholder' => '60 29th Street #343, San Francisco, CA 94110, US', |
339 | 339 | 'type' => 'text', |
340 | 340 | ], |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | 'depends_on' => [ |
344 | 344 | 'settings.schema.type.default' => 'LocalBusiness', |
345 | 345 | ], |
346 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_telephone</code>', |
|
347 | - 'label' => __('Telephone Number', 'site-reviews'), |
|
346 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_telephone</code>', |
|
347 | + 'label' => __( 'Telephone Number', 'site-reviews' ), |
|
348 | 348 | 'placeholder' => '+1 (877) 273-3049', |
349 | 349 | 'type' => 'text', |
350 | 350 | ], |
@@ -353,8 +353,8 @@ discard block |
||
353 | 353 | 'depends_on' => [ |
354 | 354 | 'settings.schema.type.default' => 'LocalBusiness', |
355 | 355 | ], |
356 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_pricerange</code>', |
|
357 | - 'label' => __('Price Range', 'site-reviews'), |
|
356 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_pricerange</code>', |
|
357 | + 'label' => __( 'Price Range', 'site-reviews' ), |
|
358 | 358 | 'placeholder' => '$$-$$$', |
359 | 359 | 'type' => 'text', |
360 | 360 | ], |
@@ -363,11 +363,11 @@ discard block |
||
363 | 363 | 'depends_on' => [ |
364 | 364 | 'settings.schema.type.default' => 'Product', |
365 | 365 | ], |
366 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_offertype</code>', |
|
367 | - 'label' => __('Offer Type', 'site-reviews'), |
|
366 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_offertype</code>', |
|
367 | + 'label' => __( 'Offer Type', 'site-reviews' ), |
|
368 | 368 | 'options' => [ |
369 | - 'AggregateOffer' => __('AggregateOffer', 'site-reviews'), |
|
370 | - 'Offer' => __('Offer', 'site-reviews'), |
|
369 | + 'AggregateOffer' => __( 'AggregateOffer', 'site-reviews' ), |
|
370 | + 'Offer' => __( 'Offer', 'site-reviews' ), |
|
371 | 371 | ], |
372 | 372 | 'type' => 'select', |
373 | 373 | ], |
@@ -377,8 +377,8 @@ discard block |
||
377 | 377 | 'settings.schema.type.default' => 'Product', |
378 | 378 | 'settings.schema.offertype' => 'Offer', |
379 | 379 | ], |
380 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_price</code>', |
|
381 | - 'label' => __('Price', 'site-reviews'), |
|
380 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_price</code>', |
|
381 | + 'label' => __( 'Price', 'site-reviews' ), |
|
382 | 382 | 'placeholder' => '50.00', |
383 | 383 | 'type' => 'text', |
384 | 384 | ], |
@@ -388,8 +388,8 @@ discard block |
||
388 | 388 | 'settings.schema.type.default' => 'Product', |
389 | 389 | 'settings.schema.offertype' => 'AggregateOffer', |
390 | 390 | ], |
391 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_lowprice</code>', |
|
392 | - 'label' => __('Low Price', 'site-reviews'), |
|
391 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_lowprice</code>', |
|
392 | + 'label' => __( 'Low Price', 'site-reviews' ), |
|
393 | 393 | 'placeholder' => '10.00', |
394 | 394 | 'type' => 'text', |
395 | 395 | ], |
@@ -399,8 +399,8 @@ discard block |
||
399 | 399 | 'settings.schema.type.default' => 'Product', |
400 | 400 | 'settings.schema.offertype' => 'AggregateOffer', |
401 | 401 | ], |
402 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_highprice</code>', |
|
403 | - 'label' => __('High Price', 'site-reviews'), |
|
402 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_highprice</code>', |
|
403 | + 'label' => __( 'High Price', 'site-reviews' ), |
|
404 | 404 | 'placeholder' => '100.00', |
405 | 405 | 'type' => 'text', |
406 | 406 | ], |
@@ -409,34 +409,34 @@ discard block |
||
409 | 409 | 'depends_on' => [ |
410 | 410 | 'settings.schema.type.default' => 'Product', |
411 | 411 | ], |
412 | - 'description' => __('Custom Field name', 'site-reviews').': <code>schema_pricecurrency</code>', |
|
413 | - 'label' => __('Price Currency', 'site-reviews'), |
|
412 | + 'description' => __( 'Custom Field name', 'site-reviews' ).': <code>schema_pricecurrency</code>', |
|
413 | + 'label' => __( 'Price Currency', 'site-reviews' ), |
|
414 | 414 | 'placeholder' => 'USD', |
415 | 415 | 'type' => 'text', |
416 | 416 | ], |
417 | 417 | 'settings.submissions.required' => [ |
418 | 418 | 'default' => ['content', 'email', 'name', 'rating', 'terms', 'title'], |
419 | - 'description' => __('Choose which fields should be required in the submission form.', 'site-reviews'), |
|
420 | - 'label' => __('Required Fields', 'site-reviews'), |
|
419 | + 'description' => __( 'Choose which fields should be required in the submission form.', 'site-reviews' ), |
|
420 | + 'label' => __( 'Required Fields', 'site-reviews' ), |
|
421 | 421 | 'options' => [ |
422 | - 'rating' => __('Rating', 'site-reviews'), |
|
423 | - 'title' => __('Title', 'site-reviews'), |
|
424 | - 'content' => __('Review', 'site-reviews'), |
|
425 | - 'name' => __('Name', 'site-reviews'), |
|
426 | - 'email' => __('Email', 'site-reviews'), |
|
427 | - 'terms' => __('Terms', 'site-reviews'), |
|
422 | + 'rating' => __( 'Rating', 'site-reviews' ), |
|
423 | + 'title' => __( 'Title', 'site-reviews' ), |
|
424 | + 'content' => __( 'Review', 'site-reviews' ), |
|
425 | + 'name' => __( 'Name', 'site-reviews' ), |
|
426 | + 'email' => __( 'Email', 'site-reviews' ), |
|
427 | + 'terms' => __( 'Terms', 'site-reviews' ), |
|
428 | 428 | ], |
429 | 429 | 'type' => 'checkbox', |
430 | 430 | ], |
431 | 431 | 'settings.submissions.limit' => [ |
432 | 432 | 'default' => '', |
433 | - 'description' => __('Limits the number of reviews that can be submitted to one-per-person. If you are assigning reviews, then the limit will be applied to the assigned page or category.', 'site-reviews'), |
|
434 | - 'label' => __('Limit Reviews', 'site-reviews'), |
|
433 | + 'description' => __( 'Limits the number of reviews that can be submitted to one-per-person. If you are assigning reviews, then the limit will be applied to the assigned page or category.', 'site-reviews' ), |
|
434 | + 'label' => __( 'Limit Reviews', 'site-reviews' ), |
|
435 | 435 | 'options' => [ |
436 | - '' => __('No Limit', 'site-reviews'), |
|
437 | - 'email' => __('By Email Address', 'site-reviews'), |
|
438 | - 'ip_address' => __('By IP Address', 'site-reviews'), |
|
439 | - 'username' => __('By Username (will only work for registered users)', 'site-reviews'), |
|
436 | + '' => __( 'No Limit', 'site-reviews' ), |
|
437 | + 'email' => __( 'By Email Address', 'site-reviews' ), |
|
438 | + 'ip_address' => __( 'By IP Address', 'site-reviews' ), |
|
439 | + 'username' => __( 'By Username (will only work for registered users)', 'site-reviews' ), |
|
440 | 440 | ], |
441 | 441 | 'type' => 'select', |
442 | 442 | ], |
@@ -445,8 +445,8 @@ discard block |
||
445 | 445 | 'depends_on' => [ |
446 | 446 | 'settings.submissions.limit' => ['email'], |
447 | 447 | ], |
448 | - 'description' => __('One Email per line. All emails in the whitelist will be excluded from the review submission limit.', 'site-reviews'), |
|
449 | - 'label' => __('Email Whitelist', 'site-reviews'), |
|
448 | + 'description' => __( 'One Email per line. All emails in the whitelist will be excluded from the review submission limit.', 'site-reviews' ), |
|
449 | + 'label' => __( 'Email Whitelist', 'site-reviews' ), |
|
450 | 450 | 'rows' => 5, |
451 | 451 | 'type' => 'code', |
452 | 452 | ], |
@@ -455,8 +455,8 @@ discard block |
||
455 | 455 | 'depends_on' => [ |
456 | 456 | 'settings.submissions.limit' => ['ip_address'], |
457 | 457 | ], |
458 | - 'description' => __('One IP Address per line. All IP Addresses in the whitelist will be excluded from the review submission limit..', 'site-reviews'), |
|
459 | - 'label' => __('IP Address Whitelist', 'site-reviews'), |
|
458 | + 'description' => __( 'One IP Address per line. All IP Addresses in the whitelist will be excluded from the review submission limit..', 'site-reviews' ), |
|
459 | + 'label' => __( 'IP Address Whitelist', 'site-reviews' ), |
|
460 | 460 | 'rows' => 5, |
461 | 461 | 'type' => 'code', |
462 | 462 | ], |
@@ -465,15 +465,15 @@ discard block |
||
465 | 465 | 'depends_on' => [ |
466 | 466 | 'settings.submissions.limit' => ['username'], |
467 | 467 | ], |
468 | - 'description' => __('One Username per line. All registered users with a Username in the whitelist will be excluded from the review submission limit.', 'site-reviews'), |
|
469 | - 'label' => __('Username Whitelist', 'site-reviews'), |
|
468 | + 'description' => __( 'One Username per line. All registered users with a Username in the whitelist will be excluded from the review submission limit.', 'site-reviews' ), |
|
469 | + 'label' => __( 'Username Whitelist', 'site-reviews' ), |
|
470 | 470 | 'rows' => 5, |
471 | 471 | 'type' => 'code', |
472 | 472 | ], |
473 | 473 | 'settings.submissions.recaptcha.integration' => [ |
474 | 474 | 'default' => '', |
475 | - 'description' => __('Invisible reCAPTCHA is a free anti-spam service from Google. To use it, you will need to <a href="https://www.google.com/recaptcha/admin" target="_blank">sign up</a> for an API key pair for your site.', 'site-reviews'), |
|
476 | - 'label' => __('Invisible reCAPTCHA', 'site-reviews'), |
|
475 | + 'description' => __( 'Invisible reCAPTCHA is a free anti-spam service from Google. To use it, you will need to <a href="https://www.google.com/recaptcha/admin" target="_blank">sign up</a> for an API key pair for your site.', 'site-reviews' ), |
|
476 | + 'label' => __( 'Invisible reCAPTCHA', 'site-reviews' ), |
|
477 | 477 | 'options' => [ |
478 | 478 | '' => 'Do not use reCAPTCHA', |
479 | 479 | 'all' => 'Use reCAPTCHA', |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | 'depends_on' => [ |
487 | 487 | 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
488 | 488 | ], |
489 | - 'label' => __('Site Key', 'site-reviews'), |
|
489 | + 'label' => __( 'Site Key', 'site-reviews' ), |
|
490 | 490 | 'type' => 'text', |
491 | 491 | ], |
492 | 492 | 'settings.submissions.recaptcha.secret' => [ |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | 'depends_on' => [ |
495 | 495 | 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
496 | 496 | ], |
497 | - 'label' => __('Site Secret', 'site-reviews'), |
|
497 | + 'label' => __( 'Site Secret', 'site-reviews' ), |
|
498 | 498 | 'type' => 'text', |
499 | 499 | ], |
500 | 500 | 'settings.submissions.recaptcha.position' => [ |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | 'depends_on' => [ |
503 | 503 | 'settings.submissions.recaptcha.integration' => ['all', 'guest'], |
504 | 504 | ], |
505 | - 'description' => __('This option may not work consistently if another plugin is loading reCAPTCHA on the same page as Site Reviews.', 'site-reviews'), |
|
506 | - 'label' => __('Badge Position', 'site-reviews'), |
|
505 | + 'description' => __( 'This option may not work consistently if another plugin is loading reCAPTCHA on the same page as Site Reviews.', 'site-reviews' ), |
|
506 | + 'label' => __( 'Badge Position', 'site-reviews' ), |
|
507 | 507 | 'options' => [ |
508 | 508 | 'bottomleft' => 'Bottom Left', |
509 | 509 | 'bottomright' => 'Bottom Right', |
@@ -513,16 +513,16 @@ discard block |
||
513 | 513 | ], |
514 | 514 | 'settings.submissions.akismet' => [ |
515 | 515 | 'default' => 'no', |
516 | - 'description' => __('The <a href="https://akismet.com" target="_blank">Akismet plugin</a> integration provides spam-filtering for your reviews. In order for this setting to have any affect, you will need to first install and activate the Akismet plugin and set up a WordPress.com API key.', 'site-reviews'), |
|
517 | - 'label' => __('Enable Akismet Integration', 'site-reviews'), |
|
516 | + 'description' => __( 'The <a href="https://akismet.com" target="_blank">Akismet plugin</a> integration provides spam-filtering for your reviews. In order for this setting to have any affect, you will need to first install and activate the Akismet plugin and set up a WordPress.com API key.', 'site-reviews' ), |
|
517 | + 'label' => __( 'Enable Akismet Integration', 'site-reviews' ), |
|
518 | 518 | 'type' => 'yes_no', |
519 | 519 | ], |
520 | 520 | 'settings.submissions.blacklist.integration' => [ |
521 | 521 | 'default' => '', |
522 | - 'description' => sprintf(__('Choose which Blacklist you would prefer to use for reviews. The %s can be found in the WordPress Discussion Settings page.', 'site-reviews'), |
|
523 | - '<a href="'.admin_url('options-discussion.php#users_can_register').'">'.__('Comment Blacklist', 'site-reviews').'</a>' |
|
522 | + 'description' => sprintf( __( 'Choose which Blacklist you would prefer to use for reviews. The %s can be found in the WordPress Discussion Settings page.', 'site-reviews' ), |
|
523 | + '<a href="'.admin_url( 'options-discussion.php#users_can_register' ).'">'.__( 'Comment Blacklist', 'site-reviews' ).'</a>' |
|
524 | 524 | ), |
525 | - 'label' => __('Blacklist', 'site-reviews'), |
|
525 | + 'label' => __( 'Blacklist', 'site-reviews' ), |
|
526 | 526 | 'options' => [ |
527 | 527 | '' => 'Use the Site Reviews Blacklist', |
528 | 528 | 'comments' => 'Use the WordPress Comment Blacklist', |
@@ -534,18 +534,18 @@ discard block |
||
534 | 534 | 'depends_on' => [ |
535 | 535 | 'settings.submissions.blacklist.integration' => [''], |
536 | 536 | ], |
537 | - 'description' => __('One entry or IP address per line. When a review contains any of these entries in its title, content, name, email, or IP address, it will be rejected. It is case-insensitive and will match partial words, so "press" will match "WordPress".', 'site-reviews'), |
|
538 | - 'label' => __('Review Blacklist', 'site-reviews'), |
|
537 | + 'description' => __( 'One entry or IP address per line. When a review contains any of these entries in its title, content, name, email, or IP address, it will be rejected. It is case-insensitive and will match partial words, so "press" will match "WordPress".', 'site-reviews' ), |
|
538 | + 'label' => __( 'Review Blacklist', 'site-reviews' ), |
|
539 | 539 | 'rows' => 10, |
540 | 540 | 'type' => 'code', |
541 | 541 | ], |
542 | 542 | 'settings.submissions.blacklist.action' => [ |
543 | 543 | 'default' => 'unapprove', |
544 | - 'description' => __('Choose the action that should be taken when a review is blacklisted.', 'site-reviews'), |
|
545 | - 'label' => __('Blacklist Action', 'site-reviews'), |
|
544 | + 'description' => __( 'Choose the action that should be taken when a review is blacklisted.', 'site-reviews' ), |
|
545 | + 'label' => __( 'Blacklist Action', 'site-reviews' ), |
|
546 | 546 | 'options' => [ |
547 | - 'unapprove' => __('Require approval', 'site-reviews'), |
|
548 | - 'reject' => __('Reject submission', 'site-reviews'), |
|
547 | + 'unapprove' => __( 'Require approval', 'site-reviews' ), |
|
548 | + 'reject' => __( 'Reject submission', 'site-reviews' ), |
|
549 | 549 | ], |
550 | 550 | 'type' => 'select', |
551 | 551 | ], |
@@ -1,37 +1,37 @@ discard block |
||
1 | -<?php defined('WPINC') || die; ?> |
|
1 | +<?php defined( 'WPINC' ) || die; ?> |
|
2 | 2 | |
3 | 3 | <form method="post" class="glsr-form-sync glsr-status"> |
4 | - <?php $selected = key($services); ?> |
|
4 | + <?php $selected = key( $services ); ?> |
|
5 | 5 | <table class="wp-list-table widefat fixed striped"> |
6 | 6 | <thead> |
7 | 7 | <tr> |
8 | 8 | <td class="check-column glsr-radio-column"><span class="dashicons-before dashicons-update"></span></td> |
9 | - <th scope="col" class="column-primary"><?= __('Service', 'site-reviews'); ?></th> |
|
10 | - <th scope="col" class="column-total_fetched"><?= __('Reviews', 'site-reviews'); ?></th> |
|
11 | - <th scope="col" class="column-last_sync"><?= __('Last Sync', 'site-reviews'); ?></th> |
|
9 | + <th scope="col" class="column-primary"><?= __( 'Service', 'site-reviews' ); ?></th> |
|
10 | + <th scope="col" class="column-total_fetched"><?= __( 'Reviews', 'site-reviews' ); ?></th> |
|
11 | + <th scope="col" class="column-last_sync"><?= __( 'Last Sync', 'site-reviews' ); ?></th> |
|
12 | 12 | </tr> |
13 | 13 | </thead> |
14 | 14 | <tbody> |
15 | - <?php foreach ($services as $slug => $details) : ?> |
|
15 | + <?php foreach( $services as $slug => $details ) : ?> |
|
16 | 16 | <tr class="service-<?= $slug; ?>"> |
17 | 17 | <th scope="row" class="check-column"> |
18 | - <input type="radio" name="{{ id }}[service]" value="<?= $slug; ?>" <?php checked($slug, $selected); ?>> |
|
18 | + <input type="radio" name="{{ id }}[service]" value="<?= $slug; ?>" <?php checked( $slug, $selected ); ?>> |
|
19 | 19 | </th> |
20 | 20 | <td class="column-primary has-row-actions"> |
21 | 21 | <strong><?= $details['name']; ?></strong> |
22 | 22 | <div class="row-actions"> |
23 | - <span><a href="{{ base_url }}&page=settings#!addons"><?= __('Settings', 'site-reviews'); ?></a> | </span> |
|
24 | - <span><a href="{{ base_url }}&page=settings#!licenses"><?= __('License', 'site-reviews'); ?></a> | </span> |
|
25 | - <span><a href="{{ base_url }}&page=documentation#!addons"><?= __('Documentation', 'site-reviews'); ?></a></span> |
|
23 | + <span><a href="{{ base_url }}&page=settings#!addons"><?= __( 'Settings', 'site-reviews' ); ?></a> | </span> |
|
24 | + <span><a href="{{ base_url }}&page=settings#!licenses"><?= __( 'License', 'site-reviews' ); ?></a> | </span> |
|
25 | + <span><a href="{{ base_url }}&page=documentation#!addons"><?= __( 'Documentation', 'site-reviews' ); ?></a></span> |
|
26 | 26 | </div> |
27 | 27 | <button type="button" class="toggle-row"> |
28 | - <span class="screen-reader-text"><?= __('Show more details', 'site-reviews'); ?></span> |
|
28 | + <span class="screen-reader-text"><?= __( 'Show more details', 'site-reviews' ); ?></span> |
|
29 | 29 | </button> |
30 | 30 | </td> |
31 | - <td class="column-total_fetched" data-colname="<?= __('Reviews', 'site-reviews'); ?>"> |
|
31 | + <td class="column-total_fetched" data-colname="<?= __( 'Reviews', 'site-reviews' ); ?>"> |
|
32 | 32 | <a href="<?= $details['reviews_url']; ?>"><?= $details['reviews_count']; ?></a> |
33 | 33 | </td> |
34 | - <td class="column-last_sync" data-colname="<?= __('Last Sync', 'site-reviews'); ?>"> |
|
34 | + <td class="column-last_sync" data-colname="<?= __( 'Last Sync', 'site-reviews' ); ?>"> |
|
35 | 35 | <?= $details['last_sync']; ?> |
36 | 36 | </td> |
37 | 37 | </tr> |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | <tfoot> |
41 | 41 | <tr> |
42 | 42 | <td colspan="4" class="no-items" style="display:table-cell!important;"> |
43 | - <div class="glsr-progress" data-active-text="<?= __('Please wait...', 'site-reviews'); ?>"> |
|
43 | + <div class="glsr-progress" data-active-text="<?= __( 'Please wait...', 'site-reviews' ); ?>"> |
|
44 | 44 | <div class="glsr-progress-bar" style="width: 0%;"> |
45 | - <span class="glsr-progress-status"><?= __('Inactive', 'site-reviews'); ?></span> |
|
45 | + <span class="glsr-progress-status"><?= __( 'Inactive', 'site-reviews' ); ?></span> |
|
46 | 46 | </div> |
47 | 47 | <div class="glsr-progress-background"> |
48 | - <span class="glsr-progress-status"><?= __('Inactive', 'site-reviews'); ?></span> |
|
48 | + <span class="glsr-progress-status"><?= __( 'Inactive', 'site-reviews' ); ?></span> |
|
49 | 49 | </div> |
50 | 50 | </div> |
51 | 51 | </td> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | </table> |
55 | 55 | <div class="tablenav bottom"> |
56 | 56 | <button type="submit" class="glsr-button button" id="sync-reviews"> |
57 | - <span data-loading="<?= __('Syncing...', 'site-reviews'); ?>"><?= __('Sync Reviews', 'site-reviews'); ?></span> |
|
57 | + <span data-loading="<?= __( 'Syncing...', 'site-reviews' ); ?>"><?= __( 'Sync Reviews', 'site-reviews' ); ?></span> |
|
58 | 58 | </button> |
59 | 59 | </div> |
60 | 60 | </form> |
@@ -10,97 +10,97 @@ |
||
10 | 10 | |
11 | 11 | class MainController extends Controller |
12 | 12 | { |
13 | - /** |
|
14 | - * @return void |
|
15 | - * @action init |
|
16 | - */ |
|
17 | - public function registerPostType() |
|
18 | - { |
|
19 | - if (!glsr()->hasPermission()) { |
|
20 | - return; |
|
21 | - } |
|
22 | - $command = new RegisterPostType([ |
|
23 | - 'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE], |
|
24 | - 'columns' => [ |
|
25 | - 'title' => '', |
|
26 | - 'category' => '', |
|
27 | - 'assigned_to' => __('Assigned To', 'site-reviews'), |
|
28 | - 'reviewer' => __('Author', 'site-reviews'), |
|
29 | - 'email' => __('Email', 'site-reviews'), |
|
30 | - 'ip_address' => __('IP Address', 'site-reviews'), |
|
31 | - 'response' => __('Response', 'site-reviews'), |
|
32 | - 'review_type' => __('Type', 'site-reviews'), |
|
33 | - 'rating' => __('Rating', 'site-reviews'), |
|
34 | - 'pinned' => __('Pinned', 'site-reviews'), |
|
35 | - 'date' => '', |
|
36 | - ], |
|
37 | - 'menu_icon' => 'dashicons-star-half', |
|
38 | - 'menu_name' => glsr()->name, |
|
39 | - 'map_meta_cap' => true, |
|
40 | - 'plural' => __('Reviews', 'site-reviews'), |
|
41 | - 'post_type' => Application::POST_TYPE, |
|
42 | - 'rest_controller_class' => RestReviewController::class, |
|
43 | - 'show_in_rest' => true, |
|
44 | - 'single' => __('Review', 'site-reviews'), |
|
45 | - ]); |
|
46 | - $this->execute($command); |
|
47 | - } |
|
13 | + /** |
|
14 | + * @return void |
|
15 | + * @action init |
|
16 | + */ |
|
17 | + public function registerPostType() |
|
18 | + { |
|
19 | + if (!glsr()->hasPermission()) { |
|
20 | + return; |
|
21 | + } |
|
22 | + $command = new RegisterPostType([ |
|
23 | + 'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE], |
|
24 | + 'columns' => [ |
|
25 | + 'title' => '', |
|
26 | + 'category' => '', |
|
27 | + 'assigned_to' => __('Assigned To', 'site-reviews'), |
|
28 | + 'reviewer' => __('Author', 'site-reviews'), |
|
29 | + 'email' => __('Email', 'site-reviews'), |
|
30 | + 'ip_address' => __('IP Address', 'site-reviews'), |
|
31 | + 'response' => __('Response', 'site-reviews'), |
|
32 | + 'review_type' => __('Type', 'site-reviews'), |
|
33 | + 'rating' => __('Rating', 'site-reviews'), |
|
34 | + 'pinned' => __('Pinned', 'site-reviews'), |
|
35 | + 'date' => '', |
|
36 | + ], |
|
37 | + 'menu_icon' => 'dashicons-star-half', |
|
38 | + 'menu_name' => glsr()->name, |
|
39 | + 'map_meta_cap' => true, |
|
40 | + 'plural' => __('Reviews', 'site-reviews'), |
|
41 | + 'post_type' => Application::POST_TYPE, |
|
42 | + 'rest_controller_class' => RestReviewController::class, |
|
43 | + 'show_in_rest' => true, |
|
44 | + 'single' => __('Review', 'site-reviews'), |
|
45 | + ]); |
|
46 | + $this->execute($command); |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @return void |
|
51 | - * @action init |
|
52 | - */ |
|
53 | - public function registerShortcodes() |
|
54 | - { |
|
55 | - $command = new RegisterShortcodes([ |
|
56 | - 'site_reviews', |
|
57 | - 'site_reviews_form', |
|
58 | - 'site_reviews_summary', |
|
59 | - ]); |
|
60 | - $this->execute($command); |
|
61 | - } |
|
49 | + /** |
|
50 | + * @return void |
|
51 | + * @action init |
|
52 | + */ |
|
53 | + public function registerShortcodes() |
|
54 | + { |
|
55 | + $command = new RegisterShortcodes([ |
|
56 | + 'site_reviews', |
|
57 | + 'site_reviews_form', |
|
58 | + 'site_reviews_summary', |
|
59 | + ]); |
|
60 | + $this->execute($command); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @return void |
|
65 | - * @action init |
|
66 | - */ |
|
67 | - public function registerTaxonomy() |
|
68 | - { |
|
69 | - $command = new RegisterTaxonomy([ |
|
70 | - 'hierarchical' => true, |
|
71 | - 'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'], |
|
72 | - 'public' => false, |
|
73 | - 'rest_controller_class' => RestCategoryController::class, |
|
74 | - 'show_admin_column' => true, |
|
75 | - 'show_in_rest' => true, |
|
76 | - 'show_ui' => true, |
|
77 | - ]); |
|
78 | - $this->execute($command); |
|
79 | - } |
|
63 | + /** |
|
64 | + * @return void |
|
65 | + * @action init |
|
66 | + */ |
|
67 | + public function registerTaxonomy() |
|
68 | + { |
|
69 | + $command = new RegisterTaxonomy([ |
|
70 | + 'hierarchical' => true, |
|
71 | + 'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'], |
|
72 | + 'public' => false, |
|
73 | + 'rest_controller_class' => RestCategoryController::class, |
|
74 | + 'show_admin_column' => true, |
|
75 | + 'show_in_rest' => true, |
|
76 | + 'show_ui' => true, |
|
77 | + ]); |
|
78 | + $this->execute($command); |
|
79 | + } |
|
80 | 80 | |
81 | - /** |
|
82 | - * @return void |
|
83 | - * @action widgets_init |
|
84 | - */ |
|
85 | - public function registerWidgets() |
|
86 | - { |
|
87 | - $command = new RegisterWidgets([ |
|
88 | - 'site-reviews' => [ |
|
89 | - 'class' => 'glsr-widget glsr-widget-site-reviews', |
|
90 | - 'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'), |
|
91 | - 'title' => __('Recent Reviews', 'site-reviews'), |
|
92 | - ], |
|
93 | - 'site-reviews-form' => [ |
|
94 | - 'class' => 'glsr-widget glsr-widget-site-reviews-form', |
|
95 | - 'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'), |
|
96 | - 'title' => __('Submit a Review', 'site-reviews'), |
|
97 | - ], |
|
98 | - 'site-reviews-summary' => [ |
|
99 | - 'class' => 'glsr-widget glsr-widget-site-reviews-summary', |
|
100 | - 'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'), |
|
101 | - 'title' => __('Summary of Reviews', 'site-reviews'), |
|
102 | - ], |
|
103 | - ]); |
|
104 | - $this->execute($command); |
|
105 | - } |
|
81 | + /** |
|
82 | + * @return void |
|
83 | + * @action widgets_init |
|
84 | + */ |
|
85 | + public function registerWidgets() |
|
86 | + { |
|
87 | + $command = new RegisterWidgets([ |
|
88 | + 'site-reviews' => [ |
|
89 | + 'class' => 'glsr-widget glsr-widget-site-reviews', |
|
90 | + 'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'), |
|
91 | + 'title' => __('Recent Reviews', 'site-reviews'), |
|
92 | + ], |
|
93 | + 'site-reviews-form' => [ |
|
94 | + 'class' => 'glsr-widget glsr-widget-site-reviews-form', |
|
95 | + 'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'), |
|
96 | + 'title' => __('Submit a Review', 'site-reviews'), |
|
97 | + ], |
|
98 | + 'site-reviews-summary' => [ |
|
99 | + 'class' => 'glsr-widget glsr-widget-site-reviews-summary', |
|
100 | + 'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'), |
|
101 | + 'title' => __('Summary of Reviews', 'site-reviews'), |
|
102 | + ], |
|
103 | + ]); |
|
104 | + $this->execute($command); |
|
105 | + } |
|
106 | 106 | } |
@@ -16,34 +16,34 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function registerPostType() |
18 | 18 | { |
19 | - if (!glsr()->hasPermission()) { |
|
19 | + if( !glsr()->hasPermission() ) { |
|
20 | 20 | return; |
21 | 21 | } |
22 | - $command = new RegisterPostType([ |
|
22 | + $command = new RegisterPostType( [ |
|
23 | 23 | 'capabilities' => ['create_posts' => 'create_'.Application::POST_TYPE], |
24 | 24 | 'columns' => [ |
25 | 25 | 'title' => '', |
26 | 26 | 'category' => '', |
27 | - 'assigned_to' => __('Assigned To', 'site-reviews'), |
|
28 | - 'reviewer' => __('Author', 'site-reviews'), |
|
29 | - 'email' => __('Email', 'site-reviews'), |
|
30 | - 'ip_address' => __('IP Address', 'site-reviews'), |
|
31 | - 'response' => __('Response', 'site-reviews'), |
|
32 | - 'review_type' => __('Type', 'site-reviews'), |
|
33 | - 'rating' => __('Rating', 'site-reviews'), |
|
34 | - 'pinned' => __('Pinned', 'site-reviews'), |
|
27 | + 'assigned_to' => __( 'Assigned To', 'site-reviews' ), |
|
28 | + 'reviewer' => __( 'Author', 'site-reviews' ), |
|
29 | + 'email' => __( 'Email', 'site-reviews' ), |
|
30 | + 'ip_address' => __( 'IP Address', 'site-reviews' ), |
|
31 | + 'response' => __( 'Response', 'site-reviews' ), |
|
32 | + 'review_type' => __( 'Type', 'site-reviews' ), |
|
33 | + 'rating' => __( 'Rating', 'site-reviews' ), |
|
34 | + 'pinned' => __( 'Pinned', 'site-reviews' ), |
|
35 | 35 | 'date' => '', |
36 | 36 | ], |
37 | 37 | 'menu_icon' => 'dashicons-star-half', |
38 | 38 | 'menu_name' => glsr()->name, |
39 | 39 | 'map_meta_cap' => true, |
40 | - 'plural' => __('Reviews', 'site-reviews'), |
|
40 | + 'plural' => __( 'Reviews', 'site-reviews' ), |
|
41 | 41 | 'post_type' => Application::POST_TYPE, |
42 | 42 | 'rest_controller_class' => RestReviewController::class, |
43 | 43 | 'show_in_rest' => true, |
44 | - 'single' => __('Review', 'site-reviews'), |
|
45 | - ]); |
|
46 | - $this->execute($command); |
|
44 | + 'single' => __( 'Review', 'site-reviews' ), |
|
45 | + ] ); |
|
46 | + $this->execute( $command ); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function registerShortcodes() |
54 | 54 | { |
55 | - $command = new RegisterShortcodes([ |
|
55 | + $command = new RegisterShortcodes( [ |
|
56 | 56 | 'site_reviews', |
57 | 57 | 'site_reviews_form', |
58 | 58 | 'site_reviews_summary', |
59 | - ]); |
|
60 | - $this->execute($command); |
|
59 | + ] ); |
|
60 | + $this->execute( $command ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function registerTaxonomy() |
68 | 68 | { |
69 | - $command = new RegisterTaxonomy([ |
|
69 | + $command = new RegisterTaxonomy( [ |
|
70 | 70 | 'hierarchical' => true, |
71 | - 'meta_box_cb' => [glsr(EditorController::class), 'renderTaxonomyMetabox'], |
|
71 | + 'meta_box_cb' => [glsr( EditorController::class ), 'renderTaxonomyMetabox'], |
|
72 | 72 | 'public' => false, |
73 | 73 | 'rest_controller_class' => RestCategoryController::class, |
74 | 74 | 'show_admin_column' => true, |
75 | 75 | 'show_in_rest' => true, |
76 | 76 | 'show_ui' => true, |
77 | - ]); |
|
78 | - $this->execute($command); |
|
77 | + ] ); |
|
78 | + $this->execute( $command ); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -84,23 +84,23 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function registerWidgets() |
86 | 86 | { |
87 | - $command = new RegisterWidgets([ |
|
87 | + $command = new RegisterWidgets( [ |
|
88 | 88 | 'site-reviews' => [ |
89 | 89 | 'class' => 'glsr-widget glsr-widget-site-reviews', |
90 | - 'description' => __('Site Reviews: Display your recent reviews.', 'site-reviews'), |
|
91 | - 'title' => __('Recent Reviews', 'site-reviews'), |
|
90 | + 'description' => __( 'Site Reviews: Display your recent reviews.', 'site-reviews' ), |
|
91 | + 'title' => __( 'Recent Reviews', 'site-reviews' ), |
|
92 | 92 | ], |
93 | 93 | 'site-reviews-form' => [ |
94 | 94 | 'class' => 'glsr-widget glsr-widget-site-reviews-form', |
95 | - 'description' => __('Site Reviews: Display a form to submit reviews.', 'site-reviews'), |
|
96 | - 'title' => __('Submit a Review', 'site-reviews'), |
|
95 | + 'description' => __( 'Site Reviews: Display a form to submit reviews.', 'site-reviews' ), |
|
96 | + 'title' => __( 'Submit a Review', 'site-reviews' ), |
|
97 | 97 | ], |
98 | 98 | 'site-reviews-summary' => [ |
99 | 99 | 'class' => 'glsr-widget glsr-widget-site-reviews-summary', |
100 | - 'description' => __('Site Reviews: Display a summary of your reviews.', 'site-reviews'), |
|
101 | - 'title' => __('Summary of Reviews', 'site-reviews'), |
|
100 | + 'description' => __( 'Site Reviews: Display a summary of your reviews.', 'site-reviews' ), |
|
101 | + 'title' => __( 'Summary of Reviews', 'site-reviews' ), |
|
102 | 102 | ], |
103 | - ]); |
|
104 | - $this->execute($command); |
|
103 | + ] ); |
|
104 | + $this->execute( $command ); |
|
105 | 105 | } |
106 | 106 | } |
@@ -10,176 +10,176 @@ |
||
10 | 10 | |
11 | 11 | class Columns |
12 | 12 | { |
13 | - /** |
|
14 | - * @param int $postId |
|
15 | - * @return void|string |
|
16 | - */ |
|
17 | - public function buildColumnAssignedTo($postId) |
|
18 | - { |
|
19 | - $assignedPost = glsr(Database::class)->getAssignedToPost($postId); |
|
20 | - if ($assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status) { |
|
21 | - return glsr(Builder::class)->a(get_the_title($assignedPost->ID), [ |
|
22 | - 'href' => (string) get_the_permalink($assignedPost->ID), |
|
23 | - ]); |
|
24 | - } |
|
25 | - } |
|
13 | + /** |
|
14 | + * @param int $postId |
|
15 | + * @return void|string |
|
16 | + */ |
|
17 | + public function buildColumnAssignedTo($postId) |
|
18 | + { |
|
19 | + $assignedPost = glsr(Database::class)->getAssignedToPost($postId); |
|
20 | + if ($assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status) { |
|
21 | + return glsr(Builder::class)->a(get_the_title($assignedPost->ID), [ |
|
22 | + 'href' => (string) get_the_permalink($assignedPost->ID), |
|
23 | + ]); |
|
24 | + } |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * @param int $postId |
|
29 | - * @return void|string |
|
30 | - */ |
|
31 | - public function buildColumnEmail($postId) |
|
32 | - { |
|
33 | - if ($email = glsr(Database::class)->get($postId, 'email')) { |
|
34 | - return $email; |
|
35 | - } |
|
36 | - } |
|
27 | + /** |
|
28 | + * @param int $postId |
|
29 | + * @return void|string |
|
30 | + */ |
|
31 | + public function buildColumnEmail($postId) |
|
32 | + { |
|
33 | + if ($email = glsr(Database::class)->get($postId, 'email')) { |
|
34 | + return $email; |
|
35 | + } |
|
36 | + } |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param int $postId |
|
40 | - * @return void|string |
|
41 | - */ |
|
42 | - public function buildColumnIpAddress($postId) |
|
43 | - { |
|
44 | - if ($ipAddress = glsr(Database::class)->get($postId, 'ip_address')) { |
|
45 | - return $ipAddress; |
|
46 | - } |
|
47 | - } |
|
38 | + /** |
|
39 | + * @param int $postId |
|
40 | + * @return void|string |
|
41 | + */ |
|
42 | + public function buildColumnIpAddress($postId) |
|
43 | + { |
|
44 | + if ($ipAddress = glsr(Database::class)->get($postId, 'ip_address')) { |
|
45 | + return $ipAddress; |
|
46 | + } |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @param int $postId |
|
51 | - * @return string |
|
52 | - */ |
|
53 | - public function buildColumnPinned($postId) |
|
54 | - { |
|
55 | - $pinned = glsr(Database::class)->get($postId, 'pinned') |
|
56 | - ? 'pinned ' |
|
57 | - : ''; |
|
58 | - return glsr(Builder::class)->i([ |
|
59 | - 'class' => $pinned.'dashicons dashicons-sticky', |
|
60 | - 'data-id' => $postId, |
|
61 | - ]); |
|
62 | - } |
|
49 | + /** |
|
50 | + * @param int $postId |
|
51 | + * @return string |
|
52 | + */ |
|
53 | + public function buildColumnPinned($postId) |
|
54 | + { |
|
55 | + $pinned = glsr(Database::class)->get($postId, 'pinned') |
|
56 | + ? 'pinned ' |
|
57 | + : ''; |
|
58 | + return glsr(Builder::class)->i([ |
|
59 | + 'class' => $pinned.'dashicons dashicons-sticky', |
|
60 | + 'data-id' => $postId, |
|
61 | + ]); |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @param int $postId |
|
66 | - * @return string |
|
67 | - */ |
|
68 | - public function buildColumnResponse($postId) |
|
69 | - { |
|
70 | - return glsr(Database::class)->get($postId, 'response') |
|
71 | - ? __('Yes', 'site-reviews') |
|
72 | - : __('No', 'site-reviews'); |
|
73 | - } |
|
64 | + /** |
|
65 | + * @param int $postId |
|
66 | + * @return string |
|
67 | + */ |
|
68 | + public function buildColumnResponse($postId) |
|
69 | + { |
|
70 | + return glsr(Database::class)->get($postId, 'response') |
|
71 | + ? __('Yes', 'site-reviews') |
|
72 | + : __('No', 'site-reviews'); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @param int $postId |
|
77 | - * @return string |
|
78 | - */ |
|
79 | - public function buildColumnReviewer($postId) |
|
80 | - { |
|
81 | - return strval(glsr(Database::class)->get($postId, 'author')); |
|
82 | - } |
|
75 | + /** |
|
76 | + * @param int $postId |
|
77 | + * @return string |
|
78 | + */ |
|
79 | + public function buildColumnReviewer($postId) |
|
80 | + { |
|
81 | + return strval(glsr(Database::class)->get($postId, 'author')); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @param int $postId |
|
86 | - * @param int|null $rating |
|
87 | - * @return string |
|
88 | - */ |
|
89 | - public function buildColumnRating($postId) |
|
90 | - { |
|
91 | - return glsr_star_rating(intval(glsr(Database::class)->get($postId, 'rating'))); |
|
92 | - } |
|
84 | + /** |
|
85 | + * @param int $postId |
|
86 | + * @param int|null $rating |
|
87 | + * @return string |
|
88 | + */ |
|
89 | + public function buildColumnRating($postId) |
|
90 | + { |
|
91 | + return glsr_star_rating(intval(glsr(Database::class)->get($postId, 'rating'))); |
|
92 | + } |
|
93 | 93 | |
94 | - /** |
|
95 | - * @param int $postId |
|
96 | - * @return string |
|
97 | - */ |
|
98 | - public function buildColumnReviewType($postId) |
|
99 | - { |
|
100 | - $type = glsr(Database::class)->get($postId, 'review_type'); |
|
101 | - return array_key_exists($type, glsr()->reviewTypes) |
|
102 | - ? glsr()->reviewTypes[$type] |
|
103 | - : __('Unsupported Type', 'site-reviews'); |
|
104 | - } |
|
94 | + /** |
|
95 | + * @param int $postId |
|
96 | + * @return string |
|
97 | + */ |
|
98 | + public function buildColumnReviewType($postId) |
|
99 | + { |
|
100 | + $type = glsr(Database::class)->get($postId, 'review_type'); |
|
101 | + return array_key_exists($type, glsr()->reviewTypes) |
|
102 | + ? glsr()->reviewTypes[$type] |
|
103 | + : __('Unsupported Type', 'site-reviews'); |
|
104 | + } |
|
105 | 105 | |
106 | - /** |
|
107 | - * @param string $postType |
|
108 | - * @return void |
|
109 | - */ |
|
110 | - public function renderFilters($postType) |
|
111 | - { |
|
112 | - if (Application::POST_TYPE !== $postType) { |
|
113 | - return; |
|
114 | - } |
|
115 | - if (!($status = filter_input(INPUT_GET, 'post_status'))) { |
|
116 | - $status = 'publish'; |
|
117 | - } |
|
118 | - $ratings = glsr(Database::class)->getReviewsMeta('rating', $status); |
|
119 | - $types = glsr(Database::class)->getReviewsMeta('review_type', $status); |
|
120 | - $this->renderFilterRatings($ratings); |
|
121 | - $this->renderFilterTypes($types); |
|
122 | - } |
|
106 | + /** |
|
107 | + * @param string $postType |
|
108 | + * @return void |
|
109 | + */ |
|
110 | + public function renderFilters($postType) |
|
111 | + { |
|
112 | + if (Application::POST_TYPE !== $postType) { |
|
113 | + return; |
|
114 | + } |
|
115 | + if (!($status = filter_input(INPUT_GET, 'post_status'))) { |
|
116 | + $status = 'publish'; |
|
117 | + } |
|
118 | + $ratings = glsr(Database::class)->getReviewsMeta('rating', $status); |
|
119 | + $types = glsr(Database::class)->getReviewsMeta('review_type', $status); |
|
120 | + $this->renderFilterRatings($ratings); |
|
121 | + $this->renderFilterTypes($types); |
|
122 | + } |
|
123 | 123 | |
124 | - /** |
|
125 | - * @param string $column |
|
126 | - * @param int $postId |
|
127 | - * @return void |
|
128 | - */ |
|
129 | - public function renderValues($column, $postId) |
|
130 | - { |
|
131 | - $method = Helper::buildMethodName($column, 'buildColumn'); |
|
132 | - $value = method_exists($this, $method) |
|
133 | - ? call_user_func([$this, $method], $postId) |
|
134 | - : apply_filters('site-reviews/columns/'.$column, '', $postId); |
|
135 | - if (empty($value)) { |
|
136 | - $value = '—'; |
|
137 | - } |
|
138 | - echo $value; |
|
139 | - } |
|
124 | + /** |
|
125 | + * @param string $column |
|
126 | + * @param int $postId |
|
127 | + * @return void |
|
128 | + */ |
|
129 | + public function renderValues($column, $postId) |
|
130 | + { |
|
131 | + $method = Helper::buildMethodName($column, 'buildColumn'); |
|
132 | + $value = method_exists($this, $method) |
|
133 | + ? call_user_func([$this, $method], $postId) |
|
134 | + : apply_filters('site-reviews/columns/'.$column, '', $postId); |
|
135 | + if (empty($value)) { |
|
136 | + $value = '—'; |
|
137 | + } |
|
138 | + echo $value; |
|
139 | + } |
|
140 | 140 | |
141 | - /** |
|
142 | - * @param array $ratings |
|
143 | - * @return void |
|
144 | - */ |
|
145 | - protected function renderFilterRatings($ratings) |
|
146 | - { |
|
147 | - if (empty($ratings)) { |
|
148 | - return; |
|
149 | - } |
|
150 | - $ratings = array_flip(array_reverse($ratings)); |
|
151 | - array_walk($ratings, function (&$value, $key) { |
|
152 | - $label = _n('%s star', '%s stars', $key, 'site-reviews'); |
|
153 | - $value = sprintf($label, $key); |
|
154 | - }); |
|
155 | - echo glsr(Builder::class)->label(__('Filter by rating', 'site-reviews'), [ |
|
156 | - 'class' => 'screen-reader-text', |
|
157 | - 'for' => 'rating', |
|
158 | - ]); |
|
159 | - echo glsr(Builder::class)->select([ |
|
160 | - 'name' => 'rating', |
|
161 | - 'options' => ['' => __('All ratings', 'site-reviews')] + $ratings, |
|
162 | - 'value' => filter_input(INPUT_GET, 'rating'), |
|
163 | - ]); |
|
164 | - } |
|
141 | + /** |
|
142 | + * @param array $ratings |
|
143 | + * @return void |
|
144 | + */ |
|
145 | + protected function renderFilterRatings($ratings) |
|
146 | + { |
|
147 | + if (empty($ratings)) { |
|
148 | + return; |
|
149 | + } |
|
150 | + $ratings = array_flip(array_reverse($ratings)); |
|
151 | + array_walk($ratings, function (&$value, $key) { |
|
152 | + $label = _n('%s star', '%s stars', $key, 'site-reviews'); |
|
153 | + $value = sprintf($label, $key); |
|
154 | + }); |
|
155 | + echo glsr(Builder::class)->label(__('Filter by rating', 'site-reviews'), [ |
|
156 | + 'class' => 'screen-reader-text', |
|
157 | + 'for' => 'rating', |
|
158 | + ]); |
|
159 | + echo glsr(Builder::class)->select([ |
|
160 | + 'name' => 'rating', |
|
161 | + 'options' => ['' => __('All ratings', 'site-reviews')] + $ratings, |
|
162 | + 'value' => filter_input(INPUT_GET, 'rating'), |
|
163 | + ]); |
|
164 | + } |
|
165 | 165 | |
166 | - /** |
|
167 | - * @param array $types |
|
168 | - * @return void |
|
169 | - */ |
|
170 | - protected function renderFilterTypes($types) |
|
171 | - { |
|
172 | - if (count(glsr()->reviewTypes) < 2) { |
|
173 | - return; |
|
174 | - } |
|
175 | - echo glsr(Builder::class)->label(__('Filter by type', 'site-reviews'), [ |
|
176 | - 'class' => 'screen-reader-text', |
|
177 | - 'for' => 'review_type', |
|
178 | - ]); |
|
179 | - echo glsr(Builder::class)->select([ |
|
180 | - 'name' => 'review_type', |
|
181 | - 'options' => ['' => __('All types', 'site-reviews')] + glsr()->reviewTypes, |
|
182 | - 'value' => filter_input(INPUT_GET, 'review_type'), |
|
183 | - ]); |
|
184 | - } |
|
166 | + /** |
|
167 | + * @param array $types |
|
168 | + * @return void |
|
169 | + */ |
|
170 | + protected function renderFilterTypes($types) |
|
171 | + { |
|
172 | + if (count(glsr()->reviewTypes) < 2) { |
|
173 | + return; |
|
174 | + } |
|
175 | + echo glsr(Builder::class)->label(__('Filter by type', 'site-reviews'), [ |
|
176 | + 'class' => 'screen-reader-text', |
|
177 | + 'for' => 'review_type', |
|
178 | + ]); |
|
179 | + echo glsr(Builder::class)->select([ |
|
180 | + 'name' => 'review_type', |
|
181 | + 'options' => ['' => __('All types', 'site-reviews')] + glsr()->reviewTypes, |
|
182 | + 'value' => filter_input(INPUT_GET, 'review_type'), |
|
183 | + ]); |
|
184 | + } |
|
185 | 185 | } |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | * @param int $postId |
15 | 15 | * @return void|string |
16 | 16 | */ |
17 | - public function buildColumnAssignedTo($postId) |
|
17 | + public function buildColumnAssignedTo( $postId ) |
|
18 | 18 | { |
19 | - $assignedPost = glsr(Database::class)->getAssignedToPost($postId); |
|
20 | - if ($assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status) { |
|
21 | - return glsr(Builder::class)->a(get_the_title($assignedPost->ID), [ |
|
22 | - 'href' => (string) get_the_permalink($assignedPost->ID), |
|
23 | - ]); |
|
19 | + $assignedPost = glsr( Database::class )->getAssignedToPost( $postId ); |
|
20 | + if( $assignedPost instanceof WP_Post && 'publish' == $assignedPost->post_status ) { |
|
21 | + return glsr( Builder::class )->a( get_the_title( $assignedPost->ID ), [ |
|
22 | + 'href' => (string)get_the_permalink( $assignedPost->ID ), |
|
23 | + ] ); |
|
24 | 24 | } |
25 | 25 | } |
26 | 26 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * @param int $postId |
29 | 29 | * @return void|string |
30 | 30 | */ |
31 | - public function buildColumnEmail($postId) |
|
31 | + public function buildColumnEmail( $postId ) |
|
32 | 32 | { |
33 | - if ($email = glsr(Database::class)->get($postId, 'email')) { |
|
33 | + if( $email = glsr( Database::class )->get( $postId, 'email' ) ) { |
|
34 | 34 | return $email; |
35 | 35 | } |
36 | 36 | } |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param int $postId |
40 | 40 | * @return void|string |
41 | 41 | */ |
42 | - public function buildColumnIpAddress($postId) |
|
42 | + public function buildColumnIpAddress( $postId ) |
|
43 | 43 | { |
44 | - if ($ipAddress = glsr(Database::class)->get($postId, 'ip_address')) { |
|
44 | + if( $ipAddress = glsr( Database::class )->get( $postId, 'ip_address' ) ) { |
|
45 | 45 | return $ipAddress; |
46 | 46 | } |
47 | 47 | } |
@@ -50,35 +50,35 @@ discard block |
||
50 | 50 | * @param int $postId |
51 | 51 | * @return string |
52 | 52 | */ |
53 | - public function buildColumnPinned($postId) |
|
53 | + public function buildColumnPinned( $postId ) |
|
54 | 54 | { |
55 | - $pinned = glsr(Database::class)->get($postId, 'pinned') |
|
55 | + $pinned = glsr( Database::class )->get( $postId, 'pinned' ) |
|
56 | 56 | ? 'pinned ' |
57 | 57 | : ''; |
58 | - return glsr(Builder::class)->i([ |
|
58 | + return glsr( Builder::class )->i( [ |
|
59 | 59 | 'class' => $pinned.'dashicons dashicons-sticky', |
60 | 60 | 'data-id' => $postId, |
61 | - ]); |
|
61 | + ] ); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
65 | 65 | * @param int $postId |
66 | 66 | * @return string |
67 | 67 | */ |
68 | - public function buildColumnResponse($postId) |
|
68 | + public function buildColumnResponse( $postId ) |
|
69 | 69 | { |
70 | - return glsr(Database::class)->get($postId, 'response') |
|
71 | - ? __('Yes', 'site-reviews') |
|
72 | - : __('No', 'site-reviews'); |
|
70 | + return glsr( Database::class )->get( $postId, 'response' ) |
|
71 | + ? __( 'Yes', 'site-reviews' ) |
|
72 | + : __( 'No', 'site-reviews' ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
76 | 76 | * @param int $postId |
77 | 77 | * @return string |
78 | 78 | */ |
79 | - public function buildColumnReviewer($postId) |
|
79 | + public function buildColumnReviewer( $postId ) |
|
80 | 80 | { |
81 | - return strval(glsr(Database::class)->get($postId, 'author')); |
|
81 | + return strval( glsr( Database::class )->get( $postId, 'author' ) ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,39 +86,39 @@ discard block |
||
86 | 86 | * @param int|null $rating |
87 | 87 | * @return string |
88 | 88 | */ |
89 | - public function buildColumnRating($postId) |
|
89 | + public function buildColumnRating( $postId ) |
|
90 | 90 | { |
91 | - return glsr_star_rating(intval(glsr(Database::class)->get($postId, 'rating'))); |
|
91 | + return glsr_star_rating( intval( glsr( Database::class )->get( $postId, 'rating' ) ) ); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | 95 | * @param int $postId |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - public function buildColumnReviewType($postId) |
|
98 | + public function buildColumnReviewType( $postId ) |
|
99 | 99 | { |
100 | - $type = glsr(Database::class)->get($postId, 'review_type'); |
|
101 | - return array_key_exists($type, glsr()->reviewTypes) |
|
100 | + $type = glsr( Database::class )->get( $postId, 'review_type' ); |
|
101 | + return array_key_exists( $type, glsr()->reviewTypes ) |
|
102 | 102 | ? glsr()->reviewTypes[$type] |
103 | - : __('Unsupported Type', 'site-reviews'); |
|
103 | + : __( 'Unsupported Type', 'site-reviews' ); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | 107 | * @param string $postType |
108 | 108 | * @return void |
109 | 109 | */ |
110 | - public function renderFilters($postType) |
|
110 | + public function renderFilters( $postType ) |
|
111 | 111 | { |
112 | - if (Application::POST_TYPE !== $postType) { |
|
112 | + if( Application::POST_TYPE !== $postType ) { |
|
113 | 113 | return; |
114 | 114 | } |
115 | - if (!($status = filter_input(INPUT_GET, 'post_status'))) { |
|
115 | + if( !($status = filter_input( INPUT_GET, 'post_status' )) ) { |
|
116 | 116 | $status = 'publish'; |
117 | 117 | } |
118 | - $ratings = glsr(Database::class)->getReviewsMeta('rating', $status); |
|
119 | - $types = glsr(Database::class)->getReviewsMeta('review_type', $status); |
|
120 | - $this->renderFilterRatings($ratings); |
|
121 | - $this->renderFilterTypes($types); |
|
118 | + $ratings = glsr( Database::class )->getReviewsMeta( 'rating', $status ); |
|
119 | + $types = glsr( Database::class )->getReviewsMeta( 'review_type', $status ); |
|
120 | + $this->renderFilterRatings( $ratings ); |
|
121 | + $this->renderFilterTypes( $types ); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | * @param int $postId |
127 | 127 | * @return void |
128 | 128 | */ |
129 | - public function renderValues($column, $postId) |
|
129 | + public function renderValues( $column, $postId ) |
|
130 | 130 | { |
131 | - $method = Helper::buildMethodName($column, 'buildColumn'); |
|
132 | - $value = method_exists($this, $method) |
|
133 | - ? call_user_func([$this, $method], $postId) |
|
134 | - : apply_filters('site-reviews/columns/'.$column, '', $postId); |
|
135 | - if (empty($value)) { |
|
131 | + $method = Helper::buildMethodName( $column, 'buildColumn' ); |
|
132 | + $value = method_exists( $this, $method ) |
|
133 | + ? call_user_func( [$this, $method], $postId ) |
|
134 | + : apply_filters( 'site-reviews/columns/'.$column, '', $postId ); |
|
135 | + if( empty($value) ) { |
|
136 | 136 | $value = '—'; |
137 | 137 | } |
138 | 138 | echo $value; |
@@ -142,44 +142,44 @@ discard block |
||
142 | 142 | * @param array $ratings |
143 | 143 | * @return void |
144 | 144 | */ |
145 | - protected function renderFilterRatings($ratings) |
|
145 | + protected function renderFilterRatings( $ratings ) |
|
146 | 146 | { |
147 | - if (empty($ratings)) { |
|
147 | + if( empty($ratings) ) { |
|
148 | 148 | return; |
149 | 149 | } |
150 | - $ratings = array_flip(array_reverse($ratings)); |
|
151 | - array_walk($ratings, function (&$value, $key) { |
|
152 | - $label = _n('%s star', '%s stars', $key, 'site-reviews'); |
|
153 | - $value = sprintf($label, $key); |
|
150 | + $ratings = array_flip( array_reverse( $ratings ) ); |
|
151 | + array_walk( $ratings, function( &$value, $key ) { |
|
152 | + $label = _n( '%s star', '%s stars', $key, 'site-reviews' ); |
|
153 | + $value = sprintf( $label, $key ); |
|
154 | 154 | }); |
155 | - echo glsr(Builder::class)->label(__('Filter by rating', 'site-reviews'), [ |
|
155 | + echo glsr( Builder::class )->label( __( 'Filter by rating', 'site-reviews' ), [ |
|
156 | 156 | 'class' => 'screen-reader-text', |
157 | 157 | 'for' => 'rating', |
158 | - ]); |
|
159 | - echo glsr(Builder::class)->select([ |
|
158 | + ] ); |
|
159 | + echo glsr( Builder::class )->select( [ |
|
160 | 160 | 'name' => 'rating', |
161 | - 'options' => ['' => __('All ratings', 'site-reviews')] + $ratings, |
|
162 | - 'value' => filter_input(INPUT_GET, 'rating'), |
|
163 | - ]); |
|
161 | + 'options' => ['' => __( 'All ratings', 'site-reviews' )] + $ratings, |
|
162 | + 'value' => filter_input( INPUT_GET, 'rating' ), |
|
163 | + ] ); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
167 | 167 | * @param array $types |
168 | 168 | * @return void |
169 | 169 | */ |
170 | - protected function renderFilterTypes($types) |
|
170 | + protected function renderFilterTypes( $types ) |
|
171 | 171 | { |
172 | - if (count(glsr()->reviewTypes) < 2) { |
|
172 | + if( count( glsr()->reviewTypes ) < 2 ) { |
|
173 | 173 | return; |
174 | 174 | } |
175 | - echo glsr(Builder::class)->label(__('Filter by type', 'site-reviews'), [ |
|
175 | + echo glsr( Builder::class )->label( __( 'Filter by type', 'site-reviews' ), [ |
|
176 | 176 | 'class' => 'screen-reader-text', |
177 | 177 | 'for' => 'review_type', |
178 | - ]); |
|
179 | - echo glsr(Builder::class)->select([ |
|
178 | + ] ); |
|
179 | + echo glsr( Builder::class )->select( [ |
|
180 | 180 | 'name' => 'review_type', |
181 | - 'options' => ['' => __('All types', 'site-reviews')] + glsr()->reviewTypes, |
|
182 | - 'value' => filter_input(INPUT_GET, 'review_type'), |
|
183 | - ]); |
|
181 | + 'options' => ['' => __( 'All types', 'site-reviews' )] + glsr()->reviewTypes, |
|
182 | + 'value' => filter_input( INPUT_GET, 'review_type' ), |
|
183 | + ] ); |
|
184 | 184 | } |
185 | 185 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php defined('WPINC') || die; ?> |
|
1 | +<?php defined( 'WPINC' ) || die; ?> |
|
2 | 2 | |
3 | 3 | <p>This page shows all of the available shortcode options with examples of how to use them. You can use multiple options in the same shortcode.</p> |
4 | 4 | |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | <div class="glsr-card-header"> |
7 | 7 | <h3>[site_reviews]</h3> |
8 | 8 | <button type="button" class="handlediv" aria-expanded="true"> |
9 | - <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span> |
|
9 | + <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span> |
|
10 | 10 | <span class="toggle-indicator" aria-hidden="true"></span> |
11 | 11 | </button> |
12 | 12 | </div> |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | <div class="glsr-card-header"> |
81 | 81 | <h3>[site_reviews_form]</h3> |
82 | 82 | <button type="button" class="handlediv" aria-expanded="true"> |
83 | - <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span> |
|
83 | + <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span> |
|
84 | 84 | <span class="toggle-indicator" aria-hidden="true"></span> |
85 | 85 | </button> |
86 | 86 | </div> |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | <div class="glsr-card-header"> |
129 | 129 | <h3>[site_reviews_summary]</h3> |
130 | 130 | <button type="button" class="handlediv" aria-expanded="true"> |
131 | - <span class="screen-reader-text"><?= __('Toggle documentation panel', 'site-reviews'); ?></span> |
|
131 | + <span class="screen-reader-text"><?= __( 'Toggle documentation panel', 'site-reviews' ); ?></span> |
|
132 | 132 | <span class="toggle-indicator" aria-hidden="true"></span> |
133 | 133 | </button> |
134 | 134 | </div> |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | <pre><code>[site_reviews_summary hide="bars,if_empty,rating,stars,summary"]</code></pre> |
159 | 159 | |
160 | 160 | <p class="glsr-heading">labels</p> |
161 | - <p>The "labels" attribute allows you to enter custom labels for the percentage bar levels (from high to low), each level should be separated with a comma. However, rather than using this attribute to change the labels it's recommended to instead create a custom translation for them in the <code><a href="<?= admin_url('edit.php?post_type=site-review&page=settings#!translations'); ?>">Settings → Translations</a></code> page.</p> |
|
161 | + <p>The "labels" attribute allows you to enter custom labels for the percentage bar levels (from high to low), each level should be separated with a comma. However, rather than using this attribute to change the labels it's recommended to instead create a custom translation for them in the <code><a href="<?= admin_url( 'edit.php?post_type=site-review&page=settings#!translations' ); ?>">Settings → Translations</a></code> page.</p> |
|
162 | 162 | <p>The default labels value is: <code>"Excellent,Very good,Average,Poor,Terrible"</code></p> |
163 | 163 | <pre><code>[site_reviews_summary labels="5 star,4 star,3 star,2 star,1 star"]</code></pre> |
164 | 164 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | <pre><code>[site_reviews_summary schema="true"]</code></pre> |
176 | 176 | |
177 | 177 | <p class="glsr-heading">text</p> |
178 | - <p>The "text" attribute allows you to change the summary text. Available template tags to use are, "{rating}" which represents the calculated average rating, "{max}" which represents the maximum star rating available, and "{num}" which represents the total number of reviews. However, rather than using this attribute to change the summary text it's recommended to instead create a custom translation for it in the <code><a href="<?= admin_url('edit.php?post_type=site-review&page=settings#!translations'); ?>">Settings → Translations</a></code> page. That way, you will be able to customize both the singular (1 review) and plural (2 reviews) summary texts.</p> |
|
178 | + <p>The "text" attribute allows you to change the summary text. Available template tags to use are, "{rating}" which represents the calculated average rating, "{max}" which represents the maximum star rating available, and "{num}" which represents the total number of reviews. However, rather than using this attribute to change the summary text it's recommended to instead create a custom translation for it in the <code><a href="<?= admin_url( 'edit.php?post_type=site-review&page=settings#!translations' ); ?>">Settings → Translations</a></code> page. That way, you will be able to customize both the singular (1 review) and plural (2 reviews) summary texts.</p> |
|
179 | 179 | <p>The default text value is: <code>"{rating} out of {max} stars (based on {num} reviews)"</code></p> |
180 | 180 | <pre><code>[site_reviews_summary text="{num} customer reviews"]</code></pre> |
181 | 181 |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <div class="notice notice-info is-dismissible glsr-notice" data-dismiss="welcome"> |
2 | - <p><?= $text; ?> — <a class="button button-small" href="<?= admin_url('edit.php?post_type='.glsr()->post_type.'&page=welcome#!whatsnew'); ?>">See what's new</a></p> |
|
2 | + <p><?= $text; ?> — <a class="button button-small" href="<?= admin_url( 'edit.php?post_type='.glsr()->post_type.'&page=welcome#!whatsnew' ); ?>">See what's new</a></p> |
|
3 | 3 | </div> |
@@ -7,92 +7,92 @@ |
||
7 | 7 | |
8 | 8 | class SiteReviewsWidget extends Widget |
9 | 9 | { |
10 | - /** |
|
11 | - * @param array $instance |
|
12 | - * @return void |
|
13 | - */ |
|
14 | - public function form($instance) |
|
15 | - { |
|
16 | - $this->widgetArgs = glsr(SiteReviewsShortcode::class)->normalizeAtts($instance); |
|
17 | - $terms = glsr(Database::class)->getTerms(); |
|
18 | - $this->renderField('text', [ |
|
19 | - 'class' => 'widefat', |
|
20 | - 'label' => __('Title', 'site-reviews'), |
|
21 | - 'name' => 'title', |
|
22 | - ]); |
|
23 | - $this->renderField('number', [ |
|
24 | - 'class' => 'small-text', |
|
25 | - 'default' => 10, |
|
26 | - 'label' => __('How many reviews would you like to display?', 'site-reviews'), |
|
27 | - 'max' => 100, |
|
28 | - 'name' => 'display', |
|
29 | - ]); |
|
30 | - $this->renderField('select', [ |
|
31 | - 'label' => __('What is the minimum rating to display?', 'site-reviews'), |
|
32 | - 'name' => 'rating', |
|
33 | - 'options' => [ |
|
34 | - '5' => sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5), |
|
35 | - '4' => sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4), |
|
36 | - '3' => sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3), |
|
37 | - '2' => sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2), |
|
38 | - '1' => sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1), |
|
39 | - ], |
|
40 | - ]); |
|
41 | - if (count(glsr()->reviewTypes) > 1) { |
|
42 | - $this->renderField('select', [ |
|
43 | - 'class' => 'widefat', |
|
44 | - 'label' => __('Which type of review would you like to display?', 'site-reviews'), |
|
45 | - 'name' => 'type', |
|
46 | - 'options' => ['' => __('All Reviews', 'site-reviews')] + glsr()->reviewTypes, |
|
47 | - ]); |
|
48 | - } |
|
49 | - if (!empty($terms)) { |
|
50 | - $this->renderField('select', [ |
|
51 | - 'class' => 'widefat', |
|
52 | - 'label' => __('Limit reviews to this category', 'site-reviews'), |
|
53 | - 'name' => 'category', |
|
54 | - 'options' => ['' => __('All Categories', 'site-reviews')] + $terms, |
|
55 | - ]); |
|
56 | - } |
|
57 | - $this->renderField('text', [ |
|
58 | - 'class' => 'widefat', |
|
59 | - 'default' => '', |
|
60 | - 'description' => sprintf(__("Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews'), '<code>post_id</code>'), |
|
61 | - 'label' => __('Limit reviews to those assigned to this page/post ID', 'site-reviews'), |
|
62 | - 'name' => 'assigned_to', |
|
63 | - ]); |
|
64 | - $this->renderField('text', [ |
|
65 | - 'class' => 'widefat', |
|
66 | - 'label' => __('Enter any custom CSS classes here', 'site-reviews'), |
|
67 | - 'name' => 'class', |
|
68 | - ]); |
|
69 | - $this->renderField('checkbox', [ |
|
70 | - 'name' => 'hide', |
|
71 | - 'options' => glsr(SiteReviewsShortcode::class)->getHideOptions(), |
|
72 | - ]); |
|
73 | - } |
|
10 | + /** |
|
11 | + * @param array $instance |
|
12 | + * @return void |
|
13 | + */ |
|
14 | + public function form($instance) |
|
15 | + { |
|
16 | + $this->widgetArgs = glsr(SiteReviewsShortcode::class)->normalizeAtts($instance); |
|
17 | + $terms = glsr(Database::class)->getTerms(); |
|
18 | + $this->renderField('text', [ |
|
19 | + 'class' => 'widefat', |
|
20 | + 'label' => __('Title', 'site-reviews'), |
|
21 | + 'name' => 'title', |
|
22 | + ]); |
|
23 | + $this->renderField('number', [ |
|
24 | + 'class' => 'small-text', |
|
25 | + 'default' => 10, |
|
26 | + 'label' => __('How many reviews would you like to display?', 'site-reviews'), |
|
27 | + 'max' => 100, |
|
28 | + 'name' => 'display', |
|
29 | + ]); |
|
30 | + $this->renderField('select', [ |
|
31 | + 'label' => __('What is the minimum rating to display?', 'site-reviews'), |
|
32 | + 'name' => 'rating', |
|
33 | + 'options' => [ |
|
34 | + '5' => sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5), |
|
35 | + '4' => sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4), |
|
36 | + '3' => sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3), |
|
37 | + '2' => sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2), |
|
38 | + '1' => sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1), |
|
39 | + ], |
|
40 | + ]); |
|
41 | + if (count(glsr()->reviewTypes) > 1) { |
|
42 | + $this->renderField('select', [ |
|
43 | + 'class' => 'widefat', |
|
44 | + 'label' => __('Which type of review would you like to display?', 'site-reviews'), |
|
45 | + 'name' => 'type', |
|
46 | + 'options' => ['' => __('All Reviews', 'site-reviews')] + glsr()->reviewTypes, |
|
47 | + ]); |
|
48 | + } |
|
49 | + if (!empty($terms)) { |
|
50 | + $this->renderField('select', [ |
|
51 | + 'class' => 'widefat', |
|
52 | + 'label' => __('Limit reviews to this category', 'site-reviews'), |
|
53 | + 'name' => 'category', |
|
54 | + 'options' => ['' => __('All Categories', 'site-reviews')] + $terms, |
|
55 | + ]); |
|
56 | + } |
|
57 | + $this->renderField('text', [ |
|
58 | + 'class' => 'widefat', |
|
59 | + 'default' => '', |
|
60 | + 'description' => sprintf(__("Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews'), '<code>post_id</code>'), |
|
61 | + 'label' => __('Limit reviews to those assigned to this page/post ID', 'site-reviews'), |
|
62 | + 'name' => 'assigned_to', |
|
63 | + ]); |
|
64 | + $this->renderField('text', [ |
|
65 | + 'class' => 'widefat', |
|
66 | + 'label' => __('Enter any custom CSS classes here', 'site-reviews'), |
|
67 | + 'name' => 'class', |
|
68 | + ]); |
|
69 | + $this->renderField('checkbox', [ |
|
70 | + 'name' => 'hide', |
|
71 | + 'options' => glsr(SiteReviewsShortcode::class)->getHideOptions(), |
|
72 | + ]); |
|
73 | + } |
|
74 | 74 | |
75 | - /** |
|
76 | - * @param array $newInstance |
|
77 | - * @param array $oldInstance |
|
78 | - * @return array |
|
79 | - */ |
|
80 | - public function update($newInstance, $oldInstance) |
|
81 | - { |
|
82 | - if (!is_numeric($newInstance['display'])) { |
|
83 | - $newInstance['display'] = 10; |
|
84 | - } |
|
85 | - $newInstance['display'] = min(50, max(0, intval($newInstance['display']))); |
|
86 | - return parent::update($newInstance, $oldInstance); |
|
87 | - } |
|
75 | + /** |
|
76 | + * @param array $newInstance |
|
77 | + * @param array $oldInstance |
|
78 | + * @return array |
|
79 | + */ |
|
80 | + public function update($newInstance, $oldInstance) |
|
81 | + { |
|
82 | + if (!is_numeric($newInstance['display'])) { |
|
83 | + $newInstance['display'] = 10; |
|
84 | + } |
|
85 | + $newInstance['display'] = min(50, max(0, intval($newInstance['display']))); |
|
86 | + return parent::update($newInstance, $oldInstance); |
|
87 | + } |
|
88 | 88 | |
89 | - /** |
|
90 | - * @param array $args |
|
91 | - * @param array $instance |
|
92 | - * @return void |
|
93 | - */ |
|
94 | - public function widget($args, $instance) |
|
95 | - { |
|
96 | - echo glsr(SiteReviewsShortcode::class)->build($instance, $args, 'widget'); |
|
97 | - } |
|
89 | + /** |
|
90 | + * @param array $args |
|
91 | + * @param array $instance |
|
92 | + * @return void |
|
93 | + */ |
|
94 | + public function widget($args, $instance) |
|
95 | + { |
|
96 | + echo glsr(SiteReviewsShortcode::class)->build($instance, $args, 'widget'); |
|
97 | + } |
|
98 | 98 | } |
@@ -11,65 +11,65 @@ discard block |
||
11 | 11 | * @param array $instance |
12 | 12 | * @return void |
13 | 13 | */ |
14 | - public function form($instance) |
|
14 | + public function form( $instance ) |
|
15 | 15 | { |
16 | - $this->widgetArgs = glsr(SiteReviewsShortcode::class)->normalizeAtts($instance); |
|
17 | - $terms = glsr(Database::class)->getTerms(); |
|
18 | - $this->renderField('text', [ |
|
16 | + $this->widgetArgs = glsr( SiteReviewsShortcode::class )->normalizeAtts( $instance ); |
|
17 | + $terms = glsr( Database::class )->getTerms(); |
|
18 | + $this->renderField( 'text', [ |
|
19 | 19 | 'class' => 'widefat', |
20 | - 'label' => __('Title', 'site-reviews'), |
|
20 | + 'label' => __( 'Title', 'site-reviews' ), |
|
21 | 21 | 'name' => 'title', |
22 | - ]); |
|
23 | - $this->renderField('number', [ |
|
22 | + ] ); |
|
23 | + $this->renderField( 'number', [ |
|
24 | 24 | 'class' => 'small-text', |
25 | 25 | 'default' => 10, |
26 | - 'label' => __('How many reviews would you like to display?', 'site-reviews'), |
|
26 | + 'label' => __( 'How many reviews would you like to display?', 'site-reviews' ), |
|
27 | 27 | 'max' => 100, |
28 | 28 | 'name' => 'display', |
29 | - ]); |
|
30 | - $this->renderField('select', [ |
|
31 | - 'label' => __('What is the minimum rating to display?', 'site-reviews'), |
|
29 | + ] ); |
|
30 | + $this->renderField( 'select', [ |
|
31 | + 'label' => __( 'What is the minimum rating to display?', 'site-reviews' ), |
|
32 | 32 | 'name' => 'rating', |
33 | 33 | 'options' => [ |
34 | - '5' => sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5), |
|
35 | - '4' => sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4), |
|
36 | - '3' => sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3), |
|
37 | - '2' => sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2), |
|
38 | - '1' => sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1), |
|
34 | + '5' => sprintf( _n( '%s star', '%s stars', 5, 'site-reviews' ), 5 ), |
|
35 | + '4' => sprintf( _n( '%s star', '%s stars', 4, 'site-reviews' ), 4 ), |
|
36 | + '3' => sprintf( _n( '%s star', '%s stars', 3, 'site-reviews' ), 3 ), |
|
37 | + '2' => sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 ), |
|
38 | + '1' => sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 ), |
|
39 | 39 | ], |
40 | - ]); |
|
41 | - if (count(glsr()->reviewTypes) > 1) { |
|
42 | - $this->renderField('select', [ |
|
40 | + ] ); |
|
41 | + if( count( glsr()->reviewTypes ) > 1 ) { |
|
42 | + $this->renderField( 'select', [ |
|
43 | 43 | 'class' => 'widefat', |
44 | - 'label' => __('Which type of review would you like to display?', 'site-reviews'), |
|
44 | + 'label' => __( 'Which type of review would you like to display?', 'site-reviews' ), |
|
45 | 45 | 'name' => 'type', |
46 | - 'options' => ['' => __('All Reviews', 'site-reviews')] + glsr()->reviewTypes, |
|
47 | - ]); |
|
46 | + 'options' => ['' => __( 'All Reviews', 'site-reviews' )] + glsr()->reviewTypes, |
|
47 | + ] ); |
|
48 | 48 | } |
49 | - if (!empty($terms)) { |
|
50 | - $this->renderField('select', [ |
|
49 | + if( !empty($terms) ) { |
|
50 | + $this->renderField( 'select', [ |
|
51 | 51 | 'class' => 'widefat', |
52 | - 'label' => __('Limit reviews to this category', 'site-reviews'), |
|
52 | + 'label' => __( 'Limit reviews to this category', 'site-reviews' ), |
|
53 | 53 | 'name' => 'category', |
54 | - 'options' => ['' => __('All Categories', 'site-reviews')] + $terms, |
|
55 | - ]); |
|
54 | + 'options' => ['' => __( 'All Categories', 'site-reviews' )] + $terms, |
|
55 | + ] ); |
|
56 | 56 | } |
57 | - $this->renderField('text', [ |
|
57 | + $this->renderField( 'text', [ |
|
58 | 58 | 'class' => 'widefat', |
59 | 59 | 'default' => '', |
60 | - 'description' => sprintf(__("Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews'), '<code>post_id</code>'), |
|
61 | - 'label' => __('Limit reviews to those assigned to this page/post ID', 'site-reviews'), |
|
60 | + 'description' => sprintf( __( "Separate multiple ID's with a comma. You may also enter %s to automatically represent the current page/post ID.", 'site-reviews' ), '<code>post_id</code>' ), |
|
61 | + 'label' => __( 'Limit reviews to those assigned to this page/post ID', 'site-reviews' ), |
|
62 | 62 | 'name' => 'assigned_to', |
63 | - ]); |
|
64 | - $this->renderField('text', [ |
|
63 | + ] ); |
|
64 | + $this->renderField( 'text', [ |
|
65 | 65 | 'class' => 'widefat', |
66 | - 'label' => __('Enter any custom CSS classes here', 'site-reviews'), |
|
66 | + 'label' => __( 'Enter any custom CSS classes here', 'site-reviews' ), |
|
67 | 67 | 'name' => 'class', |
68 | - ]); |
|
69 | - $this->renderField('checkbox', [ |
|
68 | + ] ); |
|
69 | + $this->renderField( 'checkbox', [ |
|
70 | 70 | 'name' => 'hide', |
71 | - 'options' => glsr(SiteReviewsShortcode::class)->getHideOptions(), |
|
72 | - ]); |
|
71 | + 'options' => glsr( SiteReviewsShortcode::class )->getHideOptions(), |
|
72 | + ] ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | * @param array $oldInstance |
78 | 78 | * @return array |
79 | 79 | */ |
80 | - public function update($newInstance, $oldInstance) |
|
80 | + public function update( $newInstance, $oldInstance ) |
|
81 | 81 | { |
82 | - if (!is_numeric($newInstance['display'])) { |
|
82 | + if( !is_numeric( $newInstance['display'] ) ) { |
|
83 | 83 | $newInstance['display'] = 10; |
84 | 84 | } |
85 | - $newInstance['display'] = min(50, max(0, intval($newInstance['display']))); |
|
86 | - return parent::update($newInstance, $oldInstance); |
|
85 | + $newInstance['display'] = min( 50, max( 0, intval( $newInstance['display'] ) ) ); |
|
86 | + return parent::update( $newInstance, $oldInstance ); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | * @param array $instance |
92 | 92 | * @return void |
93 | 93 | */ |
94 | - public function widget($args, $instance) |
|
94 | + public function widget( $args, $instance ) |
|
95 | 95 | { |
96 | - echo glsr(SiteReviewsShortcode::class)->build($instance, $args, 'widget'); |
|
96 | + echo glsr( SiteReviewsShortcode::class )->build( $instance, $args, 'widget' ); |
|
97 | 97 | } |
98 | 98 | } |
@@ -4,84 +4,84 @@ |
||
4 | 4 | |
5 | 5 | class SiteReviewsPopup extends TinymcePopupGenerator |
6 | 6 | { |
7 | - /** |
|
8 | - * @return array |
|
9 | - */ |
|
10 | - public function fields() |
|
11 | - { |
|
12 | - return [[ |
|
13 | - 'html' => sprintf('<p class="strong">%s</p>', esc_html__('All settings are optional.', 'site-reviews')), |
|
14 | - 'minWidth' => 320, |
|
15 | - 'type' => 'container', |
|
16 | - ], [ |
|
17 | - 'label' => esc_html__('Title', 'site-reviews'), |
|
18 | - 'name' => 'title', |
|
19 | - 'tooltip' => __('Enter a custom shortcode heading.', 'site-reviews'), |
|
20 | - 'type' => 'textbox', |
|
21 | - ], [ |
|
22 | - 'label' => esc_html__('Display', 'site-reviews'), |
|
23 | - 'maxLength' => 5, |
|
24 | - 'name' => 'display', |
|
25 | - 'size' => 3, |
|
26 | - 'text' => '10', |
|
27 | - 'tooltip' => __('How many reviews would you like to display (default: 10)?', 'site-reviews'), |
|
28 | - 'type' => 'textbox', |
|
29 | - ], [ |
|
30 | - 'label' => esc_html__('Rating', 'site-reviews'), |
|
31 | - 'name' => 'rating', |
|
32 | - 'options' => [ |
|
33 | - '5' => esc_html(sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5)), |
|
34 | - '4' => esc_html(sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4)), |
|
35 | - '3' => esc_html(sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3)), |
|
36 | - '2' => esc_html(sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2)), |
|
37 | - '1' => esc_html(sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1)), |
|
38 | - '0' => esc_html(__('Unrated', 'site-reviews')), |
|
39 | - ], |
|
40 | - 'tooltip' => __('What is the minimum rating to display (default: 1 star)?', 'site-reviews'), |
|
41 | - 'type' => 'listbox', |
|
42 | - ], [ |
|
43 | - 'label' => esc_html__('Pagination', 'site-reviews'), |
|
44 | - 'name' => 'pagination', |
|
45 | - 'options' => [ |
|
46 | - 'true' => esc_html__('Enable', 'site-reviews'), |
|
47 | - 'ajax' => esc_html__('Enable (using ajax)', 'site-reviews'), |
|
48 | - 'false' => esc_html__('Disable', 'site-reviews'), |
|
49 | - ], |
|
50 | - 'tooltip' => __('When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews'), |
|
51 | - 'type' => 'listbox', |
|
52 | - ], |
|
53 | - $this->getTypes(__('Which type of review would you like to display?', 'site-reviews')), |
|
54 | - $this->getCategories(__('Limit reviews to this category.', 'site-reviews')), |
|
55 | - [ |
|
56 | - 'label' => esc_html__('Assigned To', 'site-reviews'), |
|
57 | - 'name' => 'assigned_to', |
|
58 | - 'tooltip' => __('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews'), |
|
59 | - 'type' => 'textbox', |
|
60 | - ], [ |
|
61 | - 'label' => esc_html__('Schema', 'site-reviews'), |
|
62 | - 'name' => 'schema', |
|
63 | - 'options' => [ |
|
64 | - 'true' => esc_html__('Enable rich snippets', 'site-reviews'), |
|
65 | - 'false' => esc_html__('Disable rich snippets', 'site-reviews'), |
|
66 | - ], |
|
67 | - 'tooltip' => __('Rich snippets are disabled by default.', 'site-reviews'), |
|
68 | - 'type' => 'listbox', |
|
69 | - ], [ |
|
70 | - 'label' => esc_html__('Classes', 'site-reviews'), |
|
71 | - 'name' => 'class', |
|
72 | - 'tooltip' => __('Add custom CSS classes to the shortcode.', 'site-reviews'), |
|
73 | - 'type' => 'textbox', |
|
74 | - ], [ |
|
75 | - 'columns' => 2, |
|
76 | - 'items' => $this->getHideOptions(), |
|
77 | - 'label' => esc_html__('Hide', 'site-reviews'), |
|
78 | - 'layout' => 'grid', |
|
79 | - 'spacing' => 5, |
|
80 | - 'type' => 'container', |
|
81 | - ], [ |
|
82 | - 'hidden' => true, |
|
83 | - 'name' => 'id', |
|
84 | - 'type' => 'textbox', |
|
85 | - ], ]; |
|
86 | - } |
|
7 | + /** |
|
8 | + * @return array |
|
9 | + */ |
|
10 | + public function fields() |
|
11 | + { |
|
12 | + return [[ |
|
13 | + 'html' => sprintf('<p class="strong">%s</p>', esc_html__('All settings are optional.', 'site-reviews')), |
|
14 | + 'minWidth' => 320, |
|
15 | + 'type' => 'container', |
|
16 | + ], [ |
|
17 | + 'label' => esc_html__('Title', 'site-reviews'), |
|
18 | + 'name' => 'title', |
|
19 | + 'tooltip' => __('Enter a custom shortcode heading.', 'site-reviews'), |
|
20 | + 'type' => 'textbox', |
|
21 | + ], [ |
|
22 | + 'label' => esc_html__('Display', 'site-reviews'), |
|
23 | + 'maxLength' => 5, |
|
24 | + 'name' => 'display', |
|
25 | + 'size' => 3, |
|
26 | + 'text' => '10', |
|
27 | + 'tooltip' => __('How many reviews would you like to display (default: 10)?', 'site-reviews'), |
|
28 | + 'type' => 'textbox', |
|
29 | + ], [ |
|
30 | + 'label' => esc_html__('Rating', 'site-reviews'), |
|
31 | + 'name' => 'rating', |
|
32 | + 'options' => [ |
|
33 | + '5' => esc_html(sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5)), |
|
34 | + '4' => esc_html(sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4)), |
|
35 | + '3' => esc_html(sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3)), |
|
36 | + '2' => esc_html(sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2)), |
|
37 | + '1' => esc_html(sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1)), |
|
38 | + '0' => esc_html(__('Unrated', 'site-reviews')), |
|
39 | + ], |
|
40 | + 'tooltip' => __('What is the minimum rating to display (default: 1 star)?', 'site-reviews'), |
|
41 | + 'type' => 'listbox', |
|
42 | + ], [ |
|
43 | + 'label' => esc_html__('Pagination', 'site-reviews'), |
|
44 | + 'name' => 'pagination', |
|
45 | + 'options' => [ |
|
46 | + 'true' => esc_html__('Enable', 'site-reviews'), |
|
47 | + 'ajax' => esc_html__('Enable (using ajax)', 'site-reviews'), |
|
48 | + 'false' => esc_html__('Disable', 'site-reviews'), |
|
49 | + ], |
|
50 | + 'tooltip' => __('When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews'), |
|
51 | + 'type' => 'listbox', |
|
52 | + ], |
|
53 | + $this->getTypes(__('Which type of review would you like to display?', 'site-reviews')), |
|
54 | + $this->getCategories(__('Limit reviews to this category.', 'site-reviews')), |
|
55 | + [ |
|
56 | + 'label' => esc_html__('Assigned To', 'site-reviews'), |
|
57 | + 'name' => 'assigned_to', |
|
58 | + 'tooltip' => __('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews'), |
|
59 | + 'type' => 'textbox', |
|
60 | + ], [ |
|
61 | + 'label' => esc_html__('Schema', 'site-reviews'), |
|
62 | + 'name' => 'schema', |
|
63 | + 'options' => [ |
|
64 | + 'true' => esc_html__('Enable rich snippets', 'site-reviews'), |
|
65 | + 'false' => esc_html__('Disable rich snippets', 'site-reviews'), |
|
66 | + ], |
|
67 | + 'tooltip' => __('Rich snippets are disabled by default.', 'site-reviews'), |
|
68 | + 'type' => 'listbox', |
|
69 | + ], [ |
|
70 | + 'label' => esc_html__('Classes', 'site-reviews'), |
|
71 | + 'name' => 'class', |
|
72 | + 'tooltip' => __('Add custom CSS classes to the shortcode.', 'site-reviews'), |
|
73 | + 'type' => 'textbox', |
|
74 | + ], [ |
|
75 | + 'columns' => 2, |
|
76 | + 'items' => $this->getHideOptions(), |
|
77 | + 'label' => esc_html__('Hide', 'site-reviews'), |
|
78 | + 'layout' => 'grid', |
|
79 | + 'spacing' => 5, |
|
80 | + 'type' => 'container', |
|
81 | + ], [ |
|
82 | + 'hidden' => true, |
|
83 | + 'name' => 'id', |
|
84 | + 'type' => 'textbox', |
|
85 | + ], ]; |
|
86 | + } |
|
87 | 87 | } |
@@ -10,71 +10,71 @@ |
||
10 | 10 | public function fields() |
11 | 11 | { |
12 | 12 | return [[ |
13 | - 'html' => sprintf('<p class="strong">%s</p>', esc_html__('All settings are optional.', 'site-reviews')), |
|
13 | + 'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' ) ), |
|
14 | 14 | 'minWidth' => 320, |
15 | 15 | 'type' => 'container', |
16 | 16 | ], [ |
17 | - 'label' => esc_html__('Title', 'site-reviews'), |
|
17 | + 'label' => esc_html__( 'Title', 'site-reviews' ), |
|
18 | 18 | 'name' => 'title', |
19 | - 'tooltip' => __('Enter a custom shortcode heading.', 'site-reviews'), |
|
19 | + 'tooltip' => __( 'Enter a custom shortcode heading.', 'site-reviews' ), |
|
20 | 20 | 'type' => 'textbox', |
21 | 21 | ], [ |
22 | - 'label' => esc_html__('Display', 'site-reviews'), |
|
22 | + 'label' => esc_html__( 'Display', 'site-reviews' ), |
|
23 | 23 | 'maxLength' => 5, |
24 | 24 | 'name' => 'display', |
25 | 25 | 'size' => 3, |
26 | 26 | 'text' => '10', |
27 | - 'tooltip' => __('How many reviews would you like to display (default: 10)?', 'site-reviews'), |
|
27 | + 'tooltip' => __( 'How many reviews would you like to display (default: 10)?', 'site-reviews' ), |
|
28 | 28 | 'type' => 'textbox', |
29 | 29 | ], [ |
30 | - 'label' => esc_html__('Rating', 'site-reviews'), |
|
30 | + 'label' => esc_html__( 'Rating', 'site-reviews' ), |
|
31 | 31 | 'name' => 'rating', |
32 | 32 | 'options' => [ |
33 | - '5' => esc_html(sprintf(_n('%s star', '%s stars', 5, 'site-reviews'), 5)), |
|
34 | - '4' => esc_html(sprintf(_n('%s star', '%s stars', 4, 'site-reviews'), 4)), |
|
35 | - '3' => esc_html(sprintf(_n('%s star', '%s stars', 3, 'site-reviews'), 3)), |
|
36 | - '2' => esc_html(sprintf(_n('%s star', '%s stars', 2, 'site-reviews'), 2)), |
|
37 | - '1' => esc_html(sprintf(_n('%s star', '%s stars', 1, 'site-reviews'), 1)), |
|
38 | - '0' => esc_html(__('Unrated', 'site-reviews')), |
|
33 | + '5' => esc_html( sprintf( _n( '%s star', '%s stars', 5, 'site-reviews' ), 5 ) ), |
|
34 | + '4' => esc_html( sprintf( _n( '%s star', '%s stars', 4, 'site-reviews' ), 4 ) ), |
|
35 | + '3' => esc_html( sprintf( _n( '%s star', '%s stars', 3, 'site-reviews' ), 3 ) ), |
|
36 | + '2' => esc_html( sprintf( _n( '%s star', '%s stars', 2, 'site-reviews' ), 2 ) ), |
|
37 | + '1' => esc_html( sprintf( _n( '%s star', '%s stars', 1, 'site-reviews' ), 1 ) ), |
|
38 | + '0' => esc_html( __( 'Unrated', 'site-reviews' ) ), |
|
39 | 39 | ], |
40 | - 'tooltip' => __('What is the minimum rating to display (default: 1 star)?', 'site-reviews'), |
|
40 | + 'tooltip' => __( 'What is the minimum rating to display (default: 1 star)?', 'site-reviews' ), |
|
41 | 41 | 'type' => 'listbox', |
42 | 42 | ], [ |
43 | - 'label' => esc_html__('Pagination', 'site-reviews'), |
|
43 | + 'label' => esc_html__( 'Pagination', 'site-reviews' ), |
|
44 | 44 | 'name' => 'pagination', |
45 | 45 | 'options' => [ |
46 | - 'true' => esc_html__('Enable', 'site-reviews'), |
|
47 | - 'ajax' => esc_html__('Enable (using ajax)', 'site-reviews'), |
|
48 | - 'false' => esc_html__('Disable', 'site-reviews'), |
|
46 | + 'true' => esc_html__( 'Enable', 'site-reviews' ), |
|
47 | + 'ajax' => esc_html__( 'Enable (using ajax)', 'site-reviews' ), |
|
48 | + 'false' => esc_html__( 'Disable', 'site-reviews' ), |
|
49 | 49 | ], |
50 | - 'tooltip' => __('When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews'), |
|
50 | + 'tooltip' => __( 'When using pagination this shortcode can only be used once on a page. (default: disable)', 'site-reviews' ), |
|
51 | 51 | 'type' => 'listbox', |
52 | 52 | ], |
53 | - $this->getTypes(__('Which type of review would you like to display?', 'site-reviews')), |
|
54 | - $this->getCategories(__('Limit reviews to this category.', 'site-reviews')), |
|
53 | + $this->getTypes( __( 'Which type of review would you like to display?', 'site-reviews' ) ), |
|
54 | + $this->getCategories( __( 'Limit reviews to this category.', 'site-reviews' ) ), |
|
55 | 55 | [ |
56 | - 'label' => esc_html__('Assigned To', 'site-reviews'), |
|
56 | + 'label' => esc_html__( 'Assigned To', 'site-reviews' ), |
|
57 | 57 | 'name' => 'assigned_to', |
58 | - 'tooltip' => __('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews'), |
|
58 | + 'tooltip' => __( 'Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'site-reviews' ), |
|
59 | 59 | 'type' => 'textbox', |
60 | 60 | ], [ |
61 | - 'label' => esc_html__('Schema', 'site-reviews'), |
|
61 | + 'label' => esc_html__( 'Schema', 'site-reviews' ), |
|
62 | 62 | 'name' => 'schema', |
63 | 63 | 'options' => [ |
64 | - 'true' => esc_html__('Enable rich snippets', 'site-reviews'), |
|
65 | - 'false' => esc_html__('Disable rich snippets', 'site-reviews'), |
|
64 | + 'true' => esc_html__( 'Enable rich snippets', 'site-reviews' ), |
|
65 | + 'false' => esc_html__( 'Disable rich snippets', 'site-reviews' ), |
|
66 | 66 | ], |
67 | - 'tooltip' => __('Rich snippets are disabled by default.', 'site-reviews'), |
|
67 | + 'tooltip' => __( 'Rich snippets are disabled by default.', 'site-reviews' ), |
|
68 | 68 | 'type' => 'listbox', |
69 | 69 | ], [ |
70 | - 'label' => esc_html__('Classes', 'site-reviews'), |
|
70 | + 'label' => esc_html__( 'Classes', 'site-reviews' ), |
|
71 | 71 | 'name' => 'class', |
72 | - 'tooltip' => __('Add custom CSS classes to the shortcode.', 'site-reviews'), |
|
72 | + 'tooltip' => __( 'Add custom CSS classes to the shortcode.', 'site-reviews' ), |
|
73 | 73 | 'type' => 'textbox', |
74 | 74 | ], [ |
75 | 75 | 'columns' => 2, |
76 | 76 | 'items' => $this->getHideOptions(), |
77 | - 'label' => esc_html__('Hide', 'site-reviews'), |
|
77 | + 'label' => esc_html__( 'Hide', 'site-reviews' ), |
|
78 | 78 | 'layout' => 'grid', |
79 | 79 | 'spacing' => 5, |
80 | 80 | 'type' => 'container', |
@@ -8,97 +8,97 @@ |
||
8 | 8 | |
9 | 9 | class WelcomeController extends Controller |
10 | 10 | { |
11 | - /** |
|
12 | - * @return array |
|
13 | - * @filter plugin_action_links_site-reviews/site-reviews.php |
|
14 | - */ |
|
15 | - public function filterActionLinks(array $links) |
|
16 | - { |
|
17 | - $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [ |
|
18 | - 'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'), |
|
19 | - ]); |
|
20 | - return $links; |
|
21 | - } |
|
11 | + /** |
|
12 | + * @return array |
|
13 | + * @filter plugin_action_links_site-reviews/site-reviews.php |
|
14 | + */ |
|
15 | + public function filterActionLinks(array $links) |
|
16 | + { |
|
17 | + $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [ |
|
18 | + 'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'), |
|
19 | + ]); |
|
20 | + return $links; |
|
21 | + } |
|
22 | 22 | |
23 | - /** |
|
24 | - * @return string |
|
25 | - * @filter admin_title |
|
26 | - */ |
|
27 | - public function filterAdminTitle($title) |
|
28 | - { |
|
29 | - return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id |
|
30 | - ? sprintf(__('Welcome to %s — WordPress', 'site-reviews'), glsr()->name) |
|
31 | - : $title; |
|
32 | - } |
|
23 | + /** |
|
24 | + * @return string |
|
25 | + * @filter admin_title |
|
26 | + */ |
|
27 | + public function filterAdminTitle($title) |
|
28 | + { |
|
29 | + return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id |
|
30 | + ? sprintf(__('Welcome to %s — WordPress', 'site-reviews'), glsr()->name) |
|
31 | + : $title; |
|
32 | + } |
|
33 | 33 | |
34 | - /** |
|
35 | - * @param string $text |
|
36 | - * @return string |
|
37 | - * @filter admin_footer_text |
|
38 | - */ |
|
39 | - public function filterFooterText($text) |
|
40 | - { |
|
41 | - if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) { |
|
42 | - return $text; |
|
43 | - } |
|
44 | - $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post'; |
|
45 | - return wp_kses_post(sprintf( |
|
46 | - __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'), |
|
47 | - '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">★★★★★</a>', |
|
48 | - '<a href="'.$url.'" target="_blank">wordpress.org</a>' |
|
49 | - )); |
|
50 | - } |
|
34 | + /** |
|
35 | + * @param string $text |
|
36 | + * @return string |
|
37 | + * @filter admin_footer_text |
|
38 | + */ |
|
39 | + public function filterFooterText($text) |
|
40 | + { |
|
41 | + if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) { |
|
42 | + return $text; |
|
43 | + } |
|
44 | + $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post'; |
|
45 | + return wp_kses_post(sprintf( |
|
46 | + __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'), |
|
47 | + '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">★★★★★</a>', |
|
48 | + '<a href="'.$url.'" target="_blank">wordpress.org</a>' |
|
49 | + )); |
|
50 | + } |
|
51 | 51 | |
52 | - /** |
|
53 | - * @param string $plugin |
|
54 | - * @param bool $isNetworkActivation |
|
55 | - * @return void |
|
56 | - * @action activated_plugin |
|
57 | - */ |
|
58 | - public function redirectOnActivation($plugin, $isNetworkActivation) |
|
59 | - { |
|
60 | - if (!$isNetworkActivation |
|
61 | - && 'cli' !== php_sapi_name() |
|
62 | - && $plugin === plugin_basename(glsr()->file)) { |
|
63 | - wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome')); |
|
64 | - exit; |
|
65 | - } |
|
66 | - } |
|
52 | + /** |
|
53 | + * @param string $plugin |
|
54 | + * @param bool $isNetworkActivation |
|
55 | + * @return void |
|
56 | + * @action activated_plugin |
|
57 | + */ |
|
58 | + public function redirectOnActivation($plugin, $isNetworkActivation) |
|
59 | + { |
|
60 | + if (!$isNetworkActivation |
|
61 | + && 'cli' !== php_sapi_name() |
|
62 | + && $plugin === plugin_basename(glsr()->file)) { |
|
63 | + wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome')); |
|
64 | + exit; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @return void |
|
70 | - * @action admin_menu |
|
71 | - */ |
|
72 | - public function registerPage() |
|
73 | - { |
|
74 | - add_submenu_page('edit.php?post_type='.Application::POST_TYPE, |
|
75 | - sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name), |
|
76 | - glsr()->name, |
|
77 | - glsr()->getPermission('welcome'), |
|
78 | - 'welcome', |
|
79 | - [$this, 'renderPage'] |
|
80 | - ); |
|
81 | - remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome'); |
|
82 | - } |
|
68 | + /** |
|
69 | + * @return void |
|
70 | + * @action admin_menu |
|
71 | + */ |
|
72 | + public function registerPage() |
|
73 | + { |
|
74 | + add_submenu_page('edit.php?post_type='.Application::POST_TYPE, |
|
75 | + sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name), |
|
76 | + glsr()->name, |
|
77 | + glsr()->getPermission('welcome'), |
|
78 | + 'welcome', |
|
79 | + [$this, 'renderPage'] |
|
80 | + ); |
|
81 | + remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome'); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return void |
|
86 | - * @see $this->registerPage() |
|
87 | - * @callback add_submenu_page |
|
88 | - */ |
|
89 | - public function renderPage() |
|
90 | - { |
|
91 | - $tabs = apply_filters('site-reviews/addon/welcome/tabs', [ |
|
92 | - 'getting-started' => __('Getting Started', 'site-reviews'), |
|
93 | - 'whatsnew' => __('What\'s New', 'site-reviews'), |
|
94 | - 'upgrade-guide' => __('Upgrade Guide', 'site-reviews'), |
|
95 | - 'support' => __('Support', 'site-reviews'), |
|
96 | - ]); |
|
97 | - glsr()->render('pages/welcome/index', [ |
|
98 | - 'data' => ['context' => []], |
|
99 | - 'http_referer' => (string) wp_get_referer(), |
|
100 | - 'tabs' => $tabs, |
|
101 | - 'template' => glsr(Template::class), |
|
102 | - ]); |
|
103 | - } |
|
84 | + /** |
|
85 | + * @return void |
|
86 | + * @see $this->registerPage() |
|
87 | + * @callback add_submenu_page |
|
88 | + */ |
|
89 | + public function renderPage() |
|
90 | + { |
|
91 | + $tabs = apply_filters('site-reviews/addon/welcome/tabs', [ |
|
92 | + 'getting-started' => __('Getting Started', 'site-reviews'), |
|
93 | + 'whatsnew' => __('What\'s New', 'site-reviews'), |
|
94 | + 'upgrade-guide' => __('Upgrade Guide', 'site-reviews'), |
|
95 | + 'support' => __('Support', 'site-reviews'), |
|
96 | + ]); |
|
97 | + glsr()->render('pages/welcome/index', [ |
|
98 | + 'data' => ['context' => []], |
|
99 | + 'http_referer' => (string) wp_get_referer(), |
|
100 | + 'tabs' => $tabs, |
|
101 | + 'template' => glsr(Template::class), |
|
102 | + ]); |
|
103 | + } |
|
104 | 104 | } |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | * @return array |
13 | 13 | * @filter plugin_action_links_site-reviews/site-reviews.php |
14 | 14 | */ |
15 | - public function filterActionLinks(array $links) |
|
15 | + public function filterActionLinks( array $links ) |
|
16 | 16 | { |
17 | - $links['welcome'] = glsr(Builder::class)->a(__('About', 'site-reviews'), [ |
|
18 | - 'href' => admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome'), |
|
19 | - ]); |
|
17 | + $links['welcome'] = glsr( Builder::class )->a( __( 'About', 'site-reviews' ), [ |
|
18 | + 'href' => admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=welcome' ), |
|
19 | + ] ); |
|
20 | 20 | return $links; |
21 | 21 | } |
22 | 22 | |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | * @return string |
25 | 25 | * @filter admin_title |
26 | 26 | */ |
27 | - public function filterAdminTitle($title) |
|
27 | + public function filterAdminTitle( $title ) |
|
28 | 28 | { |
29 | 29 | return Application::POST_TYPE.'_page_welcome' == glsr_current_screen()->id |
30 | - ? sprintf(__('Welcome to %s — WordPress', 'site-reviews'), glsr()->name) |
|
30 | + ? sprintf( __( 'Welcome to %s — WordPress', 'site-reviews' ), glsr()->name ) |
|
31 | 31 | : $title; |
32 | 32 | } |
33 | 33 | |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | * @return string |
37 | 37 | * @filter admin_footer_text |
38 | 38 | */ |
39 | - public function filterFooterText($text) |
|
39 | + public function filterFooterText( $text ) |
|
40 | 40 | { |
41 | - if (Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id) { |
|
41 | + if( Application::POST_TYPE.'_page_welcome' != glsr_current_screen()->id ) { |
|
42 | 42 | return $text; |
43 | 43 | } |
44 | 44 | $url = 'https://wordpress.org/support/view/plugin-reviews/site-reviews?filter=5#new-post'; |
45 | - return wp_kses_post(sprintf( |
|
46 | - __('Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews'), |
|
45 | + return wp_kses_post( sprintf( |
|
46 | + __( 'Please rate %s on %s and help us spread the word. Thank you so much!', 'site-reviews' ), |
|
47 | 47 | '<strong>'.glsr()->name.'</strong> <a href="'.$url.'" target="_blank">★★★★★</a>', |
48 | 48 | '<a href="'.$url.'" target="_blank">wordpress.org</a>' |
49 | - )); |
|
49 | + ) ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | * @return void |
56 | 56 | * @action activated_plugin |
57 | 57 | */ |
58 | - public function redirectOnActivation($plugin, $isNetworkActivation) |
|
58 | + public function redirectOnActivation( $plugin, $isNetworkActivation ) |
|
59 | 59 | { |
60 | - if (!$isNetworkActivation |
|
60 | + if( !$isNetworkActivation |
|
61 | 61 | && 'cli' !== php_sapi_name() |
62 | - && $plugin === plugin_basename(glsr()->file)) { |
|
63 | - wp_safe_redirect(admin_url('edit.php?post_type='.Application::POST_TYPE.'&page=welcome')); |
|
62 | + && $plugin === plugin_basename( glsr()->file ) ) { |
|
63 | + wp_safe_redirect( admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=welcome' ) ); |
|
64 | 64 | exit; |
65 | 65 | } |
66 | 66 | } |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function registerPage() |
73 | 73 | { |
74 | - add_submenu_page('edit.php?post_type='.Application::POST_TYPE, |
|
75 | - sprintf(__('Welcome to %s', 'site-reviews'), glsr()->name), |
|
74 | + add_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, |
|
75 | + sprintf( __( 'Welcome to %s', 'site-reviews' ), glsr()->name ), |
|
76 | 76 | glsr()->name, |
77 | - glsr()->getPermission('welcome'), |
|
77 | + glsr()->getPermission( 'welcome' ), |
|
78 | 78 | 'welcome', |
79 | 79 | [$this, 'renderPage'] |
80 | 80 | ); |
81 | - remove_submenu_page('edit.php?post_type='.Application::POST_TYPE, 'welcome'); |
|
81 | + remove_submenu_page( 'edit.php?post_type='.Application::POST_TYPE, 'welcome' ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -88,17 +88,17 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function renderPage() |
90 | 90 | { |
91 | - $tabs = apply_filters('site-reviews/addon/welcome/tabs', [ |
|
92 | - 'getting-started' => __('Getting Started', 'site-reviews'), |
|
93 | - 'whatsnew' => __('What\'s New', 'site-reviews'), |
|
94 | - 'upgrade-guide' => __('Upgrade Guide', 'site-reviews'), |
|
95 | - 'support' => __('Support', 'site-reviews'), |
|
96 | - ]); |
|
97 | - glsr()->render('pages/welcome/index', [ |
|
91 | + $tabs = apply_filters( 'site-reviews/addon/welcome/tabs', [ |
|
92 | + 'getting-started' => __( 'Getting Started', 'site-reviews' ), |
|
93 | + 'whatsnew' => __( 'What\'s New', 'site-reviews' ), |
|
94 | + 'upgrade-guide' => __( 'Upgrade Guide', 'site-reviews' ), |
|
95 | + 'support' => __( 'Support', 'site-reviews' ), |
|
96 | + ] ); |
|
97 | + glsr()->render( 'pages/welcome/index', [ |
|
98 | 98 | 'data' => ['context' => []], |
99 | - 'http_referer' => (string) wp_get_referer(), |
|
99 | + 'http_referer' => (string)wp_get_referer(), |
|
100 | 100 | 'tabs' => $tabs, |
101 | - 'template' => glsr(Template::class), |
|
102 | - ]); |
|
101 | + 'template' => glsr( Template::class ), |
|
102 | + ] ); |
|
103 | 103 | } |
104 | 104 | } |