90% woo-customer-coupons

Code Review | Customer Coupons for WooCommerce

WordPress plugin Customer Coupons for WooCommerce scored 90% from 54 tests.

About plugin

  • Plugin page: woo-customer-coupons
  • Plugin version: 1.3.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: May 1, 2019
  • Latest release: Apr 12, 2023
  • Number of updates: 43
  • Update frequency: every 33.8 days
  • Top authors: mytrinh (74.42%)kimvt1991 (18.6%)mrt3vn (11.63%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active / 6,184 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 gracefully, with no errors

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

Analyzing server-side resources used by Customer Coupons for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.69 ▼3.73
Dashboard /wp-admin3.33 ▲0.0244.72 ▼5.60
Posts /wp-admin/edit.php3.38 ▲0.0250.76 ▼1.58
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.39 ▼24.62
Media Library /wp-admin/upload.php3.25 ▲0.0230.15 ▼9.10

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Customer Coupons for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.23 ▼1.335.57 ▲3.6953.26 ▲8.38
Dashboard /wp-admin2,211 ▲264.84 ▼0.06112.30 ▼41.7645.26 ▼6.26
Posts /wp-admin/edit.php2,093 ▲12.06 ▲0.0045.13 ▲2.7645.37 ▲5.76
Add New Post /wp-admin/post-new.php1,524 ▼1823.19 ▲4.98706.36 ▲5.2960.34 ▲1.56
Media Library /wp-admin/upload.php1,390 ▲24.25 ▲0.01114.38 ▼10.2949.29 ▼1.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: coupons, custom coupons for woocommerce, woocommerce customer coupons, wc coupons, woocommerce coupons...

woo-customer-coupons/woo-customer-coupons.php Passed 13 tests

The primary PHP file in "Customer Coupons for WooCommerce" version 1.3.1 is used by WordPress to initiate all plugin functionality
79 characters long description:
Customer Coupons for WooCommerce helps you display your coupons on the website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin6,163 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP131361272,900
SVG1041,514
JavaScript202574694
CSS1955101659
Sass25927396

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity43.71
▷ Minimum class complexity4.00
▷ Maximum class complexity108.00
Average method complexity4.99
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods72
▷ Static methods1318.06%
▷ Public methods6691.67%
▷ Protected methods45.56%
▷ Private methods22.78%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants12
▷ Global constants12100.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
1 PNG file occupies 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/minicolors.png67.02KB34.31KB▼ 48.80%