10% wp-business-hours

Code Review | Plugin Name: WP Business Hours

WordPress plugin Plugin Name: WP Business Hours scored10%from 54 tests.

About plugin

  • Plugin page: wp-business-hours
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8
  • WordPress version: 6.3.1
  • First release: Oct 26, 2013
  • Latest release: May 16, 2014
  • Number of updates: 13
  • Update frequency: every 15.9 days
  • Top authors: mejar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,107 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/wp-business-hours/wp-business-hours.php+120
    Methods with the same name as their class will not be constructors in a future version of PHP; BHS_Widget has a deprecated constructor

Server metrics [RAM: ▼1.96MB] [CPU: ▼60.75ms] Passed 4 tests

An overview of server-side resources used by Plugin Name: WP Business Hours
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.425.19 ▼38.05
Dashboard /wp-admin2.10 ▼1.295.67 ▼62.00
Posts /wp-admin/edit.php2.10 ▼1.306.35 ▼42.77
Add New Post /wp-admin/post-new.php2.10 ▼3.835.72 ▼100.19
Media Library /wp-admin/upload.php2.10 ▼1.175.55 ▼34.16
Business Hours /wp-admin/options-general.php?page=wp-business-hours2.105.96

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 9 new options
New WordPress options
wp_business_hours_css
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
widget_businessh-widget
wp_business_hours

Browser metrics Passed 4 tests

Plugin Name: WP Business Hours: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.16 ▼0.191.98 ▲0.3044.66 ▲2.44
Dashboard /wp-admin2,202 ▲285.61 ▼0.0790.57 ▼6.1841.96 ▲1.80
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0538.75 ▲0.9136.72 ▼2.92
Add New Post /wp-admin/post-new.php1,529 ▼923.09 ▲0.01666.67 ▼13.1653.30 ▼7.70
Media Library /wp-admin/upload.php1,404 ▲74.19 ▼0.02101.12 ▲1.6545.81 ▲3.81
Business Hours /wp-admin/options-general.php?page=wp-business-hours9761.9924.8129.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wp-business-hours/wp-business-hours.php+120
    Methods with the same name as their class will not be constructors in a future version of PHP; BHS_Widget has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • wp_business_hours_css
    • widget_businessh-widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • wp_business_hours
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp-business-hours
    • > Deprecated in wp-content/plugins/wp-business-hours/wp-business-hours.php+120
    Methods with the same name as their class will not be constructors in a future version of PHP; BHS_Widget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wp-business-hours
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in BHS_Widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% 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
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-business-hours/wp-business-hours.php:27

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Default Display)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === Plugin Name: WP Business Hours === )
The official readme.txt is a good inspiration

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

The entry point to "Plugin Name: WP Business Hours" version 1.4 is a PHP file that has certain tags in its header comment area
99 characters long description:
Plugin is to show Business hours, Admin can manage the business hours Weekly. widget and shortcode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected131 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11310131

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png19.98KB6.19KB▼ 69.01%