Passed
Push — master ( 35381c...afd9ab )
by Christian
02:32
created
podlove.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -22,22 +22,22 @@  discard block
 block discarded – undo
22 22
 }
23 23
 
24 24
 // Constants
25
-require('constants.php');
26
-require('settings/buttons.php');
25
+require( 'constants.php' );
26
+require( 'settings/buttons.php' );
27 27
 // Models
28
-require('model/base.php');
29
-require('model/button.php');
30
-require('model/network_button.php');
28
+require( 'model/base.php' );
29
+require( 'model/button.php' );
30
+require( 'model/network_button.php' );
31 31
 // Table
32
-require('settings/buttons_list_table.php');
32
+require( 'settings/buttons_list_table.php' );
33 33
 // Media Types
34
-require('media_types.php');
34
+require( 'media_types.php' );
35 35
 // Widget
36
-require('widget.php');
36
+require( 'widget.php' );
37 37
 // Version control
38
-require('version.php');
38
+require( 'version.php' );
39 39
 // Helper functions
40
-require('helper.php');
40
+require( 'helper.php' );
41 41
 
42 42
 register_activation_hook( __FILE__, array( 'PodloveSubscribeButton', 'build_models' ) );
43 43
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
 		$pages = array( 'settings_page_podlove-subscribe-button', 'widgets.php' );
77 77
 
78
-		if ( ! in_array( $hook, $pages )  ) {
78
+		if ( ! in_array( $hook, $pages ) ) {
79 79
 			return;
80 80
 		}
81 81
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	}
125 125
 
126 126
 	public static function load_translations() {
127
-		load_plugin_textdomain( 'podlove-subscribe-button', false, dirname(plugin_basename( __FILE__)) . '/languages/' );
127
+		load_plugin_textdomain( 'podlove-subscribe-button', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
128 128
 
129 129
 	}
130 130
 
@@ -163,56 +163,56 @@  discard block
 block discarded – undo
163 163
 				'format' => 'rectangle'
164 164
 			);
165 165
 
166
-		foreach ($default_values as $option => $default_value) {
167
-			if ( ! get_option('podlove_subscribe_button_default_' . $option ) ) {
168
-				update_option('podlove_subscribe_button_default_' . $option, $default_value);
166
+		foreach ( $default_values as $option => $default_value ) {
167
+			if ( ! get_option( 'podlove_subscribe_button_default_' . $option ) ) {
168
+				update_option( 'podlove_subscribe_button_default_' . $option, $default_value );
169 169
 			}
170 170
 		}
171 171
 	}
172 172
 
173 173
 	public static function shortcode( $args ) {
174
-		if ( ! $args || ! isset($args['button']) ) {
175
-			return __('You need to create a Button first and provide its ID.', 'podlove-subscribe-button');
174
+		if ( ! $args || ! isset( $args[ 'button' ] ) ) {
175
+			return __( 'You need to create a Button first and provide its ID.', 'podlove-subscribe-button' );
176 176
 		} else {
177
-			$buttonid = $args['button'];
177
+			$buttonid = $args[ 'button' ];
178 178
 		}
179 179
 
180 180
 		// Fetch the (network)button by it's name
181
-		if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name($args['button']) )
182
-			return sprintf( __('Oops. There is no button with the ID "%s".', 'podlove-subscribe-button'), $args['button'] );
181
+		if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $args[ 'button' ] ) )
182
+			return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] );
183 183
 
184 184
 		// Get button styling and options
185
-		$autowidth = self::interpret_width_attribute( self::get_array_value_with_fallback($args, 'width') );
186
-		$size = self::get_attribute( 'size', self::get_array_value_with_fallback($args, 'size') );
187
-		$style = self::get_attribute( 'style', self::get_array_value_with_fallback($args, 'style') );
188
-		$format = self::get_attribute( 'format', self::get_array_value_with_fallback($args, 'format') );
189
-		$color = self::get_attribute( 'color', self::get_array_value_with_fallback($args, 'color') );
190
-
191
-		if ( isset($args['language']) ) {
192
-			$language = $args['language'];
185
+		$autowidth = self::interpret_width_attribute( self::get_array_value_with_fallback( $args, 'width' ) );
186
+		$size = self::get_attribute( 'size', self::get_array_value_with_fallback( $args, 'size' ) );
187
+		$style = self::get_attribute( 'style', self::get_array_value_with_fallback( $args, 'style' ) );
188
+		$format = self::get_attribute( 'format', self::get_array_value_with_fallback( $args, 'format' ) );
189
+		$color = self::get_attribute( 'color', self::get_array_value_with_fallback( $args, 'color' ) );
190
+
191
+		if ( isset( $args[ 'language' ] ) ) {
192
+			$language = $args[ 'language' ];
193 193
 		} else {
194 194
 			$language = 'en';
195 195
 		}
196 196
 
197
-		if ( isset($args['color']) ) {
198
-			$color = $args['color'];
197
+		if ( isset( $args[ 'color' ] ) ) {
198
+			$color = $args[ 'color' ];
199 199
 		} else {
200
-			$color = get_option('podlove_subscribe_button_default_color', '#599677');
200
+			$color = get_option( 'podlove_subscribe_button_default_color', '#599677' );
201 201
 		}
202 202
 
203
-		if ( isset($args['hide']) && $args['hide'] == 'true' ) {
203
+		if ( isset( $args[ 'hide' ] ) && $args[ 'hide' ] == 'true' ) {
204 204
 			$hide = true;
205 205
 		} else {
206 206
 			$hide = false;
207 207
 		}
208 208
 
209 209
 		// Render button
210
-		return $button->render($size, $autowidth, $style, $format, $color, $hide, $buttonid, $language);
210
+		return $button->render( $size, $autowidth, $style, $format, $color, $hide, $buttonid, $language );
211 211
 	}
212 212
 
213
-	public static function get_array_value_with_fallback($args, $key) {
214
-		if ( isset($args[$key]) )
215
-			return $args[$key];
213
+	public static function get_array_value_with_fallback( $args, $key ) {
214
+		if ( isset( $args[ $key ] ) )
215
+			return $args[ $key ];
216 216
 
217 217
 		return false;
218 218
 	}
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
 	 * @param  string $attribute_value
223 223
 	 * @return string
224 224
 	 */
225
-	private static function get_attribute($attribute=null, $attribute_value=null) {
226
-		if ( isset($attribute_value) && ctype_alnum($attribute_value) && key_exists( $attribute_value, \PodloveSubscribeButton\Model\Button::$$attribute ) ) {
225
+	private static function get_attribute( $attribute = null, $attribute_value = null ) {
226
+		if ( isset( $attribute_value ) && ctype_alnum( $attribute_value ) && key_exists( $attribute_value, \PodloveSubscribeButton\Model\Button::$$attribute ) ) {
227 227
 			return $attribute_value;
228 228
 		} else {
229
-			return get_option('podlove_subscribe_button_default_' . $attribute, \PodloveSubscribeButton\Model\Button::$properties[$attribute]);
229
+			return get_option( 'podlove_subscribe_button_default_' . $attribute, \PodloveSubscribeButton\Model\Button::$properties[ $attribute ] );
230 230
 		}
231 231
 	}
232 232
 
Please login to merge, or discard this patch.
model/base.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 		}
45 45
 	}
46 46
 
47
-	private static function unserialize_property($property) {
48
-		if ( ! isset($property) )
47
+	private static function unserialize_property( $property ) {
48
+		if ( ! isset( $property ) )
49 49
 			return;
50 50
 
51
-		if ( $unserialized_string = is_serialized($property) )
52
-			return unserialize($property);
51
+		if ( $unserialized_string = is_serialized( $property ) )
52
+			return unserialize( $property );
53 53
 
54 54
 		return $property;
55 55
 	}
@@ -89,16 +89,16 @@  discard block
 block discarded – undo
89 89
 		// "id" columns and those ending on "_id" get an index by default
90 90
 		$index = $name == 'id' || stripos( $name, '_id' );
91 91
 		// but if the argument is set, it overrides the default
92
-		if (isset($args['index'])) {
93
-			$index = $args['index'];
92
+		if ( isset( $args[ 'index' ] ) ) {
93
+			$index = $args[ 'index' ];
94 94
 		}
95 95
 		
96
-		static::$properties[ $class ][] = array(
96
+		static::$properties[ $class ][ ] = array(
97 97
 			'name'  => $name,
98 98
 			'type'  => $type,
99 99
 			'index' => $index,
100
-			'index_length' => isset($args['index_length']) ? $args['index_length'] : null,
101
-			'unique' => isset($args['unique']) ? $args['unique'] : null
100
+			'index_length' => isset( $args[ 'index_length' ] ) ? $args[ 'index_length' ] : null,
101
+			'unique' => isset( $args[ 'unique' ] ) ? $args[ 'unique' ] : null
102 102
 		);
103 103
 	}
104 104
 	
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @return array property names
134 134
 	 */
135 135
 	public static function property_names() {
136
-		return array_map( function ( $p ) { return $p['name']; } , static::properties() );
136
+		return array_map( function( $p ) { return $p[ 'name' ]; } , static::properties() );
137 137
 	}
138 138
 	
139 139
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		}
172 172
 		
173 173
 		foreach ( $row as $property => $value ) {
174
-			$model->$property = static::unserialize_property($value);
174
+			$model->$property = static::unserialize_property( $value );
175 175
 		}
176 176
 		
177 177
 		return $model;
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		$models = array();
185 185
 		
186 186
 		$rows = $wpdb->get_results(
187
-			'SELECT * FROM ' . static::table_name() . ' WHERE ' . $property .  ' = \'' . $value . '\''
187
+			'SELECT * FROM ' . static::table_name() . ' WHERE ' . $property . ' = \'' . $value . '\''
188 188
 		);
189 189
 		
190 190
 		if ( ! $rows ) {
@@ -195,9 +195,9 @@  discard block
 block discarded – undo
195 195
 			$model = new $class();
196 196
 			$model->flag_as_not_new();
197 197
 			foreach ( $row as $property => $value ) {
198
-				$model->$property = static::unserialize_property($value);
198
+				$model->$property = static::unserialize_property( $value );
199 199
 			}
200
-			$models[] = $model;
200
+			$models[ ] = $model;
201 201
 		}
202 202
 		
203 203
 		return $models;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 		$model->flag_as_not_new();
212 212
 		
213 213
 		$row = $wpdb->get_row(
214
-			'SELECT * FROM ' . static::table_name() . ' WHERE ' . $property .  ' = \'' . $value . '\' LIMIT 0,1'
214
+			'SELECT * FROM ' . static::table_name() . ' WHERE ' . $property . ' = \'' . $value . '\' LIMIT 0,1'
215 215
 		);
216 216
 		
217 217
 		if ( ! $row ) {
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		}
220 220
 		
221 221
 		foreach ( $row as $property => $value ) {
222
-			$model->$property = static::unserialize_property($value);
222
+			$model->$property = static::unserialize_property( $value );
223 223
 		}
224 224
 		
225 225
 		return $model;
@@ -243,9 +243,9 @@  discard block
 block discarded – undo
243 243
 			$model = new $class();
244 244
 			$model->flag_as_not_new();
245 245
 			foreach ( $row as $property => $value ) {
246
-				$model->$property = static::unserialize_property($value);
246
+				$model->$property = static::unserialize_property( $value );
247 247
 			}
248
-			$models[] = $model;
248
+			$models[ ] = $model;
249 249
 		}
250 250
 		
251 251
 		return $models;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 		}
268 268
 		
269 269
 		foreach ( $row as $property => $value ) {
270
-			$model->$property = static::unserialize_property($value);
270
+			$model->$property = static::unserialize_property( $value );
271 271
 		}
272 272
 		
273 273
 		return $model;
@@ -290,9 +290,9 @@  discard block
 block discarded – undo
290 290
 			$model = new $class();
291 291
 			$model->flag_as_not_new();
292 292
 			foreach ( $row as $property => $value ) {
293
-				$model->$property = static::unserialize_property($value);
293
+				$model->$property = static::unserialize_property( $value );
294 294
 			}
295
-			$models[] = $model;
295
+			$models[ ] = $model;
296 296
 		}
297 297
 		
298 298
 		return $models;
@@ -322,18 +322,18 @@  discard block
 block discarded – undo
322 322
 		if ( ! is_array( $attributes ) )
323 323
 			return false;
324 324
 
325
-		$request = filter_input_array(INPUT_POST); // Do this for security reasons
325
+		$request = filter_input_array( INPUT_POST ); // Do this for security reasons
326 326
 			
327 327
 		foreach ( $attributes as $key => $value ) {
328
-			if ( is_array($value) ) {
329
-				$this->{$key} = serialize($value);
328
+			if ( is_array( $value ) ) {
329
+				$this->{$key} = serialize( $value );
330 330
 			} else {
331
-				$this->{$key} = esc_sql($value);
331
+				$this->{$key} = esc_sql( $value );
332 332
 			}
333 333
 		}
334 334
 		
335
-		if ( isset( $request['checkboxes'] ) && is_array( $request['checkboxes'] ) ) {
336
-			foreach ( $request['checkboxes'] as $checkbox ) {
335
+		if ( isset( $request[ 'checkboxes' ] ) && is_array( $request[ 'checkboxes' ] ) ) {
336
+			foreach ( $request[ 'checkboxes' ] as $checkbox ) {
337 337
 				if ( isset( $attributes[ $checkbox ] ) && $attributes[ $checkbox ] === 'on' ) {
338 338
 					$this->$checkbox = 1;
339 339
 				} else {
@@ -345,8 +345,8 @@  discard block
 block discarded – undo
345 345
 		// @todo this is the wrong place to do this!
346 346
 		// The feed password is the only "passphrase" which is saved. It is not encrypted!
347 347
 		// However, we keep this function for later use
348
-		if ( isset( $request['passwords'] ) && is_array( $request['passwords'] ) ) {
349
-			foreach ( $request['passwords'] as $password ) {
348
+		if ( isset( $request[ 'passwords' ] ) && is_array( $request[ 'passwords' ] ) ) {
349
+			foreach ( $request[ 'passwords' ] as $password ) {
350 350
 				$this->$password = $attributes[ $password ];
351 351
 			}
352 352
 		}
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 * @param  mixed  $value
361 361
 	 * @return (bool) query success
362 362
 	 */
363
-	public function update_attribute($attribute, $value) {
363
+	public function update_attribute( $attribute, $value ) {
364 364
 		global $wpdb;
365 365
 
366 366
 		$this->$attribute = $value;
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 			"UPDATE %s SET %s = '%s' WHERE id = %s",
370 370
 			static::table_name(),
371 371
 			$attribute,
372
-			mysqli_real_escape_string($value),
372
+			mysqli_real_escape_string( $value ),
373 373
 			$this->id
374 374
 		);
375 375
 
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
 
415 415
 		$this->is_new = false;
416 416
 
417
-		do_action('podlove_model_save', $this);
418
-		do_action('podlove_model_change', $this);
417
+		do_action( 'podlove_model_save', $this );
418
+		do_action( 'podlove_model_change', $this );
419 419
 
420 420
 		return $success;
421 421
 	}
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
 
460 460
 		$rows_affected = $wpdb->query( $sql );
461 461
 
462
-	    do_action('podlove_model_delete', $this);
463
-	    do_action('podlove_model_change', $this);
462
+	    do_action( 'podlove_model_delete', $this );
463
+	    do_action( 'podlove_model_change', $this );
464 464
 
465 465
 		return $rows_affected !== false;
466 466
 	}
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 		global $wpdb;
470 470
 
471 471
 		if ( $this->$p !== null && $this->$p !== '' ) {
472
-			return sprintf( "%s = '%s'", $p, ( is_array($this->$p) ? serialize($this->$p) : $this->$p ) );
472
+			return sprintf( "%s = '%s'", $p, ( is_array( $this->$p ) ? serialize( $this->$p ) : $this->$p ) );
473 473
 		} else {
474 474
 			return "$p = NULL";
475 475
 		}
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 		
497 497
 		$property_sql = array();
498 498
 		foreach ( static::properties() as $property )
499
-			$property_sql[] = "`{$property['name']}` {$property['type']}";
499
+			$property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}";
500 500
 		
501 501
 		$sql = 'CREATE TABLE IF NOT EXISTS '
502 502
 		     . static::table_name()
@@ -522,14 +522,14 @@  discard block
 block discarded – undo
522 522
 
523 523
 		$indices_sql = 'SHOW INDEX FROM `' . static::table_name() . '`';
524 524
 		$indices = $wpdb->get_results( $indices_sql );
525
-		$index_columns = array_map( function($index){ return $index->Column_name; }, $indices );
525
+		$index_columns = array_map( function( $index ) { return $index->Column_name; }, $indices );
526 526
 
527 527
 		foreach ( static::properties() as $property ) {
528 528
 
529
-			if ( $property['index'] && ! in_array( $property['name'], $index_columns ) ) {
530
-				$length = isset($property['index_length']) ? '(' . (int) $property['index_length'] . ')' : '';
531
-				$unique = isset($property['unique']) && $property['unique'] ? 'UNIQUE' : '';
532
-				$sql = 'ALTER TABLE `' . static::table_name() . '` ADD ' . $unique . ' INDEX `' . $property['name'] . '` (' . $property['name'] . $length . ')';
529
+			if ( $property[ 'index' ] && ! in_array( $property[ 'name' ], $index_columns ) ) {
530
+				$length = isset( $property[ 'index_length' ] ) ? '(' . (int) $property[ 'index_length' ] . ')' : '';
531
+				$unique = isset( $property[ 'unique' ] ) && $property[ 'unique' ] ? 'UNIQUE' : '';
532
+				$sql = 'ALTER TABLE `' . static::table_name() . '` ADD ' . $unique . ' INDEX `' . $property[ 'name' ] . '` (' . $property[ 'name' ] . $length . ')';
533 533
 				$wpdb->query( $sql );
534 534
 			}
535 535
 		}
Please login to merge, or discard this patch.
model/button.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -44,12 +44,12 @@  discard block
 block discarded – undo
44 44
 	 * @param  string $name
45 45
 	 * @return object||FALSE
46 46
 	 */
47
-	public static function get_button_by_name($name) {
48
-		if ( $button = \PodloveSubscribeButton\Model\Button::find_one_by_property('name', $name) ) {
47
+	public static function get_button_by_name( $name ) {
48
+		if ( $button = \PodloveSubscribeButton\Model\Button::find_one_by_property( 'name', $name ) ) {
49 49
 			return $button;
50 50
 		}
51 51
 
52
-		if ( $network_button = \PodloveSubscribeButton\Model\NetworkButton::find_one_by_property('name', $name) ) {
52
+		if ( $network_button = \PodloveSubscribeButton\Model\NetworkButton::find_one_by_property( 'name', $name ) ) {
53 53
 			$network_button->id = $network_button->id . 'N';
54 54
 			return $network_button;
55 55
 		}
@@ -62,9 +62,9 @@  discard block
 block discarded – undo
62 62
 	 * @param  array
63 63
 	 * @return array
64 64
 	 */
65
-	public static function get_global_setting_with_fallback( $settings=array() ) {
66
-		foreach (self::$properties as $property => $default) {
67
-			$settings[$property] = ( get_option('podlove_subscribe_button_default_' . $property) ? get_option('podlove_subscribe_button_default_' . $property) : $default );
65
+	public static function get_global_setting_with_fallback( $settings = array() ) {
66
+		foreach ( self::$properties as $property => $default ) {
67
+			$settings[ $property ] = ( get_option( 'podlove_subscribe_button_default_' . $property ) ? get_option( 'podlove_subscribe_button_default_' . $property ) : $default );
68 68
 		}
69 69
 
70 70
 		return $settings;
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 	 * @param  boolean $buttonid
82 82
 	 * @return string
83 83
 	 */
84
-	public function render( $size='big', $autowidth='on', $style='filled', $format='rectangle', $color='#599677', $hide = false, $buttonid = false, $language='en' ) {
84
+	public function render( $size = 'big', $autowidth = 'on', $style = 'filled', $format = 'rectangle', $color = '#599677', $hide = false, $buttonid = false, $language = 'en' ) {
85 85
 		$button_styling = array_merge(
86
-				$this->get_button_styling($size, $autowidth, $style, $format, $color),
86
+				$this->get_button_styling( $size, $autowidth, $style, $format, $color ),
87 87
 				array(
88 88
 						'hide' => $hide,
89 89
 						'buttonid' => $buttonid,
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 				'subtitle' => $this->subtitle,
98 98
 				'description' => $this->description,
99 99
 				'cover' => $this->cover,
100
-				'feeds' => $this->get_feeds_as_array($this->feeds)
100
+				'feeds' => $this->get_feeds_as_array( $this->feeds )
101 101
 			), $button_styling );
102 102
 	}
103 103
 
@@ -105,20 +105,20 @@  discard block
 block discarded – undo
105 105
 	 * Provides the feed as an array in the required format
106 106
 	 * @return array
107 107
 	 */
108
-	private function get_feeds_as_array( $feeds=array() ) {
109
-		foreach ($feeds as $feed) {
110
-			if ( isset(\PodloveSubscribeButton\MediaTypes::$audio[$feed['format']]['extension']) ) {
108
+	private function get_feeds_as_array( $feeds = array() ) {
109
+		foreach ( $feeds as $feed ) {
110
+			if ( isset( \PodloveSubscribeButton\MediaTypes::$audio[ $feed[ 'format' ] ][ 'extension' ] ) ) {
111 111
 				$new_feed = array(
112 112
 						'type' => 'audio',
113
-						'format' => \PodloveSubscribeButton\MediaTypes::$audio[$feed['format']]['extension'],
114
-						'url' => $feed['url'],
113
+						'format' => \PodloveSubscribeButton\MediaTypes::$audio[ $feed[ 'format' ] ][ 'extension' ],
114
+						'url' => $feed[ 'url' ],
115 115
 						'variant' => 'high'
116 116
 					);
117 117
 
118
-				if ( isset($feed['itunesfeedid']) && $feed['itunesfeedid'] > 0 )
119
-					$new_feed['directory-url-itunes'] = "https://itunes.apple.com/podcast/id" . $feed['itunesfeedid'];
118
+				if ( isset( $feed[ 'itunesfeedid' ] ) && $feed[ 'itunesfeedid' ] > 0 )
119
+					$new_feed[ 'directory-url-itunes' ] = "https://itunes.apple.com/podcast/id" . $feed[ 'itunesfeedid' ];
120 120
 
121
-				$feeds[] = $new_feed;
121
+				$feeds[ ] = $new_feed;
122 122
 			}
123 123
 		}
124 124
 
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 	 * @param  string $data_attributes
133 133
 	 * @return string 
134 134
 	 */
135
-	private function provide_button_html($podcast_data, $button_styling, $data_attributes="") {
135
+	private function provide_button_html( $podcast_data, $button_styling, $data_attributes = "" ) {
136 136
 		// Create data attributes for Button
137
-		foreach ($button_styling as $attribute => $value) {
137
+		foreach ( $button_styling as $attribute => $value ) {
138 138
 			$data_attributes .= 'data-' . $attribute . '="' . $value . '" ';
139 139
 		}
140 140
 
141 141
 		return"
142 142
 			<script>
143
-				podcastData".$this->id . " = ".json_encode($podcast_data)."
143
+				podcastData".$this->id . " = " . json_encode( $podcast_data ) . "
144 144
 			</script>
145 145
 			<script 
146 146
 				class=\"podlove-subscribe-button\" 
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
 	 * @param  string $color
159 159
 	 * @return array
160 160
 	 */
161
-	public function get_button_styling($size, $autowidth, $style, $format, $color) {
161
+	public function get_button_styling( $size, $autowidth, $style, $format, $color ) {
162 162
 
163 163
 		return array(
164 164
 				// $attribute => $value
165
-				'size' => ( $size == 'default' ? get_option('podlove_subscribe_button_default_size', $size) : $size )
166
-			 	. self::interpret_autowidth_attribute($autowidth),
167
-				'style' => ( $style == 'default' ? get_option('podlove_subscribe_button_default_style', $style) : $style ),
168
-				'format' => ( $format == 'default' ? get_option('podlove_subscribe_button_default_format', $format) : $format ),
169
-				'color' => ( isset($color) ? $color : get_option('podlove_subscribe_button_default_color', $color) ),
165
+				'size' => ( $size == 'default' ? get_option( 'podlove_subscribe_button_default_size', $size ) : $size )
166
+			 	. self::interpret_autowidth_attribute( $autowidth ),
167
+				'style' => ( $style == 'default' ? get_option( 'podlove_subscribe_button_default_style', $style ) : $style ),
168
+				'format' => ( $format == 'default' ? get_option( 'podlove_subscribe_button_default_format', $format ) : $format ),
169
+				'color' => ( isset( $color ) ? $color : get_option( 'podlove_subscribe_button_default_color', $color ) ),
170 170
 				'json-data' => 'podcastData' . $this->id
171 171
 			);
172 172
 	}
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 	 * @param  string $autowidth
177 177
 	 * @return string
178 178
 	 */
179
-	private static function interpret_autowidth_attribute($autowidth) {
180
-		if ( $autowidth == 'default' && get_option('podlove_subscribe_button_default_autowidth') !== 'on' )
179
+	private static function interpret_autowidth_attribute( $autowidth ) {
180
+		if ( $autowidth == 'default' && get_option( 'podlove_subscribe_button_default_autowidth' ) !== 'on' )
181 181
 			return '';
182 182
 
183 183
 		if ( $autowidth !== 'default' && $autowidth !== 'on' )
Please login to merge, or discard this patch.
settings/buttons.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@  discard block
 block discarded – undo
6 6
 
7 7
 	public static function page() {
8 8
 
9
-		$action = null !== filter_input(INPUT_GET, 'action') ? filter_input(INPUT_GET, 'action') : null;
9
+		$action = null !== filter_input( INPUT_GET, 'action' ) ? filter_input( INPUT_GET, 'action' ) : null;
10 10
 		$is_network = is_network_admin();
11 11
 
12
-		if ( $action == 'confirm_delete' && null !== filter_input(INPUT_GET, 'button') ) {
13
-			$button = ( $is_network === true ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( (int) filter_input(INPUT_GET, 'button') ) : \PodloveSubscribeButton\Model\Button::find_by_id( (int) filter_input(INPUT_GET, 'button') ) );
12
+		if ( $action == 'confirm_delete' && null !== filter_input( INPUT_GET, 'button' ) ) {
13
+			$button = ( $is_network === true ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( (int) filter_input( INPUT_GET, 'button' ) ) : \PodloveSubscribeButton\Model\Button::find_by_id( (int) filter_input( INPUT_GET, 'button' ) ) );
14 14
 			?>
15 15
 			<div class="updated">
16 16
 				<p>
@@ -27,11 +27,11 @@  discard block
 block discarded – undo
27 27
 		}
28 28
 		?>
29 29
 		<div class="wrap">
30
-			<h2><?php echo __( 'Podlove Subscribe Button', 'podlove-subscribe-button' ); ?> <a href="?page=<?php echo filter_input(INPUT_GET, 'page'); ?>&amp;action=new&amp;network=<?php echo $is_network; ?>" class="add-new-h2"><?php _e( 'Add New', 'podlove-subscribe-button' ); ?></a></h2>
30
+			<h2><?php echo __( 'Podlove Subscribe Button', 'podlove-subscribe-button' ); ?> <a href="?page=<?php echo filter_input( INPUT_GET, 'page' ); ?>&amp;action=new&amp;network=<?php echo $is_network; ?>" class="add-new-h2"><?php _e( 'Add New', 'podlove-subscribe-button' ); ?></a></h2>
31 31
 			<?php
32 32
 
33 33
 			switch ( $action ) {
34
-				case 'new':   self::new_template();  break;
34
+				case 'new':   self::new_template(); break;
35 35
 				case 'edit':  self::edit_template(); break;
36 36
 				case 'index': self::view_template(); break;
37 37
 				default:      self::view_template(); break;
@@ -45,18 +45,18 @@  discard block
 block discarded – undo
45 45
 	 * Process form: save/update a format
46 46
 	 */
47 47
 	public static function save() {
48
-		if ( null == filter_input(INPUT_GET, 'button') )
48
+		if ( null == filter_input( INPUT_GET, 'button' ) )
49 49
 			return;
50 50
 
51
-		$post = filter_input_array(INPUT_POST);
51
+		$post = filter_input_array( INPUT_POST );
52 52
 
53
-		$button = ( filter_input(INPUT_GET, 'network') === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input(INPUT_GET, 'button') ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input(INPUT_GET, 'button') ) );
54
-		$button->update_attributes( $post['podlove_button'] );
53
+		$button = ( filter_input( INPUT_GET, 'network' ) === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input( INPUT_GET, 'button' ) ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input( INPUT_GET, 'button' ) ) );
54
+		$button->update_attributes( $post[ 'podlove_button' ] );
55 55
 
56
-		if ( isset($post['submit_and_stay']) ) {
57
-			self::redirect( 'edit', $button->id, array( 'network' => filter_input(INPUT_GET, 'network') ), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
56
+		if ( isset( $post[ 'submit_and_stay' ] ) ) {
57
+			self::redirect( 'edit', $button->id, array( 'network' => filter_input( INPUT_GET, 'network' ) ), ( filter_input( INPUT_GET, 'network' ) === '1' ? true : false ) );
58 58
 		} else {
59
-			self::redirect( 'index', $button->id, array(), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
59
+			self::redirect( 'index', $button->id, array(), ( filter_input( INPUT_GET, 'network' ) === '1' ? true : false ) );
60 60
 		}
61 61
 	}
62 62
 	/**
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
 	public static function create() {
66 66
 		global $wpdb;
67 67
 
68
-		$post = filter_input_array(INPUT_POST);
68
+		$post = filter_input_array( INPUT_POST );
69 69
 
70
-		$button = ( filter_input(INPUT_GET, 'network') === '1' ? new \PodloveSubscribeButton\Model\NetworkButton : new \PodloveSubscribeButton\Model\Button );
71
-		$button->update_attributes( $post['podlove_button'] );
70
+		$button = ( filter_input( INPUT_GET, 'network' ) === '1' ? new \PodloveSubscribeButton\Model\NetworkButton : new \PodloveSubscribeButton\Model\Button );
71
+		$button->update_attributes( $post[ 'podlove_button' ] );
72 72
 
73
-		if ( isset($post['submit_and_stay']) ) {
74
-			self::redirect( 'edit', $button->id, array( 'network' => filter_input(INPUT_GET, 'network') ), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
73
+		if ( isset( $post[ 'submit_and_stay' ] ) ) {
74
+			self::redirect( 'edit', $button->id, array( 'network' => filter_input( INPUT_GET, 'network' ) ), ( filter_input( INPUT_GET, 'network' ) === '1' ? true : false ) );
75 75
 		} else {
76
-			self::redirect( 'index', $button->id, array(), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
76
+			self::redirect( 'index', $button->id, array(), ( filter_input( INPUT_GET, 'network' ) === '1' ? true : false ) );
77 77
 		}
78 78
 	}
79 79
 
@@ -81,33 +81,33 @@  discard block
 block discarded – undo
81 81
 	 * Process form: delete a format
82 82
 	 */
83 83
 	public static function delete() {
84
-		if ( null ==  filter_input(INPUT_GET, 'button') )
84
+		if ( null == filter_input( INPUT_GET, 'button' ) )
85 85
 			return;
86 86
 
87
-		$button = ( filter_input(INPUT_GET, 'network') === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input(INPUT_GET, 'button') ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input(INPUT_GET, 'button') ) );
87
+		$button = ( filter_input( INPUT_GET, 'network' ) === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input( INPUT_GET, 'button' ) ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input( INPUT_GET, 'button' ) ) );
88 88
 		$button->delete();
89 89
 
90
-		self::redirect( 'index', null, array(), ( filter_input(INPUT_GET, 'network') === '1' ? true : false ) );
90
+		self::redirect( 'index', null, array(), ( filter_input( INPUT_GET, 'network' ) === '1' ? true : false ) );
91 91
 	}
92 92
 
93 93
 	/**
94 94
 	 * Helper method: redirect to a certain page.
95 95
 	 */
96 96
 	public static function redirect( $action, $button_id = null, $params = array(), $network = false ) {
97
-		$page    = ( $network ? '/network/settings' : 'options-general' ) . '.php?page=' . filter_input(INPUT_GET, 'page');
97
+		$page    = ( $network ? '/network/settings' : 'options-general' ) . '.php?page=' . filter_input( INPUT_GET, 'page' );
98 98
 		$show    = ( $button_id ) ? '&button=' . $button_id : '';
99 99
 		$action  = '&action=' . $action;
100 100
 
101
-		array_walk( $params, function(&$value, $key) { $value = "&$key=$value"; } );
101
+		array_walk( $params, function( &$value, $key ) { $value = "&$key=$value"; } );
102 102
 
103 103
 		wp_redirect( admin_url( $page . $show . $action . implode( '', $params ) ) );
104 104
 	}
105 105
 
106 106
 	public static function process_form() {
107
-		if ( null === filter_input(INPUT_GET, 'button') )
107
+		if ( null === filter_input( INPUT_GET, 'button' ) )
108 108
 			return;
109 109
 
110
-		$action = ( null !== filter_input(INPUT_GET, 'action') ? filter_input(INPUT_GET, 'action') : null );
110
+		$action = ( null !== filter_input( INPUT_GET, 'action' ) ? filter_input( INPUT_GET, 'action' ) : null );
111 111
 
112 112
 		if ( $action === 'save' ) {
113 113
 			self::save();
@@ -119,22 +119,22 @@  discard block
 block discarded – undo
119 119
 	}
120 120
 
121 121
 	public static function new_template() {
122
-		if ( filter_input(INPUT_GET, 'network') == '1' ) {
122
+		if ( filter_input( INPUT_GET, 'network' ) == '1' ) {
123 123
 			$button = new \PodloveSubscribeButton\Model\NetworkButton;
124 124
 		} else {
125 125
 			$button = new \PodloveSubscribeButton\Model\Button;
126 126
 		}
127 127
 
128
-		echo '<h3>' . __( 'New Subscribe button', 'podlove-subscribe-button' ) . '</h3>'.
128
+		echo '<h3>' . __( 'New Subscribe button', 'podlove-subscribe-button' ) . '</h3>' .
129 129
 				__( 'Please fill in your Podcast metadata to create a Podlove Subscription button', 'podlove-subscribe-button' );
130 130
 		self::form_template( $button, 'create' );
131 131
 	}
132 132
 
133 133
 	public static function edit_template() {
134
-		if ( filter_input(INPUT_GET, 'network') == '1' ) {
135
-			$button = \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input(INPUT_GET, 'button') );
134
+		if ( filter_input( INPUT_GET, 'network' ) == '1' ) {
135
+			$button = \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input( INPUT_GET, 'button' ) );
136 136
 		} else {
137
-			$button = \PodloveSubscribeButton\Model\Button::find_by_id( filter_input(INPUT_GET, 'button') );
137
+			$button = \PodloveSubscribeButton\Model\Button::find_by_id( filter_input( INPUT_GET, 'button' ) );
138 138
 		}
139 139
 
140 140
 		echo '<h3>' . sprintf( __( 'Edit Subscribe button: %s', 'podlove-subscribe-button' ), $button->title ) . '</h3>';
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
 	public static function view_template() {
145 145
 		$is_network = is_network_admin();
146 146
 		?>
147
-		<p><?php _e('This plugin allows easy inclusion of the Podlove Subscribe Button. Put it in your sidebar with a simple widget or include the button in pages and/or posts with a simple shortcode.', 'podlove-subscribe-button' ); ?></p>
148
-		<p><?php _e('Start by adding a button for each of your podcasts here. You can then add the button to your sidebar by adding the <a href="widgets.php">Podlove Subscribe Button widget</a>.', 'podlove-subscribe-button' ); ?></p>
149
-		<p><?php _e('If you want to display the button inside a page or article, you can also use the <code>[podlove-subscribe-button]</code> shortcode anywhere.', 'podlove-subscribe-button' ); ?></p>
147
+		<p><?php _e( 'This plugin allows easy inclusion of the Podlove Subscribe Button. Put it in your sidebar with a simple widget or include the button in pages and/or posts with a simple shortcode.', 'podlove-subscribe-button' ); ?></p>
148
+		<p><?php _e( 'Start by adding a button for each of your podcasts here. You can then add the button to your sidebar by adding the <a href="widgets.php">Podlove Subscribe Button widget</a>.', 'podlove-subscribe-button' ); ?></p>
149
+		<p><?php _e( 'If you want to display the button inside a page or article, you can also use the <code>[podlove-subscribe-button]</code> shortcode anywhere.', 'podlove-subscribe-button' ); ?></p>
150 150
 		<?php
151 151
 		$table = new \PodloveSubscribeButton\Button_List_Table;
152 152
 		$table->prepare_items();
@@ -157,49 +157,49 @@  discard block
 block discarded – undo
157 157
 
158 158
 		if ( ! $is_network ) :
159 159
 		?>
160
-		<h3><?php _e('Default Settings', 'podlove-subscribe-button' ); ?></h3>
160
+		<h3><?php _e( 'Default Settings', 'podlove-subscribe-button' ); ?></h3>
161 161
 		<form method="post" action="options.php">
162 162
 			<?php settings_fields( 'podlove-subscribe-button' ); ?>
163 163
 			<?php do_settings_sections( 'podlove-subscribe-button' ); ?>
164 164
 			<table class="form-table">
165 165
 				<tr valign="top">
166
-				<th scope="row"><label for="podlove_subscribe_button_default_size"><?php _e('Size', 'podlove-subscribe-button' ); ?></label></th>
166
+				<th scope="row"><label for="podlove_subscribe_button_default_size"><?php _e( 'Size', 'podlove-subscribe-button' ); ?></label></th>
167 167
 				<td>
168 168
 					<select name="podlove_subscribe_button_default_size" id="podlove_subscribe_button_default_size">
169
-						<?php foreach (\PodloveSubscribeButton\Model\Button::$size as $value => $description) : ?>
170
-							<option value="<?php echo $value; ?>" <?php echo ( $settings['size'] == $value ? "selected" : '' ); ?>><?php echo $description; ?></option>
169
+						<?php foreach ( \PodloveSubscribeButton\Model\Button::$size as $value => $description ) : ?>
170
+							<option value="<?php echo $value; ?>" <?php echo ( $settings[ 'size' ] == $value ? "selected" : '' ); ?>><?php echo $description; ?></option>
171 171
 						<?php endforeach; ?>
172 172
 					</select>
173 173
 				</td>
174 174
 				</tr>
175 175
 				<tr valign="top">
176
-				<th scope="row"><label for="podlove_subscribe_button_default_autowidth"><?php _e('Autowidth', 'podlove-subscribe-button' ); ?></label></th>
176
+				<th scope="row"><label for="podlove_subscribe_button_default_autowidth"><?php _e( 'Autowidth', 'podlove-subscribe-button' ); ?></label></th>
177 177
 				<td>
178
-					<input type="checkbox" name="podlove_subscribe_button_default_autowidth" id="podlove_subscribe_button_default_autowidth" <?php echo ( $settings['autowidth'] == 'on' ? 'checked' : '' ) ?> />
178
+					<input type="checkbox" name="podlove_subscribe_button_default_autowidth" id="podlove_subscribe_button_default_autowidth" <?php echo ( $settings[ 'autowidth' ] == 'on' ? 'checked' : '' ) ?> />
179 179
 				</td>
180 180
 				</tr>
181 181
 				<tr valign="top">
182
-				<th scope="row"><label for="podlove_subscribe_button_default_color"><?php _e('Color', 'podlove-subscribe-button' ); ?></label></th>
182
+				<th scope="row"><label for="podlove_subscribe_button_default_color"><?php _e( 'Color', 'podlove-subscribe-button' ); ?></label></th>
183 183
 				<td>
184
-					<input id="podlove_subscribe_button_default_color" name="podlove_subscribe_button_default_color" class="podlove_subscribe_button_color" value="<?php echo $settings['color'] ?>" />
184
+					<input id="podlove_subscribe_button_default_color" name="podlove_subscribe_button_default_color" class="podlove_subscribe_button_color" value="<?php echo $settings[ 'color' ] ?>" />
185 185
 				</td>
186 186
 				</tr>
187 187
 				<tr valign="top">
188
-				<th scope="row"><label for="podlove_subscribe_button_default_style"><?php _e('Style', 'podlove-subscribe-button' ); ?></label></th>
188
+				<th scope="row"><label for="podlove_subscribe_button_default_style"><?php _e( 'Style', 'podlove-subscribe-button' ); ?></label></th>
189 189
 				<td>
190 190
 					<select name="podlove_subscribe_button_default_style" id="podlove_subscribe_button_default_style">
191
-						<?php foreach (\PodloveSubscribeButton\Model\Button::$style as $value => $description) : ?>
192
-							<option value="<?php echo $value; ?>" <?php echo ( $settings['style'] == $value ? "selected" : '' ); ?>><?php echo $description; ?></option>
191
+						<?php foreach ( \PodloveSubscribeButton\Model\Button::$style as $value => $description ) : ?>
192
+							<option value="<?php echo $value; ?>" <?php echo ( $settings[ 'style' ] == $value ? "selected" : '' ); ?>><?php echo $description; ?></option>
193 193
 						<?php endforeach; ?>
194 194
 					</select>
195 195
 				</td>
196 196
 				</tr>
197 197
 				<tr valign="top">
198
-				<th scope="row"><label for="podlove_subscribe_button_default_format"><?php _e('Format', 'podlove-subscribe-button' ); ?></label></th>
198
+				<th scope="row"><label for="podlove_subscribe_button_default_format"><?php _e( 'Format', 'podlove-subscribe-button' ); ?></label></th>
199 199
 				<td>
200 200
 					<select name="podlove_subscribe_button_default_format" id="podlove_subscribe_button_default_format">
201
-						<?php foreach (\PodloveSubscribeButton\Model\Button::$format as $value => $description) : ?>
202
-							<option value="<?php echo $value; ?>" <?php echo ( $settings['format'] == $value ? "selected" : '' ); ?>><?php echo $description; ?></option>
201
+						<?php foreach ( \PodloveSubscribeButton\Model\Button::$format as $value => $description ) : ?>
202
+							<option value="<?php echo $value; ?>" <?php echo ( $settings[ 'format' ] == $value ? "selected" : '' ); ?>><?php echo $description; ?></option>
203 203
 						<?php endforeach; ?>
204 204
 					</select>
205 205
 				</td>
@@ -223,16 +223,16 @@  discard block
 block discarded – undo
223 223
 					<tbody>
224 224
 					<tr>
225 225
 						<td scope="row">
226
-							<label for="podlove_button_name"><?php _e('Button ID', 'podlove-subscribe-button' ); ?></label>
226
+							<label for="podlove_button_name"><?php _e( 'Button ID', 'podlove-subscribe-button' ); ?></label>
227 227
 						</td>
228 228
 						<td>
229 229
 							<input type="text" class="regular-text" id="podlove_button_name" name="podlove_button[name]" value="<?php echo $button->name; ?>" />
230
-							<br /><span class="description"><?php _e('The ID will be used as in internal identifier for shortcodes.', 'podlove-subscribe-button' ); ?></span>
230
+							<br /><span class="description"><?php _e( 'The ID will be used as in internal identifier for shortcodes.', 'podlove-subscribe-button' ); ?></span>
231 231
 						</td>
232 232
 					</tr>
233 233
 					<tr>
234 234
 						<td scope="row">
235
-							<label for="podlove_button_title"><?php _e('Podcast Title', 'podlove-subscribe-button' ); ?></label>
235
+							<label for="podlove_button_title"><?php _e( 'Podcast Title', 'podlove-subscribe-button' ); ?></label>
236 236
 						</td>
237 237
 						<td>
238 238
 							<input type="text" class="regular-text" id="podlove_button_title" name="podlove_button[title]" value="<?php echo $button->title; ?>" />
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 					</tr>
241 241
 					<tr>
242 242
 						<td scope="row">
243
-							<label for="podlove_button_subtitle"><?php _e('Podcast Subtitle', 'podlove-subscribe-button' ); ?></label>
243
+							<label for="podlove_button_subtitle"><?php _e( 'Podcast Subtitle', 'podlove-subscribe-button' ); ?></label>
244 244
 						</td>
245 245
 						<td>
246 246
 							<input type="text" class="regular-text" id="podlove_button_subtitle" name="podlove_button[subtitle]" value="<?php echo $button->subtitle; ?>" />
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 					</tr>
249 249
 					<tr>
250 250
 						<td scope="row">
251
-							<label for="podlove_button_description"><?php _e('Podcast Description', 'podlove-subscribe-button' ); ?></label>
251
+							<label for="podlove_button_description"><?php _e( 'Podcast Description', 'podlove-subscribe-button' ); ?></label>
252 252
 						</td>
253 253
 						<td>
254 254
 							<textarea class="autogrow" cols="40" rows="3" id="podlove_button_description" name="podlove_button[description]"><?php echo $button->description; ?></textarea>
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 					</tr>
257 257
 					<tr>
258 258
 						<td scope="row">
259
-							<label for="podlove-button-cover"><?php _e('Podcast Image URL', 'podlove-subscribe-button' ); ?></label>
259
+							<label for="podlove-button-cover"><?php _e( 'Podcast Image URL', 'podlove-subscribe-button' ); ?></label>
260 260
 						</td>
261 261
 						<td>
262 262
 							<input type="text" class="regular-text" id="podlove-button-cover" name="podlove_button[cover]" value="<?php echo $button->cover; ?>" />
@@ -274,29 +274,29 @@  discard block
 block discarded – undo
274 274
 					</tr>
275 275
 					<tr>
276 276
 						<td scope="row">
277
-							<label for="feeds_table"><?php _e('Podcast Feeds', 'podlove-subscribe-button' ); ?></label>
277
+							<label for="feeds_table"><?php _e( 'Podcast Feeds', 'podlove-subscribe-button' ); ?></label>
278 278
 						</td>
279 279
 						<td>
280 280
 							<table id="feeds_table" class="podlove_alternating" border="0" cellspacing="0">
281 281
 								<thead>
282 282
 									<tr>
283
-										<th><?php _e('URL', 'podlove-subscribe-button' ); ?></th>
284
-										<th><?php _e('iTunes feed ID', 'podlove-subscribe-button' ); ?></th>
285
-										<th><?php _e('Media format', 'podlove-subscribe-button' ); ?></th>
286
-										<th><?php _e('Actions', 'podlove-subscribe-button' ); ?></th>
283
+										<th><?php _e( 'URL', 'podlove-subscribe-button' ); ?></th>
284
+										<th><?php _e( 'iTunes feed ID', 'podlove-subscribe-button' ); ?></th>
285
+										<th><?php _e( 'Media format', 'podlove-subscribe-button' ); ?></th>
286
+										<th><?php _e( 'Actions', 'podlove-subscribe-button' ); ?></th>
287 287
 									</tr>
288 288
 								</thead>
289 289
 								<tbody id="feeds_table_body">
290 290
 								</tbody>
291 291
 							</table>
292 292
 							<input type="button" class="button add_feed" value="+" />
293
-							<p><span class="description"><?php _e('Provide all Feeds with their corresponding Media File Type. The Subscribe Button will then automatically provide the most suitable feed to the subscriber with respect to their Podcast Client.', 'podlove-subscribe-button' ); ?></span></p>
293
+							<p><span class="description"><?php _e( 'Provide all Feeds with their corresponding Media File Type. The Subscribe Button will then automatically provide the most suitable feed to the subscriber with respect to their Podcast Client.', 'podlove-subscribe-button' ); ?></span></p>
294 294
 						</td>
295 295
 					</tr>
296 296
 					</tbody>
297 297
 				</table>
298
-				<input name="submit" id="submit" class="button button-primary" value="<?php _e('Save Changes', 'podlove-subscribe-button' ); ?>" type="submit" />
299
-				<input type="submit" name="submit_and_stay" id="submit_and_stay" class="button" value="<?php _e('Save Changes and Continue Editing', 'podlove-subscribe-button' ); ?>"  />
298
+				<input name="submit" id="submit" class="button button-primary" value="<?php _e( 'Save Changes', 'podlove-subscribe-button' ); ?>" type="submit" />
299
+				<input type="submit" name="submit_and_stay" id="submit_and_stay" class="button" value="<?php _e( 'Save Changes and Continue Editing', 'podlove-subscribe-button' ); ?>"  />
300 300
 
301 301
 				<script type="text/template" id="feed_line_template">
302 302
 					<tr>
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 						<td>
310 310
 							<select class="regular-text podlove-media-format" name="podlove_button[feeds][{{id}}][format]">
311 311
 								<?php
312
-									foreach (\PodloveSubscribeButton\MediaTypes::$audio as $id => $audio) {
313
-										echo "<option value='".$id."'>".$audio['title']."</option>\n";
312
+									foreach ( \PodloveSubscribeButton\MediaTypes::$audio as $id => $audio ) {
313
+										echo "<option value='" . $id . "'>" . $audio[ 'title' ] . "</option>\n";
314 314
 									}
315 315
 								?>
316 316
 							</select>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 					</tr>
320 320
 				</script>
321 321
 				<script type="text/javascript">
322
-					var feeds = <?php echo json_encode($button->feeds); ?>;
322
+					var feeds = <?php echo json_encode( $button->feeds ); ?>;
323 323
 				</script>
324 324
 		</form>
325 325
 		<?php
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 
328 328
 	public static function get_action_link( $button, $title, $action = 'edit', $type = 'link' ) {
329 329
 		return sprintf(
330
-			'<a href="?page=%s&action=%s&button=%s&network='.is_network_admin().'"%s>' . $title . '</a>',
331
-			filter_input(INPUT_GET, 'page'),
330
+			'<a href="?page=%s&action=%s&button=%s&network=' . is_network_admin() . '"%s>' . $title . '</a>',
331
+			filter_input( INPUT_GET, 'page' ),
332 332
 			$action,
333 333
 			$button->id,
334 334
 			$type == 'button' ? ' class="button"' : ''
Please login to merge, or discard this patch.