94% advanced-coupons-for-woocommerce-free

Code Review | Advanced Coupons for WooCommerce Coupons

WordPress plugin Advanced Coupons for WooCommerce Coupons scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-coupons-...
  • Plugin version: 4.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 5.9.2
  • First release: May 5, 2020
  • Latest release: Mar 21, 2022
  • Number of updates: 74
  • Update frequency: every 9.5 days
  • Top authors: jkohlbach (75.68%)rymera01 (25.68%)

Code review

54 tests

User reviews

59 reviews

Install metrics

10,000+ active / 217,663 total downloads

Benchmarks

Plugin footprint Passed 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.23MB] [CPU: ▼297.09ms] Passed 4 tests

An overview of server-side resources used by Advanced Coupons for WooCommerce Coupons
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.2957.74 ▲9.75
Dashboard /wp-admin3.64 ▲0.2334.17 ▲1.76
Posts /wp-admin/edit.php3.87 ▲0.2238.88 ▲2.71
Add New Post /wp-admin/post-new.php7.17 ▲0.1993.10 ▼1,192.92
Media Library /wp-admin/upload.php3.58 ▲0.2825.58 ▲0.09

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 335 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Coupons for WooCommerce Coupons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲9415.57 ▼0.225.65 ▼0.572.07 ▼0.18
Dashboard /wp-admin2,951 ▲936.02 ▼0.17118.90 ▼15.87191.33 ▲28.68
Posts /wp-admin/edit.php2,742 ▲543.24 ▼0.0064.59 ▼0.05167.91 ▲25.58
Add New Post /wp-admin/post-new.php1,719 ▲820.71 ▼0.55427.84 ▼31.17159.75 ▲7.20
Media Library /wp-admin/upload.php1,746 ▲485.69 ▲0.20126.71 ▼19.15232.84 ▲48.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Coupon' not found in wp-content/plugins/advanced-coupons-for-woocommerce-free/Models/Objects/Advanced_Coupon.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

advanced-coupons-for-woocommerce-free/advanced-coupons-for-woocommerce-free.php Passed 13 tests

The entry point to "Advanced Coupons for WooCommerce Coupons" version 4.0.2 is a PHP file that has certain tags in its header comment area
140 characters long description:
Advanced Coupons for WooCommerce (Free Version) gives WooCommerce store owners extra coupon features so they can market their stores better.

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 plugin63,541 lines of code in 279 files:
LanguageFilesBlank linesComment linesLines of code
JSON102039,294
PHP733,0397,97411,120
TypeScript1261,7421,4487,090
Sass3557712,578
PO File16387432,141
CSS144620798
JavaScript176247491
HTML12817
SVG20012

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.40
Average class complexity32.02
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces11
Interfaces5
Traits0
Classes36
▷ Abstract classes25.56%
▷ Concrete classes3494.44%
▷ Final classes00.00%
Methods638
▷ Static methods345.33%
▷ Public methods50178.53%
▷ Protected methods223.45%
▷ Private methods11518.03%
Functions57
▷ Named functions23.51%
▷ Anonymous functions5596.49%
Constants81
▷ Global constants00.00%
▷ Class constants81100.00%
▷ Public constants81100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.22MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/Wholesale-Suite-Icon-WC-Marketing.png1.04KB0.71KB▼ 32.27%
images/coupons-free-guide.png111.73KB39.52KB▼ 64.63%
images/premium-add-on-sidebar.png37.64KB9.26KB▼ 75.40%
images/acfw-logo.png8.13KB3.88KB▼ 52.23%
images/Advanced-Coupons-Icon-WC-Marketing.png1.48KB1.56KB0.00%