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