89% wc-auto-coupon

Code Review | Auto Discount for WooCommerce

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

About plugin

  • Plugin page: wc-auto-coupon
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Apr 3, 2020
  • Latest release: May 29, 2021
  • Number of updates: 5
  • Update frequency: every 84.8 days
  • Top authors: aashik (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /476 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.31ms] Passed 4 tests

Server-side resources used by Auto Discount for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.89 ▼1.35
Dashboard /wp-admin3.31 ▲0.0044.77 ▼3.93
Posts /wp-admin/edit.php3.36 ▲0.0045.62 ▼1.75
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.67 ▼18.20
Media Library /wp-admin/upload.php3.23 ▲0.0034.75 ▲2.11

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Auto Discount for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7914.80 ▲0.402.11 ▲0.3843.69 ▲3.66
Dashboard /wp-admin2,209 ▲244.86 ▼1.04108.61 ▲11.5838.05 ▼5.56
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0338.97 ▲2.7834.00 ▲0.91
Add New Post /wp-admin/post-new.php1,538 ▼422.86 ▲4.37688.05 ▲49.4753.28 ▲3.28
Media Library /wp-admin/upload.php1,385 ▼34.20 ▼0.01105.82 ▲9.2648.05 ▲4.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The SRP test was a success

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)
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

wc-auto-coupon/auto-discount-for-woocommerce.php 77% from 13 tests

Analyzing the main PHP file in "Auto Discount for WooCommerce" version 1.1.0
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.3.2" instead of "4.0.1")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-auto-coupon.php" instead of "auto-discount-for-woocommerce.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
No dangerous file extensions were detected89 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1163589

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin