Completed
Push — master ( 20b044...92d91e )
by Fulvio
08:14 queued 05:34
created
wp-php-console.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * Domain Path:  /languages
17 17
  */
18 18
 
19
-defined( 'ABSPATH' ) or exit;
19
+defined('ABSPATH') or exit;
20 20
 
21 21
 /**
22 22
  * WP PHP Console
@@ -42,10 +42,10 @@  discard block
 block discarded – undo
42 42
  */
43 43
 
44 44
 // Composer fallback for PHP < 5.3.0.
45
-if ( -1 === version_compare( PHP_VERSION, '5.3.0' ) ) {
46
-	require_once dirname( __FILE__ ) . '/vendor/autoload_52.php';
45
+if ( -1 === version_compare(PHP_VERSION, '5.3.0') ) {
46
+	require_once dirname(__FILE__).'/vendor/autoload_52.php';
47 47
 } else {
48
-	require_once dirname( __FILE__ ) . '/vendor/autoload.php';
48
+	require_once dirname(__FILE__).'/vendor/autoload.php';
49 49
 }
50 50
 
51 51
 /**
@@ -55,18 +55,18 @@  discard block
 block discarded – undo
55 55
  */
56 56
 $this_plugin_checks = new WP_Requirements(
57 57
 	'WP PHP Console',
58
-	plugin_basename( __FILE__ ),
58
+	plugin_basename(__FILE__),
59 59
 	array(
60 60
 		'PHP' => '5.4.0',
61 61
 	)
62 62
 );
63 63
 
64
-if ( false === $this_plugin_checks->pass() ) {
64
+if (false === $this_plugin_checks->pass()) {
65 65
 	// Stop.
66 66
 	$this_plugin_checks->halt();
67 67
 	return;
68 68
 } else {
69 69
 	// Load the main class of this plugin.
70
-	require_once dirname( __FILE__ ) . '/includes/class-wp-php-console.php';
70
+	require_once dirname(__FILE__).'/includes/class-wp-php-console.php';
71 71
 	return new \WP_PHP_Console\Plugin();
72 72
 }
Please login to merge, or discard this patch.
uninstall.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
  * @package WP_PHP_Console
8 8
  */
9 9
 
10
-if ( ! defined( 'ABSPATH' ) || ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
10
+if ( ! defined('ABSPATH') || ! defined('WP_UNINSTALL_PLUGIN')) {
11 11
 	exit; 
12 12
 }
13 13
 
14
-delete_option( 'wp_php_console' );
14
+delete_option('wp_php_console');
Please login to merge, or discard this patch.
includes/class-wp-php-console.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 use PhpConsole;
12 12
 
13
-defined( 'ABSPATH' ) or exit;
13
+defined('ABSPATH') or exit;
14 14
 
15 15
 /**
16 16
  * WP PHP Console main class.
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	public function __construct() {
65 65
 
66 66
 		// Handle translations.
67
-		add_action( 'plugins_loaded', array( $this, 'set_locale' ) );
67
+		add_action('plugins_loaded', array($this, 'set_locale'));
68 68
 
69 69
 		// Set options.
70 70
 		$this->options = $this->get_options();
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
 		$this->set_admin();
74 74
 
75 75
 		// Bail out if PHP Console can't be found.
76
-		if ( ! class_exists( 'PhpConsole\Connector' ) ) {
76
+		if ( ! class_exists('PhpConsole\Connector')) {
77 77
 			return;
78 78
 		}
79 79
 
80 80
 		// Connect to PHP Console.
81
-		add_action( 'init', array( $this, 'connect' ), -100 );
81
+		add_action('init', array($this, 'connect'), -100);
82 82
 
83 83
 		// Delay further PHP Console initialisation
84 84
 		// to have more context during Remote PHP execution.
85
-		add_action( 'wp_loaded', array( $this, 'init' ), -100 );
85
+		add_action('wp_loaded', array($this, 'init'), -100);
86 86
 
87 87
 	}
88 88
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		load_plugin_textdomain(
98 98
 			'wp-php-console',
99 99
 			false,
100
-			dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
100
+			dirname(dirname(plugin_basename(__FILE__))).'/languages/'
101 101
 		);
102 102
 
103 103
 	}
@@ -110,19 +110,19 @@  discard block
 block discarded – undo
110 110
 	 */
111 111
 	private function set_admin() {
112 112
 
113
-		if ( ! defined( 'DOING_AJAX' ) && is_admin() ) {
113
+		if ( ! defined('DOING_AJAX') && is_admin()) {
114 114
 
115 115
 			// Add a settings link to the plugins admin screen.
116
-			$plugin_name = str_replace( 'includes/class-', '', plugin_basename( __FILE__ ) );
117
-			add_filter( "plugin_action_links_{$plugin_name}", function( $actions ) {
118
-				return array_merge( array(
119
-					'<a href="' . esc_url( admin_url( 'options-general.php?page=wp-php-console' ) ) . '">' . __( 'Settings', 'wp-php-console' ) . '</a>',
120
-				), $actions );
116
+			$plugin_name = str_replace('includes/class-', '', plugin_basename(__FILE__));
117
+			add_filter("plugin_action_links_{$plugin_name}", function($actions) {
118
+				return array_merge(array(
119
+					'<a href="'.esc_url(admin_url('options-general.php?page=wp-php-console')).'">'.__('Settings', 'wp-php-console').'</a>',
120
+				), $actions);
121 121
 			} );
122 122
 
123 123
 			// Init settings.
124
-			require_once __DIR__ . '/class-wp-php-console-settings.php';
125
-			new Settings( $this->options );
124
+			require_once __DIR__.'/class-wp-php-console-settings.php';
125
+			new Settings($this->options);
126 126
 		}
127 127
 
128 128
 	}
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
 		// PhpConsole needs to hook in session, in WordPress we need to be in 'init'
139 139
 		// @link http://silvermapleweb.com/using-the-php-session-in-wordpress/
140
-		if ( ! session_id() ) {
140
+		if ( ! session_id()) {
141 141
 			session_start();
142 142
 		}
143 143
 
144
-		if ( ! $this->connector instanceof PhpConsole\Connector ) {
144
+		if ( ! $this->connector instanceof PhpConsole\Connector) {
145 145
 			$this->connector = PhpConsole\Connector::getInstance();
146 146
 		}
147 147
 
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
 	 */
160 160
 	protected function get_options() {
161 161
 
162
-		$options = get_option( 'wp_php_console', array() );
162
+		$options = get_option('wp_php_console', array());
163 163
 
164
-		return wp_parse_args( $options, array(
164
+		return wp_parse_args($options, array(
165 165
 			'ip'       => '',
166 166
 			'password' => '',
167 167
 			'register' => false,
168 168
 			'short'    => false,
169 169
 			'ssl'      => false,
170 170
 			'stack'    => false,
171
-		) );
171
+		));
172 172
 	}
173 173
 
174 174
 
@@ -180,31 +180,31 @@  discard block
 block discarded – undo
180 180
 	private function apply_options() {
181 181
 
182 182
 		// Bail out if not connected yet to PHP Console.
183
-		if ( ! $this->connector instanceof PhpConsole\Connector ) {
183
+		if ( ! $this->connector instanceof PhpConsole\Connector) {
184 184
 			return;
185 185
 		}
186 186
 
187 187
 		// Apply 'register' option to PHP Console...
188
-		if ( true === $this->options['register'] && ! class_exists( 'PC', false ) ) {
188
+		if (true === $this->options['register'] && ! class_exists('PC', false)) {
189 189
 			// ...only if PC not registered yet.
190 190
 			try {
191 191
 				PhpConsole\Helper::register();
192
-			} catch( \Exception $e ) {
193
-				$this->print_notice_exception( $e );
192
+			} catch (\Exception $e) {
193
+				$this->print_notice_exception($e);
194 194
 			}
195 195
 		}
196 196
 
197 197
 		// Apply 'stack' option to PHP Console.
198
-		if ( true === $this->options['stack'] ) {
198
+		if (true === $this->options['stack']) {
199 199
 			$this->connector->getDebugDispatcher()->detectTraceAndSource = true;
200 200
 		}
201 201
 
202 202
 		// Apply 'short' option to PHP Console.
203
-		if ( true === $this->options['short'] ) {
203
+		if (true === $this->options['short']) {
204 204
 			try {
205
-				$this->connector->setSourcesBasePath( $_SERVER['DOCUMENT_ROOT'] );
206
-			} catch ( \Exception $e ) {
207
-				$this->print_notice_exception( $e );
205
+				$this->connector->setSourcesBasePath($_SERVER['DOCUMENT_ROOT']);
206
+			} catch (\Exception $e) {
207
+				$this->print_notice_exception($e);
208 208
 			}
209 209
 		}
210 210
 
@@ -221,80 +221,80 @@  discard block
 block discarded – undo
221 221
 		// Get PHP Console extension password.
222 222
 		$password = $this->options['password'];
223 223
 
224
-		if ( ! $password ) {
224
+		if ( ! $password) {
225 225
 			// Display admin notice and abort if no password has been set.
226
-			add_action( 'admin_notices', array( $this, 'password_notice' ) );
226
+			add_action('admin_notices', array($this, 'password_notice'));
227 227
 			return;
228 228
 		}
229 229
 
230 230
 		// Selectively remove slashes added by WordPress as expected by PhpConsole.
231
-		if ( array_key_exists( PhpConsole\Connector::POST_VAR_NAME, $_POST ) ) {
232
-			$_POST[ PhpConsole\Connector::POST_VAR_NAME ] = stripslashes_deep( $_POST[ PhpConsole\Connector::POST_VAR_NAME ] );
231
+		if (array_key_exists(PhpConsole\Connector::POST_VAR_NAME, $_POST)) {
232
+			$_POST[PhpConsole\Connector::POST_VAR_NAME] = stripslashes_deep($_POST[PhpConsole\Connector::POST_VAR_NAME]);
233 233
 		}
234 234
 
235 235
 		// Get PHP Console instance if wasn't set yet.
236
-		if ( ! $this->connector instanceof PhpConsole\Connector ) {
236
+		if ( ! $this->connector instanceof PhpConsole\Connector) {
237 237
 			$this->connector = PhpConsole\Connector::getInstance();
238 238
 		}
239 239
 
240 240
 		// Set PHP Console password.
241 241
 		try {
242
-			$this->connector->setPassword( $password );
243
-		} catch ( \Exception $e ) {
244
-			$this->print_notice_exception( $e );
242
+			$this->connector->setPassword($password);
243
+		} catch (\Exception $e) {
244
+			$this->print_notice_exception($e);
245 245
 		}
246 246
 
247 247
 		// Get PHP Console handler instance.
248 248
 		$handler = PhpConsole\Handler::getInstance();
249 249
 
250
-		if ( true !== PhpConsole\Handler::getInstance()->isStarted() ) {
250
+		if (true !== PhpConsole\Handler::getInstance()->isStarted()) {
251 251
 			try {
252 252
 				$handler->start();
253
-			} catch( \Exception $e ) {
254
-				$this->print_notice_exception( $e );
253
+			} catch (\Exception $e) {
254
+				$this->print_notice_exception($e);
255 255
 			}
256 256
 		}
257 257
 
258 258
 		// Enable SSL-only mode.
259
-		if ( true === $this->options['ssl'] ) {
259
+		if (true === $this->options['ssl']) {
260 260
 			$this->connector->enableSslOnlyMode();
261 261
 		}
262 262
 
263 263
 		// Restrict IP addresses.
264
-		$allowedIpMasks = ! empty( $this->options['ip'] ) ? explode( ',', $this->options['ip'] ) : '';
264
+		$allowedIpMasks = ! empty($this->options['ip']) ? explode(',', $this->options['ip']) : '';
265 265
 
266
-		if ( is_array( $allowedIpMasks ) && count( $allowedIpMasks ) > 0 ) {
267
-			$this->connector->setAllowedIpMasks( $allowedIpMasks );
266
+		if (is_array($allowedIpMasks) && count($allowedIpMasks) > 0) {
267
+			$this->connector->setAllowedIpMasks($allowedIpMasks);
268 268
 		}
269 269
 
270 270
 		$evalProvider = $this->connector->getEvalDispatcher()->getEvalProvider();
271 271
 
272 272
 		try {
273
-			$evalProvider->addSharedVar( 'uri', $_SERVER['REQUEST_URI'] );
274
-		} catch ( \Exception $e ) {
275
-			$this->print_notice_exception( $e );
273
+			$evalProvider->addSharedVar('uri', $_SERVER['REQUEST_URI']);
274
+		} catch (\Exception $e) {
275
+			$this->print_notice_exception($e);
276 276
 		}
277 277
 
278 278
 		try {
279
-			$evalProvider->addSharedVarReference( 'post', $_POST );
280
-		} catch ( \Exception $e ) {
281
-			$this->print_notice_exception( $e );
279
+			$evalProvider->addSharedVarReference('post', $_POST);
280
+		} catch (\Exception $e) {
281
+			$this->print_notice_exception($e);
282 282
 		}
283 283
 
284
-		$openBaseDirs = array( ABSPATH, get_template_directory() );
284
+		$openBaseDirs = array(ABSPATH, get_template_directory());
285 285
 
286 286
 		try {
287
-			$evalProvider->addSharedVarReference( 'dirs', $openBaseDirs );
288
-		} catch ( \Exception $e ) {
289
-			$this->print_notice_exception( $e );
287
+			$evalProvider->addSharedVarReference('dirs', $openBaseDirs);
288
+		} catch (\Exception $e) {
289
+			$this->print_notice_exception($e);
290 290
 		}
291 291
 
292
-		$evalProvider->setOpenBaseDirs( $openBaseDirs );
292
+		$evalProvider->setOpenBaseDirs($openBaseDirs);
293 293
 
294 294
 		try {
295 295
 			$this->connector->startEvalRequestsListener();
296
-		} catch ( \Exception $e ) {
297
-			$this->print_notice_exception( $e );
296
+		} catch (\Exception $e) {
297
+			$this->print_notice_exception($e);
298 298
 		}
299 299
 
300 300
 	}
@@ -306,13 +306,13 @@  discard block
 block discarded – undo
306 306
 	 * @since 1.4.0
307 307
 	 * @param \Exception $e Exception object
308 308
 	 */
309
-	public function print_notice_exception( \Exception $e ) {
309
+	public function print_notice_exception(\Exception $e) {
310 310
 
311
-		add_action( 'admin_notices', function() use ( $e ) {
311
+		add_action('admin_notices', function() use ($e) {
312 312
 
313 313
 			?>
314 314
 			<div class="error">
315
-				<p><?php printf( '%1$s: %2$s', self::NAME, $e->getMessage() ); ?></p>
315
+				<p><?php printf('%1$s: %2$s', self::NAME, $e->getMessage()); ?></p>
316 316
 			</div>
317 317
 			<?php
318 318
 
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
 		<div class="update-nag">
334 334
 			<p><?php
335 335
 			/* translators: Placeholders: %1$s - WP Php Console name, %2$s - opening HTML <a> link tag; %3$s closing HTML </a> link tag */
336
-			printf( __( '%1$s: Please remember to %2$sset a password%3$s if you want to enable the terminal.', 'wp-php-console' ),
337
-				'<strong>' . self::NAME . '</strong>',
338
-				'<a href="' . esc_url( admin_url( 'options-general.php?page=wp-php-console' ) ) .'">',
336
+			printf(__('%1$s: Please remember to %2$sset a password%3$s if you want to enable the terminal.', 'wp-php-console'),
337
+				'<strong>'.self::NAME.'</strong>',
338
+				'<a href="'.esc_url(admin_url('options-general.php?page=wp-php-console')).'">',
339 339
 				'</a>'
340 340
 			); ?>
341 341
 			</p>
Please login to merge, or discard this patch.
includes/class-wp-php-console-settings.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 namespace WP_PHP_Console;
10 10
 
11
-defined( 'ABSPATH' ) or exit;
11
+defined('ABSPATH') or exit;
12 12
 
13 13
 /**
14 14
  * WP PHP Console settings class.
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
 	 * @since 1.5.0
54 54
 	 * @param array $options Plugin settings options.
55 55
 	 */
56
-	public function __construct( array $options ) {
56
+	public function __construct(array $options) {
57 57
 
58
-		$this->page    = sanitize_title( strtolower( Plugin::NAME ) );
59
-		$this->option  = str_replace( '-', '_', $this->page );
58
+		$this->page    = sanitize_title(strtolower(Plugin::NAME));
59
+		$this->option  = str_replace('-', '_', $this->page);
60 60
 		$this->options = $options;
61 61
 
62
-		add_action( 'admin_menu', array( $this, 'register_settings_page' ) );
62
+		add_action('admin_menu', array($this, 'register_settings_page'));
63 63
 
64 64
 	}
65 65
 
@@ -72,14 +72,14 @@  discard block
 block discarded – undo
72 72
 	public function register_settings_page() {
73 73
 
74 74
 		add_options_page(
75
-			__( 'WP PHP Console', 'wp-php-console' ),
76
-			__( 'WP PHP Console', 'wp-php-console' ),
75
+			__('WP PHP Console', 'wp-php-console'),
76
+			__('WP PHP Console', 'wp-php-console'),
77 77
 			'manage_options',
78 78
 			$this->page,
79
-			array( $this, 'settings_page' )
79
+			array($this, 'settings_page')
80 80
 		);
81 81
 
82
-		add_action( 'admin_init', array( $this, 'register_settings'  ) );
82
+		add_action('admin_init', array($this, 'register_settings'));
83 83
 
84 84
 	}
85 85
 
@@ -94,46 +94,46 @@  discard block
 block discarded – undo
94 94
 		register_setting(
95 95
 			$this->option,
96 96
 			$this->option,
97
-			array( $this, 'sanitize_field' )
97
+			array($this, 'sanitize_field')
98 98
 		);
99 99
 
100 100
 		add_settings_section(
101 101
 			$this->option,
102
-			__( 'Settings', 'wp-php-console' ),
103
-			array( $this, 'settings_info' ),
102
+			__('Settings', 'wp-php-console'),
103
+			array($this, 'settings_info'),
104 104
 			$this->page
105 105
 		);
106 106
 
107 107
 		$settings_fields = array(
108 108
 			'password' => array(
109
-				 'label'    => esc_html__( 'Password',           'wp-php-console' ),
110
-				 'callback' => array( $this, 'password_field' ),
109
+				 'label'    => esc_html__('Password', 'wp-php-console'),
110
+				 'callback' => array($this, 'password_field'),
111 111
 			),
112 112
 			'ssl'      => array(
113
-				 'label'    => esc_html__( 'Allow only on SSL',  'wp-php-console' ),
114
-				 'callback' => array( $this, 'ssl_field' ),
113
+				 'label'    => esc_html__('Allow only on SSL', 'wp-php-console'),
114
+				 'callback' => array($this, 'ssl_field'),
115 115
 			),
116 116
 			'ip' => array(
117
-				 'label'    => esc_html__( 'Allowed IP Masks',   'wp-php-console' ),
118
-				 'callback' => array( $this, 'ip_field' ),
117
+				 'label'    => esc_html__('Allowed IP Masks', 'wp-php-console'),
118
+				 'callback' => array($this, 'ip_field'),
119 119
 			),
120 120
 			'register' => array(
121
-				 'label'    => esc_html__( 'Register PC Class',  'wp-php-console' ),
122
-				 'callback' => array( $this, 'register_field' ),
121
+				 'label'    => esc_html__('Register PC Class', 'wp-php-console'),
122
+				 'callback' => array($this, 'register_field'),
123 123
 			),
124 124
 			'stack'    => array(
125
-				 'label'    => esc_html__( 'Show Call Stack',    'wp-php-console' ),
126
-				 'callback' => array( $this, 'stack_field' ),
125
+				 'label'    => esc_html__('Show Call Stack', 'wp-php-console'),
126
+				 'callback' => array($this, 'stack_field'),
127 127
 			),
128 128
 			'short'    => array(
129
-				 'label'    => esc_html__( 'Short Path Names',   'wp-php-console' ),
130
-				 'callback' => array( $this, 'short_field' ),
129
+				 'label'    => esc_html__('Short Path Names', 'wp-php-console'),
130
+				 'callback' => array($this, 'short_field'),
131 131
 			),
132 132
 		);
133 133
 
134
-		foreach ( $settings_fields as $key => $field ) {
134
+		foreach ($settings_fields as $key => $field) {
135 135
 			add_settings_field(
136
-				$this->page . '['. $key . ']',
136
+				$this->page.'['.$key.']',
137 137
 				$field['label'],
138 138
 				$field['callback'],
139 139
 				$this->page,
@@ -155,31 +155,31 @@  discard block
 block discarded – undo
155 155
 		?>
156 156
 		<p><?php
157 157
 			/* translators: Placeholder: %s refers to the PHP Console library, pointing to its GitHub repository */
158
-			printf( _x( 'This plugin allows you to use %s within your WordPress installation for testing, debugging and development purposes.', 'PHP Console, the PHP Library', 'wp-php-console' ),
158
+			printf(_x('This plugin allows you to use %s within your WordPress installation for testing, debugging and development purposes.', 'PHP Console, the PHP Library', 'wp-php-console'),
159 159
 				'<a href="https://github.com/barbushin/php-console" target="_blank">PHP Console</a>'
160 160
 			); ?><br>
161
-			<?php esc_html_e( 'Usage instructions:', 'wp-php-console' ); ?>
161
+			<?php esc_html_e('Usage instructions:', 'wp-php-console'); ?>
162 162
 		</p>
163 163
 		<ol>
164 164
 			<?php
165 165
 
166 166
 			$instructions = array(
167 167
 				/* translators: Placeholder: %s represents the Google Chrome PHP Console extension download link */
168
-				sprintf( _x( 'Make sure you have downloaded and installed %s.', 'PHP Console, the Chrome Extension', 'wp-php-console' ),
168
+				sprintf(_x('Make sure you have downloaded and installed %s.', 'PHP Console, the Chrome Extension', 'wp-php-console'),
169 169
 					'<a target="_blank" href="https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef">PHP Console extension for Google Chrome</a>'
170 170
 				),
171
-				esc_html__( 'Set a password for the eval terminal in the options below and hit "Save Changes".', 'wp-php-console' ),
172
-				esc_html__( 'Reload any page of your installation and click on the key icon in your Chrome browser address bar, enter your password and access the terminal.', 'wp-php-console' ),
173
-				esc_html__( 'From the eval terminal you can execute any PHP or WordPress specific function, including functions from your plugins and active theme.', 'wp-php-console' ),
171
+				esc_html__('Set a password for the eval terminal in the options below and hit "Save Changes".', 'wp-php-console'),
172
+				esc_html__('Reload any page of your installation and click on the key icon in your Chrome browser address bar, enter your password and access the terminal.', 'wp-php-console'),
173
+				esc_html__('From the eval terminal you can execute any PHP or WordPress specific function, including functions from your plugins and active theme.', 'wp-php-console'),
174 174
 				/* translators: Placeholders: %1$s - PHP code snippet example, %2$s - Chrome javascript console shortcut */
175
-				sprintf( __( 'In your PHP code, you can call PHP Console debug statements like %1$s to display PHP variables in the browser\'s JavaScript-console (e.g. %2$s) and optionally filter selected tags through the browser\'s Remote PHP Eval Terminal screen\'s "Ignore Debug options".', 'wp-php-console' ),
175
+				sprintf(__('In your PHP code, you can call PHP Console debug statements like %1$s to display PHP variables in the browser\'s JavaScript-console (e.g. %2$s) and optionally filter selected tags through the browser\'s Remote PHP Eval Terminal screen\'s "Ignore Debug options".', 'wp-php-console'),
176 176
 					'<code>debug(&#36;var, &#36;tag)</code>',
177 177
 					'<code>CTRL+SHIFT+J</code>'
178 178
 				),
179 179
 			);
180 180
 
181
-			foreach ( $instructions as $list_item ) {
182
-				echo '<li>' . $list_item  . '</li>';
181
+			foreach ($instructions as $list_item) {
182
+				echo '<li>'.$list_item.'</li>';
183 183
 			}
184 184
 
185 185
 			?>
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 	public function password_field() {
199 199
 
200 200
 		?>
201
-		<input type="password" id="wp-php-console-password" name="wp_php_console[password]" value="<?php echo esc_attr( $this->options['password'] ); ?>">
202
-		<label for="wp-php-console-password"><?php esc_html_e( 'Required', 'wp-php-console' ); ?></label><br>
203
-		<p class="description"><?php esc_html_e( 'The password for the eval terminal. If empty, the plugin will not work.', 'wp-php-console' ); ?></p>
201
+		<input type="password" id="wp-php-console-password" name="wp_php_console[password]" value="<?php echo esc_attr($this->options['password']); ?>">
202
+		<label for="wp-php-console-password"><?php esc_html_e('Required', 'wp-php-console'); ?></label><br>
203
+		<p class="description"><?php esc_html_e('The password for the eval terminal. If empty, the plugin will not work.', 'wp-php-console'); ?></p>
204 204
 		<?php
205 205
 
206 206
 	}
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
 	public function ssl_field() {
215 215
 
216 216
 		?>
217
-		<input type="checkbox" id="wp-php-console-ssl" name="wp_php_console[ssl]" value="1" <?php checked( (bool) $this->options['ssl'] ); ?> />
218
-		<label for="wp-php-console-ssl"><?php esc_html_e( 'Yes', 'wp-php-console' ); ?></label><br>
219
-		<p class="description"><?php esc_html_e( 'Tick this option if you want the eval terminal to work only on a SSL connection.', 'wp-php-console' ); ?></p>
217
+		<input type="checkbox" id="wp-php-console-ssl" name="wp_php_console[ssl]" value="1" <?php checked((bool) $this->options['ssl']); ?> />
218
+		<label for="wp-php-console-ssl"><?php esc_html_e('Yes', 'wp-php-console'); ?></label><br>
219
+		<p class="description"><?php esc_html_e('Tick this option if you want the eval terminal to work only on a SSL connection.', 'wp-php-console'); ?></p>
220 220
 		<?php
221 221
 
222 222
 	}
@@ -230,19 +230,19 @@  discard block
 block discarded – undo
230 230
 	public function ip_field() {
231 231
 
232 232
 		?>
233
-		<input type="text" class="regular-text" id="wp-php-console-ip" name="wp_php_console[ip]" value="<?php echo esc_attr( $this->options['ip'] ); ?>" />
234
-		<label for="wp-php-console-ip"><?php esc_html_e( 'IP addresses (optional)', 'wp-php-console' ); ?></label><br>
235
-		<p class="description"><?php esc_html_e( 'You may specify any of the following, to give access to specific IPs to the eval terminal:', 'wp-php-console' ); ?><br>
233
+		<input type="text" class="regular-text" id="wp-php-console-ip" name="wp_php_console[ip]" value="<?php echo esc_attr($this->options['ip']); ?>" />
234
+		<label for="wp-php-console-ip"><?php esc_html_e('IP addresses (optional)', 'wp-php-console'); ?></label><br>
235
+		<p class="description"><?php esc_html_e('You may specify any of the following, to give access to specific IPs to the eval terminal:', 'wp-php-console'); ?><br>
236 236
 			<ol>
237 237
 				<li><small><?php
238 238
 					/* translators: Placeholders: %1$s - a single IP address, %2$s link to Varying Vagrant Vagrants project repository */
239
-					printf( __( 'An IP address (for example %1$s, %2$s default IP address).', 'wp-php-console' ),
239
+					printf(__('An IP address (for example %1$s, %2$s default IP address).', 'wp-php-console'),
240 240
 						'<code>192.168.50.4</code>',
241 241
 						'<a href="https://github.com/Varying-Vagrant-Vagrants/VVV">Varying Vagrant Vagrants</a>'
242 242
 					); ?></small></li>
243 243
 				<li><small><?php
244 244
 					/* translators: Placeholders: %1$s a range of IP addresses, %2$s - comma separated IP addresses */
245
-					printf( __( 'A range of addresses (%1$s) or multiple addresses, comma separated (%2$s).', 'wp-php-console' ),
245
+					printf(__('A range of addresses (%1$s) or multiple addresses, comma separated (%2$s).', 'wp-php-console'),
246 246
 						'<code>192.168.*.*</code>',
247 247
 						'<code>192.168.10.25,192.168.10.28</code>'
248 248
 					); ?></small></li>
@@ -261,13 +261,13 @@  discard block
 block discarded – undo
261 261
 	public function register_field() {
262 262
 
263 263
 		?>
264
-		<input type="checkbox" id="wp-php-console-register" name="wp_php_console[register]" value="1" <?php checked( (bool) $this->options['register'] ); ?> />
265
-		<label for="wp-php-console-register"><?php esc_html_e( 'Yes', 'wp-php-console' ); ?></label><br>
264
+		<input type="checkbox" id="wp-php-console-register" name="wp_php_console[register]" value="1" <?php checked((bool) $this->options['register']); ?> />
265
+		<label for="wp-php-console-register"><?php esc_html_e('Yes', 'wp-php-console'); ?></label><br>
266 266
 		<p class="description"><?php
267
-			esc_html_e( 'Tick to register PC class in the global namespace.', 'wp-php-console' );
267
+			esc_html_e('Tick to register PC class in the global namespace.', 'wp-php-console');
268 268
 			echo '<br>';
269 269
 			/* translators: Placeholders: %1$s, %2$s and %3$s are PHP code snippets examples */
270
-			printf( __( 'Allows to write %1$s or %2$s instructions in PHP to inspect %3$s in the JavaScript console.', 'wp-php-console' ),
270
+			printf(__('Allows to write %1$s or %2$s instructions in PHP to inspect %3$s in the JavaScript console.', 'wp-php-console'),
271 271
 				'<code>PC::debug(&#36;var, &#36;tag)</code>',
272 272
 				'<code>PC::magic_tag(&#36;var)</code>',
273 273
 				'<code>&#36;var</code>'
@@ -285,9 +285,9 @@  discard block
 block discarded – undo
285 285
 	public function stack_field() {
286 286
 
287 287
 		?>
288
-		<input type="checkbox" id="wp-php-console-stack" name="wp_php_console[stack]" value="1" <?php checked( (bool) $this->options['stack'] ); ?> />
289
-		<label for="wp-php-console-stack"><?php esc_html_e( 'Yes', 'wp-php-console' ); ?></label><br />
290
-		<p class="description"><?php esc_html_e( 'Tick to see the full call stack when PHP Console writes to the browser JavaScript console.', 'wp-php-console' ); ?></p>
288
+		<input type="checkbox" id="wp-php-console-stack" name="wp_php_console[stack]" value="1" <?php checked((bool) $this->options['stack']); ?> />
289
+		<label for="wp-php-console-stack"><?php esc_html_e('Yes', 'wp-php-console'); ?></label><br />
290
+		<p class="description"><?php esc_html_e('Tick to see the full call stack when PHP Console writes to the browser JavaScript console.', 'wp-php-console'); ?></p>
291 291
 		<?php
292 292
 
293 293
 	}
@@ -301,13 +301,13 @@  discard block
 block discarded – undo
301 301
 	public function short_field() {
302 302
 
303 303
 		?>
304
-		<input type="checkbox" id="wp-php-console-short" name="wp_php_console[short]" value="1" <?php checked( (bool) $this->options['short'] ); ?> />
305
-		<label for="wp-php-console-short"><?php esc_html_e( 'Yes', 'wp-php-console' ); ?></label><br>
304
+		<input type="checkbox" id="wp-php-console-short" name="wp_php_console[short]" value="1" <?php checked((bool) $this->options['short']); ?> />
305
+		<label for="wp-php-console-short"><?php esc_html_e('Yes', 'wp-php-console'); ?></label><br>
306 306
 		<p class="description"><?php
307
-			esc_html_e( 'Tick to shorten the length of PHP Console error sources and traces paths in browser JavaScript console for better readability.', 'wp-php-console' );
307
+			esc_html_e('Tick to shorten the length of PHP Console error sources and traces paths in browser JavaScript console for better readability.', 'wp-php-console');
308 308
 			echo '<br>';
309 309
 			/* translators: Placeholders: %1$s - long server path, %2$s - shortened server path */
310
-			printf( __( 'Paths like %1$s will be displayed as %2$s', 'wp-php-console' ),
310
+			printf(__('Paths like %1$s will be displayed as %2$s', 'wp-php-console'),
311 311
 				'<code>/server/path/to/document/root/WP/wp-admin/admin.php:31</code>',
312 312
 				'<code>/WP/wp-admin/admin.php:31</code>'
313 313
 			); ?></p>
@@ -323,24 +323,24 @@  discard block
 block discarded – undo
323 323
 	 * @param  array $option user input
324 324
 	 * @return array sanitized input
325 325
 	 */
326
-	public function sanitize_field( $option ) {
326
+	public function sanitize_field($option) {
327 327
 
328
-		$input = wp_parse_args( $option, array(
328
+		$input = wp_parse_args($option, array(
329 329
 			'ip'       => '',
330 330
 			'password' => '',
331 331
 			'register' => false,
332 332
 			'short'    => false,
333 333
 			'ssl'      => false,
334 334
 			'stack'    => false,
335
-		) );
335
+		));
336 336
 
337 337
 		$sanitized_input = array(
338
-			'ip'       => sanitize_text_field( $input['ip'] ),
339
-			'password' => sanitize_text_field( $input['password'] ),
340
-			'register' => ! empty( $input['register'] ),
341
-			'short'    => ! empty( $input['short'] ),
342
-			'ssl'      => ! empty( $input['ssl'] ),
343
-			'stack'    => ! empty( $input['stack'] ),
338
+			'ip'       => sanitize_text_field($input['ip']),
339
+			'password' => sanitize_text_field($input['password']),
340
+			'register' => ! empty($input['register']),
341
+			'short'    => ! empty($input['short']),
342
+			'ssl'      => ! empty($input['ssl']),
343
+			'stack'    => ! empty($input['stack']),
344 344
 		);
345 345
 
346 346
 		return $sanitized_input;
@@ -356,14 +356,14 @@  discard block
 block discarded – undo
356 356
 
357 357
 		?>
358 358
 		<div class="wrap">
359
-			<h2><?php esc_html_e( 'WP PHP Console', 'wp-php-console' ); ?></h2>
359
+			<h2><?php esc_html_e('WP PHP Console', 'wp-php-console'); ?></h2>
360 360
 			<hr />
361 361
 			<form method="post" action="options.php">
362 362
 				<?php
363 363
 
364
-				settings_fields( $this->option );
364
+				settings_fields($this->option);
365 365
 
366
-				do_settings_sections( $this->page );
366
+				do_settings_sections($this->page);
367 367
 
368 368
 				submit_button();
369 369
 
Please login to merge, or discard this patch.
tests/_support/WpunitTester.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 */
19 19
 class WpunitTester extends \Codeception\Actor
20 20
 {
21
-    use _generated\WpunitTesterActions;
21
+	use _generated\WpunitTesterActions;
22 22
 
23 23
    /**
24 24
     * Define custom actions here
Please login to merge, or discard this patch.
tests/_support/UnitTester.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 */
19 19
 class UnitTester extends \Codeception\Actor
20 20
 {
21
-    use _generated\UnitTesterActions;
21
+	use _generated\UnitTesterActions;
22 22
 
23 23
    /**
24 24
     * Define custom actions here
Please login to merge, or discard this patch.
tests/_support/AcceptanceTester.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 */
19 19
 class AcceptanceTester extends \Codeception\Actor
20 20
 {
21
-    use _generated\AcceptanceTesterActions;
21
+	use _generated\AcceptanceTesterActions;
22 22
 
23 23
    /**
24 24
     * Define custom actions here
Please login to merge, or discard this patch.
tests/_support/FunctionalTester.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 */
19 19
 class FunctionalTester extends \Codeception\Actor
20 20
 {
21
-    use _generated\FunctionalTesterActions;
21
+	use _generated\FunctionalTesterActions;
22 22
 
23 23
    /**
24 24
     * Define custom actions here
Please login to merge, or discard this patch.
tests/acceptance/AdminTestCest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-class AdminTestCest  {
3
+class AdminTestCest {
4 4
 
5 5
 
6
-	public function TestPluginActivationDeactivation( AcceptanceTester $I ) {
6
+	public function TestPluginActivationDeactivation(AcceptanceTester $I) {
7 7
 
8
-		$I->wantTo( 'See if WP PHP Console is listed in the Plugins page.' );
8
+		$I->wantTo('See if WP PHP Console is listed in the Plugins page.');
9 9
 
10 10
 		$I->loginAsAdmin();
11 11
 		$I->amOnPluginsPage();
12 12
 
13
-		$I->seePluginInstalled( 'wp-php-console' );
13
+		$I->seePluginInstalled('wp-php-console');
14 14
 
15
-		$I->wantTo( 'Deactivate and reactivate WP PHP Console.' );
15
+		$I->wantTo('Deactivate and reactivate WP PHP Console.');
16 16
 
17
-		$I->deactivatePlugin( 'wp-php-console' );
18
-		$I->seePluginDeactivated( 'wp-php-console' );
19
-		$I->activatePlugin( 'wp-php-console' );
20
-		$I->seePluginActivated( 'wp-php-console' );
17
+		$I->deactivatePlugin('wp-php-console');
18
+		$I->seePluginDeactivated('wp-php-console');
19
+		$I->activatePlugin('wp-php-console');
20
+		$I->seePluginActivated('wp-php-console');
21 21
 	}
22 22
 
23 23
 
Please login to merge, or discard this patch.