77% wpspeed

Code Review | WPSpeed

WordPress plugin WPSpeed scored77%from 54 tests.

About plugin

  • Plugin page: wpspeed
  • Plugin version: 2.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 16, 2022
  • Latest release: Dec 2, 2023
  • Number of updates: 141
  • Update frequency: every 3.1 days
  • Top authors: John Dagelmore (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

700+ active /3,811 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼0.93ms] Passed 4 tests

An overview of server-side resources used by WPSpeed
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4645.09 ▲6.18
Dashboard /wp-admin3.65 ▲0.3048.66 ▼11.30
Posts /wp-admin/edit.php3.70 ▲0.3453.10 ▲8.61
Add New Post /wp-admin/post-new.php6.16 ▲0.2892.43 ▼2.16
Media Library /wp-admin/upload.php3.51 ▲0.2837.05 ▲3.56
WPSpeed Settings /wp-admin/options-general.php?page=wpspeed5.4749.63

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

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • The plugin illegally modified 36 files (1,398.71KB) outside of "wp-content/plugins/wpspeed/" and "wp-content/uploads/"
    • (new file) wp-content/cache/wpspeed/412cf65f1050d0700a95b45eaab38773.wpc
    • (new file) wp-content/cache/wpspeed/25373ec61baf57c006e0566f2b19c81a.wpc
    • (new file) wp-content/cache/wpspeed/07b1b3353c8423d364c28d3764ac4647.wpc
    • (new file) wp-content/cache/wpspeed/429d0f2647681554e91d8258e9b2060f.wpc
    • (new file) wp-content/cache/wpspeed/008f9c2c1d9ff319c09a9c6b61bbc15a.wpc
    • (new file) wp-content/cache/wpspeed/3ad932f6e141a72fe653a5f9ed8a75b6.wpc
    • (new file) wp-content/cache/wpspeed/10531e46d7b5f7883ea825104dfca023.wpc
    • (new file) wp-content/cache/wpspeed/3c3a5dff2cfa0aaae135d83a8ed60b56.wpc
    • (new file) wp-content/cache/wpspeed/14064270ec3f4e33152463234dbad782.wpc
    • (new file) wp-content/cache/wpspeed/131d01f9716b7b3609436487bf439376.wpc
    • ...
Filesystem: 274 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPSpeed
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,765 ▲1814.28 ▲0.072.21 ▲0.6137.46 ▼6.03
Dashboard /wp-admin2,221 ▲475.58 ▼0.0794.16 ▼8.5642.44 ▼2.74
Posts /wp-admin/edit.php2,126 ▲261.95 ▲0.0139.75 ▼0.1936.50 ▲0.31
Add New Post /wp-admin/post-new.php1,537 ▲1123.64 ▲0.44667.30 ▼7.5853.90 ▼4.41
Media Library /wp-admin/upload.php1,426 ▲324.21 ▼0.0694.87 ▼2.7639.91 ▼0.59
WPSpeed Settings /wp-admin/options-general.php?page=wpspeed7,3933.65152.0167.85

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 76× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/wpspeed/src/Core/LightImages.php
    • > /wp-content/plugins/wpspeed/src/Core/Css/CssSearchObject.php
    • > /wp-content/plugins/wpspeed/src/Core/Interfaces/Utility.php
    • > /wp-content/plugins/wpspeed/src/Core/Html/LinkBuilder.php
    • > /wp-content/plugins/wpspeed/src/Core/Css/Sprite/CssSpriteGen.php
    • > /wp-content/plugins/wpspeed/src/Core/Css/Callbacks/HandleAtRules.php
    • > /wp-content/plugins/wpspeed/src/Core/Combiner.php
    • > /wp-content/plugins/wpspeed/src/Core/Css/Sprite/Handlers/Imagick.php
    • > /wp-content/plugins/wpspeed/src/Core/Css/Callbacks/CallbackBase.php
    • > /wp-content/plugins/wpspeed/src/Core/Http2.php
  • 48× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WPSFramework\\Document\\Document' not found in wp-content/plugins/wpspeed/vendor/wpspeed/framework/src/Document/Csv.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'WPSFramework\\Session\\SegmentInterface' not found in wp-content/plugins/wpspeed/vendor/wpspeed/framework/src/Session/Segment.php:18
    • > PHP Fatal error
      Trait 'WPSpeed\\RegexTokenizer\\Base' not found in wp-content/plugins/wpspeed/src/Core/Optimizers/RegexTokenizer/Html.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WPSpeed\\Platform\\Plugin' not found in wp-content/plugins/wpspeed/src/Admin/templates/compiled/b3b6c12f77754b3a89c70f20feca8ffdd4f5082e.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WPSFramework\\Registry\\AbstractRegistryFormat' not found in wp-content/plugins/wpspeed/vendor/wpspeed/framework/src/Registry/Format/Json.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'WPSFramework\\Mvc\\Compiler\\CompilerInterface' not found in wp-content/plugins/wpspeed/vendor/wpspeed/framework/src/Mvc/Compiler/Blade.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'WPSFramework\\Filesystem\\FilesystemInterface' not found in wp-content/plugins/wpspeed/vendor/wpspeed/framework/src/Filesystem/Hybrid.php:16
    • > PHP Fatal error
      Trait 'WPSpeed\\RegexTokenizer\\Base' not found in wp-content/plugins/wpspeed/src/Core/Optimizers/Minify/Base.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'WPSFramework\\Application\\Application' not found in wp-content/plugins/wpspeed/src/Admin/Application.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WPSFramework\\Mvc\\Controller' not found in wp-content/plugins/wpspeed/src/Admin/Controller/Utility.php:22

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 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
The official readme.txt is a good inspiration

wpspeed/wpspeed.php 92% from 13 tests

"WPSpeed" version 2.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 499 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin25,494 lines of code in 208 files:
LanguageFilesBlank linesComment linesLines of code
PHP1865,80111,78323,841
JavaScript132812271,101
CSS48628429
Markdown126059
JSON10054
XML1008
HTML2002

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 125)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity19.35
▷ Minimum class complexity1.00
▷ Maximum class complexity223.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity125.00
Code structure
Namespaces43
Interfaces20
Traits7
Classes148
▷ Abstract classes1812.16%
▷ Concrete classes13087.84%
▷ Final classes21.54%
Methods1,566
▷ Static methods57736.85%
▷ Public methods1,32384.48%
▷ Protected methods17911.43%
▷ Private methods644.09%
Functions72
▷ Named functions2838.89%
▷ Anonymous functions4461.11%
Constants43
▷ Global constants3581.40%
▷ Class constants818.60%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
32 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/images/wpspeed-logo.png14.57KB5.27KB▼ 63.81%
media/core/icons/sprite_gen.png1.57KB1.59KB0.00%
media/images/bkg_tooltip_left.png0.74KB0.76KB0.00%
media/core/icons/deluxe.png1.96KB2.01KB0.00%
media/core/icons/lazyload.png1.73KB1.73KB0.00%