72% mailjet-for-wordpress

Code Review | Mailjet Email Marketing

WordPress plugin Mailjet Email Marketing scored72%from 54 tests.

About plugin

  • Plugin page: mailjet-for-wordp...
  • Plugin version: 5.5.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2.2
  • WordPress version: 6.3.1
  • First release: Jan 27, 2012
  • Latest release: Nov 10, 2023
  • Number of updates: 388
  • Update frequency: every 11.1 days
  • Top authors: Mailjet (100%)

Code review

54 tests

User reviews

40 reviews

Install metrics

20,000+ active /550,140 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.34MB] [CPU: ▲8.02ms] Passed 4 tests

This is a short check of server-side resources used by Mailjet Email Marketing
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.47 ▲1.0153.85 ▲15.61
Dashboard /wp-admin4.76 ▲1.4258.99 ▲3.33
Posts /wp-admin/edit.php4.82 ▲1.4660.50 ▲12.59
Add New Post /wp-admin/post-new.php7.36 ▲1.4897.18 ▲1.00
Media Library /wp-admin/upload.php4.69 ▲1.4647.17 ▲15.14
/wp-admin/admin.php?page=mailjet_dashboard_page4.8142.88
/wp-admin/admin.php?page=mailjet_allsetup_page4.6043.59
/wp-admin/admin.php?page=mailjet_user_access_page4.6241.67
Campaigns /wp-admin/admin.php?page=mailjet_settings_campaigns_menu4.90223.37
Statistics /wp-admin/admin.php?page=mailjet_settings_stats_menu4.90239.62
/wp-admin/admin.php?page=mailjet_subscription_options_page4.7942.14
Lists /wp-admin/admin.php?page=mailjet_settings_contacts_menu4.90232.85
/wp-admin/admin.php?page=mailjet_connect_account_page4.8242.50
/wp-admin/admin.php?page=mailjet_integrations_page4.8250.36
/wp-admin/admin.php?page=mailjet_sending_settings_page4.7545.74

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 668 new files
Database: no new tables, 25 new options
New WordPress options
send_test_email_btn
mailjet_plugin_version
widget_recent-comments
mailjet_sync_list
mailjet_from_email_extra_hidden
settings_step
widget_theysaidso_widget
mailjet_comment_authors_list
mailjet_from_email_extra
activate_mailjet_sync
...

Browser metrics Passed 4 tests

A check of browser resources used by Mailjet Email Marketing
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17713.82 ▼0.518.71 ▲6.9742.02 ▼0.61
Dashboard /wp-admin2,203 ▲225.68 ▼0.0193.10 ▼11.8391.96 ▲51.83
Posts /wp-admin/edit.php2,126 ▲261.99 ▼0.0138.84 ▼2.5440.12 ▲4.04
Add New Post /wp-admin/post-new.php1,701 ▲17321.92 ▼1.02769.27 ▲162.6144.24 ▼7.45
Media Library /wp-admin/upload.php1,423 ▲264.08 ▼0.16100.74 ▼5.0483.96 ▲40.35
/wp-admin/admin.php?page=mailjet_dashboard_page1,6302.2731.8843.49
/wp-admin/admin.php?page=mailjet_allsetup_page9162.0122.9943.44
/wp-admin/admin.php?page=mailjet_user_access_page1,0912.0226.4649.22
Campaigns /wp-admin/admin.php?page=mailjet_settings_campaigns_menu1,6772.2526.7337.27
Statistics /wp-admin/admin.php?page=mailjet_settings_stats_menu1,6722.2329.5941.20
/wp-admin/admin.php?page=mailjet_subscription_options_page1,1651.6825.1743.23
Lists /wp-admin/admin.php?page=mailjet_settings_contacts_menu1,6772.2527.7542.20
/wp-admin/admin.php?page=mailjet_connect_account_page1,0612.0025.6336.16
/wp-admin/admin.php?page=mailjet_integrations_page1,3001.6528.3647.45
/wp-admin/admin.php?page=mailjet_sending_settings_page1,2001.6528.6542.19

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 9 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • mailjet_plugin_version
    • widget_recent-comments
    • widget_wp_mailjet_form_builder_widget
    • mj_profile_name

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
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailjet_subscription_options_page
    • > Warning in wp-content/plugins/mailjet-for-wordpress/src/templates/admin/settingTemplates/SubscriptionSettingsPartials/subscrFieldset.php+105
    Invalid argument supplied for foreach()

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 items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/mailjet-for-wordpress/src/templates/confirm-subscription-email.php
    • > /wp-content/plugins/mailjet-for-wordpress/src/front/partials/MailjetPublicDisplay.php
  • 251× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MailjetWp\\GuzzleHttp\\Psr7\\Request' not found in wp-content/plugins/mailjet-for-wordpress/vendor/guzzlehttp/psr7/src/ServerRequest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'MailjetWp\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailjet-for-wordpress/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'MailjetWp\\Analog\\Handler\\PDO' not found in wp-content/plugins/mailjet-for-wordpress/vendor/analog/analog/examples/pdo.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PhpCsFixer\\Finder' not found in wp-content/plugins/mailjet-for-wordpress/vendor/bamarni/composer-bin-plugin/.php-cs-fixer.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'MailjetWp\\Sepia\\PoParser\\SourceHandler\\SourceHandler' not found in wp-content/plugins/mailjet-for-wordpress/vendor/sepia/po-parser/src/SourceHandler/StringSource.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'MailjetWp\\Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/mailjet-for-wordpress/vendor/guzzlehttp/psr7/src/Request.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'MailjetWp\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailjet-for-wordpress/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailjet-for-wordpress/src/widget/WP_Mailjet_Subscribe_Widget.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'MailjetWp\\Analog' not found in wp-content/plugins/mailjet-for-wordpress/vendor/analog/analog/examples/stderr.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailjet-for-wordpress/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (The initial setup wizard will guide you through the quick steps to get started), #2 (Access all features from the plugin dashboard), #3 (Configure a subscription widget to collect subscribers from your site), #4 (Activate and configure WooCommerce and Contact Form 7 integrations), #5 (Enable order notifications for WooCommerce), #6 (Configure abandoned cart notifications for WooCommerce)
You can look at the official readme.txt

mailjet-for-wordpress/wp-mailjet.php 92% from 13 tests

The main file in "Mailjet Email Marketing" v. 5.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mailjet-for-wordpress.php" instead of "wp-mailjet.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected43,065 lines of code in 569 files:
LanguageFilesBlank linesComment linesLines of code
PHP4031,55311,95625,154
PO File321,8752,3205,493
Markdown381,73505,084
JSON34002,189
CSS6411761,978
HTML42294011,627
JavaScript6106130594
SVG1703348
YAML10530276
Bourne Shell129796182
make2381185
XML41345
Dockerfile18010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.39
▷ Minimum class complexity1.00
▷ Maximum class complexity251.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces46
Interfaces31
Traits5
Classes291
▷ Abstract classes41.37%
▷ Concrete classes28798.63%
▷ Final classes5017.42%
Methods1,632
▷ Static methods30818.87%
▷ Public methods1,30579.96%
▷ Protected methods784.78%
▷ Private methods24915.26%
Functions232
▷ Named functions9641.38%
▷ Anonymous functions13658.62%
Constants162
▷ Global constants74.32%
▷ Class constants15595.68%
▷ Public constants14090.32%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
30 PNG files occupy 0.98MB with 0.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/admin/images/need_help.png0.40KB0.31KB▼ 22.03%
src/admin/images/create_contact_list.png0.38KB0.26KB▼ 31.01%
src/admin/images/all_setup_screen_signup_to_newsletter.png2.29KB1.04KB▼ 54.27%
src/admin/images/dashboard_top_right_image.png2.29KB1.04KB▼ 54.27%
src/admin/images/all_setup_screen_send_campaign.png3.99KB1.82KB▼ 54.26%