93% store-opening-hours-for-woocommerce

Code Review | Store Opening Hours For WooCommerce

WordPress plugin Store Opening Hours For WooCommerce scored 93% from 54 tests.

About plugin

  • Plugin page: store-opening-hou...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Jun 26, 2021
  • Latest release: Jan 22, 2022
  • Number of updates: 6
  • Update frequency: every 35.0 days
  • Top authors: elegantapps27 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active / 365 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.02MB] [CPU: ▼326.47ms] Passed 4 tests

This is a short check of server-side resources used by Store Opening Hours For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0155.72 ▼2.47
Dashboard /wp-admin3.42 ▲0.0035.25 ▲2.47
Posts /wp-admin/edit.php3.65 ▲0.0050.51 ▼75.03
Add New Post /wp-admin/post-new.php6.89 ▼0.0994.24 ▼1,225.84
Media Library /wp-admin/upload.php3.30 ▲0.0023.62 ▼2.53
Essential Kit /wp-admin/admin.php?page=soh_kit3.1018.26
Store Opening Hours Settings /wp-admin/admin.php?page=store-opening-hours-settings3.1019.06

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Store Opening Hours For WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,036 ▲28217.71 ▲2.066.26 ▲0.602.32 ▼0.51
Dashboard /wp-admin2,895 ▲376.18 ▼0.02119.80 ▼16.16161.36 ▲3.02
Posts /wp-admin/edit.php2,657 ▼283.23 ▼0.0197.74 ▲32.35142.67 ▼6.11
Add New Post /wp-admin/post-new.php1,668 ▼118.92 ▼2.14398.69 ▼53.99190.44 ▲24.39
Media Library /wp-admin/upload.php1,698 ▼05.53 ▼0.01116.91 ▼30.41195.05 ▲9.51
Essential Kit /wp-admin/admin.php?page=soh_kit280.940.0316.80
Store Opening Hours Settings /wp-admin/admin.php?page=store-opening-hours-settings280.940.0417.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=soh_kit
    • > Network (severe)
    wp-admin/admin.php?page=soh_kit - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=store-opening-hours-settings
    • > Network (severe)
    wp-admin/admin.php?page=store-opening-hours-settings - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt is a good inspiration

store-opening-hours-for-woocommerce/store_opening_hours_main.php 77% from 13 tests

The entry point to "Store Opening Hours For WooCommerce" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("store-opening-hours-for-woocommerce.php" instead of "store_opening_hours_main.php")
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin4,029 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP5146171,774
CSS343491,558
JavaScript3150169696
SVG1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity54.80
▷ Minimum class complexity3.00
▷ Maximum class complexity189.00
Average method complexity9.15
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods33
▷ Static methods412.12%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Close.png0.48KB0.61KB0.00%
images/open.png4.38KB1.95KB▼ 55.49%
images/support.png6.44KB5.59KB▼ 13.09%
images/review.png15.87KB11.90KB▼ 25.01%
images/star.png39.75KB10.35KB▼ 73.95%