84% edd-promo

Code Review | EDD Promo

WordPress plugin EDD Promo scored 84% from 54 tests.

About plugin

  • Plugin page: edd-promo
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jan 28, 2015
  • Latest release: Jan 28, 2015
  • Number of updates: 17
  • Update frequency: every 0.1 days
  • Top authors: cbfreeman (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 999 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼124.93ms] Passed 4 tests

Analyzing server-side resources used by EDD Promo
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0639.13 ▼6.72
Dashboard /wp-admin3.38 ▼0.0147.22 ▼475.93
Posts /wp-admin/edit.php3.49 ▲0.1344.82 ▼12.14
Add New Post /wp-admin/post-new.php5.96 ▲0.0784.14 ▼4.91
Media Library /wp-admin/upload.php3.30 ▲0.0736.73 ▲4.30
EDD Promo /wp-admin/options-general.php?page=edd_promo_options3.3436.89

Server storage [IO: ▲0.50MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 55 new files
Database: 2 new tables, 7 new options
New tables
wp_eddpromorecords
wp_eddpromonewsletter
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
edd_promo_options

Browser metrics Passed 4 tests

Checking browser requirements for EDD Promo
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲5314.80 ▲0.371.79 ▼0.3143.80 ▲1.29
Dashboard /wp-admin2,210 ▲224.84 ▼0.0798.04 ▼0.4737.62 ▲0.01
Posts /wp-admin/edit.php2,099 ▲102.04 ▼0.0140.29 ▲4.2935.13 ▲1.40
Add New Post /wp-admin/post-new.php1,533 ▼018.32 ▼4.70639.67 ▼66.7363.27 ▼5.21
Media Library /wp-admin/upload.php1,398 ▲104.21 ▼0.0397.14 ▼9.7144.74 ▲3.23
EDD Promo /wp-admin/options-general.php?page=edd_promo_options1,6517.69151.1671.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 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
Please fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/edd-promo/edd.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/edd-promo/edd-promo-options.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function site_url() in wp-content/plugins/edd-promo/edd.php:77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/edd-promo/unsubscribe.php:17
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/edd-promo/edd.php on line 25
    • > PHP Notice
      Trying to get property 'user_email' of non-object in wp-content/plugins/edd-promo/unsubscribe.php on line 6
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/edd-promo/edd.php on line 23
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/edd-promo/unsubscribe.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/edd-promo/templates/template-1.php:5

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (The default settings page provided with EDD Promo. Tested on many email clients like Gmail, Yahoo!, Live/Hotmail, etc.), #2 (Sample email is provided with EDD Promo.), #3 (Sample Dashboard section is provided with EDD Promo.)
The official readme.txt is a good inspiration

edd-promo/edd.php 92% from 13 tests

The main PHP file in "EDD Promo" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("edd-promo.php" instead of "edd.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin6,616 lines of code in 46 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript226204524,600
HTML9105101,112
CSS910410480
PHP5118165419
Markdown1105

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png19.00KB9.37KB▼ 50.70%
screenshot-2.png136.51KB39.43KB▼ 71.12%
screenshot-3.png11.39KB6.44KB▼ 43.47%