90% woo-coupon-box

Code Review | Coupon Box for WooCommerce

WordPress plugin Coupon Box for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: woo-coupon-box
  • Plugin version: 2.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 28, 2016
  • Latest release: Nov 29, 2023
  • Number of updates: 107
  • Update frequency: every 26.8 days
  • Top authors: mrt3vn (55.14%)thanhtd (16.82%)kimvt1991 (14.95%)mytrinh (12.15%)vietmike (4.67%)

Code review

54 tests

User reviews

36 reviews

Install metrics

2,000+ active /69,282 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼8.36ms] Passed 4 tests

This is a short check of server-side resources used by Coupon Box for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1336.53 ▼4.27
Dashboard /wp-admin3.44 ▲0.0946.34 ▼15.99
Posts /wp-admin/edit.php3.55 ▲0.1948.70 ▲3.09
Add New Post /wp-admin/post-new.php6.02 ▲0.1382.80 ▼15.66
Media Library /wp-admin/upload.php3.36 ▲0.1335.36 ▲2.48

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Coupon Box for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲1214.67 ▲0.331.59 ▼0.3937.13 ▼6.28
Dashboard /wp-admin2,207 ▲275.62 ▼0.0492.76 ▲3.6139.53 ▼1.67
Posts /wp-admin/edit.php2,110 ▲102.01 ▼0.0137.09 ▼0.4734.70 ▲2.08
Add New Post /wp-admin/post-new.php1,540 ▲1423.04 ▲0.06653.59 ▲16.1455.77 ▼1.39
Media Library /wp-admin/upload.php1,403 ▲64.22 ▼0.0097.48 ▼0.6743.63 ▲3.19

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 detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: coupon, coupon box, woocommerce coupon, coupon subscribe, woocommerce subscribe

woo-coupon-box/woo-coupon-box.php 92% from 13 tests

This is the main PHP file of "Coupon Box for WooCommerce" version 2.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 226 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin19,480 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP185873297,003
JavaScript141,3344686,598
CSS407272303,770
SVG4092,109

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity33.88
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods122
▷ Static methods10.82%
▷ Public methods10081.97%
▷ Protected methods1915.57%
▷ Private methods32.46%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 compressed PNG files occupy 0.01MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
images/color-picker-transparency-grid.png2.58KB2.80KB0.00%
images/transparency-grid.png2.58KB2.80KB0.00%
images/scissors.png0.47KB0.39KB▼ 16.35%