90% wc-alcohol

Code Review | WooCommerce Alcohol Sale Restrictions

WordPress plugin WooCommerce Alcohol Sale Restrictions scored90%from 54 tests.

About plugin

  • Plugin page: wc-alcohol
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Feb 21, 2018
  • Latest release: Oct 23, 2023
  • Number of updates: 20
  • Update frequency: every 103.5 days
  • Top authors: alexminza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,090 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.75ms] Passed 4 tests

A check of server-side resources used by WooCommerce Alcohol Sale Restrictions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0534.19 ▼6.78
Dashboard /wp-admin3.36 ▲0.0144.02 ▼17.65
Posts /wp-admin/edit.php3.47 ▲0.1146.58 ▲2.00
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.63 ▼6.31
Media Library /wp-admin/upload.php3.28 ▲0.0533.28 ▼0.26

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Alcohol Sale Restrictions
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.31 ▼0.041.53 ▼0.0636.33 ▼9.89
Dashboard /wp-admin2,195 ▲215.62 ▼0.0783.09 ▼18.7237.02 ▼6.23
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0933.49 ▼4.2234.56 ▼2.07
Add New Post /wp-admin/post-new.php1,526 ▼223.32 ▲0.12686.65 ▲25.5463.48 ▲6.37
Media Library /wp-admin/upload.php1,400 ▼04.26 ▲0.0398.03 ▲1.2844.35 ▼0.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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
5 plugin tags: time, woocommerce, alcohol, sale, restriction

wc-alcohol/wc-alcohol.php Passed 13 tests

This is the main PHP file of "WooCommerce Alcohol Sale Restrictions" version 1.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
61 characters long description:
WooCommerce alcohol sale limitations during restriction hours

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected455 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP17759293
PO File24044134
JSON10028

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity44.00
▷ Minimum class complexity44.00
▷ Maximum class complexity44.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods945.00%
▷ Protected methods1050.00%
▷ Private methods15.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.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
No PNG files were detected