Skip to content

Commit 69f8576

Browse files
author
nekorjira
committed
updated dependencies, removed submodules
1 parent 3ecd46a commit 69f8576

File tree

174 files changed

+9840
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+9840
-24
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### 1.2.0 (11 dec 2014)
2+
* Updated dependencies and got rid of git submodules.
3+
14
### 1.1.0 (07 nov 2014)
25
* Added donation link/button.
36
* PHP Console server is now instantiated later, allowing to catch all your theme functions too.

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
This is an implementation of **[PHP Console](https://github.com/barbushin/php-console)** as a [WordPress](http://www.wordpress.org) plugin.
44

5-
65
> PHP Console allows you to handle PHP errors & exceptions, dump variables, execute PHP code remotely and many other things using [Google Chrome PHP Console extension](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef) and [PhpConsole server library](https://github.com/barbushin/php-console).
76
87
This implementation for WordPress allows you to test any WordPress specific function or class (including those introduced by your active theme and plugins!) from PHP Console terminal and inspect results, catch error and warnings with stack trace straight from Chrome Dev Tools console.
@@ -14,23 +13,23 @@ Follow these steps:
1413

1514
1. First, install **[PHP Console for Google Chrome](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef)**.
1615

17-
2. Then, add this plugin to your WordPress installation (by placing it into your `wp-content/plugins/` directory). **Note:** If you are cloning or manually downloading this git repo from GitHub, make sure to init PHP Console git submodule (i.e. `lib\php-console` directory should not be empty - this step is not necessary if you happen to download this plugin from WordPress.org).
16+
2. Then, add this plugin to your WordPress installation (by placing it into your `wp-content/plugins/` directory or corresponding plugins directory in your installation).
1817

19-
3. Once installed, activate WP PHP Console from WordPress plugins dashboard page; then go to `PHP Console` settings page from the `Settings` menu. From here you need to enter a password for the eval terminal (required, otherwise the eval terminal simply won't work).
18+
3. Once installed, activate WP PHP Console from WordPress plugins dashboard page as you would do with any other plugin; then go to `PHP Console` settings page from the `Settings` menu. From here you need to enter a password for the eval terminal (required, otherwise the eval terminal simply won't work). You can also set other options.
2019

2120
### Options
2221

23-
In WP PHP Console settings page, you can also tick a checkbox to use the terminal only on a SSL connection (of course then if you don't have SSL the terminal simply won't work). You can also specify IP addresses to restrict the accessibility to the eval terminal (a single address eg. `192.168.0.4`; or an address mask eg. `192.168.*.*` or multiple IPs, comma separated `192.168.1.22,192.168.1.24,192.168.3.*`).
22+
In WP PHP Console settings page, you can tick a checkbox to use the terminal only on a SSL connection (of course then if you don't actually have SSL, PHP Console simply won't work). You can also specify IP addresses to restrict the accessibility to the eval terminal (a single address eg. `192.168.0.4`; or an address mask eg. `192.168.*.*` or multiple IPs, comma separated `192.168.1.22,192.168.1.24,192.168.3.*`). In case of having issues in connecting with the PHP terminal, try entering a generic wildcard `*` in this field.
2423

2524

2625
## Usage
2726

28-
Once you have set up a password, you can navigate any of your WordPress page (including WordPress admin) and try the console. You will se a "key" icon in your browser address bar. By clicking on it, it will prompt for the password you have set just before. After entering the correct password, you can use the eval terminal and run any PHP code from it, including WordPress own functions. Furthermore, in Chrome Dev Tools console you will also see printed any PHP errors, warnings, notices with stack trace, which will be useful to debug your plugin or theme.
27+
Once you have set up a password, you can navigate any of your WordPress page (including WordPress admin dashboard pages) and try the console. You will se a "key" icon in your browser address bar. By clicking on it, it will prompt for the password you have set just before. After entering the correct password, you can use the eval terminal and run any PHP code from it, including WordPress own functions. Furthermore, in Chrome Dev Tools console you will also see printed any PHP errors, warnings, notices with stack trace, which will be useful to debug your plugin or theme.
2928

3029
### Caveats
3130

32-
You should not use this plugin or PHP Console library in a production environment, rather a development/testing environment. You will otherwise add more load to your server and even put your site at risk since you're exposing PHP code publicly.
31+
You should NOT use this plugin or PHP Console library in a production environment, rather a development/testing environment. You will otherwise add more load to your server and even put your site at risk since you're exposing PHP code publicly.
3332

3433
### Browser support
3534

36-
Currently PHP Console only supports Google Chrome browser. If you're using for example Firefox or Opera this plugin won't be of much use to you at the moment.
35+
Currently PHP Console only supports Google Chrome browser. If you're using, developing or testing with Firefox or Opera this plugin won't be of much use to you at the moment.

README.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
44
Tags: development, debug, debugging
55
Requires at least: 3.0.1
66
Tested up to: 4.0
7-
Stable tag: 1.1.0
7+
Stable tag: 1.2.0
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -50,6 +50,9 @@ No it doesn't, unless PHP Console is ported as a Firefox add-on for example.
5050

5151
== Changelog ==
5252

53+
= 1.2.0 =
54+
* Updated dependencies
55+
5356
= 1.1.0 =
5457
* Added donation link/button.
5558
* PHP Console server is now instantiated later, allowing to catch all your theme functions too.

composer.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
{
2-
"name": "nekojira/wp-php-console",
2+
"name": "wp-php-console",
33
"description": "A WordPress implementation of PHP Console.",
4-
"version": "1.1.0",
5-
"type": "wordpress-plugin",
4+
"version": "1.2.0",
65
"keywords": [
76
"wordpress",
87
"debug",
98
"debugging",
10-
"development"
9+
"development",
10+
"php-console"
1111
],
1212
"homepage": "https://github.com/nekojira/wp-php-console",
13-
"license": "GPLv2 or later"
13+
"license": "GPLv2 or later",
14+
"type": "wordpress-plugin",
15+
"require": {
16+
"php": ">=5.3.2",
17+
"composer/installers": "v1.0.19",
18+
"php-console/php-console": "~3.1"
19+
}
1420
}

composer.lock

Lines changed: 166 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/class-wp-php-console.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* WP PHP Console Plugin Core Class
55
*
6-
* @link https://github.com/wp-php-console
6+
* @link https://github.com/nekojira/wp-php-console
77
* @since 1.0.0
88
*
99
* @package WP_PHP_Console
@@ -37,6 +37,14 @@ class WP_PHP_Console {
3737
*/
3838
protected $version;
3939

40+
/**
41+
* Options.
42+
*
43+
* @since 1.0.0
44+
* @access protected
45+
*/
46+
protected $options;
47+
4048
/**
4149
* Construct.
4250
*
@@ -46,6 +54,7 @@ public function __construct() {
4654

4755
$this->plugin_name = 'wp-php-console';
4856
$this->version = '1.1.0';
57+
$this->options = get_option( 'wp-php-console' );
4958

5059
add_action( 'plugins_loaded', array( $this, 'set_locale' ) );
5160
add_action( 'admin_menu', array( $this, 'register_settings_page' ) );
@@ -256,6 +265,9 @@ public function settings_info() {
256265
*/
257266
public function init() {
258267

268+
if ( ! class_exists( 'PhpConsole\Connector' ) )
269+
return;
270+
259271
$options = get_option( 'wp_php_console' );
260272

261273
$password = isset( $options['password'] ) ? $options['password'] : '';
@@ -269,12 +281,12 @@ public function init() {
269281
if ( PhpConsole\Handler::getInstance()->isStarted() != true )
270282
$handler->start();
271283

272-
$enableSslOnlyMode = isset( $options['ssl'] ) ? $options['ssl'] : '';
284+
$enableSslOnlyMode = isset( $options['ssl'] ) ? ( ! empty( $options['ssl'] ) ? $options['ssl'] : '' ) : '';
273285
if ( $enableSslOnlyMode == true )
274286
$connector->enableSslOnlyMode();
275287

276-
$allowedIpMasks = isset( $options['ip'] ) ? explode( ',', $options['ip'] ) : '';
277-
if ( $allowedIpMasks )
288+
$allowedIpMasks = isset( $options['ip'] ) ? ( ! empty( $options['ip'] ) ? implode( ',', $options['ip'] ) : '' ) : '';
289+
if ( ! is_array( $allowedIpMasks ) && ! empty( $allowedIpMasks ) )
278290
$connector->setAllowedIpMasks( (array) $allowedIpMasks );
279291

280292
$evalProvider = $connector->getEvalDispatcher()->getEvalProvider();

lib/php-console

Lines changed: 0 additions & 1 deletion
This file was deleted.

vendor/autoload.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
// autoload.php @generated by Composer
4+
5+
require_once __DIR__ . '/composer' . '/autoload_real.php';
6+
7+
return ComposerAutoloaderInit2c64d051d18a1b25d2d528d8981e0274::getLoader();

0 commit comments

Comments
 (0)