PluginProbe
Code Profiler – WordPress Performance Profiling and Debugging Made Easy / 1.9.6
Code Profiler – WordPress Performance Profiling and Debugging Made Easy v1.9.6
1.9.6 1.9.5 1.9.4 1.9.3 trunk 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6 1.6.1 1.6.10 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 All 41 releases
← All changes | lib/class-report.php +7 -31 1.6.101.9.6 View file →
@@ -6,9 +6,9 @@
6 6 | | | / _ \ / _` |/ _ \ | |_) | '__/ _ \| |_| | |/ _ \ '__| |
7 7 | | |__| (_) | (_| | __/ | __/| | | (_) | _| | | __/ | |
8 8 | \____\___/ \__,_|\___| |_| |_| \___/|_| |_|_|\___|_| |
9 9 | |
10 - | (c) Jerome Bruandet ~ https://code-profiler.com/ |
10 + | (c) Jerome Bruandet ~ https://nintechnet.com/codeprofiler/ |
11 11 +=====================================================================+
12 12 */
13 13
14 14 if (! defined('ABSPATH') ) { die('Forbidden'); }
@@ -20,9 +20,8 @@
20 20 private $last_type;
21 21 private $last_time = 0;
22 22 private $themes = [];
23 23 private $plugins = [];
24 - private $composer = [];
25 24 private $summary_list = [];
26 25 private $cx_buffer = [];
27 26 private $parsed_data = 0;
28 27 private $plugins_dir;
@@ -94,9 +93,8 @@
94 93 $this->save_iostats();
95 94 $this->save_connections();
96 95 $this->save_data();
97 96 $this->save_diskio();
98 - $this->save_composer();
99 97
100 98 code_profiler_log_info( sprintf(
101 99 __('Volume of code and data analyzed: %1$sMB (%2$s plugins and '.
102 100 '1 theme) in %4$ss - Memory used: %3$sMB', 'code-profiler'),
@@ -210,8 +208,14 @@
210 208 $this->summary_list['items'] = $this->total_plugins + 1; // Add the theme
211 209 $this->summary_list['time'] = $this->convert_2_seconds( $this->summary_list['time'] );
212 210 $this->summary_list['time'] = number_format( $this->summary_list['time'], 4 );
213 211
212 + // Re-run options
213 + if (! empty( $s['rerun'] ) ) {
214 + $this->summary_list['rerun'] = $s['rerun'];
215 + $this->summary_list['rerun']['profile'] = $this->profile_name;
216 + }
217 +
214 218 // Save Code Profiler, PHP and WordPress' versions
215 219 global $wp_version;
216 220 $this->summary_list['versions'] = [
217 221 'wp' => $wp_version,
@@ -219,9 +223,8 @@
219 223 'php' => PHP_VERSION
220 224 ];
221 225
222 226 file_put_contents( $summary_json, json_encode( $this->summary_list ) );
223 -
224 227 }
225 228
226 229
227 230 /**
@@ -385,16 +388,8 @@
385 388 if (! isset( $this->plugins[ $slug['plugin'] ]['time'] ) ) {
386 389 $this->plugins[ $slug['plugin'] ]['time'] = 0;
387 390 }
388 391 }
389 -
390 - // Look for multiple copies of composer and warn the user
391 - if ( preg_match("`^{$this->plugins_dir}[\\\/](?:[^\\\/]+)[\\\/].+?[\\\/]composer[\\\/]autoload_real\.php`", $caller ) ) {
392 - // Save the slug first, we'll fetch the name later
393 - if (! isset( $this->composer[ $slug['plugin'] ] ) ) {
394 - $this->composer[ $slug['plugin'] ] = '';
395 - }
396 - }
397 392 }
398 393
399 394 // We don't have a slug: if there's an old record, update it
400 395 } else {
@@ -470,27 +465,8 @@
470 465 CODE_PROFILER_UPLOAD_DIR ."/{$this->microtime}.{$this->profile_name}.diskio.profile"
471 466 );
472 467 }
473 468
474 -
475 - /**
476 - * Save list of plugins using composer
477 - */
478 - private function save_composer() {
479 -
480 - if (! empty( $this->composer ) ) {
481 - // Try to get the plugin's name
482 - foreach( $this->composer as $slug => $v ) {
483 - if ( isset( $this->plugins[ $slug ]['name'] ) ) {
484 - $this->composer[ $slug ] = $this->plugins[ $slug ]['name'];
485 - }
486 - }
487 - file_put_contents(
488 - CODE_PROFILER_UPLOAD_DIR ."/{$this->microtime}.{$this->profile_name}.composer.profile",
489 - json_encode( $this->composer )
490 - );
491 - }
492 - }
493 469
494 470 /**
495 471 * External connections.
496 472 */