78% peakhour

Code Review | Peakhour

WordPress plugin Peakhour scored78%from 54 tests.

About plugin

  • Plugin page: peakhour
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.2-6.3.1
  • WordPress version: 6.3.1
  • First release: Apr 23, 2019
  • Latest release: Sep 19, 2023
  • Number of updates: 17
  • Update frequency: every 94.9 days
  • Top authors: ddalessa (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /833 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.20MB] [CPU: ▼4.73ms] Passed 4 tests

Server-side resources used by Peakhour
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1435.55 ▼0.73
Dashboard /wp-admin3.57 ▲0.2648.15 ▼2.50
Posts /wp-admin/edit.php3.62 ▲0.2651.26 ▼0.17
Add New Post /wp-admin/post-new.php6.08 ▲0.2080.88 ▼15.51
Media Library /wp-admin/upload.php3.43 ▲0.2034.08 ▲1.84

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
peakhour-settings
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Peakhour
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲7013.23 ▼1.075.71 ▲3.7143.36 ▲1.79
Dashboard /wp-admin2,222 ▲374.85 ▼1.01105.28 ▲2.9339.33 ▼5.64
Posts /wp-admin/edit.php2,102 ▲102.05 ▲0.0439.02 ▼6.6735.86 ▼1.90
Add New Post /wp-admin/post-new.php1,546 ▲1822.94 ▲4.45648.17 ▲35.4157.56 ▲3.05
Media Library /wp-admin/upload.php1,398 ▲74.14 ▼0.0798.71 ▲2.8240.86 ▼2.87

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/peakhour/includes/class-peakhour-api.php
    • > /wp-content/plugins/peakhour/includes/class-peakhour-cdn.php
    • > /wp-content/plugins/peakhour/includes/class-peakhour-settings.php
    • > /wp-content/plugins/peakhour/includes/class-peakhour-settings-page.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Peakhour_Header' not found in wp-content/plugins/peakhour/includes/class-peakhour-cache-tags-header.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Peakhour_Settings' not found in wp-content/plugins/peakhour/includes/class-peakhour-remove-query-strings.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Requires php: Version format is invalid
  • Plugin Name: You should set the name of your plugin on the first line ( === peakhour === )
You can take inspiration from this readme.txt

peakhour/peakhour.php Passed 13 tests

The main PHP file in "Peakhour" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
74 characters long description:
Integrate your Wordpress installation with peakhour.io website accelerator

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
No dangerous file extensions were detected1,356 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP112653911,138
Markdown1460218

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes110.00%
▷ Concrete classes990.00%
▷ Final classes00.00%
Methods96
▷ Static methods77.29%
▷ Public methods9093.75%
▷ Protected methods00.00%
▷ Private methods66.25%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.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
There are no PNG files in this plugin