Version Description
Improved scanner performance (props askapache). Fixed a CSS conflict in overlays
Download this release
Release Info
Developer | StarfieldTech |
Plugin | P3 (Plugin Performance Profiler) |
Version | 1.5.3 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.5.3
- build.bat +13 -0
- classes/class.p3-profiler-plugin.php +1 -1
- classes/class.p3-profiler.php +29 -20
- css/p3.css +5 -5
- p3-profiler.php +5 -5
- readme.txt +10 -3
build.bat
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
'-- Remove the existing zip
|
2 |
+
del p3-profiler.zip
|
3 |
+
|
4 |
+
'-- Make a temp copy
|
5 |
+
cd ..
|
6 |
+
rmdir /S /Q .\p3-profiler
|
7 |
+
xcopy /S .\profiler-plugin .\p3-profiler\
|
8 |
+
|
9 |
+
'-- Zip it
|
10 |
+
"c:\Program Files (x86)\7-Zip\7z.exe" a -r -tzip -y -xr!?svn\* -x!.svn .\profiler-plugin\p3-profiler.zip -x!build.bat p3-profiler\*
|
11 |
+
|
12 |
+
'-- Clean up
|
13 |
+
rmdir /S /Q .\p3-profiler
|
classes/class.p3-profiler-plugin.php
CHANGED
@@ -46,7 +46,7 @@ class P3_Profiler_Plugin {
|
|
46 |
// Version check, only 3.3+
|
47 |
if ( ! version_compare( $wp_version, '3.3', '>=' ) ) {
|
48 |
if ( function_exists( 'deactivate_plugins' ) )
|
49 |
-
deactivate_plugins(
|
50 |
die( '<strong>P3</strong> requires WordPress 3.3 or later' );
|
51 |
}
|
52 |
|
46 |
// Version check, only 3.3+
|
47 |
if ( ! version_compare( $wp_version, '3.3', '>=' ) ) {
|
48 |
if ( function_exists( 'deactivate_plugins' ) )
|
49 |
+
deactivate_plugins( P3_PATH . DIRECTORY_SEPARATOR . 'p3-profiler.php' );
|
50 |
die( '<strong>P3</strong> requires WordPress 3.3 or later' );
|
51 |
}
|
52 |
|
classes/class.p3-profiler.php
CHANGED
@@ -92,13 +92,13 @@ class P3_Profiler {
|
|
92 |
* @var array
|
93 |
*/
|
94 |
private $_debug_entry = array();
|
95 |
-
|
96 |
/**
|
97 |
* Last stack should be marked as plugin time
|
98 |
* @const
|
99 |
*/
|
100 |
const CATEGORY_PLUGIN = 1;
|
101 |
-
|
102 |
/**
|
103 |
* Last stack should be marked as theme time
|
104 |
* @const
|
@@ -121,7 +121,7 @@ class P3_Profiler {
|
|
121 |
|
122 |
// Set up paths
|
123 |
$this->_P3_PATH = realpath( dirname( __FILE__ ) );
|
124 |
-
|
125 |
// Debug mode
|
126 |
$this->_debug_entry = array(
|
127 |
'profiling_enabled' => false,
|
@@ -148,7 +148,7 @@ class P3_Profiler {
|
|
148 |
}
|
149 |
}
|
150 |
}
|
151 |
-
|
152 |
// Add a global flag to let everyone know we're profiling
|
153 |
if ( !empty( $opts ) && preg_match( '/' . $opts['profiling_enabled']['ip'] . '/', p3_profiler_get_ip() ) ) {
|
154 |
define( 'WPP_PROFILING_STARTED', true );
|
@@ -161,13 +161,13 @@ class P3_Profiler {
|
|
161 |
if ( !defined( 'WPP_PROFILING_STARTED' ) ) {
|
162 |
return $this;
|
163 |
}
|
164 |
-
|
165 |
// Emergency shut off switch
|
166 |
if ( isset( $_REQUEST['P3_SHUTOFF'] ) && !empty( $_REQUEST['P3_SHUTOFF'] ) ) {
|
167 |
p3_profiler_disable();
|
168 |
return $this;
|
169 |
}
|
170 |
-
|
171 |
// Hook shutdown
|
172 |
register_shutdown_function( array( $this, 'shutdown_handler' ) );
|
173 |
|
@@ -188,7 +188,7 @@ class P3_Profiler {
|
|
188 |
@ini_set( 'memory_limit', '256M' );
|
189 |
}
|
190 |
@set_time_limit( 90 );
|
191 |
-
|
192 |
// Set the profile file
|
193 |
$this->_profile_filename = $opts['profiling_enabled']['name'] . '.json';
|
194 |
|
@@ -255,7 +255,7 @@ class P3_Profiler {
|
|
255 |
}
|
256 |
$themes_folder = 'themes';
|
257 |
|
258 |
-
// Start timing time spent in the profiler
|
259 |
$start = microtime( true );
|
260 |
|
261 |
// Calculate the last call time
|
@@ -284,20 +284,29 @@ class P3_Profiler {
|
|
284 |
|
285 |
// Examine the current stack, see if we should track it. It should be
|
286 |
// related to a plugin file if we're going to track it
|
287 |
-
|
288 |
-
|
289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
$bt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT );
|
291 |
-
} else {
|
292 |
-
$bt = debug_backtrace(
|
293 |
}
|
294 |
|
295 |
// Find our function
|
296 |
$frame = $bt[0];
|
297 |
-
if (
|
298 |
$frame = $bt[1];
|
299 |
-
|
300 |
-
$lambda_file =
|
301 |
|
302 |
// Free up memory
|
303 |
unset( $bt );
|
@@ -305,7 +314,7 @@ class P3_Profiler {
|
|
305 |
// Include/require
|
306 |
if ( in_array( strtolower( $frame['function'] ), array( 'include', 'require', 'include_once', 'require_once' ) ) ) {
|
307 |
$file = $frame['args'][0];
|
308 |
-
|
309 |
// Object instances
|
310 |
} elseif ( isset( $frame['object'] ) && method_exists( $frame['object'], $frame['function'] ) ) {
|
311 |
try {
|
@@ -313,7 +322,7 @@ class P3_Profiler {
|
|
313 |
$file = $reflector->getFileName();
|
314 |
} catch ( Exception $e ) {
|
315 |
}
|
316 |
-
|
317 |
// Static object calls
|
318 |
} elseif ( isset( $frame['class'] ) && method_exists( $frame['class'], $frame['function'] ) ) {
|
319 |
try {
|
@@ -342,7 +351,7 @@ class P3_Profiler {
|
|
342 |
} else {
|
343 |
$file = $_SERVER['SCRIPT_FILENAME'];
|
344 |
}
|
345 |
-
|
346 |
// Check for "eval()'d code"
|
347 |
if ( strpos( $file, "eval()'d" ) ) {
|
348 |
list($file, $junk) = explode(': eval(', $str, 2);
|
@@ -628,7 +637,7 @@ class P3_Profiler {
|
|
628 |
$transient .= json_encode( $this->_profile ) . PHP_EOL;
|
629 |
update_option( 'p3_scan_' . $opts['profiling_enabled']['name'], $transient );
|
630 |
}
|
631 |
-
|
632 |
/**
|
633 |
* Get the current URL
|
634 |
* @return string
|
92 |
* @var array
|
93 |
*/
|
94 |
private $_debug_entry = array();
|
95 |
+
|
96 |
/**
|
97 |
* Last stack should be marked as plugin time
|
98 |
* @const
|
99 |
*/
|
100 |
const CATEGORY_PLUGIN = 1;
|
101 |
+
|
102 |
/**
|
103 |
* Last stack should be marked as theme time
|
104 |
* @const
|
121 |
|
122 |
// Set up paths
|
123 |
$this->_P3_PATH = realpath( dirname( __FILE__ ) );
|
124 |
+
|
125 |
// Debug mode
|
126 |
$this->_debug_entry = array(
|
127 |
'profiling_enabled' => false,
|
148 |
}
|
149 |
}
|
150 |
}
|
151 |
+
|
152 |
// Add a global flag to let everyone know we're profiling
|
153 |
if ( !empty( $opts ) && preg_match( '/' . $opts['profiling_enabled']['ip'] . '/', p3_profiler_get_ip() ) ) {
|
154 |
define( 'WPP_PROFILING_STARTED', true );
|
161 |
if ( !defined( 'WPP_PROFILING_STARTED' ) ) {
|
162 |
return $this;
|
163 |
}
|
164 |
+
|
165 |
// Emergency shut off switch
|
166 |
if ( isset( $_REQUEST['P3_SHUTOFF'] ) && !empty( $_REQUEST['P3_SHUTOFF'] ) ) {
|
167 |
p3_profiler_disable();
|
168 |
return $this;
|
169 |
}
|
170 |
+
|
171 |
// Hook shutdown
|
172 |
register_shutdown_function( array( $this, 'shutdown_handler' ) );
|
173 |
|
188 |
@ini_set( 'memory_limit', '256M' );
|
189 |
}
|
190 |
@set_time_limit( 90 );
|
191 |
+
|
192 |
// Set the profile file
|
193 |
$this->_profile_filename = $opts['profiling_enabled']['name'] . '.json';
|
194 |
|
255 |
}
|
256 |
$themes_folder = 'themes';
|
257 |
|
258 |
+
// Start timing time spent in the profiler
|
259 |
$start = microtime( true );
|
260 |
|
261 |
// Calculate the last call time
|
284 |
|
285 |
// Examine the current stack, see if we should track it. It should be
|
286 |
// related to a plugin file if we're going to track it
|
287 |
+
static $is_540;
|
288 |
+
static $is_536;
|
289 |
+
|
290 |
+
if ( $is_540 == null ) {
|
291 |
+
if ( $is_540 = version_compare( PHP_VERSION, '5.4.0', '>=' ) == false ) {
|
292 |
+
$is_536 = version_compare( PHP_VERSION, '5.3.6', '>=' );
|
293 |
+
}
|
294 |
+
}
|
295 |
+
|
296 |
+
if ( $is_540 ) { // if $ver >= 5.4.0
|
297 |
+
$bt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT, 2 );
|
298 |
+
} elseif ( $is_536 ) { // if $ver >= 5.3.6
|
299 |
$bt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT );
|
300 |
+
} else { // if $ver < 5.3.6
|
301 |
+
$bt = debug_backtrace( true );
|
302 |
}
|
303 |
|
304 |
// Find our function
|
305 |
$frame = $bt[0];
|
306 |
+
if ( isset( $bt[1] ) )
|
307 |
$frame = $bt[1];
|
308 |
+
|
309 |
+
$lambda_file = isset( $bt[0]['file']{0} ) ? $bt[0]['file'] : '';
|
310 |
|
311 |
// Free up memory
|
312 |
unset( $bt );
|
314 |
// Include/require
|
315 |
if ( in_array( strtolower( $frame['function'] ), array( 'include', 'require', 'include_once', 'require_once' ) ) ) {
|
316 |
$file = $frame['args'][0];
|
317 |
+
|
318 |
// Object instances
|
319 |
} elseif ( isset( $frame['object'] ) && method_exists( $frame['object'], $frame['function'] ) ) {
|
320 |
try {
|
322 |
$file = $reflector->getFileName();
|
323 |
} catch ( Exception $e ) {
|
324 |
}
|
325 |
+
|
326 |
// Static object calls
|
327 |
} elseif ( isset( $frame['class'] ) && method_exists( $frame['class'], $frame['function'] ) ) {
|
328 |
try {
|
351 |
} else {
|
352 |
$file = $_SERVER['SCRIPT_FILENAME'];
|
353 |
}
|
354 |
+
|
355 |
// Check for "eval()'d code"
|
356 |
if ( strpos( $file, "eval()'d" ) ) {
|
357 |
list($file, $junk) = explode(': eval(', $str, 2);
|
637 |
$transient .= json_encode( $this->_profile ) . PHP_EOL;
|
638 |
update_option( 'p3_scan_' . $opts['profiling_enabled']['name'], $transient );
|
639 |
}
|
640 |
+
|
641 |
/**
|
642 |
* Get the current URL
|
643 |
* @return string
|
css/p3.css
CHANGED
@@ -49,7 +49,7 @@
|
|
49 |
}
|
50 |
|
51 |
|
52 |
-
/** Light grey italic captions **/
|
53 |
em.p3-em {
|
54 |
color: #999999;
|
55 |
}
|
@@ -70,7 +70,7 @@ em.p3-em {
|
|
70 |
.noTitle .ui-dialog-titlebar {
|
71 |
display: none;
|
72 |
}
|
73 |
-
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
74 |
float: none;
|
75 |
text-align: center;
|
76 |
}
|
@@ -80,7 +80,7 @@ em.p3-em {
|
|
80 |
|
81 |
|
82 |
|
83 |
-
/** Turn "Cancel" button into link **/
|
84 |
button.p3-cancel-button{
|
85 |
border-width: 0px !important;
|
86 |
background-image: none !important;
|
@@ -263,7 +263,7 @@ p3-glossary-container {
|
|
263 |
height: 60px;
|
264 |
}
|
265 |
.p3-faded-grey {
|
266 |
-
color: #dddddd;
|
267 |
}
|
268 |
|
269 |
|
@@ -387,6 +387,6 @@ div#p3-reminder-wrapper {
|
|
387 |
}
|
388 |
|
389 |
/** http://wordpress.org/support/topic/plugin-broken-with-wp-371?replies=14#post-4976803 **/
|
390 |
-
.ui-front {
|
391 |
z-index: 100 !important;
|
392 |
}
|
49 |
}
|
50 |
|
51 |
|
52 |
+
/** Light grey italic captions **/
|
53 |
em.p3-em {
|
54 |
color: #999999;
|
55 |
}
|
70 |
.noTitle .ui-dialog-titlebar {
|
71 |
display: none;
|
72 |
}
|
73 |
+
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
|
74 |
float: none;
|
75 |
text-align: center;
|
76 |
}
|
80 |
|
81 |
|
82 |
|
83 |
+
/** Turn "Cancel" button into link **/
|
84 |
button.p3-cancel-button{
|
85 |
border-width: 0px !important;
|
86 |
background-image: none !important;
|
263 |
height: 60px;
|
264 |
}
|
265 |
.p3-faded-grey {
|
266 |
+
color: #dddddd;
|
267 |
}
|
268 |
|
269 |
|
387 |
}
|
388 |
|
389 |
/** http://wordpress.org/support/topic/plugin-broken-with-wp-371?replies=14#post-4976803 **/
|
390 |
+
.ui-front:first-child {
|
391 |
z-index: 100 !important;
|
392 |
}
|
p3-profiler.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: P3 (Plugin Performance Profiler)
|
|
4 |
Plugin URI: http://support.godaddy.com/godaddy/wordpress-p3-plugin/
|
5 |
Description: See which plugins are slowing down your site. Create a profile of your WordPress site's plugins' performance by measuring their impact on your site's load time.
|
6 |
Author: GoDaddy.com
|
7 |
-
Version: 1.5.
|
8 |
Author URI: http://www.godaddy.com/
|
9 |
Text Domain: p3-profiler
|
10 |
Domain Path: /languages
|
@@ -63,10 +63,10 @@ if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) {
|
|
63 |
|
64 |
// Admin hooks
|
65 |
} elseif ( is_admin() ) {
|
66 |
-
|
67 |
// Show the 'Profiler' option under the 'Plugins' menu
|
68 |
add_action( 'admin_menu', array( 'P3_Profiler_Plugin', 'tools_menu' ) );
|
69 |
-
|
70 |
// Show the 'Profile now' link on the plugins table
|
71 |
add_action( 'plugin_action_links', array( 'P3_Profiler_Plugin', 'add_settings_link'), 10, 2 );
|
72 |
|
@@ -115,8 +115,8 @@ if ( function_exists( 'is_multisite' ) && is_multisite() ) {
|
|
115 |
|
116 |
/**
|
117 |
* Autoloader ... very little logic needed
|
118 |
-
* @param string $className
|
119 |
-
* @return
|
120 |
*/
|
121 |
function p3_profiler_autoload( $className ) {
|
122 |
switch ( $className ) {
|
4 |
Plugin URI: http://support.godaddy.com/godaddy/wordpress-p3-plugin/
|
5 |
Description: See which plugins are slowing down your site. Create a profile of your WordPress site's plugins' performance by measuring their impact on your site's load time.
|
6 |
Author: GoDaddy.com
|
7 |
+
Version: 1.5.3
|
8 |
Author URI: http://www.godaddy.com/
|
9 |
Text Domain: p3-profiler
|
10 |
Domain Path: /languages
|
63 |
|
64 |
// Admin hooks
|
65 |
} elseif ( is_admin() ) {
|
66 |
+
|
67 |
// Show the 'Profiler' option under the 'Plugins' menu
|
68 |
add_action( 'admin_menu', array( 'P3_Profiler_Plugin', 'tools_menu' ) );
|
69 |
+
|
70 |
// Show the 'Profile now' link on the plugins table
|
71 |
add_action( 'plugin_action_links', array( 'P3_Profiler_Plugin', 'add_settings_link'), 10, 2 );
|
72 |
|
115 |
|
116 |
/**
|
117 |
* Autoloader ... very little logic needed
|
118 |
+
* @param string $className
|
119 |
+
* @return
|
120 |
*/
|
121 |
function p3_profiler_autoload( $className ) {
|
122 |
switch ( $className ) {
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
-
|
2 |
-
Contributors: Godaddy, StarfieldTech, kurtpayne
|
3 |
Tags: debug, debugging, developer, development, performance, plugin, profiler, speed
|
4 |
Requires at least: 3.3
|
5 |
Tested up to: 4.0
|
6 |
-
Stable tag: 1.5.
|
7 |
License: GPLv2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -47,6 +47,9 @@ Manual installation:
|
|
47 |
|
48 |
== Upgrade Notice ==
|
49 |
|
|
|
|
|
|
|
50 |
= 1.5.2 =
|
51 |
Fixed a race condition in the error detection logic. Now P3 will auto deactivate 60 seconds after an error if it is not cleared.
|
52 |
|
@@ -146,6 +149,10 @@ add_filter( 'p3_automatic_scan_urls', 'my_p3_auto_scan_pages' );
|
|
146 |
|
147 |
== Changelog ==
|
148 |
|
|
|
|
|
|
|
|
|
149 |
= 1.5.2 =
|
150 |
* Fix a race condition in the error detection logic
|
151 |
* Add a notice about WordPress SEO and Jetpack
|
1 |
+
=== P3 (Plugin Performance Profiler) ===
|
2 |
+
Contributors: Godaddy, StarfieldTech, kurtpayne, cklosows
|
3 |
Tags: debug, debugging, developer, development, performance, plugin, profiler, speed
|
4 |
Requires at least: 3.3
|
5 |
Tested up to: 4.0
|
6 |
+
Stable tag: 1.5.3
|
7 |
License: GPLv2
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
47 |
|
48 |
== Upgrade Notice ==
|
49 |
|
50 |
+
= 1.5.3 =
|
51 |
+
Improved scanner performance (props askapache). Fixed a CSS conflict in overlays
|
52 |
+
|
53 |
= 1.5.2 =
|
54 |
Fixed a race condition in the error detection logic. Now P3 will auto deactivate 60 seconds after an error if it is not cleared.
|
55 |
|
149 |
|
150 |
== Changelog ==
|
151 |
|
152 |
+
= 1.5.3 =
|
153 |
+
* Improved scanner performance (props askapache)
|
154 |
+
* Fix a CSS conflict in overlays
|
155 |
+
|
156 |
= 1.5.2 =
|
157 |
* Fix a race condition in the error detection logic
|
158 |
* Add a notice about WordPress SEO and Jetpack
|