88% advanced-coupon-conditions-for-woocommerce

Code Review | Advanced Coupon Conditions for Woocommerce

WordPress plugin Advanced Coupon Conditions for Woocommerce scored 88% from 54 tests.

About plugin

  • Plugin page: advanced-coupon-c...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 5.9.2
  • First release: Nov 21, 2016
  • Latest release: Jan 10, 2017
  • Number of updates: 5
  • Update frequency: every 9.4 days
  • Top authors: dcurasi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,094 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

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

An overview of server-side resources used by Advanced Coupon Conditions for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.1756.46 ▲7.45
Dashboard /wp-admin3.52 ▲0.1139.16 ▲5.10
Posts /wp-admin/edit.php3.74 ▲0.1038.78 ▲2.46
Add New Post /wp-admin/post-new.php6.99 ▲0.0193.36 ▼1,167.48
Media Library /wp-admin/upload.php3.40 ▲0.1026.80 ▲1.73

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Coupon Conditions for Woocommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,916 ▲17216.26 ▲0.629.42 ▲3.022.25 ▼0.19
Dashboard /wp-admin2,907 ▲466.18 ▼0.01117.46 ▼20.83165.55 ▲3.16
Posts /wp-admin/edit.php2,708 ▲143.36 ▲0.0063.41 ▼0.58134.91 ▼9.37
Add New Post /wp-admin/post-new.php1,786 ▲6921.63 ▼0.27448.21 ▼23.39159.24 ▼5.29
Media Library /wp-admin/upload.php1,712 ▲145.55 ▲0.02146.72 ▲3.55191.82 ▼3.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 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 0% 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 take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/advanced-coupon-conditions-for-woocommerce/public/partials/dc-accfw-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-coupon-conditions-for-woocommerce/admin/partials/dc-accfw-admin-display.php:21

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please delete some tags, you are using 27 tag instead of maximum 10
You can look at the official readme.txt

advanced-coupon-conditions-for-woocommerce/dc-accfw.php 85% from 13 tests

The main file in "Advanced Coupon Conditions for Woocommerce" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-coupon-conditions-for-woocommerce.php" instead of "dc-accfw.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
No dangerous file extensions were detected465 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12148589379
PO File1151674
CSS2186
JavaScript24546

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.29
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods36
▷ Static methods1336.11%
▷ Public methods3186.11%
▷ Protected methods00.00%
▷ Private methods513.89%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
No PNG files were detected