@@ -3,54 +3,54 @@ discard block |
||
3 | 3 | return [ |
4 | 4 | 'settings.general.require.approval' => [ |
5 | 5 | 'default' => true, |
6 | - 'desc' => __( 'Set the status of new review submissions to pending.', 'site-reviews' ), |
|
7 | - 'label' => __( 'Require approval', 'site-reviews' ), |
|
6 | + 'desc' => __('Set the status of new review submissions to pending.', 'site-reviews'), |
|
7 | + 'label' => __('Require approval', 'site-reviews'), |
|
8 | 8 | 'type' => 'yesno_inline', |
9 | 9 | ], |
10 | 10 | 'settings.general.require.login' => [ |
11 | 11 | 'default' => false, |
12 | - 'desc' => __( 'Only allow review submissions from registered users.', 'site-reviews' ), |
|
13 | - 'label' => __( 'Require login', 'site-reviews' ), |
|
12 | + 'desc' => __('Only allow review submissions from registered users.', 'site-reviews'), |
|
13 | + 'label' => __('Require login', 'site-reviews'), |
|
14 | 14 | 'type' => 'yesno_inline', |
15 | 15 | ], |
16 | 16 | 'settings.general.require.login_register' => [ |
17 | 17 | 'default' => false, |
18 | 18 | 'depends' => ['require.login' => 'yes'], |
19 | - 'desc' => 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' ), |
|
20 | - glsr( 'Modules\Html\Builder' )->a( __( 'Anyone can register' ), ['href' => admin_url( 'options-general.php' )] ) |
|
19 | + 'desc' => 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'), |
|
20 | + glsr('Modules\Html\Builder')->a(__('Anyone can register'), ['href' => admin_url('options-general.php')]) |
|
21 | 21 | ), |
22 | - 'label' => __( 'Show registration link', 'site-reviews' ), |
|
22 | + 'label' => __('Show registration link', 'site-reviews'), |
|
23 | 23 | 'type' => 'yesno_inline', |
24 | 24 | ], |
25 | 25 | 'settings.general.notification' => [ |
26 | 26 | 'default' => 'none', |
27 | - 'label' => __( 'Notifications', 'site-reviews' ), |
|
27 | + 'label' => __('Notifications', 'site-reviews'), |
|
28 | 28 | 'options' => [ |
29 | - 'none' => __( 'Do not send review notifications', 'site-reviews' ), |
|
30 | - 'default' => __( 'Send to administrator', 'site-reviews' ).' <code>'.(string)get_option( 'admin_email' ).'</code>', |
|
31 | - 'custom' => __( 'Send to one or more email addresses', 'site-reviews' ), |
|
32 | - 'webhook' => __( 'Send to <a href="https://slack.com/">Slack</a>', 'site-reviews' ), |
|
29 | + 'none' => __('Do not send review notifications', 'site-reviews'), |
|
30 | + 'default' => __('Send to administrator', 'site-reviews').' <code>'.(string)get_option('admin_email').'</code>', |
|
31 | + 'custom' => __('Send to one or more email addresses', 'site-reviews'), |
|
32 | + 'webhook' => __('Send to <a href="https://slack.com/">Slack</a>', 'site-reviews'), |
|
33 | 33 | ], |
34 | 34 | 'type' => 'radio', |
35 | 35 | ], |
36 | 36 | 'settings.general.notification_email' => [ |
37 | 37 | 'default' => '', |
38 | 38 | 'depends' => ['notification' => 'custom'], |
39 | - 'label' => __( 'Send notification emails to', 'site-reviews' ), |
|
40 | - 'placeholder' => __( 'Separate multiple emails with a comma', 'site-reviews' ), |
|
39 | + 'label' => __('Send notification emails to', 'site-reviews'), |
|
40 | + 'placeholder' => __('Separate multiple emails with a comma', 'site-reviews'), |
|
41 | 41 | 'type' => 'text', |
42 | 42 | ], |
43 | 43 | 'settings.general.webhook_url' => [ |
44 | 44 | 'default' => '', |
45 | 45 | 'depends' => ['notification' => 'webhook'], |
46 | - 'desc' => sprintf( __( 'To send notifications to Slack, create a new %s and then paste the provided Webhook URL in the field above.', 'site-reviews' ), |
|
47 | - glsr( 'Modules\Html\Builder' )->a( __( 'Incoming WebHook', 'site-reviews' ), ['href' => 'https://slack.com/apps/new/A0F7XDUAZ-incoming-webhooks'] ) |
|
46 | + 'desc' => sprintf(__('To send notifications to Slack, create a new %s and then paste the provided Webhook URL in the field above.', 'site-reviews'), |
|
47 | + glsr('Modules\Html\Builder')->a(__('Incoming WebHook', 'site-reviews'), ['href' => 'https://slack.com/apps/new/A0F7XDUAZ-incoming-webhooks']) |
|
48 | 48 | ), |
49 | - 'label' => __( 'Webhook URL', 'site-reviews' ), |
|
49 | + 'label' => __('Webhook URL', 'site-reviews'), |
|
50 | 50 | 'type' => 'url', |
51 | 51 | ], |
52 | 52 | 'settings.general.notification_message' => [ |
53 | - 'default' => glsr( 'Modules\Html' )->buildTemplate( 'templates/email-notification' ), |
|
53 | + 'default' => glsr('Modules\Html')->buildTemplate('templates/email-notification'), |
|
54 | 54 | 'depends' => ['notification' => ['custom', 'default', 'webhook']], |
55 | 55 | 'desc' => __( |
56 | 56 | 'To restore the default text, save an empty template. '. |
@@ -65,181 +65,181 @@ discard block |
||
65 | 65 | '<br><code>{review_link}</code> The link to edit/view a review', |
66 | 66 | 'site-reviews' |
67 | 67 | ), |
68 | - 'label' => __( 'Notification template', 'site-reviews' ), |
|
68 | + 'label' => __('Notification template', 'site-reviews'), |
|
69 | 69 | 'rows' => 10, |
70 | 70 | 'type' => 'code', |
71 | 71 | ], |
72 | 72 | 'settings.reviews.date.format' => [ |
73 | 73 | 'default' => '', |
74 | - 'desc' => sprintf( __( 'The default date format is the one set in your %s.', 'site-reviews' ), |
|
75 | - glsr( 'Modules\Html\Builder' )->a( __( 'WordPress settings', 'site-reviews' ), ['href' => admin_url( 'options-general.php' )] ) |
|
74 | + 'desc' => sprintf(__('The default date format is the one set in your %s.', 'site-reviews'), |
|
75 | + glsr('Modules\Html\Builder')->a(__('WordPress settings', 'site-reviews'), ['href' => admin_url('options-general.php')]) |
|
76 | 76 | ), |
77 | - 'label' => __( 'Date Format', 'site-reviews' ), |
|
77 | + 'label' => __('Date Format', 'site-reviews'), |
|
78 | 78 | 'options' => [ |
79 | - '' => __( 'Use the default date format', 'site-reviews' ), |
|
80 | - 'relative' => __( 'Use a relative date format', 'site-reviews' ), |
|
81 | - 'custom' => __( 'Use a custom date format', 'site-reviews' ), |
|
79 | + '' => __('Use the default date format', 'site-reviews'), |
|
80 | + 'relative' => __('Use a relative date format', 'site-reviews'), |
|
81 | + 'custom' => __('Use a custom date format', 'site-reviews'), |
|
82 | 82 | ], |
83 | 83 | 'type' => 'select', |
84 | 84 | ], |
85 | 85 | 'settings.reviews.date.custom' => [ |
86 | - 'default' => get_option( 'date_format' ), |
|
86 | + 'default' => get_option('date_format'), |
|
87 | 87 | 'depends' => ['date.format' => 'custom'], |
88 | - 'desc' => __( 'Enter a custom date format (<a href="https://codex.wordpress.org/Formatting_Date_and_Time">documentation on date and time formatting</a>).', 'site-reviews' ), |
|
89 | - 'label' => __( 'Custom Date Format', 'site-reviews' ), |
|
88 | + 'desc' => __('Enter a custom date format (<a href="https://codex.wordpress.org/Formatting_Date_and_Time">documentation on date and time formatting</a>).', 'site-reviews'), |
|
89 | + 'label' => __('Custom Date Format', 'site-reviews'), |
|
90 | 90 | 'type' => 'text', |
91 | 91 | ], |
92 | 92 | 'settings.reviews.assigned_links.enabled' => [ |
93 | 93 | 'default' => false, |
94 | - 'desc' => __( 'Display a link to the assigned post of a review.', 'site-reviews' ), |
|
95 | - 'label' => __( 'Enable Assigned Links', 'site-reviews' ), |
|
94 | + 'desc' => __('Display a link to the assigned post of a review.', 'site-reviews'), |
|
95 | + 'label' => __('Enable Assigned Links', 'site-reviews'), |
|
96 | 96 | 'type' => 'yesno_inline', |
97 | 97 | ], |
98 | 98 | 'settings.reviews.avatars.enabled' => [ |
99 | 99 | 'default' => false, |
100 | - 'desc' => __( 'Display reviewer avatars. These are generated from the email address of the reviewer using <a href="https://gravatar.com">Gravatar</a>.', 'site-reviews' ), |
|
101 | - 'label' => __( 'Enable Avatars', 'site-reviews' ), |
|
100 | + 'desc' => __('Display reviewer avatars. These are generated from the email address of the reviewer using <a href="https://gravatar.com">Gravatar</a>.', 'site-reviews'), |
|
101 | + 'label' => __('Enable Avatars', 'site-reviews'), |
|
102 | 102 | 'type' => 'yesno_inline', |
103 | 103 | ], |
104 | 104 | 'settings.reviews.excerpt.enabled' => [ |
105 | 105 | 'default' => false, |
106 | - 'desc' => __( 'Display an excerpt instead of the full review.', 'site-reviews' ), |
|
107 | - 'label' => __( 'Enable Excerpts', 'site-reviews' ), |
|
106 | + 'desc' => __('Display an excerpt instead of the full review.', 'site-reviews'), |
|
107 | + 'label' => __('Enable Excerpts', 'site-reviews'), |
|
108 | 108 | 'type' => 'yesno_inline', |
109 | 109 | ], |
110 | 110 | 'settings.reviews.excerpt.length' => [ |
111 | 111 | 'default' => 55, |
112 | 112 | 'depends' => ['excerpt.enabled' => 'yes'], |
113 | - 'desc' => __( 'Set the excerpt word length.', 'site-reviews' ), |
|
114 | - 'label' => __( 'Excerpt Length', 'site-reviews' ), |
|
113 | + 'desc' => __('Set the excerpt word length.', 'site-reviews'), |
|
114 | + 'label' => __('Excerpt Length', 'site-reviews'), |
|
115 | 115 | 'type' => 'number', |
116 | 116 | ], |
117 | 117 | 'settings.reviews.schema.type.default' => [ |
118 | 118 | 'default' => 'LocalBusiness', |
119 | - 'desc' => __( 'This is the default schema type for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_type</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews' ), |
|
120 | - 'label' => __( 'Default Schema Type', 'site-reviews' ), |
|
119 | + 'desc' => __('This is the default schema type for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_type</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews'), |
|
120 | + 'label' => __('Default Schema Type', 'site-reviews'), |
|
121 | 121 | 'options' => [ |
122 | - 'LocalBusiness' => __( 'Local Business', 'site-reviews' ), |
|
123 | - 'Product' => __( 'Product', 'site-reviews' ), |
|
124 | - 'custom' => __( 'Custom', 'site-reviews' ), |
|
122 | + 'LocalBusiness' => __('Local Business', 'site-reviews'), |
|
123 | + 'Product' => __('Product', 'site-reviews'), |
|
124 | + 'custom' => __('Custom', 'site-reviews'), |
|
125 | 125 | ], |
126 | 126 | 'type' => 'select', |
127 | 127 | ], |
128 | 128 | 'settings.reviews.schema.type.custom' => [ |
129 | 129 | 'default' => '', |
130 | 130 | 'depends' => ['schema.type.default' => 'custom'], |
131 | - 'desc' => __( 'Google supports review ratings for the following schema content types: Local businesses, Movies, Books, Music, and Products. <a href="https://schema.org/docs/schemas.html">View more information on schema types here</a>.', 'site-reviews' ), |
|
132 | - 'label' => __( 'Custom Schema Type', 'site-reviews' ), |
|
131 | + 'desc' => __('Google supports review ratings for the following schema content types: Local businesses, Movies, Books, Music, and Products. <a href="https://schema.org/docs/schemas.html">View more information on schema types here</a>.', 'site-reviews'), |
|
132 | + 'label' => __('Custom Schema Type', 'site-reviews'), |
|
133 | 133 | 'type' => 'text', |
134 | 134 | ], |
135 | 135 | 'settings.reviews.schema.name.default' => [ |
136 | 136 | 'default' => 'post', |
137 | - 'desc' => __( 'This is the default name of the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_name</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews' ), |
|
138 | - 'label' => __( 'Default Name', 'site-reviews' ), |
|
137 | + 'desc' => __('This is the default name of the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_name</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews'), |
|
138 | + 'label' => __('Default Name', 'site-reviews'), |
|
139 | 139 | 'options' => [ |
140 | - 'post' => __( 'Use the assigned or current page title', 'site-reviews' ), |
|
141 | - 'custom' => __( 'Enter a custom title', 'site-reviews' ), |
|
140 | + 'post' => __('Use the assigned or current page title', 'site-reviews'), |
|
141 | + 'custom' => __('Enter a custom title', 'site-reviews'), |
|
142 | 142 | ], |
143 | 143 | 'type' => 'select', |
144 | 144 | ], |
145 | 145 | 'settings.reviews.schema.name.custom' => [ |
146 | 146 | 'default' => '', |
147 | 147 | 'depends' => ['schema.name.default' => 'custom'], |
148 | - 'label' => __( 'Custom Name', 'site-reviews' ), |
|
148 | + 'label' => __('Custom Name', 'site-reviews'), |
|
149 | 149 | 'type' => 'text', |
150 | 150 | ], |
151 | 151 | 'settings.reviews.schema.description.default' => [ |
152 | 152 | 'default' => 'post', |
153 | - 'desc' => __( 'This is the default description for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_description</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews' ), |
|
154 | - 'label' => __( 'Default Description', 'site-reviews' ), |
|
153 | + 'desc' => __('This is the default description for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_description</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews'), |
|
154 | + 'label' => __('Default Description', 'site-reviews'), |
|
155 | 155 | 'options' => [ |
156 | - 'post' => __( 'Use the assigned or current page excerpt', 'site-reviews' ), |
|
157 | - 'custom' => __( 'Enter a custom description', 'site-reviews' ), |
|
156 | + 'post' => __('Use the assigned or current page excerpt', 'site-reviews'), |
|
157 | + 'custom' => __('Enter a custom description', 'site-reviews'), |
|
158 | 158 | ], |
159 | 159 | 'type' => 'select', |
160 | 160 | ], |
161 | 161 | 'settings.reviews.schema.description.custom' => [ |
162 | 162 | 'default' => '', |
163 | 163 | 'depends' => ['schema.description.default' => 'custom'], |
164 | - 'label' => __( 'Custom Description', 'site-reviews' ), |
|
164 | + 'label' => __('Custom Description', 'site-reviews'), |
|
165 | 165 | 'type' => 'text', |
166 | 166 | ], |
167 | 167 | 'settings.reviews.schema.url.default' => [ |
168 | 168 | 'default' => 'post', |
169 | - 'desc' => __( 'This is the default URL for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_url</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews' ), |
|
170 | - 'label' => __( 'Default URL', 'site-reviews' ), |
|
169 | + 'desc' => __('This is the default URL for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_url</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews'), |
|
170 | + 'label' => __('Default URL', 'site-reviews'), |
|
171 | 171 | 'options' => [ |
172 | - 'post' => __( 'Use the assigned or current page URL', 'site-reviews' ), |
|
173 | - 'custom' => __( 'Enter a custom URL', 'site-reviews' ), |
|
172 | + 'post' => __('Use the assigned or current page URL', 'site-reviews'), |
|
173 | + 'custom' => __('Enter a custom URL', 'site-reviews'), |
|
174 | 174 | ], |
175 | 175 | 'type' => 'select', |
176 | 176 | ], |
177 | 177 | 'settings.reviews.schema.url.custom' => [ |
178 | 178 | 'default' => '', |
179 | 179 | 'depends' => ['schema.url.default' => 'custom'], |
180 | - 'label' => __( 'Custom URL', 'site-reviews' ), |
|
180 | + 'label' => __('Custom URL', 'site-reviews'), |
|
181 | 181 | 'type' => 'text', |
182 | 182 | ], |
183 | 183 | 'settings.reviews.schema.image.default' => [ |
184 | 184 | 'default' => 'post', |
185 | - 'desc' => __( 'This is the default image for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_image</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews' ), |
|
186 | - 'label' => __( 'Default Image', 'site-reviews' ), |
|
185 | + 'desc' => __('This is the default image for the item being reviewed. You can override this option on a per-post/page basis by adding a <code>schema_image</code> metadata value using <a href="https://codex.wordpress.org/Using_Custom_Fields#Usage">Custom Fields</a>.', 'site-reviews'), |
|
186 | + 'label' => __('Default Image', 'site-reviews'), |
|
187 | 187 | 'options' => [ |
188 | - 'post' => __( 'Use the featured image of the assigned or current page', 'site-reviews' ), |
|
189 | - 'custom' => __( 'Enter a custom image URL', 'site-reviews' ), |
|
188 | + 'post' => __('Use the featured image of the assigned or current page', 'site-reviews'), |
|
189 | + 'custom' => __('Enter a custom image URL', 'site-reviews'), |
|
190 | 190 | ], |
191 | 191 | 'type' => 'select', |
192 | 192 | ], |
193 | 193 | 'settings.reviews.schema.image.custom' => [ |
194 | 194 | 'default' => '', |
195 | 195 | 'depends' => ['schema.image.default' => 'custom'], |
196 | - 'label' => __( 'Custom Image URL', 'site-reviews' ), |
|
196 | + 'label' => __('Custom Image URL', 'site-reviews'), |
|
197 | 197 | 'type' => 'text', |
198 | 198 | ], |
199 | 199 | 'settings.submissions.required' => [ |
200 | - 'default' => ['title','content','name','email'], |
|
201 | - 'label' => __( 'Required Fields', 'site-reviews' ), |
|
200 | + 'default' => ['title', 'content', 'name', 'email'], |
|
201 | + 'label' => __('Required Fields', 'site-reviews'), |
|
202 | 202 | 'options' => [ |
203 | - 'title' => __( 'Title', 'site-reviews' ), |
|
204 | - 'content' => __( 'Review', 'site-reviews' ), |
|
205 | - 'name' => __( 'Name', 'site-reviews' ), |
|
206 | - 'email' => __( 'Email', 'site-reviews' ), |
|
203 | + 'title' => __('Title', 'site-reviews'), |
|
204 | + 'content' => __('Review', 'site-reviews'), |
|
205 | + 'name' => __('Name', 'site-reviews'), |
|
206 | + 'email' => __('Email', 'site-reviews'), |
|
207 | 207 | ], |
208 | 208 | 'type' => 'checkbox', |
209 | 209 | ], |
210 | 210 | 'settings.submissions.akismet' => [ |
211 | 211 | 'default' => false, |
212 | - 'desc' => __( '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' ), |
|
213 | - 'label' => __( 'Enable Akismet Integration', 'site-reviews' ), |
|
212 | + 'desc' => __('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'), |
|
213 | + 'label' => __('Enable Akismet Integration', 'site-reviews'), |
|
214 | 214 | 'type' => 'yesno_inline', |
215 | 215 | ], |
216 | 216 | 'settings.submissions.recaptcha.integration' => [ |
217 | 217 | 'default' => '', |
218 | - 'desc' => __( '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. If you are already using a reCAPTCHA plugin listed here, please select it; otherwise choose "Use reCAPTCHA".', 'site-reviews' ), |
|
219 | - 'label' => __( 'Invisible reCAPTCHA', 'site-reviews' ), |
|
218 | + 'desc' => __('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. If you are already using a reCAPTCHA plugin listed here, please select it; otherwise choose "Use reCAPTCHA".', 'site-reviews'), |
|
219 | + 'label' => __('Invisible reCAPTCHA', 'site-reviews'), |
|
220 | 220 | 'options' => [ |
221 | - '' => __( 'Do not use reCAPTCHA', 'site-reviews' ), |
|
222 | - 'custom' => __( 'Use reCAPTCHA', 'site-reviews' ), |
|
223 | - 'invisible-recaptcha' => __( 'Use 3rd-party plugin: Invisible reCaptcha', 'site-reviews' ), |
|
221 | + '' => __('Do not use reCAPTCHA', 'site-reviews'), |
|
222 | + 'custom' => __('Use reCAPTCHA', 'site-reviews'), |
|
223 | + 'invisible-recaptcha' => __('Use 3rd-party plugin: Invisible reCaptcha', 'site-reviews'), |
|
224 | 224 | ], |
225 | 225 | 'type' => 'select', |
226 | 226 | ], |
227 | 227 | 'settings.submissions.recaptcha.key' => [ |
228 | 228 | 'default' => '', |
229 | 229 | 'depends' => ['recaptcha.integration' => 'custom'], |
230 | - 'label' => __( 'Site Key', 'site-reviews' ), |
|
230 | + 'label' => __('Site Key', 'site-reviews'), |
|
231 | 231 | 'type' => 'text', |
232 | 232 | ], |
233 | 233 | 'settings.submissions.recaptcha.secret' => [ |
234 | 234 | 'default' => '', |
235 | 235 | 'depends' => ['recaptcha.integration' => 'custom'], |
236 | - 'label' => __( 'Site Secret', 'site-reviews' ), |
|
236 | + 'label' => __('Site Secret', 'site-reviews'), |
|
237 | 237 | 'type' => 'text', |
238 | 238 | ], |
239 | 239 | 'settings.submissions.recaptcha.position' => [ |
240 | 240 | 'default' => 'bottomleft', |
241 | 241 | 'depends' => ['recaptcha.integration' => 'custom'], |
242 | - 'label' => __( 'Badge Position', 'site-reviews' ), |
|
242 | + 'label' => __('Badge Position', 'site-reviews'), |
|
243 | 243 | 'options' => [ |
244 | 244 | 'bottomleft' => 'Bottom Left', |
245 | 245 | 'bottomright' => 'Bottom Right', |
@@ -250,18 +250,18 @@ discard block |
||
250 | 250 | 'settings.submissions.blacklist.entries' => [ |
251 | 251 | 'default' => '', |
252 | 252 | 'class' => 'large-text code', |
253 | - 'desc' => __( 'When a review contains any of these words in its title, content, name, email, or IP address, it will be rejected. One word or IP address per line. It will match inside words, so "press" will match "WordPress".', 'site-reviews' ), |
|
254 | - 'label' => __( 'Review Blacklist', 'site-reviews' ), |
|
253 | + 'desc' => __('When a review contains any of these words in its title, content, name, email, or IP address, it will be rejected. One word or IP address per line. It will match inside words, so "press" will match "WordPress".', 'site-reviews'), |
|
254 | + 'label' => __('Review Blacklist', 'site-reviews'), |
|
255 | 255 | 'rows' => 10, |
256 | 256 | 'type' => 'textarea', |
257 | 257 | ], |
258 | 258 | 'settings.submissions.blacklist.action' => [ |
259 | 259 | 'default' => 'unapprove', |
260 | - 'desc' => __( 'Choose the action that should be taken when a review is blacklisted.', 'site-reviews' ), |
|
261 | - 'label' => __( 'Blacklist Action', 'site-reviews' ), |
|
260 | + 'desc' => __('Choose the action that should be taken when a review is blacklisted.', 'site-reviews'), |
|
261 | + 'label' => __('Blacklist Action', 'site-reviews'), |
|
262 | 262 | 'options' => [ |
263 | - 'unapprove' => __( 'Require approval', 'site-reviews' ), |
|
264 | - 'reject' => __( 'Reject submission', 'site-reviews' ), |
|
263 | + 'unapprove' => __('Require approval', 'site-reviews'), |
|
264 | + 'reject' => __('Reject submission', 'site-reviews'), |
|
265 | 265 | ], |
266 | 266 | 'type' => 'select', |
267 | 267 | ], |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -defined( 'WPINC' ) || die; |
|
3 | +defined('WPINC') || die; |
|
4 | 4 | |
5 | -require_once( ABSPATH.WPINC.'/class-phpass.php' ); |
|
5 | +require_once(ABSPATH.WPINC.'/class-phpass.php'); |
|
6 | 6 | |
7 | -spl_autoload_register( function( $className ) { |
|
7 | +spl_autoload_register(function($className) { |
|
8 | 8 | $namespaces = [ |
9 | 9 | 'GeminiLabs\\SiteReviews\\' => __DIR__.'/plugin/', |
10 | 10 | 'GeminiLabs\\SiteReviews\\Tests\\' => __DIR__.'/tests/', |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | 'Sinergi\\BrowserDetector\\' => __DIR__.'/vendor/sinergi/browser-detector/src/', |
14 | 14 | 'Vectorface\\Whip\\' => __DIR__.'/vendor/vectorface/whip/src/', |
15 | 15 | ]; |
16 | - foreach( $namespaces as $prefix => $base_dir ) { |
|
17 | - $len = strlen( $prefix ); |
|
18 | - if( strncmp( $prefix, $className, $len ) !== 0 )continue; |
|
19 | - $file = $base_dir.str_replace( '\\', '/', substr( $className, $len )).'.php'; |
|
20 | - if( !file_exists( $file ))continue; |
|
16 | + foreach ($namespaces as $prefix => $base_dir) { |
|
17 | + $len = strlen($prefix); |
|
18 | + if (strncmp($prefix, $className, $len) !== 0)continue; |
|
19 | + $file = $base_dir.str_replace('\\', '/', substr($className, $len)).'.php'; |
|
20 | + if (!file_exists($file))continue; |
|
21 | 21 | require $file; |
22 | 22 | break; |
23 | 23 | } |
@@ -15,9 +15,13 @@ |
||
15 | 15 | ]; |
16 | 16 | foreach( $namespaces as $prefix => $base_dir ) { |
17 | 17 | $len = strlen( $prefix ); |
18 | - if( strncmp( $prefix, $className, $len ) !== 0 )continue; |
|
18 | + if( strncmp( $prefix, $className, $len ) !== 0 ) { |
|
19 | + continue; |
|
20 | + } |
|
19 | 21 | $file = $base_dir.str_replace( '\\', '/', substr( $className, $len )).'.php'; |
20 | - if( !file_exists( $file ))continue; |
|
22 | + if( !file_exists( $file )) { |
|
23 | + continue; |
|
24 | + } |
|
21 | 25 | require $file; |
22 | 26 | break; |
23 | 27 | } |
@@ -16,18 +16,18 @@ |
||
16 | 16 | * Domain Path: languages |
17 | 17 | */ |
18 | 18 | |
19 | -defined( 'WPINC' ) || die; |
|
19 | +defined('WPINC') || die; |
|
20 | 20 | |
21 | -if( !class_exists( 'GL_Plugin_Check_v1' )) { |
|
21 | +if (!class_exists('GL_Plugin_Check_v1')) { |
|
22 | 22 | require_once __DIR__.'/activate.php'; |
23 | 23 | } |
24 | -if( GL_Plugin_Check_v1::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' )))return; |
|
24 | +if (GL_Plugin_Check_v1::shouldDeactivate(__FILE__, array('wordpress' => '4.7.0')))return; |
|
25 | 25 | |
26 | 26 | require_once __DIR__.'/autoload.php'; |
27 | 27 | require_once __DIR__.'/helpers.php'; |
28 | 28 | |
29 | 29 | $app = new GeminiLabs\SiteReviews\Application; |
30 | -$app->make( 'Provider' )->register( $app ); |
|
31 | -register_activation_hook( __FILE__, array( $app, 'activate' )); |
|
32 | -register_deactivation_hook( __FILE__, array( $app, 'deactivate' )); |
|
30 | +$app->make('Provider')->register($app); |
|
31 | +register_activation_hook(__FILE__, array($app, 'activate')); |
|
32 | +register_deactivation_hook(__FILE__, array($app, 'deactivate')); |
|
33 | 33 | $app->init(); |
@@ -21,7 +21,9 @@ |
||
21 | 21 | if( !class_exists( 'GL_Plugin_Check_v1' )) { |
22 | 22 | require_once __DIR__.'/activate.php'; |
23 | 23 | } |
24 | -if( GL_Plugin_Check_v1::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' )))return; |
|
24 | +if( GL_Plugin_Check_v1::shouldDeactivate( __FILE__, array( 'wordpress' => '4.7.0' ))) { |
|
25 | + return; |
|
26 | +} |
|
25 | 27 | |
26 | 28 | require_once __DIR__.'/autoload.php'; |
27 | 29 | require_once __DIR__.'/helpers.php'; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -defined( 'WPINC' ) || die; |
|
3 | +defined('WPINC') || die; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Checks for minimum system requirments on plugin activation |
@@ -30,21 +30,21 @@ discard block |
||
30 | 30 | * @param string $version |
31 | 31 | * @return bool |
32 | 32 | */ |
33 | - public static function isPhpValid( $version = '' ) |
|
33 | + public static function isPhpValid($version = '') |
|
34 | 34 | { |
35 | - if( !empty( $version )) { |
|
36 | - static::normalize( array( 'php' => $version )); |
|
35 | + if (!empty($version)) { |
|
36 | + static::normalize(array('php' => $version)); |
|
37 | 37 | } |
38 | - return !version_compare( PHP_VERSION, static::$versions->php, '<' ); |
|
38 | + return !version_compare(PHP_VERSION, static::$versions->php, '<'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * @return bool |
43 | 43 | */ |
44 | - public static function isValid( array $args = array() ) |
|
44 | + public static function isValid(array $args = array()) |
|
45 | 45 | { |
46 | - if( !empty( $args )) { |
|
47 | - static::normalize( $args ); |
|
46 | + if (!empty($args)) { |
|
47 | + static::normalize($args); |
|
48 | 48 | } |
49 | 49 | return static::isPhpValid() && static::isWpValid(); |
50 | 50 | } |
@@ -53,29 +53,29 @@ discard block |
||
53 | 53 | * @param string $version |
54 | 54 | * @return bool |
55 | 55 | */ |
56 | - public static function isWpValid( $version = '' ) |
|
56 | + public static function isWpValid($version = '') |
|
57 | 57 | { |
58 | 58 | global $wp_version; |
59 | - if( !empty( $version )) { |
|
60 | - static::normalize( array( 'wordpress' => $version )); |
|
59 | + if (!empty($version)) { |
|
60 | + static::normalize(array('wordpress' => $version)); |
|
61 | 61 | } |
62 | - return !version_compare( $wp_version, static::$versions->wordpress, '<' ); |
|
62 | + return !version_compare($wp_version, static::$versions->wordpress, '<'); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | 66 | * @param string $file |
67 | 67 | * @return bool |
68 | 68 | */ |
69 | - public static function shouldDeactivate( $file, array $args = array() ) |
|
69 | + public static function shouldDeactivate($file, array $args = array()) |
|
70 | 70 | { |
71 | - if( empty( static::$instance )) { |
|
72 | - static::$file = realpath( $file ); |
|
71 | + if (empty(static::$instance)) { |
|
72 | + static::$file = realpath($file); |
|
73 | 73 | static::$instance = new static; |
74 | - static::$versions = static::normalize( $args ); |
|
74 | + static::$versions = static::normalize($args); |
|
75 | 75 | } |
76 | - if( !static::isValid() ) { |
|
77 | - add_action( 'activated_plugin', array( static::$instance, 'deactivate' )); |
|
78 | - add_action( 'admin_notices', array( static::$instance, 'deactivate' )); |
|
76 | + if (!static::isValid()) { |
|
77 | + add_action('activated_plugin', array(static::$instance, 'deactivate')); |
|
78 | + add_action('admin_notices', array(static::$instance, 'deactivate')); |
|
79 | 79 | return true; |
80 | 80 | } |
81 | 81 | return false; |
@@ -85,24 +85,24 @@ discard block |
||
85 | 85 | * @param string $plugin |
86 | 86 | * @return void |
87 | 87 | */ |
88 | - public function deactivate( $plugin ) |
|
88 | + public function deactivate($plugin) |
|
89 | 89 | { |
90 | - if( static::isValid() )return; |
|
91 | - $pluginSlug = plugin_basename( static::$file ); |
|
92 | - if( $plugin == $pluginSlug ) { |
|
90 | + if (static::isValid())return; |
|
91 | + $pluginSlug = plugin_basename(static::$file); |
|
92 | + if ($plugin == $pluginSlug) { |
|
93 | 93 | $this->redirect(); //exit |
94 | 94 | } |
95 | - $pluginData = get_file_data( static::$file, array( 'name' => 'Plugin Name' ), 'plugin' ); |
|
96 | - deactivate_plugins( $pluginSlug ); |
|
97 | - $this->printNotice( $pluginData['name'] ); |
|
95 | + $pluginData = get_file_data(static::$file, array('name' => 'Plugin Name'), 'plugin'); |
|
96 | + deactivate_plugins($pluginSlug); |
|
97 | + $this->printNotice($pluginData['name']); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | 101 | * @return object |
102 | 102 | */ |
103 | - protected static function normalize( array $args = array() ) |
|
103 | + protected static function normalize(array $args = array()) |
|
104 | 104 | { |
105 | - return (object)wp_parse_args( $args, array( |
|
105 | + return (object)wp_parse_args($args, array( |
|
106 | 106 | 'php' => static::MIN_PHP_VERSION, |
107 | 107 | 'wordpress' => static::MIN_WORDPRESS_VERSION, |
108 | 108 | )); |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | */ |
114 | 114 | protected function redirect() |
115 | 115 | { |
116 | - wp_safe_redirect( self_admin_url( sprintf( 'plugins.php?plugin_status=%s&paged=%s&s=%s', |
|
117 | - filter_input( INPUT_GET, 'plugin_status' ), |
|
118 | - filter_input( INPUT_GET, 'paged' ), |
|
119 | - filter_input( INPUT_GET, 's' ) |
|
116 | + wp_safe_redirect(self_admin_url(sprintf('plugins.php?plugin_status=%s&paged=%s&s=%s', |
|
117 | + filter_input(INPUT_GET, 'plugin_status'), |
|
118 | + filter_input(INPUT_GET, 'paged'), |
|
119 | + filter_input(INPUT_GET, 's') |
|
120 | 120 | ))); |
121 | 121 | exit; |
122 | 122 | } |
@@ -125,29 +125,29 @@ discard block |
||
125 | 125 | * @param string $pluginName |
126 | 126 | * @return void |
127 | 127 | */ |
128 | - protected function printNotice( $pluginName ) |
|
128 | + protected function printNotice($pluginName) |
|
129 | 129 | { |
130 | 130 | $noticeTemplate = '<div id="message" class="notice notice-error error is-dismissible"><p><strong>%s</strong></p><p>%s</p><p>%s</p></div>'; |
131 | 131 | $messages = array( |
132 | - __( 'The %s plugin was deactivated.', 'site-reviews' ), |
|
133 | - __( 'Sorry, this plugin requires %s or greater in order to work properly.', 'site-reviews' ), |
|
134 | - __( 'Please contact your hosting provider or server administrator to upgrade the version of PHP on your server (your server is running PHP version %s), or try to find an alternative plugin.', 'site-reviews' ), |
|
135 | - __( 'PHP version', 'site-reviews' ), |
|
136 | - __( 'WordPress version', 'site-reviews' ), |
|
137 | - __( 'Update WordPress', 'site-reviews' ), |
|
132 | + __('The %s plugin was deactivated.', 'site-reviews'), |
|
133 | + __('Sorry, this plugin requires %s or greater in order to work properly.', 'site-reviews'), |
|
134 | + __('Please contact your hosting provider or server administrator to upgrade the version of PHP on your server (your server is running PHP version %s), or try to find an alternative plugin.', 'site-reviews'), |
|
135 | + __('PHP version', 'site-reviews'), |
|
136 | + __('WordPress version', 'site-reviews'), |
|
137 | + __('Update WordPress', 'site-reviews'), |
|
138 | 138 | ); |
139 | - if( !static::isPhpValid() ) { |
|
140 | - printf( $noticeTemplate, |
|
141 | - sprintf( $messages[0], $pluginName ), |
|
142 | - sprintf( $messages[1], $messages[3].' '.static::$versions->php ), |
|
143 | - sprintf( $messages[2], PHP_VERSION ) |
|
139 | + if (!static::isPhpValid()) { |
|
140 | + printf($noticeTemplate, |
|
141 | + sprintf($messages[0], $pluginName), |
|
142 | + sprintf($messages[1], $messages[3].' '.static::$versions->php), |
|
143 | + sprintf($messages[2], PHP_VERSION) |
|
144 | 144 | ); |
145 | 145 | } |
146 | - else if( !static::isWpValid() ) { |
|
147 | - printf( $noticeTemplate, |
|
148 | - sprintf( $messages[0], $pluginName ), |
|
149 | - sprintf( $messages[1], $messages[4].' '.static::$versions->wordpress ), |
|
150 | - sprintf( '<a href="%s">%s</a>', admin_url( 'update-core.php' ), $messages[5] ) |
|
146 | + else if (!static::isWpValid()) { |
|
147 | + printf($noticeTemplate, |
|
148 | + sprintf($messages[0], $pluginName), |
|
149 | + sprintf($messages[1], $messages[4].' '.static::$versions->wordpress), |
|
150 | + sprintf('<a href="%s">%s</a>', admin_url('update-core.php'), $messages[5]) |
|
151 | 151 | ); |
152 | 152 | } |
153 | 153 | } |
@@ -87,7 +87,9 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function deactivate( $plugin ) |
89 | 89 | { |
90 | - if( static::isValid() )return; |
|
90 | + if( static::isValid() ) { |
|
91 | + return; |
|
92 | + } |
|
91 | 93 | $pluginSlug = plugin_basename( static::$file ); |
92 | 94 | if( $plugin == $pluginSlug ) { |
93 | 95 | $this->redirect(); //exit |
@@ -142,8 +144,7 @@ discard block |
||
142 | 144 | sprintf( $messages[1], $messages[3].' '.static::$versions->php ), |
143 | 145 | sprintf( $messages[2], PHP_VERSION ) |
144 | 146 | ); |
145 | - } |
|
146 | - else if( !static::isWpValid() ) { |
|
147 | + } else if( !static::isWpValid() ) { |
|
147 | 148 | printf( $noticeTemplate, |
148 | 149 | sprintf( $messages[0], $pluginName ), |
149 | 150 | sprintf( $messages[1], $messages[4].' '.static::$versions->wordpress ), |
@@ -1,3 +1,3 @@ |
||
1 | -<?php defined( 'WPINC' ) || die; ?> |
|
1 | +<?php defined('WPINC') || die; ?> |
|
2 | 2 | |
3 | 3 | <br> |
@@ -1,3 +1,3 @@ |
||
1 | -<?php defined( 'WPINC' ) || die; |
|
1 | +<?php defined('WPINC') || die; |
|
2 | 2 | |
3 | -$html->renderForm( $currentTab.'.'.$currentSection ); |
|
3 | +$html->renderForm($currentTab.'.'.$currentSection); |
@@ -1,3 +1,3 @@ |
||
1 | -<?php defined( 'WPINC' ) || die; |
|
1 | +<?php defined('WPINC') || die; |
|
2 | 2 | |
3 | -$html->renderForm( $currentTab.'.'.$currentSection ); |
|
3 | +$html->renderForm($currentTab.'.'.$currentSection); |
@@ -1,18 +1,18 @@ |
||
1 | -<?php defined( 'WPINC' ) || die; ?> |
|
1 | +<?php defined('WPINC') || die; ?> |
|
2 | 2 | |
3 | 3 | <div class="glsr-search-box" id="glsr-search-translations"> |
4 | - <span class="screen-reader-text"><?= __( 'Search for translatable text', 'site-reviews' ); ?></span> |
|
4 | + <span class="screen-reader-text"><?= __('Search for translatable text', 'site-reviews'); ?></span> |
|
5 | 5 | <div class="glsr-spinner"><span class="spinner"></span></div> |
6 | - <input type="search" class="glsr-search-input" autocomplete="off" placeholder="<?= __( 'Search for translatable text...', 'site-reviews' ); ?>"> |
|
7 | - <?php wp_nonce_field( 'search-translations' ); ?> |
|
6 | + <input type="search" class="glsr-search-input" autocomplete="off" placeholder="<?= __('Search for translatable text...', 'site-reviews'); ?>"> |
|
7 | + <?php wp_nonce_field('search-translations'); ?> |
|
8 | 8 | <div class="glsr-search-results" data-prefix="<?= $databaseKey; ?>"></div> |
9 | 9 | </div> |
10 | 10 | |
11 | -<?php $html->renderForm( $currentTab.'.'.$currentSection ); ?> |
|
11 | +<?php $html->renderForm($currentTab.'.'.$currentSection); ?> |
|
12 | 12 | |
13 | 13 | <script type="text/html" id="tmpl-glsr-string-plural"> |
14 | -<?php include glsr()->path( 'views/translations/plural.php' ); ?> |
|
14 | +<?php include glsr()->path('views/translations/plural.php'); ?> |
|
15 | 15 | </script> |
16 | 16 | <script type="text/html" id="tmpl-glsr-string-single"> |
17 | -<?php include glsr()->path( 'views/translations/single.php' ); ?> |
|
17 | +<?php include glsr()->path('views/translations/single.php'); ?> |
|
18 | 18 | </script> |
@@ -1,3 +1,3 @@ |
||
1 | -<?php defined( 'WPINC' ) || die; |
|
1 | +<?php defined('WPINC') || die; |
|
2 | 2 | |
3 | -$html->renderForm( $currentTab.'.'.$currentSection ); |
|
3 | +$html->renderForm($currentTab.'.'.$currentSection); |