84% advanced-coupons-for-woocommerce-free

Code Review | Advanced Coupons – WooCommerce Coupons, Store Credit, Gift Cards, Loyalty Program, BOGO Coupons, Discount Rules

WordPress plugin Advanced Coupons – WooCommerce Coupons, Store Credit, Gift Cards, Loyalty Program, BOGO Coupons, Discount Rules scored84%from 54 tests.

About plugin

  • Plugin page: advanced-coupons-...
  • Plugin version: 4.5.8.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.1
  • WordPress version: 6.3.1
  • First release: May 5, 2020
  • Latest release: Nov 28, 2023
  • Number of updates: 137
  • Update frequency: every 9.7 days
  • Top authors: jkohlbach (64.23%)rymera01 (20.44%)junixdev (16.79%)

Code review

54 tests

User reviews

120 reviews

Install metrics

10,000+ active /571,488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.30MB] [CPU: ▼7.06ms] Passed 4 tests

A check of server-side resources used by Advanced Coupons – WooCommerce Coupons, Store Credit, Gift Cards, Loyalty Program, BOGO Coupons, Discount Rules
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3535.46 ▼6.46
Dashboard /wp-admin3.65 ▲0.3050.61 ▼14.07
Posts /wp-admin/edit.php3.70 ▲0.3449.91 ▲1.20
Add New Post /wp-admin/post-new.php6.17 ▲0.2890.18 ▼8.91
Media Library /wp-admin/upload.php3.51 ▲0.2836.90 ▲4.25

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 468 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Coupons – WooCommerce Coupons, Store Credit, Gift Cards, Loyalty Program, BOGO Coupons, Discount Rules
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6414.74 ▲0.421.64 ▼0.0630.72 ▼13.58
Dashboard /wp-admin2,234 ▲565.54 ▼0.1396.87 ▼10.1889.45 ▲46.38
Posts /wp-admin/edit.php2,136 ▲332.12 ▲0.1439.44 ▼0.4340.78 ▲7.69
Add New Post /wp-admin/post-new.php1,568 ▲3123.12 ▲0.10762.71 ▲171.4455.85 ▼0.83
Media Library /wp-admin/upload.php1,436 ▲424.23 ▲0.0497.36 ▼0.4479.62 ▲38.63

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • 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 everything seems fine, this is not an exhaustive test

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
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/advanced-coupons-for-woocommerce-free/Models/Objects/Emails/Coupon.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ACFWF\\Abstracts\\Base_Model' not found in wp-content/plugins/advanced-coupons-for-woocommerce-free/Models/Objects/Blocks/Checkout_Integration.php:13
    • > PHP Fatal error
      Trait 'ACFWF\\Traits\\Singleton' not found in wp-content/plugins/advanced-coupons-for-woocommerce-free/Abstracts/Base_Model.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'ACFWF\\Abstracts\\Base_Model' not found in wp-content/plugins/advanced-coupons-for-woocommerce-free/Models/Objects/Blocks/Cart_Integration.php:13
    • > 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
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/advanced-coupons-for-woocommerce-free/views/coupons/view-email-preview-error.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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:
  • Tags: There are too many tags (23 tag instead of maximum 10)
The official readme.txt might help

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

This is the main PHP file of "Advanced Coupons – WooCommerce Coupons, Store Credit, Gift Cards, Loyalty Program, BOGO Coupons, Discount Rules" version 4.5.8.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin32,826 lines of code in 414 files:
LanguageFilesBlank linesComment linesLines of code
PHP1234,14312,68916,569
TypeScript1872,4872,3509,457
Sass4479213,785
PO File19221,2301,906
CSS154527638
JSON100260
SVG4140148
JavaScript3918263

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity24.41
▷ Minimum class complexity1.00
▷ Maximum class complexity174.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces17
Interfaces5
Traits3
Classes70
▷ Abstract classes45.71%
▷ Concrete classes6694.29%
▷ Final classes00.00%
Methods962
▷ Static methods424.37%
▷ Public methods75678.59%
▷ Protected methods525.41%
▷ Private methods15416.01%
Functions66
▷ Named functions23.03%
▷ Anonymous functions6496.97%
Constants112
▷ Global constants00.00%
▷ Class constants112100.00%
▷ Public constants112100.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
17 PNG files occupy 0.29MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/twilio-logo.png2.24KB1.89KB▼ 15.76%
images/coupons-free-guide.png111.73KB39.52KB▼ 64.63%
images/wws-logo.png7.72KB5.14KB▼ 33.46%
images/woo-logo.png1.60KB1.34KB▼ 15.94%
images/agc-icon.png44.23KB18.10KB▼ 59.08%