83% stylish-business-hours

Code Review | Stylish Business Hours

WordPress plugin Stylish Business Hours scored83%from 54 tests.

About plugin

  • Plugin page: stylish-business-...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Jul 4, 2022
  • Latest release: Aug 17, 2023
  • Number of updates: 6
  • Update frequency: every 68.5 days
  • Top authors: designful (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active /825 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

This is a short check of server-side resources used by Stylish Business Hours
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.02 ▲2.56
Dashboard /wp-admin3.33 ▲0.0348.89 ▼8.28
Posts /wp-admin/edit.php3.39 ▲0.0352.41 ▲1.31
Add New Post /wp-admin/post-new.php5.93 ▲0.0598.39 ▲4.37
Media Library /wp-admin/upload.php3.26 ▲0.0336.30 ▲0.64
All Lists /wp-admin/admin.php?page=business_hour_listing3.2933.55
Add New List /wp-admin/admin.php?page=business_hour_page_new3.9072.06

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Stylish Business Hours
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲6313.73 ▼0.811.68 ▼0.7041.50 ▼3.40
Dashboard /wp-admin2,233 ▲454.92 ▼0.98104.45 ▼11.2569.84 ▲24.59
Posts /wp-admin/edit.php2,122 ▲332.00 ▼0.0438.41 ▲1.0036.69 ▲3.68
Add New Post /wp-admin/post-new.php1,693 ▲16022.41 ▼1.06705.15 ▲36.8351.29 ▼12.14
Media Library /wp-admin/upload.php1,412 ▲244.11 ▼0.1399.47 ▼5.9863.21 ▲18.82
All Lists /wp-admin/admin.php?page=business_hour_listing9311.8929.6381.77
Add New List /wp-admin/admin.php?page=business_hour_page_new3,8902.1438.7865.25

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 31× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: datas in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stylish-business-hours/shortcode/businesshourFront.php:7
    • > PHP Notice
      Undefined variable: datas in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 24
    • > PHP Notice
      Undefined variable: datas in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 24
    • > PHP Notice
      Trying to get property 'days' of non-object in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php:37
    • > PHP Notice
      Undefined variable: datas in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 17
    • > PHP Notice
      Undefined variable: datas in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 24
    • > PHP Notice
      Trying to get property 'style' of non-object in wp-content/plugins/stylish-business-hours/admin/view/businessHourView.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/stylish-business-hours/admin/businesshour_ajax.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention: You can take inspiration from this readme.txt

stylish-business-hours/businessHours.php 92% from 13 tests

The entry point to "Stylish Business Hours" version 1.0.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("stylish-business-hours.php" instead of "businessHours.php")

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
Success! There were no dangerous files found in this plugin3,152 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP10147801,620
CSS5222341,138
JavaScript43937307
HTML12058
Markdown116029

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity14.71
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods52
▷ Static methods00.00%
▷ Public methods5096.15%
▷ Protected methods00.00%
▷ Private methods23.85%
Functions8
▷ Named functions112.50%
▷ Anonymous functions787.50%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
25 PNG files occupy 0.68MB with 0.31MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/sbh_icon2.png3.49KB1.10KB▼ 68.46%
assets/images/Stylish-Business-Hours-Logo1.png3.22KB2.62KB▼ 18.72%
assets/images/admin_icon.png5.54KB1.80KB▼ 67.59%
assets/images/img_data.png14.37KB7.01KB▼ 51.22%
assets/images/Stylish-Business-Hours-Logo.png3.22KB2.62KB▼ 18.72%