66% the-events-calendar

Code Review | The Events Calendar

WordPress plugin The Events Calendar scored 66% from 54 tests.

About plugin

  • Plugin page: the-events-calendar
  • Plugin version: 5.14.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.9.2
  • WordPress version: 5.9.2
  • First release: Jan 19, 2010
  • Latest release: Mar 17, 2022
  • Number of updates: 1,001
  • Update frequency: every 4.5 days
  • Top authors: bordoni (22.18%)barry.hughes (11.99%)justinendler (11.09%)ModernTribe (9.29%)zbtirrell (8.89%)

Code review

54 tests

User reviews

1900 reviews

Install metrics

800,000+ active / 35,246,192 total downloads

Benchmarks

Plugin footprint 81% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲11.80MB] [CPU: ▼215.05ms] 50% from 4 tests

This is a short check of server-side resources used by The Events Calendar
The following require your attention
  • RAM: The total memory usage must be kept under 10MB (currently 19.22MB on /wp-admin/edit.php?post_type=tribe_events&page=aggregator)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 11.80MB on /wp-admin/edit.php?post_type=tribe_events&page=aggregator)
PageMemory (MB)CPU Time (ms)
Home /15.78 ▲12.26127.60 ▲75.33
Dashboard /wp-admin16.10 ▲12.691,004.64 ▲967.37
Posts /wp-admin/edit.php14.78 ▲11.14115.30 ▲79.12
Add New Post /wp-admin/post-new.php19.99 ▲13.01179.04 ▼1,086.55
Media Library /wp-admin/upload.php14.42 ▲11.1296.56 ▲71.91
Add New Venue /wp-admin/post-new.php?post_type=tribe_venue15.17127.54
Organizers /wp-admin/edit.php?post_type=tribe_organizer14.56108.05
Help /wp-admin/edit.php?post_type=tribe_events&page=tribe-help19.22117.05
Event Categories /wp-admin/edit-tags.php?taxonomy=tribe_events_cat&post_type=tribe_events14.5597.11
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tribe_events14.54104.07
Settings /wp-admin/edit.php?post_type=tribe_events&page=tribe-common19.22137.49
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php18.81134.29
Event Add-Ons /wp-admin/edit.php?post_type=tribe_events&page=tribe-app-shop19.22128.30
Troubleshooting /wp-admin/edit.php?post_type=tribe_events&page=tec-troubleshooting14.53101.08
Import /wp-admin/edit.php?post_type=tribe_events&page=aggregator19.22114.64

