89% woo-auto-coupons

Code Review | Auto Coupons for WooCommerce

WordPress plugin Auto Coupons for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: woo-auto-coupons
  • Plugin version: 2.3.11
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 10, 2019
  • Latest release: Nov 19, 2023
  • Number of updates: 133
  • Update frequency: every 12.9 days
  • Top authors: rermis (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

3,000+ active /69,803 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
Installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.86ms] Passed 4 tests

This is a short check of server-side resources used by Auto Coupons for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1343.94 ▲4.71
Dashboard /wp-admin3.43 ▲0.1348.05 ▲1.01
Posts /wp-admin/edit.php3.54 ▲0.1948.41 ▲2.63
Add New Post /wp-admin/post-new.php6.01 ▲0.1285.48 ▼5.32
Media Library /wp-admin/upload.php3.35 ▲0.1235.09 ▼1.74

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Auto Coupons for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5814.67 ▲0.302.13 ▲0.3843.05 ▼0.04
Dashboard /wp-admin2,195 ▲145.62 ▼0.0491.20 ▼12.3341.56 ▲3.40
Posts /wp-admin/edit.php2,100 ▼31.94 ▼0.0141.02 ▲3.5934.71 ▼5.00
Add New Post /wp-admin/post-new.php1,526 ▼023.31 ▲0.02651.32 ▼126.2747.00 ▼7.44
Media Library /wp-admin/upload.php1,397 ▼34.15 ▼0.04100.40 ▼4.6344.93 ▲0.14

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

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)
Good news, no errors were detected

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

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: coupons, discount, auto apply, woocommerce, quantity

woo-auto-coupons/wac_functions.php 85% from 13 tests

The main PHP file in "Auto Coupons for WooCommerce" ver. 2.3.11 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.6" instead of "5.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-auto-coupons.php" instead of "wac_functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin544 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP17528544

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions27
▷ Named functions2592.59%
▷ Anonymous functions27.41%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin