90% wc-disable-sales

Code Review | Disable Sales for WooCommerce

WordPress plugin Disable Sales for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: wc-disable-sales
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 13, 2021
  • Latest release: Oct 5, 2021
  • Number of updates: 9
  • Update frequency: every 5.9 days
  • Top authors: michaltry (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active /4,974 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.70ms] Passed 4 tests

This is a short check of server-side resources used by Disable Sales for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.54 ▼7.48
Dashboard /wp-admin3.36 ▲0.0547.60 ▼2.62
Posts /wp-admin/edit.php3.47 ▲0.1151.88 ▲2.09
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.57 ▼2.78
Media Library /wp-admin/upload.php3.28 ▲0.0542.84 ▲5.60

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Disable Sales for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲4113.68 ▼0.701.49 ▼0.7537.90 ▼6.84
Dashboard /wp-admin2,218 ▲304.85 ▼0.95113.83 ▼0.1244.27 ▲2.38
Posts /wp-admin/edit.php2,100 ▲112.05 ▲0.0537.80 ▲0.9729.70 ▼5.00
Add New Post /wp-admin/post-new.php1,545 ▲3123.34 ▲5.80664.07 ▼32.7147.82 ▼8.73
Media Library /wp-admin/upload.php1,403 ▲154.14 ▼0.01105.31 ▲1.8143.78 ▲0.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: temporarily, disable, vacation, off, sales...

wc-disable-sales/wc-disable-sales.php Passed 13 tests

The main PHP file in "Disable Sales for WooCommerce" ver. 1.0.8 adds more information about the plugin and also serves as the entry point for this plugin
75 characters long description:
Allows to temporarily disable WooCommerce shop abilities in given timeframe

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
Everything looks great! No dangerous files found in this plugin359 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP348111224
PO File24225135

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1178.57%
▷ Protected methods00.00%
▷ Private methods321.43%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin