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