68% p3-profiler

Code Review | P3 (Plugin Performance Profiler)

WordPress plugin P3 (Plugin Performance Profiler) scored 68% from 54 tests.

About plugin

  • Plugin page: p3-profiler
  • Plugin version: 1.5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.5
  • WordPress version: 5.9.2
  • First release: Dec 14, 2011
  • Latest release: Oct 27, 2020
  • Number of updates: 173
  • Update frequency: every 18.7 days
  • Top authors: StarfieldTech (99.42%)vanyukov (1.16%)

Code review

54 tests

User reviews

406 reviews

Install metrics

50,000+ active / 1,662,677 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼288.76ms] Passed 4 tests

A check of server-side resources used by P3 (Plugin Performance Profiler)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0361.02 ▲5.11
Dashboard /wp-admin3.45 ▲0.0435.88 ▲1.19
Posts /wp-admin/edit.php3.67 ▲0.0344.33 ▲7.47
Add New Post /wp-admin/post-new.php6.91 ▼0.06100.23 ▼1,161.41
Media Library /wp-admin/upload.php3.33 ▲0.0329.09 ▲0.09
P3 Plugin Profiler /wp-admin/tools.php?page=p3-profiler3.5662.83

Server storage [IO: ▲0.58MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • There were 1 file (0.09KB) illegally modified outside of "wp-content/plugins/p3-profiler/" and "wp-content/uploads/"
    • (new file) wp-content/mu-plugins/p3-profiler.php
Filesystem: 49 new files
Database: no new tables, 4 new options
New WordPress options
p3-profiler_options
p3-profiler_version
p3-profiler_debug_log
p3_notices

Browser metrics Passed 4 tests

Checking browser requirements for P3 (Plugin Performance Profiler)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1414.63 ▼1.136.52 ▲0.072.40 ▼0.29
Dashboard /wp-admin2,897 ▲396.16 ▲0.01119.14 ▼28.10155.92 ▼33.50
Posts /wp-admin/edit.php2,696 ▲23.23 ▲0.0065.96 ▼5.62142.27 ▼2.44
Add New Post /wp-admin/post-new.php1,664 ▲320.81 ▲4.01414.06 ▼55.32163.12 ▲3.97
Media Library /wp-admin/upload.php1,706 ▲85.51 ▲0.05147.62 ▼6.83187.86 ▼29.29
P3 Plugin Profiler /wp-admin/tools.php?page=p3-profiler2,2035.32110.02195.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • p3_notices

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 15× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/p3-profiler/templates/view-scan.php
    • > /wp-content/plugins/p3-profiler/templates/callouts.php
    • > /wp-content/plugins/p3-profiler/templates/index.php
    • > /wp-content/plugins/p3-profiler/classes/class.p3-profiler-table-sorter.php
    • > /wp-content/plugins/p3-profiler/p3-profiler.php
    • > /wp-content/plugins/p3-profiler/classes/class.p3-profiler.php
    • > /wp-content/plugins/p3-profiler/classes/class.p3-profiler-table.php
    • > /wp-content/plugins/p3-profiler/exceptions/class.p3-profiler-no-data-exception.php
    • > /wp-content/plugins/p3-profiler/classes/index.php
    • > /wp-content/plugins/p3-profiler/languages/index.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/p3-profiler/templates/template.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
8 plugin tags: speed, debugging, debug, plugin, development...

p3-profiler/p3-profiler.php 92% from 13 tests

The main PHP script in "P3 (Plugin Performance Profiler)" version 1.5.4 is automatically included on every request by WordPress
The following require your attention:
  • Description: Keep the plugin description shorter than 140 characters (currently 160 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Almost there! Just fix the following issues
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/p3-profiler/build.bat
6,407 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP175528883,811
CSS51243341,108
JavaScript5247258731
PO File1282391725
XML10022
DOS Batch13010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity32.38
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity4.76
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods80
▷ Static methods3037.50%
▷ Public methods6581.25%
▷ Protected methods00.00%
▷ Private methods1518.75%
Functions23
▷ Named functions521.74%
▷ Anonymous functions1878.26%
Constants11
▷ Global constants763.64%
▷ Class constants436.36%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_cc0000_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_333333_256x240.png4.27KB4.11KB▼ 3.78%
css/images/ui-icons_21759b_256x240.png5.23KB4.11KB▼ 21.49%
css/images/ui-icons_999999_256x240.png4.27KB4.11KB▼ 3.78%
css/logo.png6.01KB2.91KB▼ 51.56%