Server storage [IO: ▲28.53MB] [DB: ▲0.20MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • Filesystem usage must be lower than 25MB (currently using 28.53MB)
Filesystem: 1,946 new files
Database: no new tables, 12 new options
New WordPress options
widget_tribe-widget-events-list
tribe_last_save_post
tribe_last_generate_rewrite_rules
fs_accounts
widget_tribe-events-list-widget
tribe_last_updated_option
widget_recent-posts
widget_recent-comments
tribe_events_calendar_options
fs_debug_mode
...

Browser metrics Passed 4 tests

Checking browser requirements for The Events Calendar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,660 ▼1,09415.45 ▼0.586.44 ▲0.412.44 ▲0.03
Dashboard /wp-admin3,133 ▲2756.21 ▼0.02142.64 ▲7.92159.95 ▼3.99
Posts /wp-admin/edit.php2,848 ▲1603.25 ▲0.0162.96 ▲0.87137.48 ▼1.42
Add New Post /wp-admin/post-new.php1,829 ▲13919.87 ▼1.27528.83 ▲85.62149.31 ▼6.37
Media Library /wp-admin/upload.php1,849 ▲1515.58 ▲0.07154.88 ▲11.29190.16 ▲2.37
Add New Venue /wp-admin/post-new.php?post_type=tribe_venue5,00613.08298.16247.67
Organizers /wp-admin/edit.php?post_type=tribe_organizer1,7595.8593.49106.80
Help /wp-admin/edit.php?post_type=tribe_events&page=tribe-help1,6935.4081.99195.62
Event Categories /wp-admin/edit-tags.php?taxonomy=tribe_events_cat&post_type=tribe_events1,9875.8383.86117.98
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=tribe_events1,8562.8156.83114.17
Settings /wp-admin/edit.php?post_type=tribe_events&page=tribe-common1,7405.7884.25203.58
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php12,51727.02769.05199.97
Event Add-Ons /wp-admin/edit.php?post_type=tribe_events&page=tribe-app-shop1,7335.6080.63189.95
Troubleshooting /wp-admin/edit.php?post_type=tribe_events&page=tec-troubleshooting2,5406.0196.91208.93
Import /wp-admin/edit.php?post_type=tribe_events&page=aggregator1,7335.5281.82203.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_recent-posts
    • fs_gdpr
    • fs_debug_mode
    • fs_accounts
    • widget_recent-comments
    • tribe_events_calendar_options
    • tribe_last_updated_option
    • tribe_last_save_post
    • fs_active_plugins
    • widget_tribe-widget-events-list
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 103× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/the-events-calendar/src/Tribe/JSON_LD/Organizer.php
    • > /wp-content/plugins/the-events-calendar/src/admin-views/linked-post-section.php
    • > /wp-content/plugins/the-events-calendar/common/src/Tribe/Languages/Locations.php
    • > /wp-content/plugins/the-events-calendar/src/views/embed/image.php
    • > /wp-content/plugins/the-events-calendar/common/src/Tribe/Template_Factory.php
    • > /wp-content/plugins/the-events-calendar/src/views/widgets/list-widget.php
    • > /wp-content/plugins/the-events-calendar/common/src/Tribe/Admin/Help_Page.php
    • > /wp-content/plugins/the-events-calendar/src/views/list.php
    • > /wp-content/plugins/the-events-calendar/src/functions/template-tags/link.php
    • > /wp-content/plugins/the-events-calendar/src/Tribe/Template/List.php
  • 802× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Tribe\\Events\\Views\\V2\\Interfaces\\View_Url_Provider_Interface' not found in wp-content/plugins/the-events-calendar/src/Tribe/Views/V2/View_Interface.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/the-events-calendar/src/views/v2/list/event/title.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/the-events-calendar/src/deprecated/Tribe__Events__Aggregator__Record__Facebook.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/the-events-calendar/src/admin-views/admin-update-message.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Processor\\MemoryProcessor' not found in wp-content/plugins/the-events-calendar/common/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php:20
    • > PHP Notice
      Undefined variable: day in wp-content/plugins/the-events-calendar/src/views/v2/month/calendar-body/day/date.php on line 49
    • > PHP Fatal error
      Uncaught Error: Class 'Tribe__Process__Handler' not found in wp-content/plugins/the-events-calendar/common/src/Tribe/Process/Tester.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Tribe__REST__Endpoints__READ_Endpoint_Interface' not found in wp-content/plugins/the-events-calendar/src/Tribe/REST/V1/Endpoints/Swagger_Documentation.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function tribe() in wp-content/plugins/the-events-calendar/src/admin-views/aggregator/tabs/import-form.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Tribe__Events__Aggregator__REST__V1__Endpoints__Base' not found in wp-content/plugins/the-events-calendar/src/Tribe/Aggregator/REST/V1/Endpoints/Batch.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=tribe_events&page=aggregator
    • > Network (severe)
    wp-content/themes//wp-content/plugins/the-events-calendar/src/resources/images/the-events-calendar.svg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=tribe_events&page=tribe-app-shop
    • > Intervention (severe) in unknown
    /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: organizer, event, events, schedule, calendar

the-events-calendar/the-events-calendar.php Passed 13 tests

The main file in "The Events Calendar" v. 5.14.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
128 characters long description:
The Events Calendar is a carefully crafted, extensible plugin that lets you easily share your events. Beautiful. Solid. Awesome.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected181,138 lines of code in 1,641 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,31732,66092,365128,522
JavaScript14312,15917,40846,789
CSS834354554,501
Markdown72840868
JSON400311
SVG8700147

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,910)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 124)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity18.42
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity124.00
Code structure
Namespaces67
Interfaces50
Traits18
Classes765
▷ Abstract classes547.06%
▷ Concrete classes71192.94%
▷ Final classes111.55%
Methods7,126
▷ Static methods83111.66%
▷ Public methods5,59678.53%
▷ Protected methods97213.64%
▷ Private methods5587.83%
Functions794
▷ Named functions61377.20%
▷ Anonymous functions18122.80%
Constants318
▷ Global constants11335.53%
▷ Class constants20564.47%
▷ Public constants205100.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
112 compressed PNG files occupy 1.83MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/resources/images/events-bar/icon-map-hover@2x.png0.39KB0.66KB0.00%
vendor/chosen/public/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
common/src/resources/images/gutenberg-admin-notice-TEC.png9.41KB10.32KB0.00%
src/resources/images/events-bar/icon-list@2x.png0.10KB0.11KB0.00%
src/resources/images/tribe-theme/tribe-theme-tooltips@2x.png0.55KB0.73KB0.00%