90% kagg-pagespeed-module

Code Review | PageSpeed Module

WordPress plugin PageSpeed Module scored90%from 54 tests.

About plugin

  • Plugin page: kagg-pagespeed-mo...
  • Plugin version: 2.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Nov 7, 2017
  • Latest release: Oct 6, 2023
  • Number of updates: 25
  • Update frequency: every 86.4 days
  • Top authors: kaggdesign (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

400+ active /12,632 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.79ms] Passed 4 tests

This is a short check of server-side resources used by PageSpeed Module
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1339.89 ▲2.84
Dashboard /wp-admin3.44 ▲0.0947.74 ▼11.31
Posts /wp-admin/edit.php3.55 ▲0.2045.05 ▼1.01
Add New Post /wp-admin/post-new.php6.02 ▲0.1382.90 ▼13.67
Media Library /wp-admin/upload.php3.36 ▲0.1337.06 ▲6.16
PageSpeed /wp-admin/options-general.php?page=mod-pagespeed3.3329.81

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for PageSpeed Module
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5114.34 ▼0.291.68 ▲0.0644.08 ▲4.57
Dashboard /wp-admin2,188 ▲115.51 ▼0.1485.21 ▼3.5885.71 ▲43.23
Posts /wp-admin/edit.php2,114 ▲141.98 ▼0.0233.26 ▼2.2732.31 ▼3.97
Add New Post /wp-admin/post-new.php1,686 ▲15822.28 ▼0.88742.88 ▲92.9250.29 ▲2.64
Media Library /wp-admin/upload.php1,408 ▲84.11 ▼0.0892.90 ▲0.1863.30 ▲21.75
PageSpeed /wp-admin/options-general.php?page=mod-pagespeed8952.1922.1828.99

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: apache, mod_pagespeed, cache, nginx, mod pagespeed...

kagg-pagespeed-module/mod-pagespeed.php 92% from 13 tests

This is the main PHP file of "PageSpeed Module" version 2.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("kagg-pagespeed-module.php" instead of "mod-pagespeed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,097 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11204529861
CSS1170110
PO File1161666
JavaScript114655
JSON1005

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity24.60
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods57
▷ Static methods1933.33%
▷ Public methods4985.96%
▷ Protected methods00.00%
▷ Private methods814.04%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants8
▷ Global constants112.50%
▷ Class constants787.50%
▷ Public constants7100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-16x16.png0.76KB0.85KB0.00%