83% wp2speed

Code Review | WP2Speed Faster - Optimize PageSpeed Insights Score 90-100

WordPress plugin WP2Speed Faster - Optimize PageSpeed Insights Score 90-100 scored83%from 54 tests.

About plugin

  • Plugin page: wp2speed
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 13, 2022
  • Latest release: Sep 13, 2022
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: wp2speed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

4,000+ active /3,305 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.50MB] [CPU: ▲10.67ms] Passed 4 tests

A check of server-side resources used by WP2Speed Faster - Optimize PageSpeed Insights Score 90-100
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.05 ▲1.5956.11 ▲14.48
Dashboard /wp-admin4.83 ▲1.5363.41 ▲12.27
Posts /wp-admin/edit.php4.88 ▲1.5351.48 ▲6.14
Add New Post /wp-admin/post-new.php7.35 ▲1.4797.80 ▲9.80
Media Library /wp-admin/upload.php4.69 ▲1.4751.92 ▲17.71
WP2Speed /wp-admin/options-general.php?page=wp2speed4.6644.17

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

A short overview of filesystem and database impact
Just a few items left to fix
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/wp2speed/" and "wp-content/uploads/"
    • (new file) wp-content/mmr/.empty
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WP2Speed Faster - Optimize PageSpeed Insights Score 90-100
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.23 ▼0.141.82 ▲0.0942.12 ▼5.39
Dashboard /wp-admin2,199 ▲195.56 ▼0.0286.29 ▼6.4542.58 ▲3.39
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0033.11 ▼3.8635.21 ▲2.94
Add New Post /wp-admin/post-new.php1,529 ▲323.66 ▲0.71678.98 ▲52.5452.03 ▲2.47
Media Library /wp-admin/upload.php1,407 ▲104.20 ▲0.0194.32 ▼6.6142.28 ▲0.67
WP2Speed /wp-admin/options-general.php?page=wp2speed8342.2626.9326.33

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exceptions\\BasicException' not found in wp-content/plugins/wp2speed/Minify/src/Exceptions/FileImportException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/wp2speed/Minify/src/CSS.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/wp2speed/lib/template/tpl-dynamic-content.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/wp2speed/Minify/src/JS.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp2speed/lib/includes/optimize.php:392
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\ConverterInterface' not found in wp-content/plugins/wp2speed/Minify/NoConverter.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hw_config() in wp-content/plugins/wp2speed/lib/plugins/cache.php:712
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\ConverterInterface' not found in wp-content/plugins/wp2speed/Minify/Converter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Exception' not found in wp-content/plugins/wp2speed/Minify/src/Exceptions/BasicException.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp2speed/lib/includes/lazy.php:1097

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

wp2speed/wp2speed-nocdn.php 92% from 13 tests

The main file in "WP2Speed Faster - Optimize PageSpeed Insights Score 90-100" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp2speed.php" instead of "wp2speed-nocdn.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected7,914 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP261,3304,2237,552
JavaScript52518190
CSS21710172

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 153)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity78.11
▷ Minimum class complexity1.00
▷ Maximum class complexity327.00
Average method complexity6.34
▷ Minimum method complexity1.00
▷ Maximum method complexity153.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes18
▷ Abstract classes316.67%
▷ Concrete classes1583.33%
▷ Final classes16.67%
Methods262
▷ Static methods197.25%
▷ Public methods20979.77%
▷ Protected methods3814.50%
▷ Private methods155.73%
Functions159
▷ Named functions8955.97%
▷ Anonymous functions7044.03%
Constants24
▷ Global constants2083.33%
▷ Class constants416.67%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/asset/play-btn.png1.00KB1.19KB0.00%