73% discount-by-answer-for-easy-digital-downloads

Code Review | Discount by Answer for Easy Digital Downloads

WordPress plugin Discount by Answer for Easy Digital Downloads scored73%from 54 tests.

About plugin

  • Plugin page: discount-by-answe...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.3.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2019
  • Latest release: Dec 13, 2019
  • Number of updates: 10
  • Update frequency: every 31.6 days
  • Top authors: miunosoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /798 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼4.84ms] Passed 4 tests

Server-side resources used by Discount by Answer for Easy Digital Downloads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0039.92 ▲2.79
Dashboard /wp-admin3.31 ▼0.0449.68 ▼19.37
Posts /wp-admin/edit.php3.36 ▲0.0049.92 ▼2.60
Add New Post /wp-admin/post-new.php5.89 ▲0.00107.57 ▲2.73
Media Library /wp-admin/upload.php3.23 ▲0.0033.58 ▼0.12

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Discount by Answer for Easy Digital Downloads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.38 ▼0.121.77 ▼0.0343.18 ▲0.21
Dashboard /wp-admin2,198 ▲175.56 ▼0.1090.38 ▼13.1442.47 ▲0.85
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0339.28 ▼2.8138.06 ▼1.52
Add New Post /wp-admin/post-new.php1,526 ▼923.04 ▲4.78634.25 ▼0.1651.74 ▼16.81
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0597.25 ▼16.0042.75 ▼1.94

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
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/_common/utility/DiscountByAnswerForEDD_Utility.php+84
    rmdir(/tmp/): Permission denied
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 285× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_Model__FormSubmission__Validator_Base' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/admin_page/_model/delegate/validaor/AdminPageFramework_Model__FormSubmission__Validator__ResetConfirm.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_Form' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/_common/form/AdminPageFramework_Form_Meta.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_PageLoadInfo_Base' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/admin_page/_view/AdminPageFramework_PageLoadInfo_admin_page.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_Answer_PostType_ListTable' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/answer/post_type/DiscountByAnswerForEDD_Answer_PostType.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_Property_Base' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/meta_box/_model/AdminPageFramework_Property_post_meta_box.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_CheckOut_Fieldset_Input_Base' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/checkout/fieldset/input/DiscountByAnswerForEDD_CheckOut_Fieldset_Input_textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_FieldType_text' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/_common/form/field_type/AdminPageFramework_FieldType_number.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_Property_Base' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/admin_page/_model/AdminPageFramework_Property_admin_page.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_Event_Ajax_Base' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/campaign/request_type/text/event/DiscountByAnswerForEDD_Campaign_RequestType_text_Event_Ajax_LoadAnsweredKeywords.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'DiscountByAnswerForEDD_AdminPageFramework_Factory' not found in wp-content/plugins/discount-by-answer-for-easy-digital-downloads/include/library/apf/factory/widget/AdminPageFramework_Widget.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

discount-by-answer-for-easy-digital-downloads/discount-by-answer-for-easy-digital-downloads.php 85% from 13 tests

Analyzing the main PHP file in "Discount by Answer for Easy Digital Downloads" version 1.0.1
Please make the necessary changes and fix the following:
  • Domain Path: Prefix the domain path with a forward slash character ("/language")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("language")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin41,926 lines of code in 434 files:
LanguageFilesBlank linesComment linesLines of code
PHP3071,8714,96721,817
JavaScript1154,9551,39118,952
CSS101491031,085
Markdown228072

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.30
Average class complexity6.53
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes416
▷ Abstract classes10324.76%
▷ Concrete classes31375.24%
▷ Final classes41.28%
Methods2,029
▷ Static methods27613.60%
▷ Public methods1,10954.66%
▷ Protected methods37318.38%
▷ Private methods54726.96%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants29
▷ Global constants13.45%
▷ Class constants2896.55%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin