Completed
Push — master ( c92875...7f8b70 )
by LA
19:21
created
includes/do-functions.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -44,6 +44,7 @@
 block discarded – undo
44 44
  * querystring parameters to the URL, preserving existing querystring
45 45
  * parameters.
46 46
  *
47
+ * @param string $params
47 48
  * @return string Content with matching URLs having the new querystrings.
48 49
  */
49 50
 function apply_parameters_to_url( $url, $params, $content ) {
Please login to merge, or discard this patch.
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
  * @param $content
13 13
  * @return string Content with retina-enriched image tags.
14 14
  */
15
-function add_retina( $content ) {
15
+function add_retina($content) {
16 16
 	$pattern = '/<img((?![^>]+srcset )([^>]*)';
17 17
 	$pattern .= 'src=[\'"]([^\'"]*imgix.net[^\'"]*\?[^\'"]*w=[^\'"]*)[\'"]([^>]*)*?)>/i';
18 18
 	$repl = '<img$2src="$3" srcset="${3}, ${3}&amp;dpr=2 2x, ${3}&amp;dpr=3 3x,"$4>';
19
-	$content = preg_replace( $pattern, $repl, $content );
19
+	$content = preg_replace($pattern, $repl, $content);
20 20
 
21
-	return preg_replace( $pattern, $repl, $content );
21
+	return preg_replace($pattern, $repl, $content);
22 22
 }
23 23
 
24 24
 /**
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
  *
27 27
  * @return array An array of matching arrays with two keys: 'url' and 'params'
28 28
  */
29
-function imgix_extract_imgs( $content ) {
30
-	preg_match_all( '/src=["\']http.+\/([^\s]+?)["\']/', $content, $matches );
29
+function imgix_extract_imgs($content) {
30
+	preg_match_all('/src=["\']http.+\/([^\s]+?)["\']/', $content, $matches);
31 31
 	$results = array();
32 32
 
33
-	if ( $matches ) {
34
-		foreach ( $matches[1] as $url ) {
35
-			array_push( $results, $url );
33
+	if ($matches) {
34
+		foreach ($matches[1] as $url) {
35
+			array_push($results, $url);
36 36
 		}
37 37
 	}
38 38
 
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @return string Content with matching URLs having the new querystrings.
48 48
  */
49
-function apply_parameters_to_url( $url, $params, $content ) {
50
-	$parts = explode( '?', $url . '?' );
49
+function apply_parameters_to_url($url, $params, $content) {
50
+	$parts = explode('?', $url . '?');
51 51
 
52
-	list( $base_url, $base_params ) = array( $parts[0], $parts[1] );
52
+	list($base_url, $base_params) = array($parts[0], $parts[1]);
53 53
 
54 54
 	$new_url = $old_url = $base_url;
55 55
 	$new_url .= '?' . $params;
56 56
 	$new_url .= $base_params ? '&amp;' . $base_params : '';
57 57
 	$old_url .= $base_params ? '?' . $base_params : '';
58 58
 
59
-	return str_replace( $old_url, $new_url, $content );
59
+	return str_replace($old_url, $new_url, $content);
60 60
 }
61 61
 
62 62
 /**
@@ -71,19 +71,19 @@  discard block
 block discarded – undo
71 71
 	// For now, only "auto" is supported.
72 72
 	$auto = array();
73 73
 
74
-	if ( isset( $imgix_options['auto_format'] ) && $imgix_options['auto_format'] ) {
75
-		array_push( $auto, 'format' );
74
+	if (isset($imgix_options['auto_format']) && $imgix_options['auto_format']) {
75
+		array_push($auto, 'format');
76 76
 	}
77 77
 
78
-	if ( isset( $imgix_options['auto_enhance'] ) && $imgix_options['auto_enhance'] ) {
79
-		array_push( $auto, 'enhance' );
78
+	if (isset($imgix_options['auto_enhance']) && $imgix_options['auto_enhance']) {
79
+		array_push($auto, 'enhance');
80 80
 	}
81 81
 
82
-	if ( ! empty( $auto ) ) {
83
-		array_push( $params, 'auto=' . implode( '%2C', $auto ) );
82
+	if ( ! empty($auto)) {
83
+		array_push($params, 'auto=' . implode('%2C', $auto));
84 84
 	}
85 85
 
86
-	return implode( '&amp;', $params );
86
+	return implode('&amp;', $params);
87 87
 }
88 88
 
89 89
 /**
@@ -92,24 +92,24 @@  discard block
 block discarded – undo
92 92
  *
93 93
  * @return string A sanitized URL.
94 94
  */
95
-function ensure_valid_url( $url ) {
96
-	$slash = strpos( $url, '//' ) == 0 ? '//' : '';
95
+function ensure_valid_url($url) {
96
+	$slash = strpos($url, '//') == 0 ? '//' : '';
97 97
 
98
-	if ( $slash ) {
99
-		$url = substr( $url, 2 );
98
+	if ($slash) {
99
+		$url = substr($url, 2);
100 100
 	}
101 101
 
102
-	$urlp = wp_parse_url( $url );
103
-	$pref = array_key_exists( 'scheme', $urlp ) ? $urlp['scheme'] . '://' : $slash;
102
+	$urlp = wp_parse_url($url);
103
+	$pref = array_key_exists('scheme', $urlp) ? $urlp['scheme'] . '://' : $slash;
104 104
 
105
-	if ( ! $slash && strpos( $pref, 'http' ) !== 0 ) {
105
+	if ( ! $slash && strpos($pref, 'http') !== 0) {
106 106
 		$pref = 'http://';
107 107
 	}
108 108
 
109 109
 	$result = $urlp['host'] ? $pref . $urlp['host'] : false;
110 110
 
111
-	if ( $result ) {
112
-		return trailingslashit( $result );
111
+	if ($result) {
112
+		return trailingslashit($result);
113 113
 	}
114 114
 
115 115
 	return null;
@@ -120,32 +120,32 @@  discard block
 block discarded – undo
120 120
  *
121 121
  * @return array Size's width, height and crop values.
122 122
  */
123
-function get_size_info( $size ) {
123
+function get_size_info($size) {
124 124
 	global $_wp_additional_image_sizes;
125 125
 
126
-	if ( $size === 'original' ) {
126
+	if ($size === 'original') {
127 127
 		return array(
128 128
 			'width' => '',
129 129
 			'height' => '',
130 130
 			'crop' => false,
131 131
 		);
132
-	} elseif ( is_array( $size ) ) {
132
+	} elseif (is_array($size)) {
133 133
 		return array(
134 134
 			'width' => $size[1],
135 135
 			'height' => $size[0],
136 136
 			'crop' => false,
137 137
 		);
138
-	} elseif ( in_array( $size, array( 'thumbnail', 'medium', 'large' ), true ) ) {
138
+	} elseif (in_array($size, array('thumbnail', 'medium', 'large'), true)) {
139 139
 		return array(
140
-			'width' => get_option( $size . '_size_w' ),
141
-			'height' => get_option( $size . '_size_h' ),
142
-			'crop' => (boolean) get_option( $size . '_crop' ),
140
+			'width' => get_option($size . '_size_w'),
141
+			'height' => get_option($size . '_size_h'),
142
+			'crop' => (boolean) get_option($size . '_crop'),
143 143
 		);
144
-	} elseif ( isset( $_wp_additional_image_sizes[ $size ] ) ) {
144
+	} elseif (isset($_wp_additional_image_sizes[$size])) {
145 145
 		return array(
146
-			'width' => $_wp_additional_image_sizes[ $size ]['width'],
147
-			'height' => $_wp_additional_image_sizes[ $size ]['height'],
148
-			'crop' => $_wp_additional_image_sizes[ $size ]['crop'],
146
+			'width' => $_wp_additional_image_sizes[$size]['width'],
147
+			'height' => $_wp_additional_image_sizes[$size]['height'],
148
+			'crop' => $_wp_additional_image_sizes[$size]['crop'],
149 149
 		);
150 150
 	}
151 151
 
@@ -170,33 +170,33 @@  discard block
 block discarded – undo
170 170
  * @return array An array of arrays that has extracted the URL's inferred w',
171 171
  * 'h', and 'type'
172 172
  */
173
-function imgix_extract_img_details( $content ) {
174
-	preg_match_all( '/-([0-9]+)x([0-9]+)\.([^"\']+)/', $content, $matches );
173
+function imgix_extract_img_details($content) {
174
+	preg_match_all('/-([0-9]+)x([0-9]+)\.([^"\']+)/', $content, $matches);
175 175
 
176
-	$lookup = array( 'raw', 'w', 'h', 'type' );
176
+	$lookup = array('raw', 'w', 'h', 'type');
177 177
 	$data = array();
178 178
 
179
-	foreach ( $matches as $k => $v ) {
179
+	foreach ($matches as $k => $v) {
180 180
 
181
-		foreach ( $v as $index => $value ) {
181
+		foreach ($v as $index => $value) {
182 182
 
183
-			if ( ! array_key_exists( $index, $data ) ) {
184
-				$data[ $index ] = array();
183
+			if ( ! array_key_exists($index, $data)) {
184
+				$data[$index] = array();
185 185
 			}
186 186
 
187
-			$key = $lookup[ $k ];
187
+			$key = $lookup[$k];
188 188
 
189
-			if ( $key === 'type' ) {
190
-				if ( strpos( $value, '?' ) !== false ) {
191
-					$parts = explode( '?', $value );
192
-					$data[ $index ]['type'] = $parts[0];
193
-					$data[ $index ]['extra'] = $parts[1];
189
+			if ($key === 'type') {
190
+				if (strpos($value, '?') !== false) {
191
+					$parts = explode('?', $value);
192
+					$data[$index]['type'] = $parts[0];
193
+					$data[$index]['extra'] = $parts[1];
194 194
 				} else {
195
-					$data[ $index ]['type'] = $value;
196
-					$data[ $index ]['extra'] = '';
195
+					$data[$index]['type'] = $value;
196
+					$data[$index]['extra'] = '';
197 197
 				}
198 198
 			} else {
199
-				$data[ $index ][ $key ] = $value;
199
+				$data[$index][$key] = $value;
200 200
 			}
201 201
 		}
202 202
 	}
@@ -211,26 +211,26 @@  discard block
 block discarded – undo
211 211
  * @return array An array countaining the final string, and a boolean value
212 212
  * indicating if it's different from the given input string.
213 213
  */
214
-function replace_host( $str, $require_prefix = false ) {
214
+function replace_host($str, $require_prefix = false) {
215 215
 	global $imgix_options;
216 216
 
217
-	if ( ! isset( $imgix_options['cdn_link'] ) || ! $imgix_options['cdn_link'] ) {
218
-		return array( $str, false );
217
+	if ( ! isset($imgix_options['cdn_link']) || ! $imgix_options['cdn_link']) {
218
+		return array($str, false);
219 219
 	}
220 220
 
221
-	$new_host = ensure_valid_url( $imgix_options['cdn_link'] );
222
-	if ( ! $new_host ) {
223
-		return array( $str, false );
221
+	$new_host = ensure_valid_url($imgix_options['cdn_link']);
222
+	if ( ! $new_host) {
223
+		return array($str, false);
224 224
 	}
225 225
 
226 226
 	// As soon as srcset is supported…
227 227
 	// $prefix = $require_prefix? 'srcs?e?t?=[\'"]|,[\S+\n\r\s]*': '';
228
-	$prefix = $require_prefix? 'src=[\'"]': '';
229
-	$src = '(' . preg_quote( home_url( '/' ), '/' ) . '|\/\/)';
228
+	$prefix = $require_prefix ? 'src=[\'"]' : '';
229
+	$src = '(' . preg_quote(home_url('/'), '/') . '|\/\/)';
230 230
 	$patt = '/(' . $prefix . ' )' . $src . '/i';
231
-	$str = preg_replace( $patt, '$1' . $new_host, $str, -1, $count );
231
+	$str = preg_replace($patt, '$1' . $new_host, $str, -1, $count);
232 232
 
233
-	return array( $str, (boolean) $count );
233
+	return array($str, (boolean) $count);
234 234
 }
235 235
 
236 236
 /**
@@ -239,57 +239,57 @@  discard block
 block discarded – undo
239 239
  *
240 240
  * @return string equivalent imgix source with correct parameters.
241 241
  */
242
-function replace_src( $src, $size ) {
243
-	$size_info = get_size_info( $size );
242
+function replace_src($src, $size) {
243
+	$size_info = get_size_info($size);
244 244
 
245
-	if ( $size_info ) {
245
+	if ($size_info) {
246 246
 
247
-		list( $src, $match_src ) = replace_host( $src, false );
247
+		list($src, $match_src) = replace_host($src, false);
248 248
 
249
-		if ( $match_src ) {
249
+		if ($match_src) {
250 250
 			$g_params = get_global_params_string();
251 251
 			$params = array();
252 252
 
253
-			if ( isset( $size_info['crop'] ) && $size_info['crop'] ) {
254
-				array_push( $params, 'fit=crop' );
253
+			if (isset($size_info['crop']) && $size_info['crop']) {
254
+				array_push($params, 'fit=crop');
255 255
 			}
256 256
 
257
-			if ( isset( $size_info['width'] ) && $size_info['width'] ) {
258
-				array_push( $params, 'w=' . $size_info['width'] );
257
+			if (isset($size_info['width']) && $size_info['width']) {
258
+				array_push($params, 'w=' . $size_info['width']);
259 259
 			}
260 260
 
261
-			if ( isset( $size_info['height'] ) && $size_info['height'] ) {
262
-				array_push( $params, 'h=' . $size_info['height'] );
261
+			if (isset($size_info['height']) && $size_info['height']) {
262
+				array_push($params, 'h=' . $size_info['height']);
263 263
 			}
264 264
 
265
-			$p = implode( '&amp;', $params );
266
-			$p = ( $p && $g_params ) ? $p . '&amp;' . $g_params : $p . $g_params;
267
-			$src = apply_parameters_to_url( $src, $p, $src );
265
+			$p = implode('&amp;', $params);
266
+			$p = ($p && $g_params) ? $p . '&amp;' . $g_params : $p . $g_params;
267
+			$src = apply_parameters_to_url($src, $p, $src);
268 268
 		}
269 269
 	}
270 270
 
271 271
 	return $src;
272 272
 }
273 273
 
274
-function imgix_file_url( $url ) {
274
+function imgix_file_url($url) {
275 275
 
276 276
 	global $imgix_options;
277 277
 
278 278
 	$imgix_url = $imgix_options['cdn_link'];
279
-	$file = pathinfo( $url );
279
+	$file = pathinfo($url);
280 280
 
281
-	if ( ! $imgix_url ) {
281
+	if ( ! $imgix_url) {
282 282
 		return $url;
283 283
 	}
284 284
 
285
-	if ( in_array( $file['extension'], array( 'jpg', 'gif', 'png', 'jpeg' ) ) ) {
286
-		return str_replace( get_bloginfo( 'wpurl' ), $imgix_url, $url );
285
+	if (in_array($file['extension'], array('jpg', 'gif', 'png', 'jpeg'))) {
286
+		return str_replace(get_bloginfo('wpurl'), $imgix_url, $url);
287 287
 	}
288 288
 
289 289
 	return $url;
290 290
 }
291
-add_filter( 'wp_get_attachment_url', 'imgix_file_url' );
292
-add_filter( 'imgix/add-image-url', 'imgix_file_url' );
291
+add_filter('wp_get_attachment_url', 'imgix_file_url');
292
+add_filter('imgix/add-image-url', 'imgix_file_url');
293 293
 
294 294
 /**
295 295
  *
@@ -301,63 +301,63 @@  discard block
 block discarded – undo
301 301
  *
302 302
  * @return array $sources
303 303
  */
304
-function imgix_cdn_srcset( $sources, $size_array, $image_src, $image_meta, $attachment_id ) {
304
+function imgix_cdn_srcset($sources, $size_array, $image_src, $image_meta, $attachment_id) {
305 305
 
306 306
 	global $imgix_options;
307 307
 
308 308
 	$imgix_url = $imgix_options['cdn_link'];
309 309
 
310
-	foreach ( $sources as $source ) {
310
+	foreach ($sources as $source) {
311 311
 
312
-		$sources[ $source['value'] ]['url'] = apply_filters( 'imgix/add-image-url', $sources[ $source['value'] ]['url'] );
312
+		$sources[$source['value']]['url'] = apply_filters('imgix/add-image-url', $sources[$source['value']]['url']);
313 313
 
314 314
 	}
315 315
 
316 316
 	return $sources;
317 317
 }
318
-add_filter( 'wp_calculate_image_srcset', 'imgix_cdn_srcset', 10, 5 );
318
+add_filter('wp_calculate_image_srcset', 'imgix_cdn_srcset', 10, 5);
319 319
 
320
-function imgix_replace_non_wp_images( $content ) {
321
-	list( $content, $match ) = replace_host( $content, true );
320
+function imgix_replace_non_wp_images($content) {
321
+	list($content, $match) = replace_host($content, true);
322 322
 
323
-	if ( $match ) {
323
+	if ($match) {
324 324
 		// Apply image-tag-encoded params for every image in $content.
325
-		foreach ( imgix_extract_img_details( $content ) as $img ) {
325
+		foreach (imgix_extract_img_details($content) as $img) {
326 326
 			$to_replace = $img['raw'];
327 327
 			$extra_params = $img['extra'] ? '&amp;' . $img['extra'] : '';
328 328
 			$new_url = '.' . $img['type'] . '?h=' . $img['h'] . '&amp;w=' . $img['w'] . $extra_params;
329
-			$content = str_replace( $to_replace, $new_url, $content );
329
+			$content = str_replace($to_replace, $new_url, $content);
330 330
 		}
331 331
 
332 332
 		// Apply global parameters.
333 333
 		$g_params = get_global_params_string();
334
-		foreach ( imgix_extract_imgs( $content ) as $img_url ) {
335
-			$content = apply_parameters_to_url( $img_url, $g_params, $content );
334
+		foreach (imgix_extract_imgs($content) as $img_url) {
335
+			$content = apply_parameters_to_url($img_url, $g_params, $content);
336 336
 		}
337 337
 	}
338 338
 	return $content;
339 339
 }
340 340
 
341
-add_filter( 'the_content', 'imgix_replace_non_wp_images' );
341
+add_filter('the_content', 'imgix_replace_non_wp_images');
342 342
 
343 343
 function imgix_wp_head() {
344 344
 	global $imgix_options;
345 345
 
346
-	if ( isset( $imgix_options['cdn_link'] ) && $imgix_options['cdn_link'] ) {
347
-		printf( "<link rel='dns-prefetch' href='%s'/>",
348
-			esc_url( preg_replace( '/^https?:/', '', untrailingslashit( $imgix_options['cdn_link'] ) ) )
346
+	if (isset($imgix_options['cdn_link']) && $imgix_options['cdn_link']) {
347
+		printf("<link rel='dns-prefetch' href='%s'/>",
348
+			esc_url(preg_replace('/^https?:/', '', untrailingslashit($imgix_options['cdn_link'])))
349 349
 		);
350 350
 	}
351 351
 }
352 352
 
353
-add_action( 'wp_head', 'imgix_wp_head', 1 );
353
+add_action('wp_head', 'imgix_wp_head', 1);
354 354
 
355
-if ( isset( $imgix_options['add_dpi2_srcset'] ) && $imgix_options['add_dpi2_srcset'] ) {
355
+if (isset($imgix_options['add_dpi2_srcset']) && $imgix_options['add_dpi2_srcset']) {
356 356
 	function buffer_start() {
357
-		ob_start( 'add_retina' ); }
357
+		ob_start('add_retina'); }
358 358
 	function buffer_end() {
359 359
 		ob_end_flush(); }
360
-	add_action( 'after_setup_theme', 'buffer_start' );
361
-	add_action( 'shutdown', 'buffer_end' );
362
-	add_filter( 'the_content', 'add_retina' );
360
+	add_action('after_setup_theme', 'buffer_start');
361
+	add_action('shutdown', 'buffer_end');
362
+	add_filter('the_content', 'add_retina');
363 363
 }
Please login to merge, or discard this patch.
imgix.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,23 +15,23 @@
 block discarded – undo
15 15
  * Author URI:  http://github.com/wladston
16 16
  */
17 17
 
18
-$imgix_options = get_option( 'imgix_settings' );
18
+$imgix_options = get_option('imgix_settings');
19 19
 
20
-include( 'includes/do-functions.php' );
21
-include( 'includes/options-page.php' );
20
+include('includes/do-functions.php');
21
+include('includes/options-page.php');
22 22
 
23
-function imgix_plugin_admin_action_links( $links, $file ) {
23
+function imgix_plugin_admin_action_links($links, $file) {
24 24
 	static $my_plugin;
25 25
 
26
-	if ( ! $my_plugin ) {
27
-		$my_plugin = plugin_basename( __FILE__ );
26
+	if ( ! $my_plugin) {
27
+		$my_plugin = plugin_basename(__FILE__);
28 28
 	}
29 29
 
30
-	if ( $file === $my_plugin ) {
30
+	if ($file === $my_plugin) {
31 31
 		$settings_link = '<a href="options-general.php?page=imgix-options">Settings</a>';
32
-		array_unshift( $links, $settings_link );
32
+		array_unshift($links, $settings_link);
33 33
 	}
34 34
 	return $links;
35 35
 }
36 36
 
37
-add_filter( 'plugin_action_links', 'imgix_plugin_admin_action_links', 10, 2 );
37
+add_filter('plugin_action_links', 'imgix_plugin_admin_action_links', 10, 2);
Please login to merge, or discard this patch.
includes/options-page.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,37 +17,37 @@  discard block
 block discarded – undo
17 17
 		<p><strong>Need help getting started?</strong> It's easy! Check out our <a href="https://github.com/imgix-wordpress/imgix-wordpress#getting-started" target="_blank">instructions.</a></p>
18 18
 
19 19
 		<form method="post" action="options.php">
20
-			<?php settings_fields( 'imgix_settings_group' ); ?>
20
+			<?php settings_fields('imgix_settings_group'); ?>
21 21
 
22 22
 			<table class="form-table">
23 23
 
24 24
 				<tbody>
25 25
 
26 26
 					<tr>
27
-						<th><label class="description" for="imgix_settings[cdn_link]"><?php esc_html_e( 'imgix Source', 'imgix_domain' ); ?></th>
28
-						<td><input id="imgix_settings[cdn_link]" type="url" name="imgix_settings[cdn_link]" placeholder="https://yourcompany.imgix.net" value="<?php echo isset( $imgix_options['cdn_link'] ) ? esc_url( $imgix_options['cdn_link'] ) : ''; ?>" class="regular-text code" /></td>
27
+						<th><label class="description" for="imgix_settings[cdn_link]"><?php esc_html_e('imgix Source', 'imgix_domain'); ?></th>
28
+						<td><input id="imgix_settings[cdn_link]" type="url" name="imgix_settings[cdn_link]" placeholder="https://yourcompany.imgix.net" value="<?php echo isset($imgix_options['cdn_link']) ? esc_url($imgix_options['cdn_link']) : ''; ?>" class="regular-text code" /></td>
29 29
 					</tr>
30 30
 
31 31
 					<tr>
32
-						<th><label class="description" for="imgix_settings[auto_format]"><?php esc_html_e( '<a href="http://blog.imgix.com/post/90838796454/webp-jpeg-xr-progressive-jpg-support-w-auto" target="_blank">Auto Format</a> Images', 'auto_format' ); ?></label></th>
33
-						<td><input id="imgix_settings[auto_format]" type="checkbox" name="imgix_settings[auto_format]" value="1" <?php echo isset( $imgix_options['auto_format'] ) && '1' === $imgix_options['auto_format'] ? 'checked="checked"' : ''; ?> /></td>
32
+						<th><label class="description" for="imgix_settings[auto_format]"><?php esc_html_e('<a href="http://blog.imgix.com/post/90838796454/webp-jpeg-xr-progressive-jpg-support-w-auto" target="_blank">Auto Format</a> Images', 'auto_format'); ?></label></th>
33
+						<td><input id="imgix_settings[auto_format]" type="checkbox" name="imgix_settings[auto_format]" value="1" <?php echo isset($imgix_options['auto_format']) && '1' === $imgix_options['auto_format'] ? 'checked="checked"' : ''; ?> /></td>
34 34
 					</tr>
35 35
 
36 36
 					<tr>
37
-						<th><label class="description" for="imgix_settings[auto_enhance]"><?php esc_html_e( '<a href="http://blog.imgix.com/post/85095931364/autoenhance" target="_blank">Auto Enhance</a> Images', 'auto_enhance' ); ?></label></th>
38
-						<td><input id="imgix_settings[auto_enhance]" type="checkbox" name="imgix_settings[auto_enhance]" value="1" <?php echo isset( $imgix_options['auto_enhance'] ) && '1' === $imgix_options['auto_enhance'] ? 'checked="checked"' : ''; ?> /></td>
37
+						<th><label class="description" for="imgix_settings[auto_enhance]"><?php esc_html_e('<a href="http://blog.imgix.com/post/85095931364/autoenhance" target="_blank">Auto Enhance</a> Images', 'auto_enhance'); ?></label></th>
38
+						<td><input id="imgix_settings[auto_enhance]" type="checkbox" name="imgix_settings[auto_enhance]" value="1" <?php echo isset($imgix_options['auto_enhance']) && '1' === $imgix_options['auto_enhance'] ? 'checked="checked"' : ''; ?> /></td>
39 39
 					</tr>
40 40
 
41 41
 					<tr>
42
-						<th><label class="description" for="imgix_settings[add_dpi2_srcset]"><?php esc_html_e( 'Automatically add retina images using srcset', 'add_dpi2_srcset' ); ?></label></th>
43
-						<td><input id="imgix_settings[add_dpi2_srcset]" type="checkbox" name="imgix_settings[add_dpi2_srcset]" value="1" <?php echo isset( $imgix_options['add_dpi2_srcset'] ) && '1' === $imgix_options['add_dpi2_srcset'] ? 'checked="checked"' : ''; ?> /></td>
42
+						<th><label class="description" for="imgix_settings[add_dpi2_srcset]"><?php esc_html_e('Automatically add retina images using srcset', 'add_dpi2_srcset'); ?></label></th>
43
+						<td><input id="imgix_settings[add_dpi2_srcset]" type="checkbox" name="imgix_settings[add_dpi2_srcset]" value="1" <?php echo isset($imgix_options['add_dpi2_srcset']) && '1' === $imgix_options['add_dpi2_srcset'] ? 'checked="checked"' : ''; ?> /></td>
44 44
 					</tr>
45 45
 
46 46
 				</tbody>
47 47
 			</table>
48 48
 
49 49
 			<p class="submit">
50
-				<input type="submit" class="button-primary" value="<?php esc_html_e( 'Save Options', 'imgix_domain' ); ?>" />
50
+				<input type="submit" class="button-primary" value="<?php esc_html_e('Save Options', 'imgix_domain'); ?>" />
51 51
 			</p>
52 52
 		</form>
53 53
 
@@ -62,15 +62,15 @@  discard block
 block discarded – undo
62 62
  *  Adds link to options page in Admin > Settings menu.
63 63
  */
64 64
 function imgix_add_options_link() {
65
-	add_options_page( 'imgix', 'imgix', 'manage_options', 'imgix-options', 'imgix_options_page' );
65
+	add_options_page('imgix', 'imgix', 'manage_options', 'imgix-options', 'imgix_options_page');
66 66
 }
67
-add_action( 'admin_menu', 'imgix_add_options_link' );
67
+add_action('admin_menu', 'imgix_add_options_link');
68 68
 
69 69
 /**
70 70
  *  Creates our settings in the options table.
71 71
  */
72 72
 function imgix_register_settings() {
73
-	register_setting( 'imgix_settings_group', 'imgix_settings' );
73
+	register_setting('imgix_settings_group', 'imgix_settings');
74 74
 }
75 75
 
76
-add_action( 'admin_init', 'imgix_register_settings' );
76
+add_action('admin_init', 'imgix_register_settings');
Please login to merge, or discard this patch.