100% edd-force-discount

Code Review | EDD Force Discount

WordPress plugin EDD Force Discount scored 100% from 54 tests.

About plugin

  • Plugin page: edd-force-discount
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 5.8.1
  • First release: Dec 21, 2015
  • Latest release: May 8, 2019
  • Number of updates: 6
  • Update frequency: every 205.7 days
  • Top authors: kowsar89 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 577 total downloads

Benchmarks

Plugin footprint Passed 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: ▼188.99ms] Passed 4 tests

Analyzing server-side resources used by EDD Force Discount
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1239.17 ▲18.07
Dashboard /wp-admin3.06 ▲0.0147.77 ▲1.68
Posts /wp-admin/edit.php3.11 ▲0.0047.69 ▲4.32
Add New Post /wp-admin/post-new.php5.42 ▼0.0292.25 ▼763.31
Media Library /wp-admin/upload.php3.00 ▲0.0034.91 ▲1.35

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for EDD Force Discount
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲12015.77 ▲0.1913.14 ▲2.6444.68 ▼9.15
Dashboard /wp-admin2,970 ▲395.92 ▼0.23138.62 ▼9.81121.31 ▲0.12
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0167.51 ▼1.6792.90 ▼3.26
Add New Post /wp-admin/post-new.php1,683 ▲10218.73 ▲2.33378.78 ▼101.87117.79 ▼1.22
Media Library /wp-admin/upload.php1,810 ▼05.02 ▼0.00154.16 ▼5.21117.91 ▼9.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: checkout, edd, digital, force, download...

edd-force-discount/edd-force-discount.php Passed 13 tests

The primary PHP file in "EDD Force Discount" version 1.0.0 is used by WordPress to initiate all plugin functionality
83 characters long description:
A lightweight plugin to force the customer to enter a discount code during checkout

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected435 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP538181435

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.33
▷ Minimum class complexity4.00
▷ Maximum class complexity52.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3895.00%
▷ Protected methods00.00%
▷ Private methods25.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin