61% tec-subscriber-addons

Code Review | Subscriber Addons for The Events Calendar

WordPress plugin Subscriber Addons for The Events Calendar scored61%from 54 tests.

About plugin

  • Plugin page: tec-subscriber-ad...
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.1
  • WordPress version: 6.3.1
  • First release: Dec 25, 2020
  • Latest release: Apr 12, 2022
  • Number of updates: 17
  • Update frequency: every 27.8 days
  • Top authors: mywptrek (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /626 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.53MB] [CPU: ▲2.33ms] Passed 4 tests

An overview of server-side resources used by Subscriber Addons for The Events Calendar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.5339.28 ▲6.58
Dashboard /wp-admin3.84 ▲0.5451.04 ▲5.71
Posts /wp-admin/edit.php3.90 ▲0.5448.92 ▲0.57
Add New Post /wp-admin/post-new.php6.39 ▲0.5195.37 ▼1.61
Media Library /wp-admin/upload.php3.77 ▲0.5437.17 ▲4.63
Event Subscription /wp-admin/edit.php?post_type=tribe_events&page=tecsb_menu3.4426.48
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius3.9436.01
All Subscribers /wp-admin/edit.php?post_type=tecsb-subscriber3.8138.87

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 227 new files
Database: no new tables, 11 new options
New WordPress options
fs_accounts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
fs_debug_mode
fs_gdpr
widget_recent-comments
can_compress_scripts
tecsb_subscription_page_id
fs_active_plugins
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Subscriber Addons for The Events Calendar
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲18313.68 ▼0.628.67 ▲6.8827.55 ▼16.98
Dashboard /wp-admin2,239 ▲504.83 ▼0.14110.46 ▼4.2346.22 ▲7.36
Posts /wp-admin/edit.php2,122 ▲332.05 ▲0.0340.23 ▼0.3639.58 ▲5.34
Add New Post /wp-admin/post-new.php6,208 ▲4,68018.91 ▼4.54813.13 ▲167.8357.35 ▲5.41
Media Library /wp-admin/upload.php1,421 ▲304.27 ▲0.03104.03 ▲3.9444.11 ▲0.04
Event Subscription /wp-admin/edit.php?post_type=tribe_events&page=tecsb_menu280.440.083.78
Freemius Debug [v.2.4.3] /wp-admin/admin.php?page=freemius1,0682.1031.2428.34
All Subscribers /wp-admin/edit.php?post_type=tecsb-subscriber1,1471.9732.7733.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/tec-subscriber-addons/uninstall.php+13
    Trying to access array offset on value of type bool
  • Zombie WordPress options were found after uninstall: 11 options
    • db_upgraded
    • fs_accounts
    • can_compress_scripts
    • widget_theysaidso_widget
    • fs_debug_mode
    • fs_active_plugins
    • tecsb_subscription_page_id
    • widget_recent-comments
    • fs_gdpr
    • widget_recent-posts
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/tec-subscriber-addons/includes/templates/tecsb-email-style.php
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/tec-subscriber-addons/includes/templates/tecsb-email-verification.php:35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/tec-subscriber-addons/includes/admin/admin-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tec-subscriber-addons/includes/admin/class-tecsb-admin-ajax.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/tec-subscriber-addons/includes/templates/tecsb-email-unsubscribed.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/tec-subscriber-addons/includes/admin/admin-general.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/tec-subscriber-addons/includes/templates/tecsb-email-notification.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/tec-subscriber-addons/includes/admin/admin-form.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tec-subscriber-addons/includes/admin/class-tecsb-event-metabox.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tec-subscriber-addons/includes/class-tecsb-ajax.php:20
    • > PHP Fatal error
      Uncaught Error: Call to a member function tecsb_get_email_content() on null in wp-content/plugins/tec-subscriber-addons/includes/templates/tecsb-email-header.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=tribe_events&page=tecsb_menu
    • > Network (severe)
    wp-admin/edit.php?post_type=tribe_events&page=tecsb_menu - Failed to load resource: the server responded with a status of 403 (Forbidden)

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
Attributes that require attention:
  • Requires php: Version format is invalid
You can take inspiration from this readme.txt

tec-subscriber-addons/class-mwt-tec-subscriber-cc.php 85% from 13 tests

The main PHP file in "Subscriber Addons for The Events Calendar" ver. 2.0.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("tec-subscriber-addons.php" instead of "class-mwt-tec-subscriber-cc.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis 97% from 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
Everything looks great! No dangerous files found in this plugin46,932 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1317,32116,60133,174
SVG47128,789
CSS161,4451474,188
JavaScript63777482
Markdown1680214
JSON20085

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity78.36
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes23.64%
▷ Concrete classes5396.36%
▷ Final classes00.00%
Methods1,208
▷ Static methods17314.32%
▷ Public methods86871.85%
▷ Protected methods151.24%
▷ Private methods32526.90%
Functions94
▷ Named functions94100.00%
▷ Anonymous functions00.00%
Constants123
▷ Global constants9879.67%
▷ Class constants2520.33%
▷ Public constants25100.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
10 PNG files occupy 0.68MB with 0.39MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png42.89KB19.77KB▼ 53.92%
assets/screenshot-4.png69.41KB27.04KB▼ 61.04%
assets/screenshot-1.png52.71KB24.88KB▼ 52.81%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/screenshot-3.png455.46KB100.53KB▼ 77.93%