84% better-business-hours

Code Review | Better Business Hours

WordPress plugin Better Business Hours scored84%from 54 tests.

About plugin

  • Plugin page: better-business-h...
  • Plugin version: 1.0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0
  • WordPress version: 6.3.1
  • First release: May 25, 2017
  • Latest release: Jun 15, 2022
  • Number of updates: 15
  • Update frequency: every 123.8 days
  • Top authors: croixhaug (60%)nsquaredteam (46.67%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,574 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.62MB] [CPU: ▼13.94ms] Passed 4 tests

A check of server-side resources used by Better Business Hours
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0539.75 ▲1.42
Dashboard /wp-admin3.34 ▲0.0445.24 ▼2.14
Posts /wp-admin/edit.php3.39 ▲0.0346.87 ▼4.71
Add New Post /wp-admin/post-new.php3.31 ▼2.5837.01 ▼47.80
Media Library /wp-admin/upload.php3.26 ▲0.0335.34 ▼1.11

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_better-business-hours-widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Better Business Hours: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲17814.96 ▲0.2916.43 ▲14.4840.72 ▼5.10
Dashboard /wp-admin2,219 ▲345.76 ▲0.9292.18 ▼10.3540.25 ▼4.93
Posts /wp-admin/edit.php2,108 ▲162.04 ▼0.0039.78 ▲2.6435.75 ▲1.39
Add New Post /wp-admin/post-new.php1,527 ▼917.78 ▼5.50647.96 ▲49.7467.80 ▲18.30
Media Library /wp-admin/upload.php1,407 ▲194.19 ▼0.1495.29 ▼6.1839.91 ▼3.70

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_better-business-hours-widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/better-business-hours/includes/class-widget.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'BBH_Settings' not found in wp-content/plugins/better-business-hours/includes/template-display-hours.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/better-business-hours/includes/class-api-availability.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Better_Business_Hours' not found in wp-content/plugins/better-business-hours/includes/admin-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/better-business-hours/better-business-hours.php:386
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/better-business-hours/includes/class-api-settings.php:14

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: business hours widget, business hours

better-business-hours/better-business-hours.php Passed 13 tests

This is the main PHP file of "Better Business Hours" version 1.0.3.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
42 characters long description:
Easily set and display your business hours

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin14,595 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript51,24386513,378
PHP10191656891
Sass2110159
CSS2437154
Ruby17513

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity5.38
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.41
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods86
▷ Static methods78.14%
▷ Public methods8194.19%
▷ Protected methods33.49%
▷ Private methods22.33%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pencil.png1.07KB0.25KB▼ 76.74%
assets/images/eraser.png1.07KB0.25KB▼ 77.00%