83% website-speed-optimization

Code Review | Website Speed Optimization

WordPress plugin Website Speed Optimization scored 83% from 54 tests.

About plugin

  • Plugin page: website-speed-opt...
  • Plugin version: 0.1.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4.1
  • WordPress version: 5.8.1
  • First release: Oct 11, 2019
  • Latest release: May 7, 2020
  • Number of updates: 13
  • Update frequency: every 16.1 days
  • Top authors: thanminhtu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,114 total downloads

Benchmarks

Plugin footprint 83% 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: ▼140.03ms] Passed 4 tests

A check of server-side resources used by Website Speed Optimization
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.09 ▲11.57
Dashboard /wp-admin3.07 ▲0.0243.30 ▼0.35
Posts /wp-admin/edit.php3.12 ▲0.0148.13 ▲1.65
Add New Post /wp-admin/post-new.php5.43 ▼0.0193.47 ▼555.25
Media Library /wp-admin/upload.php3.01 ▲0.0133.38 ▼6.15

Server storage [IO: ▲0.07MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 1 new option
New WordPress options
wso-options

Browser metrics Passed 4 tests

An overview of browser requirements for Website Speed Optimization
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,717 ▲12115.87 ▲0.227.77 ▼2.0248.80 ▼5.43
Dashboard /wp-admin2,989 ▲526.02 ▼0.06148.12 ▼9.68141.30 ▲22.08
Posts /wp-admin/edit.php2,752 ▲132.74 ▼0.0864.52 ▼3.9896.73 ▲4.38
Add New Post /wp-admin/post-new.php1,572 ▲7215.22 ▼3.47396.14 ▲20.60123.36 ▲6.63
Media Library /wp-admin/upload.php1,781 ▼265.02 ▼0.00134.36 ▼21.56149.44 ▲29.06

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
  • This plugin does not fully uninstall, leaving 1 option in the database
    • wso-options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/website-speed-optimization/wso_setting.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/website-speed-optimization/wp-website-speed-optimization.php:15

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: website speed optimization

website-speed-optimization/wp-website-speed-optimization.php 77% from 13 tests

The main PHP script in "Website Speed Optimization" version 0.1.3 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("website-speed-optimization.php" instead of "wp-website-speed-optimization.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)
  • Domain Path: The domain path points to an invalid folder, "/lang" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,715 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP41561531,076
CSS111310
JSON100226
JavaScript1126103

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity47.20
▷ Minimum class complexity1.00
▷ Maximum class complexity156.00
Average method complexity6.13
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods45
▷ Static methods12.22%
▷ Public methods3680.00%
▷ Protected methods920.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants758.33%
▷ Class constants541.67%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon.png1.97KB1.16KB▼ 40.91%