66% events-manager

Code Review | Events Manager

WordPress plugin Events Manager scored66%from 54 tests.

About plugin

  • Plugin page: events-manager
  • Plugin version: 6.4.6.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 6, 2008
  • Latest release: Nov 15, 2023
  • Number of updates: 996
  • Update frequency: every 5.6 days
  • Top authors: netweblogic (78.71%)nutsmuggler (16.67%)msykes (4.82%)

Code review

54 tests

User reviews

473 reviews

Install metrics

90,000+ active /4,455,267 total downloads

Benchmarks

Plugin footprint 64% 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: ▲6.84MB] [CPU: ▲42.39ms] 50% from 4 tests

Server-side resources used by Events Manager
Please take the time to fix the following items
  • RAM: Try to keep total memory usage under 10MB (currently 11.42MB on /wp-admin/edit.php?post_type=event&page=events-manager-options)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.84MB on /wp-admin/edit.php?post_type=event&page=events-manager-options)
PageMemory (MB)CPU Time (ms)
Home /9.03 ▲5.5775.31 ▲30.33
Dashboard /wp-admin10.65 ▲7.3495.80 ▲50.03
Posts /wp-admin/edit.php10.67 ▲7.31106.14 ▲63.10
Add New Post /wp-admin/post-new.php13.13 ▲7.24124.78 ▲33.90
Media Library /wp-admin/upload.php10.47 ▲7.2486.26 ▲55.29
Help /wp-admin/edit.php?post_type=event&page=events-manager-help10.5180.40
Settings /wp-admin/edit.php?post_type=event&page=events-manager-options11.42130.24

Server storage [IO: ▲12.69MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 645 new files
Database: 8 new tables, 432 new options
New tables
wp_em_meta
wp_em_locations
wp_em_tickets
wp_em_events
wp_em_bookings
wp_em_tickets_bookings_meta
wp_em_bookings_meta
wp_em_tickets_bookings
New WordPress options
dbem_booking_button_msg_event_cancelled
dbem_data_privacy_export_events
can_compress_scripts
dbem_display_calendar_events_limit_msg
dbem_locations_default_order
dbem_categories_default_archive_orderby
dbem_events_page_title
dbem_ical_description_format
dbem_single_event_format
dbem_bookings_summary_message
...

Browser metrics Passed 4 tests

An overview of browser requirements for Events Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,575 ▲2,81317.98 ▲3.6413.52 ▲11.6614.20 ▼31.85
Dashboard /wp-admin4,845 ▲2,6717.78 ▲2.12182.94 ▲82.4552.22 ▲5.28
Posts /wp-admin/edit.php2,179 ▲822.03 ▲0.0548.76 ▲12.4944.06 ▲8.22
Add New Post /wp-admin/post-new.php1,593 ▲6323.53 ▲0.18737.23 ▲64.7955.42 ▲3.27
Media Library /wp-admin/upload.php1,481 ▲874.20 ▼0.0097.62 ▼1.4042.13 ▼1.68
Help /wp-admin/edit.php?post_type=event&page=events-manager-help2,8572.5946.1065.15
Settings /wp-admin/edit.php?post_type=event&page=events-manager-options24,0806.25212.03104.80

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 8 tables in the database
    • wp_em_bookings_meta
    • wp_em_tickets
    • wp_em_tickets_bookings_meta
    • wp_em_tickets_bookings
    • wp_em_locations
    • wp_em_bookings
    • wp_em_meta
    • wp_em_events
  • The uninstall procedure has failed, leaving 432 options in the database
    • dbem_data_privacy_consent_bookings
    • dbem_location_grid_item_format_footer
    • dbem_cp_events_formats
    • dbem_events_anonymous_submissions
    • dbem_timezone_default
    • dbem_categories_list_item_format_header
    • dbem_bookings_submit_button
    • dbem_rsvp_mail_port
    • dbem_events_page_ajax
    • dbem_events_default_limit
    • ...

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
  • 19× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/events-manager/templates/formats/category_event_list_item_header_format.php
    • > /wp-content/plugins/events-manager/templates/formats/tag_event_list_item_footer_format.php
    • > /wp-content/plugins/events-manager/templates/formats/map_text_format.php
    • > /wp-content/plugins/events-manager/templates/formats/event_excerpt_format.php
    • > /wp-content/plugins/events-manager/templates/formats/tag_event_list_item_format.php
    • > /wp-content/plugins/events-manager/templates/calendar/section-header-weekdays.php
    • > /wp-content/plugins/events-manager/templates/formats/block_event_list_item_format.php
    • > /wp-content/plugins/events-manager/templates/formats/category_event_list_item_footer_format.php
    • > /wp-content/plugins/events-manager/templates/formats/location_event_list_item_format.php
    • > /wp-content/plugins/events-manager/templates/formats/location_event_list_item_header_format.php
  • 233× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_categories() on null in wp-content/plugins/events-manager/templates/placeholders/eventcategoriesimages.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/events-manager/templates/templates/my-bookings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/events-manager/templates/formats/calendar_preview_tooltip_event_format.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function em_get_days_names() in wp-content/plugins/events-manager/templates/forms/event/recurring-when.php:4
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/events-manager/em-upgrade.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/events-manager/em-debug.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/events-manager/templates/forms/event/when/recurrence-duration.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function em_bookings_admin() in wp-content/plugins/events-manager/templates/buddypress/my-bookings.php:3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/events-manager/templates/calendar/section-header-weekdays.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/events-manager/templates/templates/search/form-sort.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
You can look at the official readme.txt

events-manager/events-manager.php 92% from 13 tests

The entry point to "Events Manager" version 6.4.6.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 150 characters long)

Code Analysis 95% from 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
Success! There were no dangerous files found in this plugin110,610 lines of code in 560 files:
LanguageFilesBlank linesComment linesLines of code
PHP2982,5338,57040,162
JavaScript1841,5282,78439,990
CSS3697697521,439
Sass298173515,256
TypeScript34993,4683,438
HTML5110173
SVG400138
JSON10014

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,091)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 363)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity46.68
▷ Minimum class complexity1.00
▷ Maximum class complexity1,091.00
Average method complexity5.43
▷ Minimum method complexity1.00
▷ Maximum method complexity363.00
Code structure
Namespaces13
Interfaces0
Traits0
Classes131
▷ Abstract classes00.00%
▷ Concrete classes131100.00%
▷ Final classes00.00%
Methods1,344
▷ Static methods75155.88%
▷ Public methods1,33899.55%
▷ Protected methods60.45%
▷ Private methods00.00%
Functions321
▷ Named functions31497.82%
▷ Anonymous functions72.18%
Constants62
▷ Global constants62100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
39 PNG files occupy 0.54MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/css/jquery-ui/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%
includes/css/jquery-ui/images/ui-icons_777620_256x240.png4.51KB4.18KB▼ 7.28%
includes/css/jquery-ui/images/ui-icons_cc0000_256x240.png4.51KB4.18KB▼ 7.28%
includes/images/search-geo.png0.59KB0.48KB▼ 19.41%
includes/css/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%