84% performance-lab

Code Review | Performance Lab

WordPress plugin Performance Lab scored84%from 54 tests.

About plugin

  • Plugin page: performance-lab
  • Plugin version: 2.7.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.4
  • WordPress version: 6.3.1
  • First release: Mar 7, 2022
  • Latest release: Oct 16, 2023
  • Number of updates: 25
  • Update frequency: every 25.0 days
  • Top authors: performanceteam (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

100,000+ active /912,356 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▲0.70ms] Passed 4 tests

An overview of server-side resources used by Performance Lab
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4343.25 ▲6.83
Dashboard /wp-admin3.81 ▲0.5045.90 ▼2.01
Posts /wp-admin/edit.php3.86 ▲0.5048.39 ▼1.73
Add New Post /wp-admin/post-new.php6.33 ▲0.4385.25 ▲0.12
Media Library /wp-admin/upload.php3.67 ▲0.4339.64 ▲6.42
Performance /wp-admin/options-general.php?page=perflab-modules3.6535.94
Server-Timing /wp-admin/tools.php?page=perflab-server-timing3.6433.53

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

Filesystem and database footprint
It is recommended to fix the following issues
  • The plugin illegally modified 1 file (3.28KB) outside of "wp-content/plugins/performance-lab/" and "wp-content/uploads/"
    • (new file) wp-content/object-cache.php
Filesystem: 36 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Performance Lab
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲8514.73 ▲0.141.55 ▼0.0849.36 ▲3.27
Dashboard /wp-admin2,250 ▲765.94 ▲0.2889.67 ▲4.0341.24 ▼1.20
Posts /wp-admin/edit.php2,105 ▲51.98 ▼0.0234.18 ▼3.7735.39 ▼3.88
Add New Post /wp-admin/post-new.php1,534 ▲623.22 ▲0.29634.38 ▲3.7266.79 ▲17.02
Media Library /wp-admin/upload.php1,405 ▲114.16 ▼0.0995.98 ▼0.4843.84 ▼0.04
Performance /wp-admin/options-general.php?page=perflab-modules9082.0323.7326.77
Server-Timing /wp-admin/tools.php?page=perflab-server-timing8762.1221.7235.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant PERFLAB_VERSION - assumed 'PERFLAB_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/performance-lab/modules/images/dominant-color-images/load.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/performance-lab/module-i18n.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_Imagick' not found in wp-content/plugins/performance-lab/modules/images/dominant-color-images/class-dominant-color-image-editor-imagick.php:20
    • > PHP Warning
      Use of undefined constant PERFLAB_VERSION - assumed 'PERFLAB_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/performance-lab/modules/images/webp-uploads/load.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Image_Editor_GD' not found in wp-content/plugins/performance-lab/modules/images/dominant-color-images/class-dominant-color-image-editor-gd.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: performance, javascript, site health, object caching, measurement...

performance-lab/load.php 92% from 13 tests

The entry point to "Performance Lab" version 2.7.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("performance-lab.php" instead of "load.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected3,070 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP326081,9142,965
JavaScript122795
JSON10010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity10.50
▷ Minimum class complexity7.00
▷ Maximum class complexity17.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1694.12%
▷ Protected methods00.00%
▷ Private methods15.88%
Functions145
▷ Named functions10572.41%
▷ Anonymous functions4027.59%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected