89% woo-prevent-cancel-order

Code Review | Prevent Customers To Cancel WooCommerce Orders

WordPress plugin Prevent Customers To Cancel WooCommerce Orders scored89%from 54 tests.

About plugin

  • Plugin page: woo-prevent-cance...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: May 4, 2017
  • Latest release: Jul 21, 2021
  • Number of updates: 20
  • Update frequency: every 77.0 days
  • Top authors: tychesoftwares (95%)ashokrane (10%)

Code review

54 tests

User reviews

1 review

Install metrics

800+ active /4,691 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.10ms] Passed 4 tests

Analyzing server-side resources used by Prevent Customers To Cancel WooCommerce Orders
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0137.76 ▼1.53
Dashboard /wp-admin3.31 ▲0.0145.04 ▼1.37
Posts /wp-admin/edit.php3.36 ▲0.0046.25 ▲0.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.36 ▼17.92
Media Library /wp-admin/upload.php3.23 ▲0.0034.13 ▲0.85

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Prevent Customers To Cancel WooCommerce Orders: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.58 ▼0.611.64 ▼0.4240.64 ▼8.64
Dashboard /wp-admin2,206 ▲184.85 ▼1.03103.36 ▼1.2339.14 ▼3.94
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0439.18 ▼3.1635.54 ▲0.94
Add New Post /wp-admin/post-new.php1,542 ▼018.35 ▲0.02632.40 ▲34.5354.89 ▲9.33
Media Library /wp-admin/upload.php1,385 ▼04.21 ▼0.1298.54 ▼2.4142.34 ▼0.62

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
1 plugin tags: woocommerce cancel order

woo-prevent-cancel-order/woo-prevent-cancel-order.php 85% from 13 tests

The main PHP script in "Prevent Customers To Cancel WooCommerce Orders" version 1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("1.3" instead of "3.0")
  • Description: Keep the plugin description shorter than 140 characters (currently 174 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected43 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2134643

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code1.07
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods375.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png28.90KB10.24KB▼ 64.55%