84% openhours

Code Review | Openhours

WordPress plugin Openhours scored84%from 54 tests.

About plugin

  • Plugin page: openhours
  • Plugin version: 1.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jul 5, 2019
  • Latest release: Jul 6, 2019
  • Number of updates: 9
  • Update frequency: every 0.1 days
  • Top authors: upsource (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /4,971 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼0.94ms] Passed 4 tests

Server-side resources used by Openhours
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2345.28 ▲2.88
Dashboard /wp-admin3.53 ▲0.2353.70 ▲2.25
Posts /wp-admin/edit.php3.58 ▲0.2349.28 ▼1.06
Add New Post /wp-admin/post-new.php6.11 ▲0.2386.11 ▼4.90
Media Library /wp-admin/upload.php3.45 ▲0.2235.00 ▼0.05

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_openhours
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Openhours
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.33 ▼0.041.71 ▼0.2244.31 ▼0.40
Dashboard /wp-admin2,200 ▲265.63 ▼0.0595.14 ▲1.8742.91 ▲0.53
Posts /wp-admin/edit.php2,102 ▲22.03 ▲0.0437.62 ▼0.5934.76 ▼3.18
Add New Post /wp-admin/post-new.php1,530 ▲423.14 ▲0.05672.24 ▲55.6856.97 ▲0.23
Media Library /wp-admin/upload.php1,402 ▲54.20 ▲0.02100.50 ▼5.8047.38 ▲4.65

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 were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_openhours
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

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)
Good news, no errors were detected

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/openhours/openhours.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: opening hours, wordpress openhours, operating hours, opening times, office hours...

openhours/openhours.php Passed 13 tests

The principal PHP file in "Openhours" v. 1.0 is loaded by WordPress automatically on each request
63 characters long description:
This plugin displays your office(s) opening hours in real time.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected1,110 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP128271,107
CSS1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity109.00
▷ Minimum class complexity109.00
▷ Maximum class complexity109.00
Average method complexity12.00
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin