84% wc-cancel-order

Code Review | WC Cancel Order

WordPress plugin WC Cancel Order scored 84% from 54 tests.

About plugin

  • Plugin page: wc-cancel-order
  • Plugin version: 3.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0+
  • WordPress version: 6.3.1
  • First release: Nov 9, 2014
  • Latest release: Aug 23, 2023
  • Number of updates: 73
  • Update frequency: every 44.0 days
  • Top authors: jodhavishalsingh (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

7,000+ active / 107,347 total downloads

Benchmarks

Plugin footprint 83% from 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.12MB] [CPU: ▼2.19ms] Passed 4 tests

Server-side resources used by WC Cancel Order
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1236.67 ▼4.72
Dashboard /wp-admin3.42 ▲0.1247.13 ▲0.02
Posts /wp-admin/edit.php3.54 ▲0.1849.51 ▼0.46
Add New Post /wp-admin/post-new.php6.01 ▲0.1294.22 ▼2.20
Media Library /wp-admin/upload.php3.35 ▲0.1234.63 ▼1.39

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

WC Cancel Order: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.17 ▼1.201.76 ▲0.0139.50 ▼8.70
Dashboard /wp-admin2,206 ▲185.90 ▲0.03104.92 ▲4.6940.17 ▲0.72
Posts /wp-admin/edit.php2,089 ▼32.06 ▲0.0539.32 ▼0.7534.21 ▼2.72
Add New Post /wp-admin/post-new.php1,547 ▲1418.31 ▼4.73624.28 ▼23.3361.75 ▲8.51
Media Library /wp-admin/upload.php1,391 ▲34.17 ▼0.0396.30 ▼2.0143.75 ▼2.20

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 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 50% from 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
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wc-cancel-order/includes/dashboard.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #10, #11, #12, #2, #3, #4, #5, #6, #7, #8, #9 in wc-cancel-order/assets to your readme.txt
Please take inspiration from this readme.txt

wc-cancel-order/wc-cancel-order.php Passed 13 tests

"WC Cancel Order" version 3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
72 characters long description:
Allow customers to send order cancellation request from my account page.

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
Success! There were no dangerous files found in this plugin2,709 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP172341941,296
PO File3267337704
CSS321398
JavaScript31810285
SVG11013
XML10013

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity21.33
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods86
▷ Static methods66.98%
▷ Public methods86100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin