89% woocommerce-prevent-purchase

Code Review | WooCommerce - Prevent Purchase

WordPress plugin WooCommerce - Prevent Purchase scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-preve...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1.1
  • WordPress version: 6.3.1
  • First release: Mar 19, 2015
  • Latest release: Mar 20, 2015
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: sumobi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /1,826 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by WooCommerce - Prevent Purchase
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.29 ▲0.42
Dashboard /wp-admin3.34 ▼0.0046.21 ▼17.06
Posts /wp-admin/edit.php3.39 ▲0.0347.38 ▼3.45
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.23 ▼9.94
Media Library /wp-admin/upload.php3.26 ▲0.0339.09 ▼3.39

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce - Prevent Purchase
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5713.20 ▼1.261.77 ▼0.3639.13 ▼1.46
Dashboard /wp-admin2,224 ▲214.84 ▼0.06112.23 ▼0.7044.12 ▲1.87
Posts /wp-admin/edit.php2,103 ▲32.04 ▲0.0436.24 ▼3.9831.48 ▼7.03
Add New Post /wp-admin/post-new.php1,548 ▼223.07 ▼0.13661.08 ▼20.9960.36 ▲0.42
Media Library /wp-admin/upload.php1,403 ▲64.25 ▲0.0598.63 ▼43.4942.82 ▼9.29

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 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: woocommerce, purchase, prevent, disable, sumobi

woocommerce-prevent-purchase/woocommerce-prevent-purchase.php 85% from 13 tests

The main PHP script in "WooCommerce - Prevent Purchase" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")

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 detected145 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP259137145

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.50
▷ Minimum class complexity5.00
▷ Maximum class complexity12.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin