83% website-open-close-hours

Code Review | Conditional redirect based on time

WordPress plugin Conditional redirect based on time scored 83% from 54 tests.

About plugin

  • Plugin page: website-open-clos...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 28, 2018
  • Latest release: Nov 4, 2022
  • Number of updates: 19
  • Update frequency: every 85.6 days
  • Top authors: galaxyweblinks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,436 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

This is a short check of server-side resources used by Conditional redirect based on time
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1341.00 ▼0.71
Dashboard /wp-admin3.42 ▲0.1246.41 ▲0.84
Posts /wp-admin/edit.php3.47 ▲0.1247.73 ▲4.84
Add New Post /wp-admin/post-new.php6.00 ▲0.1292.91 ▲1.84
Media Library /wp-admin/upload.php3.34 ▲0.1235.02 ▲2.91

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 14 new options
New WordPress options
woch_sun_web_status
theysaidso_admin_options
woch_tues_web_status
woch_mon_web_status
db_upgraded
woch_version
widget_recent-posts
can_compress_scripts
widget_recent-comments
woch_wed_web_status
...

Browser metrics Passed 4 tests

An overview of browser requirements for Conditional redirect based on time
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲9813.48 ▼1.191.71 ▼0.3940.74 ▼2.18
Dashboard /wp-admin2,222 ▲304.87 ▼0.10107.73 ▲0.0741.47 ▲2.18
Posts /wp-admin/edit.php2,105 ▲162.04 ▲0.0439.75 ▲4.0636.78 ▲1.07
Add New Post /wp-admin/post-new.php1,556 ▲4218.26 ▲0.60596.03 ▼69.2350.95 ▲2.38
Media Library /wp-admin/upload.php1,404 ▲194.22 ▲0.0498.14 ▼4.5740.75 ▼5.78

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
  • The uninstall procedure has failed, leaving 14 options in the database
    • widget_theysaidso_widget
    • woch_fri_web_status
    • woch_tues_web_status
    • woch_sun_web_status
    • woch_wed_web_status
    • widget_recent-comments
    • theysaidso_admin_options
    • woch_thurs_web_status
    • widget_recent-posts
    • can_compress_scripts
    • ...

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/website-open-close-hours/website_open_close_hours.php

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

readme.txt 88% from 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
Attributes that need to be fixed:
  • Requires php: Version format is invalid
  • Requires at least: Version format is invalid
You can take inspiration from this readme.txt

website-open-close-hours/website_open_close_hours.php 85% from 13 tests

The entry point to "Conditional redirect based on time" version 1.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("website-open-close-hours.php" instead of "website_open_close_hours.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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 plugin861 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP24740550
JavaScript2616193
CSS200118

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png26.99KB15.40KB▼ 42.96%