Skip to content

Commit c06fbc6

Browse files
committed
bump to 1.3.8, internal changes
1 parent f11b17d commit c06fbc6

File tree

10 files changed

+304
-28
lines changed

10 files changed

+304
-28
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ ehthumbs.db
4242
*.Trashes
4343
us.stackdump
4444

45-
### Subversion ###
46-
.svn
47-
/svn
45+
### Builds ###
46+
svn/
47+
release/

ChangeLog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Changelog
22

3+
### 1.3.8 (14 jul 2015)
4+
* Internal changes (alternate PHP version check, automated SVN deploys)
5+
36
### 1.3.7 (09 jul 2015)
47
* Fixes a bug `Cannot send session cache limiter - headers already sent`
58
* Updated PHP Console Library to 3.1.4
69

710
### 1.3.5 (10 jun 2015)
8-
* Updated PHP Console library to 3.1.3
911
* PHP 5.4.0 is the minimum required version to activate the plugin
12+
* Updated PHP Console library to 3.1.3
1013

1114
### 1.3.3 (30 apr 2015)
1215
* Supports WordPress 4.2

Gruntfile.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
module.exports = function( grunt ) {
2+
3+
var pkg = grunt.file.readJSON( 'package.json' ),
4+
distFiles = [
5+
'**',
6+
'!assets/**',
7+
'!node_modules/**',
8+
'!svn/**',
9+
'!tests/**',
10+
'!**/.*',
11+
'!bootstrap.php',
12+
'!bootstrap.php.dist',
13+
'!ChangeLog.md',
14+
'!composer.json',
15+
'!composer.lock',
16+
'!Gruntfile.js',
17+
'!package.json',
18+
'!phpunit.xml',
19+
'!phpunit.xml.dist',
20+
'!README.md'
21+
];
22+
23+
// Project configuration
24+
grunt.initConfig( {
25+
26+
pkg: pkg,
27+
28+
clean: {
29+
main: [
30+
// Clean directories before new build
31+
'svn/trunk',
32+
'release'
33+
]
34+
},
35+
36+
// Copy the plugin to a svn versioned build directory
37+
copy: {
38+
assets : {
39+
expand: true,
40+
src: 'assets/*.*',
41+
dest: 'svn/assets/'
42+
},
43+
tag: {
44+
expand: true,
45+
src: distFiles,
46+
dest: 'svn/tags/' + pkg.version + '/'
47+
},
48+
trunk: {
49+
expand: true,
50+
src: distFiles,
51+
dest: 'svn/trunk'
52+
}
53+
},
54+
55+
compress: {
56+
main: {
57+
options: {
58+
mode: 'zip',
59+
archive: './release/wp-php-console.<%= pkg.version %>.zip'
60+
},
61+
expand: true,
62+
src: distFiles,
63+
dest: '/wp-php-console/'
64+
}
65+
},
66+
67+
wp_deploy: {
68+
deploy: {
69+
options: {
70+
plugin_slug: 'wp-php-console',
71+
svn_user: 'nekojira',
72+
build_dir: 'svn',
73+
assets_dir: 'assets'
74+
}
75+
}
76+
},
77+
78+
} );
79+
80+
// Load tasks
81+
require('load-grunt-tasks')(grunt);
82+
83+
// Register tasks
84+
85+
grunt.registerTask( 'release', ['clean', 'copy:trunk', 'copy:tag', 'compress'] );
86+
87+
grunt.registerTask( 'deploy', ['release', 'wp_deploy'] );
88+
89+
grunt.util.linefeed = '\n';
90+
};

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This implementation of PHP Console makes easy to debug a WordPress installation
1616

1717
## Installation
1818

