50% event-espresso-decaf

Code Review | Event Espresso 4 Decaf - Event Registration Event Ticketing

WordPress plugin Event Espresso 4 Decaf - Event Registration Event Ticketing scored50%from 54 tests.

About plugin

  • Plugin page: event-espresso-decaf
  • Plugin version: 4.10.46.decaf...
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3.2
  • WordPress version: 6.3.1
  • First release: Sep 15, 2014
  • Latest release: Oct 13, 2023
  • Number of updates: 397
  • Update frequency: every 8.4 days
  • Top authors: eventespresso (53.4%)sethshoultes (41.06%)nerrad (4.28%)charliespider (2.02%)

Code review

54 tests

User reviews

120 reviews

Install metrics

1,000+ active /204,646 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲13.50MB] [CPU: ▲123.30ms] 50% from 4 tests

This is a short check of server-side resources used by Event Espresso 4 Decaf - Event Registration Event Ticketing
It is recommended to improve the following
  • RAM: Total memory usage must be kept under 10MB (currently 21.21MB on /wp-admin/admin.php?page=espresso_payment_settings)
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 13.50MB on /wp-admin/admin.php?page=espresso_payment_settings)
PageMemory (MB)CPU Time (ms)
Home /15.12 ▲11.65158.76 ▲119.24
Dashboard /wp-admin17.42 ▲14.07179.73 ▲114.33
Posts /wp-admin/edit.php17.52 ▲14.17170.28 ▲118.60
Add New Post /wp-admin/post-new.php42.94 ▲37.05566.80 ▲467.66
Media Library /wp-admin/upload.php17.35 ▲14.12181.27 ▲141.02
Registrations /wp-admin/admin.php?page=espresso_registrations20.87201.18
Settings /wp-admin/admin.php?page=settings17.32148.60
Management /wp-admin/admin.php?page=management17.32128.08
Maintenance /wp-admin/admin.php?page=espresso_maintenance_settings20.63152.62
Registration Form /wp-admin/admin.php?page=espresso_registration_form19.13186.90
About /wp-admin/admin.php?page=espresso_about18.91171.51
n/a /wp-admin/admin.php?page=espresso_batch16.89122.85
Extras /wp-admin/admin.php?page=extras17.32131.77
Extensions & Services /wp-admin/admin.php?page=espresso_packages18.50143.98
Payment Methods /wp-admin/admin.php?page=espresso_payment_settings21.21226.80

