79% speedguard

Code Review | Site Speed Test - SpeedGuard

WordPress plugin Site Speed Test - SpeedGuard scored 79% from 54 tests.

About plugin

  • Plugin page: speedguard
  • Plugin version: 1.8.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 6.3.1
  • First release: Feb 24, 2018
  • Latest release: Jun 16, 2021
  • Number of updates: 101
  • Update frequency: every 12.0 days
  • Top authors: sabrina.zeidan (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

400+ active / 9,672 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
Install script ran successfully

Server metrics [RAM: ▲0.48MB] [CPU: ▼3.12ms] Passed 4 tests

An overview of server-side resources used by Site Speed Test - SpeedGuard
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4447.08 ▲8.44
Dashboard /wp-admin3.81 ▲0.5150.65 ▲5.93
Posts /wp-admin/edit.php3.84 ▲0.4947.86 ▲1.68
Add New Post /wp-admin/post-new.php6.44 ▲0.5577.72 ▼21.00
Media Library /wp-admin/upload.php3.70 ▲0.4734.88 ▲0.92
Speed Tests /wp-admin/admin.php?page=speedguard_tests3.6535.37
Settings /wp-admin/admin.php?page=speedguard_settings3.6332.62

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
speedguard_average
widget_recent-comments
widget_theysaidso_widget
db_upgraded
speedguard_options
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Site Speed Test - SpeedGuard
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲19413.25 ▼1.432.45 ▲0.7742.86 ▲1.71
Dashboard /wp-admin2,313 ▲1284.90 ▼1.00107.36 ▲9.7845.25 ▼3.72
Posts /wp-admin/edit.php2,135 ▲432.02 ▼0.0134.57 ▼1.7934.63 ▲5.21
Add New Post /wp-admin/post-new.php1,555 ▲2723.09 ▲4.89637.42 ▼44.9453.45 ▼1.94
Media Library /wp-admin/upload.php1,433 ▲424.23 ▲0.0797.47 ▼8.0044.08 ▼4.12
Speed Tests /wp-admin/admin.php?page=speedguard_tests1,4231.7329.9050.20
Settings /wp-admin/admin.php?page=speedguard_settings1,0921.8426.9736.09

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 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/speedguard/admin/partials/speedguard-admin-display.php
    • > /wp-content/plugins/speedguard/public/partials/speedguard-public-display.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/speedguard/admin/includes/class.tests.php on line 9
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/speedguard/admin/includes/class.tests.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/speedguard/admin/includes/class.settings.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'SpeedGuard_Admin' not found in wp-content/plugins/speedguard/admin/includes/class.widgets.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/speedguard/admin/includes/class.tests.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration Passed 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
5 plugin tags: optimization, speed, site speed, performance, test speed

speedguard/speedguard.php Passed 13 tests

"Site Speed Test - SpeedGuard" version 1.8.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
74 characters long description:
Keeps an eye on your website’s speed for you; every single day for free.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected2,197 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP182265541,590
JavaScript411569471
CSS33315135
SVG1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity19.23
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods98
▷ Static methods3131.63%
▷ Public methods9293.88%
▷ Protected methods00.00%
▷ Private methods66.12%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/sabrina.png9.65KB4.16KB▼ 56.88%