83% advance-coupons-for-woocommerce

Code Review | Advance Coupons for Woocommerce

WordPress plugin Advance Coupons for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: advance-coupons-f...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jun 26, 2021
  • Latest release: Jun 13, 2022
  • Number of updates: 8
  • Update frequency: every 44.0 days
  • Top authors: ok9xnirab (62.5%)istiaqnirab (37.5%)springdevs (25%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /574 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
Install script ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.21ms] Passed 4 tests

Server-side resources used by Advance Coupons for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.20 ▼4.76
Dashboard /wp-admin3.38 ▲0.0848.62 ▼3.33
Posts /wp-admin/edit.php3.49 ▲0.1447.67 ▼3.49
Add New Post /wp-admin/post-new.php5.96 ▲0.0794.41 ▼0.44
Media Library /wp-admin/upload.php3.30 ▲0.0737.31 ▼1.24

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 40 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
sdwac_multi
sdwac_show_product_discount
widget_theysaidso_widget
sdwac_url
can_compress_scripts
sdwac_first_time_purchase_coupon
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Advance Coupons for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.21 ▼1.144.73 ▲3.0042.72 ▼2.85
Dashboard /wp-admin2,232 ▲415.81 ▼0.08103.22 ▲1.6447.56 ▲1.81
Posts /wp-admin/edit.php2,114 ▲252.01 ▼0.1244.27 ▲7.4939.68 ▼1.02
Add New Post /wp-admin/post-new.php1,538 ▲1923.48 ▲0.07641.81 ▼55.1152.57 ▲0.62
Media Library /wp-admin/upload.php1,411 ▲234.24 ▲0.0397.63 ▼10.4552.03 ▲7.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 10 options in the database
    • widget_recent-posts
    • sdwac_multi
    • db_upgraded
    • widget_theysaidso_widget
    • sdwac_show_product_discount
    • sdwac_url
    • theysaidso_admin_options
    • sdwac_first_time_purchase_coupon
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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 following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advance-coupons-for-woocommerce/includes/Admin/views/plugin-notice.php:4

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

advance-coupons-for-woocommerce/coupons.php 77% from 13 tests

The main PHP script in "Advance Coupons for Woocommerce" version 1.0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Name the main plugin file the same as the plugin slug ("advance-coupons-for-woocommerce.php" instead of "coupons.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,975 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP333685331,768
CSS1330165
JavaScript23137
JSON1005

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity13.30
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces7
Interfaces0
Traits1
Classes22
▷ Abstract classes00.00%
▷ Concrete classes22100.00%
▷ Final classes14.55%
Methods120
▷ Static methods1512.50%
▷ Public methods11696.67%
▷ Protected methods00.00%
▷ Private methods43.33%
Functions6
▷ Named functions350.00%
▷ Anonymous functions350.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.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