74% edd-discount-for-enavto-customers

Code Review | Discount for Envato Customers with EDD Products

WordPress plugin Discount for Envato Customers with EDD Products scored74%from 54 tests.

About plugin

  • Plugin page: edd-discount-for-...
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 1, 2022
  • Latest release: Jun 27, 2022
  • Number of updates: 11
  • Update frequency: every 8.0 days
  • Top authors: smartdatasoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /727 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼5.02ms] Passed 4 tests

A check of server-side resources used by Discount for Envato Customers with EDD Products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1536.86 ▼4.86
Dashboard /wp-admin3.45 ▲0.1446.47 ▼4.99
Posts /wp-admin/edit.php3.56 ▲0.2046.20 ▼5.09
Add New Post /wp-admin/post-new.php6.03 ▲0.14100.86 ▼5.13
Media Library /wp-admin/upload.php3.37 ▲0.1434.89 ▲0.85

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: 3 new tables, 6 new options
New tables
wp_edddfe_buyer
wp_edddfe_plans
wp_edddfe_license_details
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Discount for Envato Customers with EDD Products
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲11713.55 ▼0.855.58 ▲3.5838.99 ▼4.64
Dashboard /wp-admin2,208 ▲175.86 ▲0.99103.15 ▼1.1139.15 ▼2.58
Posts /wp-admin/edit.php2,073 ▼192.00 ▲0.0036.59 ▼3.6233.96 ▼0.31
Add New Post /wp-admin/post-new.php1,534 ▲2023.16 ▲5.50656.33 ▼2.9454.01 ▼3.97
Media Library /wp-admin/upload.php1,393 ▲114.26 ▲0.0299.20 ▼12.7644.00 ▼5.26

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 3 tables
    • wp_edddfe_buyer
    • wp_edddfe_license_details
    • wp_edddfe_plans
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Edd_Discount_For_Envato_Customers_Provider' not found in wp-content/plugins/edd-discount-for-enavto-customers/admin/class-edd-discount-for-envato-customers-admin.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Edd_Discount_For_Envato_Customers_Provider' not found in wp-content/plugins/edd-discount-for-enavto-customers/public/class-edd-discount-for-envato-customers-public.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: product sales, discount, product sale, coupon, easy digital downloads...

edd-discount-for-enavto-customers/edd-discount-for-envato-customers.php 92% from 13 tests

The main PHP script in "Discount for Envato Customers with EDD Products" version 1.0.6 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("edd-discount-for-enavto-customers.php" instead of "edd-discount-for-envato-customers.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected853 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP11132419743
CSS27885
JavaScript255425

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.25
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods48
▷ Static methods36.25%
▷ Public methods2858.33%
▷ Protected methods714.58%
▷ Private methods1327.08%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin