94% edd-discounts-by-location

Code Review | Edd Discounts By Location

WordPress plugin Edd Discounts By Location scored 94% from 54 tests.

About plugin

  • Plugin page: edd-discounts-by-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0.1
  • WordPress version: 5.8.1
  • First release: Dec 16, 2014
  • Latest release: Jan 12, 2015
  • Number of updates: 14
  • Update frequency: every 56.1 days
  • Top authors: debjyati_dc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 664 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.15MB] [CPU: ▼155.99ms] Passed 4 tests

Analyzing server-side resources used by Edd Discounts By Location
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0235.36 ▲2.54
Dashboard /wp-admin2.99 ▼0.0634.83 ▼17.12
Posts /wp-admin/edit.php3.05 ▼0.0632.45 ▼9.39
Add New Post /wp-admin/post-new.php4.98 ▼0.4576.79 ▼587.51
Media Library /wp-admin/upload.php3.00 ▼0.0127.60 ▼9.95

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Edd Discounts By Location
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,724 ▲12815.91 ▲0.3311.01 ▲1.2046.71 ▼2.22
Dashboard /wp-admin2,988 ▲545.97 ▲0.01132.90 ▼39.04110.81 ▼44.66
Posts /wp-admin/edit.php2,762 ▲232.72 ▲0.0063.31 ▼8.9193.80 ▼3.24
Add New Post /wp-admin/post-new.php1,685 ▲18518.86 ▲0.22371.92 ▲1.58108.47 ▲4.56
Media Library /wp-admin/upload.php1,831 ▲245.01 ▼0.03148.57 ▼4.37116.88 ▼0.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/edd-discounts-by-location/includes/class-dc-dependencies.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #3 (If the discount code is valid for the country then the user can purchse the product with the discount code.)
Please take inspiration from this readme.txt

edd-discounts-by-location/edd_discounts_by_location.php 92% from 13 tests

Analyzing the main PHP file in "Edd Discounts By Location" version 1.0.1
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("edd-discounts-by-location.php" instead of "edd_discounts_by_location.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin489 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP87565361
PO File1303176
CSS17040
JavaScript212712

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.80
▷ Minimum class complexity2.00
▷ Maximum class complexity17.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/dualcube.png3.29KB0.65KB▼ 80.17%
assets/images/dualcube_logo.png3.86KB3.47KB▼ 9.97%
assets/images/placeholder.png2.75KB2.92KB0.00%
assets/images/dclogo-2x.png4.35KB1.74KB▼ 60.10%
assets/images/dclogo.png3.46KB0.84KB▼ 75.80%