Passed
Push — master ( 866fb7...47a3cd )
by Virginia
02:00
created
classes/class-lsx-wetu-importer-settings.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
 			'scaling'                            => 'h',
64 64
 			'enable_tour_ref_column'             => '',
65 65
 		);
66
-		$this->fields   = array_keys( $this->defaults );
67
-		add_action( 'admin_init', array( $this, 'save_options' ) );
66
+		$this->fields = array_keys($this->defaults);
67
+		add_action('admin_init', array($this, 'save_options'));
68 68
 	}
69 69
 
70 70
 	/**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public static function get_instance() {
76 76
 		// If the single instance hasn't been set, set it now.
77
-		if ( ! isset( self::$instance ) ) {
77
+		if (!isset(self::$instance)) {
78 78
 			self::$instance = new self();
79 79
 		}
80 80
 		return self::$instance;
@@ -85,25 +85,25 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	public function display_page() {
87 87
 		$options = lsx_wetu_get_options();
88
-		foreach ( $options as $key => $value ) {
89
-			$value = trim( $value );
88
+		foreach ($options as $key => $value) {
89
+			$value = trim($value);
90 90
 		}
91
-		$options = wp_parse_args( $options, $this->defaults );
91
+		$options = wp_parse_args($options, $this->defaults);
92 92
 		?>
93 93
 		<div class="wrap">
94 94
 			<form method="post" class="">
95
-				<?php wp_nonce_field( 'lsx_wetu_importer_save', 'lsx_wetu_importer_save_options' ); ?>
96
-				<h1><?php esc_html_e( 'General', 'lsx-wetu-importer' ); ?></h1>
95
+				<?php wp_nonce_field('lsx_wetu_importer_save', 'lsx_wetu_importer_save_options'); ?>
96
+				<h1><?php esc_html_e('General', 'lsx-wetu-importer'); ?></h1>
97 97
 				<table class="form-table">
98 98
 					<tbody>
99 99
 						<tr class="form-field">
100 100
 							<th scope="row">
101
-								<label for="wetu_api_key"> <?php esc_html_e( 'API Key', 'lsx-wetu-importer' ); ?></label>
101
+								<label for="wetu_api_key"> <?php esc_html_e('API Key', 'lsx-wetu-importer'); ?></label>
102 102
 							</th>
103 103
 							<td>
104 104
 								<input data-toggle="tooltip" data-placement="top" title="The API key can be found on your My Account page of your WETU account." type="text" value="<?php
105
-								if ( isset( $options['api_key'] ) ) {
106
-									echo esc_attr( $options['api_key'] );
105
+								if (isset($options['api_key'])) {
106
+									echo esc_attr($options['api_key']);
107 107
 								}
108 108
 								?>" name="api_key" />
109 109
 							</td>
@@ -111,226 +111,226 @@  discard block
 block discarded – undo
111 111
 					</tbody>
112 112
 				</table>
113 113
 
114
-				<h1><?php esc_html_e( 'Tours', 'lsx-wetu-importer' ); ?></h1>
114
+				<h1><?php esc_html_e('Tours', 'lsx-wetu-importer'); ?></h1>
115 115
 				<table class="form-table">
116 116
 					<tbody>
117 117
 						<tr class="form-field -wrap">
118 118
 							<th scope="row">
119
-								<label for="disable_tour_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label>
119
+								<label for="disable_tour_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label>
120 120
 							</th>
121 121
 							<td>
122 122
 								<input type="checkbox"
123 123
 								<?php
124
-								if ( isset( $options['disable_tour_title'] ) && '' !== $options['disable_tour_title'] ) {
125
-									echo esc_attr( 'checked="checked"' );
124
+								if (isset($options['disable_tour_title']) && '' !== $options['disable_tour_title']) {
125
+									echo esc_attr('checked="checked"');
126 126
 								}
127 127
 								?>
128 128
 								name="disable_tour_title" />
129 129
 
130
-								<small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small>
130
+								<small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small>
131 131
 							</td>
132 132
 						</tr>
133 133
 						<tr class="form-field -wrap">
134 134
 							<th scope="row">
135
-								<label for="disable_tour_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label>
135
+								<label for="disable_tour_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label>
136 136
 							</th>
137 137
 							<td>
138 138
 								<input type="checkbox"
139 139
 								<?php
140
-								if ( isset( $options['disable_tour_descriptions'] ) && '' !== $options['disable_tour_descriptions'] ) {
141
-									echo esc_attr( 'checked="checked"' );
140
+								if (isset($options['disable_tour_descriptions']) && '' !== $options['disable_tour_descriptions']) {
141
+									echo esc_attr('checked="checked"');
142 142
 								}
143 143
 								?>
144 144
 								name="disable_tour_descriptions" />
145 145
 
146
-								<small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small>
146
+								<small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small>
147 147
 							</td>
148 148
 						</tr>
149 149
 						<tr class="form-field -wrap">
150 150
 							<th scope="row">
151
-								<label for="disable_tour_tags"><?php esc_html_e( 'Disable Tags / Travel Styles', 'lsx-wetu-importer' ); ?></label>
151
+								<label for="disable_tour_tags"><?php esc_html_e('Disable Tags / Travel Styles', 'lsx-wetu-importer'); ?></label>
152 152
 							</th>
153 153
 							<td>
154 154
 								<input type="checkbox"
155 155
 								<?php
156
-								if ( isset( $options['disable_tour_tags'] ) && '' !== $options['disable_tour_tags'] ) {
157
-									echo esc_attr( 'checked="checked"' );
156
+								if (isset($options['disable_tour_tags']) && '' !== $options['disable_tour_tags']) {
157
+									echo esc_attr('checked="checked"');
158 158
 								}
159 159
 								?>
160 160
 								name="disable_tour_tags" />
161 161
 
162
-								<small><?php esc_html_e( 'Disable this is you dont want the option available on the import screen.', 'lsx-wetu-importer' ); ?></small>
162
+								<small><?php esc_html_e('Disable this is you dont want the option available on the import screen.', 'lsx-wetu-importer'); ?></small>
163 163
 							</td>
164 164
 						</tr>
165 165
 
166 166
 						<tr class="form-field -wrap">
167 167
 							<th scope="row">
168
-								<label for="enable_tour_ref_column"><?php esc_html_e( 'Enable Reference Column', 'lsx-wetu-importer' ); ?></label>
168
+								<label for="enable_tour_ref_column"><?php esc_html_e('Enable Reference Column', 'lsx-wetu-importer'); ?></label>
169 169
 							</th>
170 170
 							<td>
171 171
 								<input type="checkbox"
172 172
 								<?php
173
-								if ( isset( $options['enable_tour_ref_column'] ) && '' !== $options['enable_tour_ref_column'] ) {
174
-									echo esc_attr( 'checked="checked"' );
173
+								if (isset($options['enable_tour_ref_column']) && '' !== $options['enable_tour_ref_column']) {
174
+									echo esc_attr('checked="checked"');
175 175
 								}
176 176
 								?>
177 177
 								name="enable_tour_ref_column" />
178
-								<small><?php esc_html_e( 'Enables the use of the WETU Reference Column for better tours management.', 'lsx-wetu-importer' ); ?></small>
178
+								<small><?php esc_html_e('Enables the use of the WETU Reference Column for better tours management.', 'lsx-wetu-importer'); ?></small>
179 179
 							</td>
180 180
 						</tr>
181 181
 
182 182
 						<tr class="form-field -wrap">
183 183
 							<th scope="row">
184
-								<label for="enable_tour_featured_random"><?php esc_html_e( 'Randomize Featured Image', 'lsx-wetu-importer' ); ?></label>
184
+								<label for="enable_tour_featured_random"><?php esc_html_e('Randomize Featured Image', 'lsx-wetu-importer'); ?></label>
185 185
 							</th>
186 186
 							<td>
187 187
 								<input type="checkbox"
188 188
 								<?php
189
-								if ( isset( $options['enable_tour_featured_random'] ) && '' !== $options['enable_tour_featured_random'] ) {
190
-									echo esc_attr( 'checked="checked"' );
189
+								if (isset($options['enable_tour_featured_random']) && '' !== $options['enable_tour_featured_random']) {
190
+									echo esc_attr('checked="checked"');
191 191
 								}
192 192
 								?>
193 193
 								name="enable_tour_featured_random" />
194
-								<small><?php esc_html_e( 'This will randomize the featured image from the destination gallery.', 'lsx-wetu-importer' ); ?></small>
194
+								<small><?php esc_html_e('This will randomize the featured image from the destination gallery.', 'lsx-wetu-importer'); ?></small>
195 195
 							</td>
196 196
 						</tr>
197 197
 					</tbody>
198 198
 				</table>
199 199
 
200
-				<h1><?php esc_html_e( 'Accommodation', 'lsx-wetu-importer' ); ?></h1>
200
+				<h1><?php esc_html_e('Accommodation', 'lsx-wetu-importer'); ?></h1>
201 201
 
202 202
 				<table class="form-table">
203 203
 					<tbody>
204 204
 						<tr class="form-field -wrap">
205 205
 							<th scope="row">
206
-								<label for="disable_accommodation_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label>
206
+								<label for="disable_accommodation_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label>
207 207
 							</th>
208 208
 							<td>
209 209
 								<input type="checkbox"
210 210
 								<?php
211
-								if ( isset( $options['disable_accommodation_title'] ) && '' !== $options['disable_accommodation_title'] ) {
212
-									echo esc_attr( 'checked="checked"' );
211
+								if (isset($options['disable_accommodation_title']) && '' !== $options['disable_accommodation_title']) {
212
+									echo esc_attr('checked="checked"');
213 213
 								}
214 214
 								?>
215 215
 								name="disable_accommodation_title" />
216 216
 
217
-								<small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small>
217
+								<small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small>
218 218
 							</td>
219 219
 						</tr>
220 220
 						<tr class="form-field -wrap">
221 221
 							<th scope="row">
222
-								<label for="disable_accommodation_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label>
222
+								<label for="disable_accommodation_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label>
223 223
 							</th>
224 224
 							<td>
225 225
 								<input type="checkbox"
226 226
 								<?php
227
-								if ( isset( $options['disable_accommodation_descriptions'] ) && '' !== $options['disable_accommodation_descriptions'] ) {
228
-									echo esc_attr( 'checked="checked"' );
227
+								if (isset($options['disable_accommodation_descriptions']) && '' !== $options['disable_accommodation_descriptions']) {
228
+									echo esc_attr('checked="checked"');
229 229
 								}
230 230
 								?>
231 231
 								name="disable_accommodation_descriptions" />
232
-								<small><?php esc_html_e( 'If you are going to edit the accommodation descriptions imported then enable this setting.', 'lsx-wetu-importer' ); ?></small>
232
+								<small><?php esc_html_e('If you are going to edit the accommodation descriptions imported then enable this setting.', 'lsx-wetu-importer'); ?></small>
233 233
 							</td>
234 234
 						</tr>
235 235
 						<tr class="form-field -wrap">
236 236
 							<th scope="row">
237
-								<label for="disable_accommodation_filtering"><?php esc_html_e( 'Disable Description Filtering', 'lsx-wetu-importer' ); ?></label>
237
+								<label for="disable_accommodation_filtering"><?php esc_html_e('Disable Description Filtering', 'lsx-wetu-importer'); ?></label>
238 238
 							</th>
239 239
 							<td>
240 240
 								<input type="checkbox"
241 241
 								<?php
242
-								if ( isset( $options['disable_accommodation_filtering'] ) && '' !== $options['disable_accommodation_filtering'] ) {
243
-									echo esc_attr( 'checked="checked"' );
242
+								if (isset($options['disable_accommodation_filtering']) && '' !== $options['disable_accommodation_filtering']) {
243
+									echo esc_attr('checked="checked"');
244 244
 								}
245 245
 								?>
246 246
 								name="disable_accommodation_filtering" />
247
-								<small><?php esc_html_e( 'This will stop the HTML from being stripped out of the description.', 'lsx-wetu-importer' ); ?></small>
247
+								<small><?php esc_html_e('This will stop the HTML from being stripped out of the description.', 'lsx-wetu-importer'); ?></small>
248 248
 							</td>
249 249
 						</tr>
250 250
 
251 251
 						<tr class="form-field -wrap">
252 252
 							<th scope="row">
253
-								<label for="disable_accommodation_excerpts"><?php esc_html_e( 'Disable Excerpts', 'lsx-wetu-importer' ); ?></label>
253
+								<label for="disable_accommodation_excerpts"><?php esc_html_e('Disable Excerpts', 'lsx-wetu-importer'); ?></label>
254 254
 							</th>
255 255
 							<td>
256 256
 								<input type="checkbox"
257 257
 								<?php
258
-								if ( isset( $options['disable_accommodation_excerpts'] ) && '' !== $options['disable_accommodation_excerpts'] ) {
259
-									echo esc_attr( 'checked="checked"' );
258
+								if (isset($options['disable_accommodation_excerpts']) && '' !== $options['disable_accommodation_excerpts']) {
259
+									echo esc_attr('checked="checked"');
260 260
 								}
261 261
 								?>
262 262
 								name="disable_accommodation_excerpts" />
263
-								<small><?php esc_html_e( 'If you are going to edit the accommodation excerpts then enable this setting.', 'lsx-wetu-importer' ); ?></small>
263
+								<small><?php esc_html_e('If you are going to edit the accommodation excerpts then enable this setting.', 'lsx-wetu-importer'); ?></small>
264 264
 							</td>
265 265
 						</tr>
266 266
 					</tbody>
267 267
 				</table>
268 268
 
269
-				<h1><?php esc_html_e( 'Destinations', 'lsx-wetu-importer' ); ?></h1>
269
+				<h1><?php esc_html_e('Destinations', 'lsx-wetu-importer'); ?></h1>
270 270
 
271 271
 				<table class="form-table">
272 272
 					<tbody>
273 273
 						<tr class="form-field -wrap">
274 274
 							<th scope="row">
275
-								<label for="disable_destination_title"><?php esc_html_e( 'Enable Custom Titles', 'lsx-wetu-importer' ); ?></label>
275
+								<label for="disable_destination_title"><?php esc_html_e('Enable Custom Titles', 'lsx-wetu-importer'); ?></label>
276 276
 							</th>
277 277
 							<td>
278 278
 								<input type="checkbox"
279 279
 								<?php
280
-								if ( isset( $options['disable_destination_title'] ) && '' !== $options['disable_destination_title'] ) {
281
-									echo esc_attr( 'checked="checked"' );
280
+								if (isset($options['disable_destination_title']) && '' !== $options['disable_destination_title']) {
281
+									echo esc_attr('checked="checked"');
282 282
 								}
283 283
 								?>
284 284
 								name="disable_destination_title" />
285 285
 
286
-								<small><?php esc_html_e( 'If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer' ); ?></small>
286
+								<small><?php esc_html_e('If you are going to manage your tour descriptions on this site and not on WETU then enable this setting.', 'lsx-wetu-importer'); ?></small>
287 287
 							</td>
288 288
 						</tr>
289 289
 						<tr class="form-field -wrap">
290 290
 							<th scope="row">
291
-								<label for="disable_destination_descriptions"><?php esc_html_e( 'Disable Descriptions', 'lsx-wetu-importer' ); ?></label>
291
+								<label for="disable_destination_descriptions"><?php esc_html_e('Disable Descriptions', 'lsx-wetu-importer'); ?></label>
292 292
 							</th>
293 293
 							<td>
294 294
 								<input type="checkbox"
295 295
 								<?php
296
-								if ( isset( $options['disable_destination_descriptions'] ) && '' !== $options['disable_destination_descriptions'] ) {
297
-									echo esc_attr( 'checked="checked"' );
296
+								if (isset($options['disable_destination_descriptions']) && '' !== $options['disable_destination_descriptions']) {
297
+									echo esc_attr('checked="checked"');
298 298
 								}
299 299
 								?>
300 300
 								name="disable_destination_descriptions" />
301
-								<small><?php esc_html_e( 'If you are going to edit the destination descriptions on this site then enable this setting.', 'lsx-wetu-importer' ); ?></small>
301
+								<small><?php esc_html_e('If you are going to edit the destination descriptions on this site then enable this setting.', 'lsx-wetu-importer'); ?></small>
302 302
 							</td>
303 303
 						</tr>
304 304
 					</tbody>
305 305
 				</table>
306 306
 
307
-				<h1><?php esc_html_e( 'Images', 'lsx-wetu-importer' ); ?></h1>
307
+				<h1><?php esc_html_e('Images', 'lsx-wetu-importer'); ?></h1>
308 308
 
309 309
 				<table class="form-table">
310 310
 					<tbody>
311 311
 						<tr class="form-field -wrap">
312 312
 							<th scope="row">
313
-								<label for="image_replacing"><?php esc_html_e( 'Replace Images', 'lsx-wetu-importer' ); ?></label>
313
+								<label for="image_replacing"><?php esc_html_e('Replace Images', 'lsx-wetu-importer'); ?></label>
314 314
 							</th>
315 315
 							<td>
316 316
 								<input type="checkbox"
317 317
 								<?php
318
-								if ( isset( $options['image_replacing'] ) && '' !== $options['image_replacing'] ) {
319
-									echo esc_attr( 'checked="checked"' );
318
+								if (isset($options['image_replacing']) && '' !== $options['image_replacing']) {
319
+									echo esc_attr('checked="checked"');
320 320
 								}
321 321
 								?>
322 322
 								name="image_replacing" />
323
-								<p><?php esc_html_e( 'Do you want your images to be replaced on each import.', 'lsx-wetu-importer' ); ?></p>
323
+								<p><?php esc_html_e('Do you want your images to be replaced on each import.', 'lsx-wetu-importer'); ?></p>
324 324
 							</td>
325 325
 						</tr>
326 326
 						<tr class="form-field -wrap">
327 327
 							<th scope="row">
328
-								<label for="image_limit"> <?php esc_html_e( 'Limit the amount of images imported to the gallery', 'lsx-wetu-importer' ); ?></label>
328
+								<label for="image_limit"> <?php esc_html_e('Limit the amount of images imported to the gallery', 'lsx-wetu-importer'); ?></label>
329 329
 							</th>
330 330
 							<td>
331 331
 								<input placeholder="" type="text" value="<?php
332
-								if ( isset( $options['image_limit'] ) && '' !== $options['image_limit'] ) {
333
-									echo esc_attr( $options['image_limit'] );
332
+								if (isset($options['image_limit']) && '' !== $options['image_limit']) {
333
+									echo esc_attr($options['image_limit']);
334 334
 								}
335 335
 								?>"
336 336
 								name="image_limit" />
@@ -339,13 +339,13 @@  discard block
 block discarded – undo
339 339
 
340 340
 						<tr class="form-field -wrap">
341 341
 							<th scope="row">
342
-								<label for="image_scaling"><?php esc_html_e( 'Enable Image Scaling', 'lsx-wetu-importer' ); ?></label>
342
+								<label for="image_scaling"><?php esc_html_e('Enable Image Scaling', 'lsx-wetu-importer'); ?></label>
343 343
 							</th>
344 344
 							<td>
345 345
 								<input type="checkbox"
346 346
 								<?php
347
-								if ( isset( $options['image_scaling'] ) && '' !== $options['image_scaling'] ) {
348
-									echo esc_attr( 'checked="checked"' );
347
+								if (isset($options['image_scaling']) && '' !== $options['image_scaling']) {
348
+									echo esc_attr('checked="checked"');
349 349
 								}
350 350
 								?>
351 351
 								name="image_scaling" />
@@ -353,12 +353,12 @@  discard block
 block discarded – undo
353 353
 						</tr>
354 354
 						<tr class="form-field -wrap">
355 355
 							<th scope="row">
356
-								<label for="width"> <?php esc_html_e( 'Width (px)', 'lsx-wetu-importer' ); ?></label>
356
+								<label for="width"> <?php esc_html_e('Width (px)', 'lsx-wetu-importer'); ?></label>
357 357
 							</th>
358 358
 							<td>
359 359
 								<input placeholder="800" type="text" value="<?php
360
-								if ( isset( $options['width'] ) && '' !== $options['width'] ) {
361
-									echo esc_attr( $options['width'] );
360
+								if (isset($options['width']) && '' !== $options['width']) {
361
+									echo esc_attr($options['width']);
362 362
 								}
363 363
 								?>"
364 364
 								name="width" />
@@ -366,12 +366,12 @@  discard block
 block discarded – undo
366 366
 						</tr>
367 367
 						<tr class="form-field -wrap">
368 368
 							<th scope="row">
369
-								<label for="height"> <?php esc_html_e( 'Height (px)', 'lsx-wetu-importer' ); ?></label>
369
+								<label for="height"> <?php esc_html_e('Height (px)', 'lsx-wetu-importer'); ?></label>
370 370
 							</th>
371 371
 							<td>
372 372
 								<input placeholder="600" type="text" value="<?php
373
-								if ( isset( $options['height'] ) && '' !== $options['height'] ) {
374
-									echo esc_attr( $options['height'] );
373
+								if (isset($options['height']) && '' !== $options['height']) {
374
+									echo esc_attr($options['height']);
375 375
 								}
376 376
 								?>"
377 377
 								name="height" />
@@ -380,63 +380,63 @@  discard block
 block discarded – undo
380 380
 
381 381
 						<tr class="form-field -wrap image-settings">
382 382
 							<th scope="row">
383
-								<label for="scaling"> <?php esc_html_e( 'Scaling', 'lsx-wetu-importer' ); ?></label>
383
+								<label for="scaling"> <?php esc_html_e('Scaling', 'lsx-wetu-importer'); ?></label>
384 384
 							</th>
385 385
 							<td>
386 386
 								<input type="radio"
387 387
 								<?php
388
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'raw' === $options['scaling'] ) {
389
-									echo esc_attr( 'checked="checked"' );
388
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'raw' === $options['scaling']) {
389
+									echo esc_attr('checked="checked"');
390 390
 								}
391 391
 								?>
392
-								name="scaling" value="raw" /> <?php esc_html_e( 'Get the Full size image, no cropping takes place.', 'lsx-wetu-importer' ); ?><br />
392
+								name="scaling" value="raw" /> <?php esc_html_e('Get the Full size image, no cropping takes place.', 'lsx-wetu-importer'); ?><br />
393 393
 								<input type="radio"
394 394
 								<?php
395
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'c' === $options['scaling'] ) {
396
-									echo esc_attr( 'checked="checked"' );
395
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'c' === $options['scaling']) {
396
+									echo esc_attr('checked="checked"');
397 397
 								}
398 398
 								?>
399
-								name="scaling"  value="c" /> <?php esc_html_e( 'Crop image to fit fully into the frame, Crop is taken from middle, preserving as much of the image as possible.', 'lsx-wetu-importer' ); ?><br />
399
+								name="scaling"  value="c" /> <?php esc_html_e('Crop image to fit fully into the frame, Crop is taken from middle, preserving as much of the image as possible.', 'lsx-wetu-importer'); ?><br />
400 400
 								<input type="radio"
401 401
 								<?php
402
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'h' === $options['scaling'] ) {
403
-									echo esc_attr( 'checked="checked"' );
402
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'h' === $options['scaling']) {
403
+									echo esc_attr('checked="checked"');
404 404
 								}
405 405
 								?>
406
-								name="scaling"  value="h" /> <?php esc_html_e( 'Crop image to fit fully into the frame, but resize to height first, then crop on width if needed', 'lsx-wetu-importer' ); ?><br />
406
+								name="scaling"  value="h" /> <?php esc_html_e('Crop image to fit fully into the frame, but resize to height first, then crop on width if needed', 'lsx-wetu-importer'); ?><br />
407 407
 								<input type="radio"
408 408
 								<?php
409
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'w' === $options['scaling'] ) {
410
-									echo esc_attr( 'checked="checked"' );
409
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'w' === $options['scaling']) {
410
+									echo esc_attr('checked="checked"');
411 411
 								}
412 412
 								?>
413
-								name="scaling"  value="w" /> <?php esc_html_e( 'Crop image to fit fully into the frame, but resize to width first, then crop on height if needed', 'lsx-wetu-importer' ); ?><br />
413
+								name="scaling"  value="w" /> <?php esc_html_e('Crop image to fit fully into the frame, but resize to width first, then crop on height if needed', 'lsx-wetu-importer'); ?><br />
414 414
 								<input type="radio"
415 415
 								<?php
416
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'nf' === $options['scaling'] ) {
417
-									echo esc_attr( 'checked="checked"' );
416
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'nf' === $options['scaling']) {
417
+									echo esc_attr('checked="checked"');
418 418
 								}
419 419
 								?>
420
-								name="scaling"  value="nf" /> <?php esc_html_e( 'Resize the image to fit within the frame. but pad the image with white to ensure the resolution matches the frame', 'lsx-wetu-importer' ); ?><br />
420
+								name="scaling"  value="nf" /> <?php esc_html_e('Resize the image to fit within the frame. but pad the image with white to ensure the resolution matches the frame', 'lsx-wetu-importer'); ?><br />
421 421
 								<input type="radio"
422 422
 								<?php
423
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'n' === $options['scaling'] ) {
424
-									echo esc_attr( 'checked="checked"' );
423
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'n' === $options['scaling']) {
424
+									echo esc_attr('checked="checked"');
425 425
 								}
426 426
 								?>
427
-								name="scaling"  value="n" /> <?php esc_html_e( 'Resize the image to fit within the frame. but do not upscale the image.', 'lsx-wetu-importer' ); ?><br />
427
+								name="scaling"  value="n" /> <?php esc_html_e('Resize the image to fit within the frame. but do not upscale the image.', 'lsx-wetu-importer'); ?><br />
428 428
 								<input type="radio"
429 429
 								<?php
430
-								if ( isset( $options['scaling'] ) && '' !== $options['scaling'] && 'W' === $options['scaling'] ) {
431
-									echo esc_attr( 'checked="checked"' );
430
+								if (isset($options['scaling']) && '' !== $options['scaling'] && 'W' === $options['scaling']) {
431
+									echo esc_attr('checked="checked"');
432 432
 								}
433 433
 								?>
434
-								name="scaling"  value="W" /> <?php esc_html_e( 'Resize the image to fit within the frame. Image will not exceed specified dimensions', 'lsx-wetu-importer' ); ?>
434
+								name="scaling"  value="W" /> <?php esc_html_e('Resize the image to fit within the frame. Image will not exceed specified dimensions', 'lsx-wetu-importer'); ?>
435 435
 							</td>
436 436
 						</tr>
437 437
 					</tbody>
438 438
 				</table>
439
-				<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e( 'Save Changes', 'lsx-wetu-importer' ); ?>"></p>
439
+				<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e('Save Changes', 'lsx-wetu-importer'); ?>"></p>
440 440
 			</form>
441 441
 		</div>
442 442
 		<?php
@@ -448,17 +448,17 @@  discard block
 block discarded – undo
448 448
 	 * @return void
449 449
 	 */
450 450
 	public function save_options() {
451
-		if ( ! isset( $_POST['lsx_wetu_importer_save_options'] ) || ! wp_verify_nonce( $_POST['lsx_wetu_importer_save_options'], 'lsx_wetu_importer_save' ) ) {
451
+		if (!isset($_POST['lsx_wetu_importer_save_options']) || !wp_verify_nonce($_POST['lsx_wetu_importer_save_options'], 'lsx_wetu_importer_save')) {
452 452
 			return;
453 453
 		}
454 454
 		$data_to_save = array();
455
-		foreach ( $this->defaults as $key => $field ) {
456
-			if ( isset( $_POST[ $key ] ) ) {
457
-				$data_to_save[ $key ] = sanitize_text_field( $_POST[ $key ] );
458
-			} else {
459
-				$data_to_save[ $key ] = '';
455
+		foreach ($this->defaults as $key => $field) {
456
+			if (isset($_POST[$key])) {
457
+				$data_to_save[$key] = sanitize_text_field($_POST[$key]);
458
+			}else {
459
+				$data_to_save[$key] = '';
460 460
 			}
461 461
 		}
462
-		update_option( 'lsx_wetu_importer_settings', $data_to_save );
462
+		update_option('lsx_wetu_importer_settings', $data_to_save);
463 463
 	}
464 464
 }
Please login to merge, or discard this patch.