90% wc-apply-coupon-on-post-order

Code Review | Coupon Manager & Reporting Lite for WooCommerce

WordPress plugin Coupon Manager & Reporting Lite for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: wc-apply-coupon-o...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9.1
  • WordPress version: 6.3.1
  • First release: Jan 24, 2019
  • Latest release: Apr 4, 2022
  • Number of updates: 25
  • Update frequency: every 46.7 days
  • Top authors: redefiningtheweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,638 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.93ms] Passed 4 tests

Analyzing server-side resources used by Coupon Manager & Reporting Lite for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.63 ▼0.33
Dashboard /wp-admin3.31 ▲0.0152.41 ▲1.52
Posts /wp-admin/edit.php3.36 ▲0.0148.24 ▲0.74
Add New Post /wp-admin/post-new.php5.89 ▲0.0189.17 ▼5.64
Media Library /wp-admin/upload.php3.23 ▲0.0145.49 ▲11.93

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Coupon Manager & Reporting Lite for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.29 ▼0.421.81 ▼0.0136.00 ▼7.54
Dashboard /wp-admin2,195 ▲175.62 ▼0.0791.62 ▼25.5940.25 ▼4.96
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0440.87 ▲5.2836.50 ▲3.26
Add New Post /wp-admin/post-new.php1,526 ▼323.26 ▲0.26595.18 ▼44.6270.12 ▲15.65
Media Library /wp-admin/upload.php1,397 ▼34.19 ▲0.0294.88 ▼3.0141.29 ▲0.16

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_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

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 on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: woocommerce coupon generator, order coupon, woocommerce order coupon, apply coupon on order, coupon...

wc-apply-coupon-on-post-order/wc-apply-coupon-on-post-order.php Passed 13 tests

The primary PHP file in "Coupon Manager & Reporting Lite for WooCommerce" version 1.0.0 is used by WordPress to initiate all plugin functionality
96 characters long description:
This is a short description of what the plugin does. It's displayed in the WordPress admin area.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin843 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP16233899728
JavaScript2105458
PO File1191957

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.82
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods55
▷ Static methods00.00%
▷ Public methods4581.82%
▷ Protected methods00.00%
▷ Private methods1018.18%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 were not PNG files found in your plugin