89% easy-digital-downloads-variable-defaults

Code Review | Easy Digital Downloads - Variable Defaults

WordPress plugin Easy Digital Downloads - Variable Defaults scored 89% from 54 tests.

About plugin

  • Plugin page: easy-digital-down...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jan 5, 2015
  • Latest release: Nov 30, 2016
  • Number of updates: 6
  • Update frequency: every 115.8 days
  • Top authors: section214 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 1,725 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
This plugin's installer ran successfully

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

A check of server-side resources used by Easy Digital Downloads - Variable Defaults
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.22 ▼6.21
Dashboard /wp-admin3.31 ▲0.0048.07 ▼5.02
Posts /wp-admin/edit.php3.36 ▲0.0048.68 ▼0.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.12 ▼14.12
Media Library /wp-admin/upload.php3.23 ▲0.0042.35 ▲8.50

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
edd_variable_defaults_v101_upgraded
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Easy Digital Downloads - Variable Defaults: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.69 ▼0.891.75 ▲0.0438.15 ▼2.30
Dashboard /wp-admin2,206 ▲185.76 ▲0.9098.00 ▼14.5940.96 ▼1.26
Posts /wp-admin/edit.php2,086 ▼32.02 ▲0.0235.81 ▼6.0531.42 ▼4.11
Add New Post /wp-admin/post-new.php1,411 ▼10617.95 ▲0.35618.51 ▲10.4356.39 ▲3.11
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.12106.47 ▲6.4245.22 ▲2.24

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • edd_variable_defaults_v101_upgraded
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: easy digital downloads, variable pricing, edd

easy-digital-downloads-variable-defaults/edd-variable-defaults.php 85% from 13 tests

The main PHP script in "Easy Digital Downloads - Variable Defaults" version 1.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("easy-digital-downloads-variable-defaults.php" instead of "edd-variable-defaults.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
Everything looks great! No dangerous files found in this plugin424 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP8113223424

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity6.50
▷ Minimum class complexity4.00
▷ Maximum class complexity9.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods666.67%
▷ Protected methods00.00%
▷ Private methods333.33%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected