73% event-calendar-newsletter

Code Review | Event Calendar Newsletter

WordPress plugin Event Calendar Newsletter scored73%from 54 tests.

About plugin

  • Plugin page: event-calendar-ne...
  • Plugin version: 2.16
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3
  • WordPress version: 6.3.1
  • First release: Aug 25, 2014
  • Latest release: Aug 9, 2023
  • Number of updates: 221
  • Update frequency: every 14.8 days
  • Top authors: brianhogg (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

700+ active /32,278 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▼7.47ms] Passed 4 tests

This is a short check of server-side resources used by Event Calendar Newsletter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5342.92 ▼4.33
Dashboard /wp-admin3.85 ▲0.5458.20 ▲13.32
Posts /wp-admin/edit.php3.90 ▲0.5455.13 ▲1.30
Add New Post /wp-admin/post-new.php6.43 ▲0.5492.11 ▼34.73
Media Library /wp-admin/upload.php3.77 ▲0.5448.46 ▲7.90
Event Calendar Newsletter /wp-admin/admin.php?page=eventcalendarnewsletter3.8444.40
Settings /wp-admin/admin.php?page=ecn-settings3.7442.39

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Event Calendar Newsletter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲9814.33 ▲0.392.26 ▲0.2740.98 ▼6.55
Dashboard /wp-admin2,244 ▲565.80 ▼0.10134.96 ▲22.2348.00 ▲4.47
Posts /wp-admin/edit.php2,133 ▲472.04 ▲0.0141.64 ▲1.9537.62 ▲0.19
Add New Post /wp-admin/post-new.php1,707 ▲18721.95 ▼1.16645.83 ▼62.1249.82 ▼4.62
Media Library /wp-admin/upload.php1,432 ▲414.23 ▼0.09110.63 ▲0.4648.41 ▲4.12
Event Calendar Newsletter /wp-admin/admin.php?page=eventcalendarnewsletter1,44011.13306.2973.74
Settings /wp-admin/admin.php?page=ecn-settings9242.0229.8127.53

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • wisdom_notification_times
    • ecn_saved_options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecn-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+204
    Undefined offset: 0
  • 15 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecn-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+205
    Trying to get property 'guid' of non-object
  • 57 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecn-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+221
    Trying to get property 'ID' of non-object
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecn-settings
    • > POST request to /wp-cron.php?doing_wp_cron=1696658530.1360850334167480468750
    • > Notice in wp-content/plugins/pressforward/Core/Utility/Retrieval.php+222
    Trying to get property 'post_title' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/event-calendar-newsletter/includes/admin/additional-settings/google-calendar-events.php
    • > /wp-content/plugins/event-calendar-newsletter/tests/bootstrap.php
    • > /wp-content/plugins/event-calendar-newsletter/event-calendar-newsletter.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/event-calendar-newsletter/tests/TheEventsCalendarTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'ECNCalendarFeed' not found in wp-content/plugins/event-calendar-newsletter/includes/ecncalendarfeedai1ec.class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ECNCalendarFeed' not found in wp-content/plugins/event-calendar-newsletter/includes/ecncalendarfeedtheeventscalendar.class.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/event-calendar-newsletter/includes/output_formats/default.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ECNCalendarFeed' not found in wp-content/plugins/event-calendar-newsletter/includes/ecncalendarfeedeventsmanager.class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ECNCalendarFeed' not found in wp-content/plugins/event-calendar-newsletter/includes/ecncalendarfeedgooglecalendarevents.class.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'ECNCalendarFeed' not found in wp-content/plugins/event-calendar-newsletter/includes/ecncalendarfeedajaxcalendar.class.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/event-calendar-newsletter/includes/admin/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ECNCalendarFeed' not found in wp-content/plugins/event-calendar-newsletter/includes/ecncalendarfeedeventorganiser.class.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/event-calendar-newsletter/includes/ecnsettings.class.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: event calendar newsletter, wordpress events calendar, the events calendar, wordpress event calendar, all-in-one event calendar

event-calendar-newsletter/event-calendar-newsletter.php Passed 13 tests

"Event Calendar Newsletter" version 2.16's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
115 characters long description:
Easily put events from your WordPress event calendar inside of a newsletter. Spend less time promoting your events!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin3,706 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP237187133,199
PO File2110116303
JavaScript1194160
CSS20026
XML10018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity22.88
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes16.25%
▷ Concrete classes1593.75%
▷ Final classes00.00%
Methods253
▷ Static methods93.56%
▷ Public methods24195.26%
▷ Protected methods10.40%
▷ Private methods114.35%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.36MB with 0.23MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/ecn-upgrade-to-pro-3.png50.93KB21.10KB▼ 58.57%
includes/images/ecn-upgrade-to-pro-2.png174.78KB51.84KB▼ 70.34%
includes/images/ecn-upgrade-to-pro.png143.34KB57.20KB▼ 60.09%