19+
Note: you will need PHP 5.4.0 minimum version on your machine or server to run this plugin.
20+
1921
1. First, install [Google Chrome extension PHP Console](https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef) from the [Chrome WebStore](https://chrome.google.com/webstore/search/php%20console?_category=extensions).
2022
Make sure the PHP Console Chrome extension is enabled through [chrome://extensions/](chrome://extensions/ "chrome://extensions/").
2123

README.txt

Lines changed: 7 additions & 2 deletions
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.6.0
66
Tested up to: 4.2.2
7-
Stable tag: 1.3.7
7+
Stable tag: 1.3.8
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -17,6 +17,8 @@ Use Chrome Dev Tools to debug your WordPress installation!
1717

1818
This implementation of PHP Console offers yet another tool to make it more easy to test on the fly any WordPress specific function or class (including those introduced by your active theme and plugins!) from a terminal and inspect results, catch errors and warnings with call stack trace straight from the Chrome JavaScript console. In other words, besides debugging, you can execute PHP or WordPress-specific PHP code straight from the terminal and print PHP variables in Chrome Dev Tools JavaScript console as if it were Javascript. It's very handy to keep everything in one place.
1919

20+
Note: PHP 5.4.0 minimum version is required your machine to use this plugin.
21+
2022
For support and pull requests, please refer to [WP PHP Console Github repo](https://github.com/nekojira/wp-php-console) and read the instructions there - thank you.
2123

2224

@@ -121,13 +123,16 @@ None yet.
121123

122124
== Changelog ==
123125

126+
= 1.3.8 =
127+
* Internal changes (alternate PHP version check, automated SVN deploys)
128+
124129
= 1.3.7 =
125130
* Fixes a bug `Cannot send session cache limiter - headers already sent`
126131
* Updated PHP Console Library to 3.1.4
127132

128133
= 1.3.5 =
129-
* Updated PHP Console library to 3.1.3
130134
* Made PHP 5.4.0 the minimum required version to activate the plugin
135+
* Updated PHP Console library to 3.1.3
131136

132137
= 1.3.3 =
133138
* Supports WordPress 4.2

composer.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
"name": "nekojira/wp-php-console",
33
"description": "A WordPress implementation of PHP Console.",
44
"type": "wordpress-plugin",
5-
"version": "1.3.7",
6-
"keywords": [
7-
"wordpress",
8-
"debug",
9-
"debugging",
10-
"development",
11-
"php-console"
12-
],
5+
"version": "1.3.8",
6+
"keywords": ["wordpress", "debug", "debugging", "development", "php-console", "console", "terminal", "command-line", "cli" ],
137
"homepage": "https://github.com/nekojira/wp-php-console",
148
"license": "GPLv2.0+",
159
"authors": [
@@ -21,7 +15,7 @@
2115
}
2216
],
2317
"require": {
24-
"php": ">=5.3.2",
18+
"php": ">=5.4.0",
2519
"composer/installers": "v1.0.19",
2620
"php-console/php-console": "~3.1"
2721
}

lib/class-wp-php-console.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class WP_PHP_Console {
5555
public function __construct() {
5656

5757
$this->plugin_name = 'wp-php-console';
58-
$this->version = '1.3.7';
58+
$this->version = '1.3.8';
5959
$this->options = get_option( 'wp_php_console' );
6060

6161
if ( ! class_exists( 'PhpConsole\Connector' ) ) {

lib/class-wp-requirements.php

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?php
2+
/**
3+
* WP Requirements
4+
*
5+
* Utility to check current PHP version, WordPress version and PHP extensions.
6+
*
7+
* @package WP_Requirements
8+
* @version 1.0.0
9+
* @author Fulvio Notarstefano <[email protected]>
10+
* @link https://github.com/nekojira/wp-requirements
11+
* @license GPL2+
12+
*/
13+
14+
if ( ! class_exists( 'WP_Requirements' ) ) {
15+
16+
class WP_Requirements {
17+
18+
/**
19+
* WordPress.
20+
*
21+
* @access private
22+
* @var bool
23+
*/
24+
private $wp = true;
25+
26+
/**
27+
* PHP.
28+
*
29+
* @access private
30+
* @var bool
31+
*/
32+
private $php = true;
33+
34+
/**
35+
* PHP Extensions.
36+
*
37+
* @access private
38+
* @var bool
39+
*/
40+
private $ext = true;
41+
42+
/**
43+
* Errors.
44+
*
45+
* An array of errors to display if any of the checks do not pass.
46+
*
47+
* @access private
48+
* @var array
49+
*/
50+
private $errors = array();
51+
52+
/**
53+
* Constructor.
54+
*
55+
* @param array $requirements Associative array with required things.
56+
* @param array $messages Associative array with messages to display (optional, to override default ones).
57+
*/
58+
public function __construct( $requirements, $messages = array() ) {
59+
60+
if ( $requirements && is_array( $requirements ) ) {
61+
62+
$errors = array();
63+
$requirements = array_merge( array( 'wp' => '', 'php' => '', 'extensions' => '' ), (array) $requirements );
64+
65+
// Check for WordPress version.
66+
if ( $requirements['wp'] && is_string( $requirements['wp'] ) ) {
67+
68+
global $wp_version;
69+
// If $wp_version isn't found or valid probably you are not running WordPress (properly)?
70+
$wp_ver = $wp_version && is_string( $wp_version ) ? $wp_version : $requirements['wp'];
71+
$wp_ver = version_compare( $wp_ver, $requirements['wp'] );
72+
73+
if ( $wp_ver === -1 ) {
74+
if ( isset( $messages['wp'] ) ) {
75+
$errors[] = $messages['wp'];
76+
} else {
77+
$errors[] = sprintf( 'The minimum WordPress version required is %1$s, WordPress version found: %2$s', '`' . $requirements['wp'] . '`', '`' . $wp_version . '`' );
78+
}
79+
$this->wp = false;
80+
}
81+
82+
}
83+
84+
// Check fo PHP version.
85+
if ( $requirements['php'] && is_string( $requirements['php'] ) ) {
86+
87+
$php_ver = version_compare( PHP_VERSION, $requirements['php'] );
88+
89+
if ( $php_ver === -1 ) {
90+
if ( isset( $messages['wp'] ) ) {
91+
$errors[] = $messages['wp'];
92+
} else {
93+
$errors[] = sprintf( 'The minimum PHP version required is %1$s, PHP version found: %2$s', '`' . $requirements['php'], '`' . PHP_VERSION . '``' );
94+
}
95+
$this->php = false;
96+
}
97+
98+
}
99+
100+
// Check fo PHP Extensions.
101+
if ( $requirements['extensions'] && is_array( $requirements['extensions'] ) ) {
102+
$extensions = array();
103+
foreach ( $requirements['extensions'] as $extension ) {
104+
if ( $extension && is_string( $extension ) ) {
105+
$extensions[ $extension ] = extension_loaded( $extension );
106+
}
107+
}
108+
if ( in_array( false, $extensions ) ) {
109+
foreach ( $extensions as $extension ) {
110+
if ( $extension === false ) {
111+
if ( isset( $messages[ $extension ] ) ) {
112+
$errors[] = $messages[ $extension ];
113+
} else {
114+
$errors[] = sprintf( 'The PHP extension %s is required and was not found', '`' . $extension . '`' );
115+
}
116+
}
117+
}
118+
$this->ext = false;
119+
}
120+
}
121+
122+
$this->errors = $errors;
123+
124+
} else {
125+
trigger_error( 'WP Requirements: the requirements passed as argument are invalid.', E_USER_ERROR );
126+
}
127+
128+
}
129+
130+
/**
131+
* Get errors.
132+
*
133+
* @return array
134+
*/
135+
public function errors() {
136+
return $this->errors;
137+
}
138+
139+
/**
140+
* Check if versions check pass.
141+
*
142+
* @return bool
143+
*/
144+
public function pass() {
145+
if ( in_array( false, array( $this->wp, $this->php, $this->ext ) ) ) {
146+
return false;
147+
}
148+
return true;
149+
}
150+
151+
}
152+
153+
}

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "wp-php-console",
3+
"title": "WP PHP Console",
4+
"description": "An implementation of PHP Console as a WordPress plugin. Use Chrome Dev Tools to debug your WordPress installation!",
5+
"version": "1.3.8",
6+
"homepage": "https://wordpress.org/plugins/wp-php-console/",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/nekojira/wp-php-console"
10+
},
11+
"devDependencies": {
12+
"grunt": "^0.4.5",
13+
"grunt-contrib-clean": "^0.6.0",
14+
"grunt-contrib-compress": "^0.13.0",
15+
"grunt-contrib-copy": "^0.8.0",
16+
"grunt-phpunit": "^0.3.6",
17+
"grunt-wp-deploy": "^1.0.3",
18+
"load-grunt-tasks": "^3.2.0"
19+
},
20+
"keywords": ["wordpress", "debug", "debugging", "development", "php-console", "console", "terminal", "command-line", "cli" ]
21+
}

0 commit comments

Comments
 (0)