Server storage [IO: ▲39.81MB] [DB: ▲4.06MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • Total filesystem usage should be limited to 25MB (currently using 39.81MB)
Filesystem: 5,138 new files
Database: 36 new tables, 18 new options
New tables
wp_esp_extra_join
wp_esp_question_group_question
wp_esp_ticket_template
wp_esp_line_item
wp_esp_transaction
wp_esp_event_meta
wp_esp_country
wp_esp_message
wp_esp_message_template
wp_esp_event_question_group
...
New WordPress options
ee_has_activated_messenger
theysaidso_admin_options
widget_recent-posts
ee_data_migration_current_db_state
db_upgraded
widget_ee-upcoming-events-widget
ee_flush_rewrite_rules
widget_theysaidso_widget
ee_caps_initialized
ee_plugin_activation_errors
...

Browser metrics Passed 4 tests

An overview of browser requirements for Event Espresso 4 Decaf - Event Registration Event Ticketing
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,146 ▲40013.25 ▼1.316.43 ▲4.4433.96 ▼7.65
Dashboard /wp-admin2,387 ▲2075.68 ▲0.0196.08 ▲3.9942.19 ▲1.23
Posts /wp-admin/edit.php2,283 ▲1802.04 ▲0.0741.43 ▼0.6535.43 ▼1.72
Add New Post /wp-admin/post-new.php1,694 ▲16621.75 ▼1.32677.29 ▲25.8735.80 ▼24.76
Media Library /wp-admin/upload.php1,583 ▲1804.14 ▼0.14110.27 ▲10.4351.80 ▲9.21
Registrations /wp-admin/admin.php?page=espresso_registrations2,1412.3342.3661.13
Settings /wp-admin/admin.php?page=settings9542.0023.8923.13
Management /wp-admin/admin.php?page=management9542.0025.2825.28
Maintenance /wp-admin/admin.php?page=espresso_maintenance_settings1,1462.2537.9538.52
Registration Form /wp-admin/admin.php?page=espresso_registration_form2,1705.3174.1364.91
About /wp-admin/admin.php?page=espresso_about1,2632.2935.7976.56
n/a /wp-admin/admin.php?page=espresso_batch390.420.103.38
Extras /wp-admin/admin.php?page=extras9512.0126.1925.96
Extensions & Services /wp-admin/admin.php?page=espresso_packages1,4512.4136.6289.83
Payment Methods /wp-admin/admin.php?page=espresso_payment_settings2,8927.08103.89120.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie tables detected upon uninstall: 36 tables
    • wp_esp_registration
    • wp_esp_event_question_group
    • wp_esp_question
    • wp_esp_price_type
    • wp_esp_question_option
    • wp_esp_payment_method
    • wp_esp_message_template
    • wp_esp_question_group_question
    • wp_esp_extra_meta
    • wp_esp_message
    • ...
  • This plugin does not fully uninstall, leaving 18 options in the database
    • ee_lang_check_en_US_4.10.46.decaf
    • ee_session_settings
    • ee_active_messengers
    • widget_ee-upcoming-events-widget
    • ee_has_activated_messenger
    • _ee_rate_limit
    • can_compress_scripts
    • ee_config_option_names
    • ee_config
    • ee_flush_rewrite_rules
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 41× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/email_payment_to_primary_attendee.template.php
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/html_invoice_ticket_line_item_pms.template.php
    • > /wp-content/plugins/event-espresso-decaf/vendor/nikic/php-parser/grammar/rebuildParsers.php
    • > /wp-content/plugins/event-espresso-decaf/ui/blocks/event-attendees.php
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/email_registration_from.template.php
    • > /wp-content/plugins/event-espresso-decaf/espresso.php
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/html_invoice_tax_line_item_list.template.php
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/html_receipt_tax_line_item_list.template.php
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/html_receipt_additional_line_item_list.template.php
    • > /wp-content/plugins/event-espresso-decaf/core/libraries/messages/defaults/default/email_registration_summary_to_admin.template.php
  • 2725× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Standards\\Generic\\Sniffs\\PHP\\ForbiddenFunctionsSniff' not found in wp-content/plugins/event-espresso-decaf/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php:13
    • > PHP Warning
      Use of undefined constant EE_CORE - assumed 'EE_CORE' (this will throw an Error in a future version of PHP) in wp-content/plugins/event-espresso-decaf/core/data_migration_scripts/EE_DMS_Core_4_6_0.dms.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/event-espresso-decaf/admin_pages/events/help_tabs/events_categories_other.help_tab.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'EE_Base' not found in wp-content/plugins/event-espresso-decaf/core/admin/EE_Admin_Hooks.core.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPUnit\\Framework\\MockObject\\Exception' not found in wp-content/plugins/event-espresso-decaf/vendor/phpunit/phpunit/src/Framework/MockObject/Exception/RuntimeException.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/event-espresso-decaf/core/libraries/messages/messenger/admin_templates/event_switcher_row.template.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'EventEspresso\\core\\libraries\\rest_api\\RestException' not found in wp-content/plugins/event-espresso-decaf/core/exceptions/RestPasswordIncorrectException.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'EventEspresso\\core\\interfaces\\ResettableInterface' not found in wp-content/plugins/event-espresso-decaf/core/EE_Maintenance_Mode.core.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'EE_Admin_Page_Init' not found in wp-content/plugins/event-espresso-decaf/admin_pages/transactions/Transactions_Admin_Page_Init.core.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PhpParser\ode\\Scalar\\MagicConst' not found in wp-content/plugins/event-espresso-decaf/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/MagicConst/Dir.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=espresso_batch
    • > Network (severe)
    wp-admin/admin.php?page=espresso_batch - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

event-espresso-decaf/espresso.php 69% from 13 tests

The entry point to "Event Espresso 4 Decaf - Event Registration Event Ticketing" version 4.10.46.decaf... is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "4.10.46.decaf...")
  • Description: The description should be shorter than 140 characters (currently 507 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("event-espresso-decaf.php" instead of "espresso.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/event-espresso-decaf/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/event-espresso-decaf/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
477,333 lines of code in 4,441 files:
LanguageFilesBlank linesComment linesLines of code
PHP3,70473,328187,048381,226
JavaScript1456,28518,51033,558
JSON557026,309
CSS1122,2371,21011,879
Markdown853,16407,933
Pascal1303,2177,0906,548
XML1864518016,490
yacc3332122,029
XSD4601,094
YAML3321124
HTML61058
SVG41044
reStructuredText2231831
DOS Batch241010

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 478)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.83
▷ Minimum class complexity1.00
▷ Maximum class complexity809.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces468
Interfaces205
Traits37
Classes2,933
▷ Abstract classes1856.31%
▷ Concrete classes2,74893.69%
▷ Final classes45616.59%
Methods19,259
▷ Static methods2,06010.70%
▷ Public methods14,90877.41%
▷ Protected methods2,82714.68%
▷ Private methods1,5247.91%
Functions1,703
▷ Named functions34820.43%
▷ Anonymous functions1,35579.57%
Constants1,553
▷ Global constants31120.03%
▷ Class constants1,24279.97%
▷ Public constants1,19195.89%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
53 PNG files occupy 0.39MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
core/templates/global_assets/images/calendar_year-24x24.png1.55KB1.09KB▼ 29.71%
core/templates/global_assets/css/espresso-ui-theme/images/ui-icons_B4113F_256x240.png4.44KB4.17KB▼ 6.02%
payment_methods/Paypal_Express/lib/paypal-express-checkout-logo-gold-160.png5.55KB2.59KB▼ 53.27%
admin_pages/messages/assets/images/form-fields.png8.92KB3.03KB▼ 66.02%
modules/gateways/Invoice/lib/templates/images/header.png21.18KB8.69KB▼ 58.97%