62% mailpoet

Code Review | MailPoet - Newsletters, Email Marketing, and Automation

WordPress plugin MailPoet - Newsletters, Email Marketing, and Automation scored62%from 54 tests.

About plugin

  • Plugin page: mailpoet
  • Plugin version: 4.38.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: Oct 28, 2016
  • Latest release: Nov 28, 2023
  • Number of updates: 944
  • Update frequency: every 2.8 days
  • Top authors: wysija (65.25%)MailPoet (34.85%)

Code review

54 tests

User reviews

1298 reviews

Install metrics

700,000+ active /37,497,316 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲4.23MB] [CPU: ▲16.63ms] Passed 4 tests

Server-side resources used by MailPoet - Newsletters, Email Marketing, and Automation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /7.82 ▲4.3664.66 ▲20.27
Dashboard /wp-admin7.54 ▲4.1969.43 ▲6.85
Posts /wp-admin/edit.php7.59 ▲4.2372.74 ▲22.68
Add New Post /wp-admin/post-new.php10.27 ▲4.38116.52 ▲16.71
Media Library /wp-admin/upload.php7.35 ▲4.1260.17 ▲25.45
Export /wp-admin/admin.php?page=mailpoet-export7.3661.51
Automation Templates /wp-admin/admin.php?page=mailpoet-automation-templates7.3658.25
Settings /wp-admin/admin.php?page=mailpoet-settings7.3647.49
Help /wp-admin/admin.php?page=mailpoet-help7.3653.74
MailPoet /wp-admin/admin.php?page=mailpoet-landingpage7.5362.65
Scheduled Actions /wp-admin/tools.php?page=action-scheduler7.5171.26
WooCommerce Setup /wp-admin/admin.php?page=mailpoet-woocommerce-setup7.1947.05
Welcome Wizard /wp-admin/admin.php?page=mailpoet-welcome-wizard7.9966.60
Automation Analytics /wp-admin/admin.php?page=mailpoet-automation-analytics7.3652.65
Email Editor /wp-admin/admin.php?page=mailpoet-email-editor7.3653.43

Server storage [IO: ▲27.24MB] [DB: ▲1.26MB] 67% from 3 tests

Filesystem and database footprint
Just a few items left to fix
  • Try to limit filesystem usage to 25MB (currently using 27.24MB)
Filesystem: 3,948 new files
Database: 44 new tables, 10 new options
New tables
wp_mailpoet_feature_flags
wp_mailpoet_newsletters
wp_mailpoet_automation_run_logs
wp_mailpoet_subscriber_ips
wp_mailpoet_statistics_woocommerce_purchases
wp_mailpoet_scheduled_tasks
wp_mailpoet_custom_fields
wp_mailpoet_statistics_bounces
wp_mailpoet_automation_run_subjects
wp_mailpoet_automation_runs
...
New WordPress options
widget_mailpoet_form
widget_recent-posts
can_compress_scripts
schema-ActionScheduler_StoreSchema
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
schema-ActionScheduler_LoggerSchema
db_upgraded
action_scheduler_hybrid_store_demarkation

Browser metrics Passed 4 tests

This is an overview of browser requirements for MailPoet - Newsletters, Email Marketing, and Automation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲10614.68 ▲0.341.45 ▼0.2836.96 ▼7.71
Dashboard /wp-admin2,273 ▲995.68 ▲0.0996.61 ▼9.6543.55 ▼3.42
Posts /wp-admin/edit.php2,178 ▲782.01 ▲0.0239.78 ▼3.4137.73 ▼1.48
Add New Post /wp-admin/post-new.php1,580 ▲5423.47 ▲0.31603.12 ▲11.9350.99 ▼2.57
Media Library /wp-admin/upload.php1,476 ▲734.18 ▼0.05102.51 ▲6.0144.32 ▲2.81
Export /wp-admin/admin.php?page=mailpoet-export1,17614.37257.7643.09
Automation Templates /wp-admin/admin.php?page=mailpoet-automation-templates1,17514.43249.9643.01
Settings /wp-admin/admin.php?page=mailpoet-settings1,17014.39186.0450.33
Help /wp-admin/admin.php?page=mailpoet-help1,17014.43211.3266.83
MailPoet /wp-admin/admin.php?page=mailpoet-landingpage1,17414.29216.9648.17
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,4451.8025.0333.84
WooCommerce Setup /wp-admin/admin.php?page=mailpoet-woocommerce-setup1,17014.36215.2555.80
Welcome Wizard /wp-admin/admin.php?page=mailpoet-welcome-wizard94511.86233.0651.45
Automation Analytics /wp-admin/admin.php?page=mailpoet-automation-analytics1,17014.38186.3357.65
Email Editor /wp-admin/admin.php?page=mailpoet-email-editor1,17014.30216.7864.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The plugin did not uninstall successfully, leaving 44 tables in the database
    • wp_mailpoet_subscriber_segment
    • wp_mailpoet_tags
    • wp_mailpoet_custom_fields
    • wp_mailpoet_statistics_clicks
    • wp_mailpoet_settings
    • wp_actionscheduler_logs
    • wp_mailpoet_newsletter_segment
    • wp_mailpoet_subscriber_tag
    • wp_mailpoet_scheduled_tasks
    • wp_actionscheduler_actions
    • ...
  • This plugin does not fully uninstall, leaving 11 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • action_scheduler_migration_status
    • schema-ActionScheduler_LoggerSchema
    • action_scheduler_hybrid_store_demarkation
    • can_compress_scripts
    • widget_recent-posts
    • schema-ActionScheduler_StoreSchema
    • db_upgraded
    • theysaidso_admin_options
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailpoet-export
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mailpoet/mailpoet-cron.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Declaration of MailPoetVendor\\Doctrine\\ORM\\Mapping\\ReflectionReadonlyProperty::setValue(MailPoetVendor\\Doctrine\\ORM\\Mapping\\mixed $objectOrValue, ?MailPoetVendor\\Doctrine\\ORM\\Mapping\\mixed $value = NULL): void should be compatible with ReflectionProperty::setValue($object, $value = NULL) in wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ReflectionReadonlyProperty.php on line 28
    • > PHP Warning
      Declaration of MailPoetVendor\\Doctrine\\ORM\\Mapping\\ReflectionReadonlyProperty::getValue(?object $object = NULL): MailPoetVendor\\Doctrine\\ORM\\Mapping\\mixed should be compatible with ReflectionProperty::getValue($object = NULL) in wp-content/plugins/mailpoet/vendor-prefixed/doctrine/orm/lib/Doctrine/ORM/Mapping/ReflectionReadonlyProperty.php on line 24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Sample newsletters) image not found
You can look at the official readme.txt

mailpoet/mailpoet.php Passed 13 tests

The main PHP file in "MailPoet - Newsletters, Email Marketing, and Automation" ver. 4.38.0 adds more information about the plugin and also serves as the entry point for this plugin
87 characters long description:
Create and send newsletters, post notifications and welcome emails from your WordPress.

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 plugin315,693 lines of code in 2,907 files:
LanguageFilesBlank linesComment linesLines of code
PHP2,65424,64834,602299,997
CSS32401155,790
HTML502742045,048
Handlebars9921043,538
JSON500719
SVG4401364
XSD1180142
Markdown326055
JavaScript1901540

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.90
▷ Minimum class complexity1.00
▷ Maximum class complexity416.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces331
Interfaces180
Traits51
Classes2,399
▷ Abstract classes1054.38%
▷ Concrete classes2,29495.62%
▷ Final classes2068.98%
Methods17,476
▷ Static methods1,2817.33%
▷ Public methods14,19081.20%
▷ Protected methods1,5538.89%
▷ Private methods1,7339.92%
Functions867
▷ Named functions17520.18%
▷ Anonymous functions69279.82%
Constants2,319
▷ Global constants1908.19%
▷ Class constants2,12991.81%
▷ Public constants2,03695.63%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
117 compressed PNG files occupy 0.18MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/newsletter_editor/social-icons/07-full-symbol-black/Google-Plus.png0.73KB1.24KB0.00%
assets/img/newsletter_editor/social-icons/04-full-flat-roundrect/Email.png1.05KB1.12KB0.00%
assets/img/newsletter_editor/social-icons/05-full-gradient-square/Email.png2.05KB2.14KB0.00%
assets/img/form_editor_icons.png12.25KB5.27KB▼ 56.96%
assets/img/datepicker/ui-icons_454545_256x240.png3.71KB4.11KB0.00%