84% crontrol-hours

Code Review | WP Crontrol Hours

WordPress plugin WP Crontrol Hours scored84%from 54 tests.

About plugin

  • Plugin page: crontrol-hours
  • Plugin version: 2.1.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.4
  • WordPress version: 6.3.1
  • First release: Nov 8, 2022
  • Latest release: Nov 9, 2023
  • Number of updates: 13
  • Update frequency: every 28.2 days
  • Top authors: tessawatkinsllc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /537 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼1.08ms] Passed 4 tests

A check of server-side resources used by WP Crontrol Hours
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3040.59 ▲0.64
Dashboard /wp-admin3.64 ▲0.3448.49 ▼1.14
Posts /wp-admin/edit.php3.75 ▲0.4049.34 ▼0.71
Add New Post /wp-admin/post-new.php6.22 ▲0.3383.29 ▼3.12
Media Library /wp-admin/upload.php3.56 ▲0.3338.92 ▲6.30
Cron Hours /wp-admin/tools.php?page=crontrol-hours3.6038.09

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
crontrol_hours_duration
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WP Crontrol Hours
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3213.98 ▼0.371.77 ▲0.0343.90 ▼2.41
Dashboard /wp-admin2,199 ▲195.66 ▼0.0284.76 ▼3.7136.24 ▼6.99
Posts /wp-admin/edit.php2,104 ▲41.97 ▲0.0339.81 ▲0.0436.25 ▼3.31
Add New Post /wp-admin/post-new.php1,529 ▼023.01 ▼0.28681.36 ▲56.2966.09 ▲11.19
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.00111.12 ▲3.8748.01 ▲2.47
Cron Hours /wp-admin/tools.php?page=crontrol-hours1,3212.0529.0563.00

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • crontrol_hours_duration
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/crontrol-hours/templates/dashboard-support.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/crontrol-hours/templates/dashboard-admin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

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
7 plugin tags: limit hours, business hours, cron, after hours, wp-cron...

crontrol-hours/crontrol-hours.php Passed 13 tests

This is the main PHP file of "WP Crontrol Hours" version 2.1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
87 characters long description:
Take control of your CRON jobs by restricting them to your website's low traffic hours.

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
Everything looks great! No dangerous files found in this plugin2,529 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP7896271,298
CSS417864903
JavaScript2471328

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity58.33
▷ Minimum class complexity38.00
▷ Maximum class complexity86.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods2354.76%
▷ Public methods3992.86%
▷ Protected methods00.00%
▷ Private methods37.14%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 compressed PNG files occupy 0.01MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/admin-logo.png4.75KB5.02KB0.00%
assets/images/check.png0.55KB0.57KB0.00%
assets/images/kofi-cup.png3.85KB4.10KB0.00%