52% mailoptin

Code Review | Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber - MailOptin

WordPress plugin Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber - MailOptin scored52%from 54 tests.

About plugin

  • Plugin page: mailoptin
  • Plugin version: 1.2.65.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Jul 17, 2017
  • Latest release: Oct 31, 2023
  • Number of updates: 399
  • Update frequency: every 5.8 days
  • Top authors: Collizo4sky (100%)

Code review

54 tests

User reviews

398 reviews

Install metrics

30,000+ active /1,887,093 total downloads

Benchmarks

Plugin footprint 65% 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: ▲1.60MB] [CPU: ▲2.60ms] Passed 4 tests

An overview of server-side resources used by Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber - MailOptin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.86 ▲1.4044.83 ▲2.44
Dashboard /wp-admin4.98 ▲1.6854.06 ▲7.85
Posts /wp-admin/edit.php5.01 ▲1.6659.07 ▲9.76
Add New Post /wp-admin/post-new.php7.66 ▲1.7796.45 ▼3.04
Media Library /wp-admin/upload.php4.89 ▲1.6640.44 ▲3.14
Login Redirect /wp-admin/admin.php?page=mailoptin-loginwp4.8142.21
Integrations /wp-admin/admin.php?page=mailoptin-integrations4.8448.30
Emails /wp-admin/admin.php?page=mailoptin-emails4.8641.63
Leads /wp-admin/admin.php?page=mailoptin-lead-bank4.8039.66
User Sync NEW /wp-admin/admin.php?page=mailoptin-fusewp4.8141.02
Optin Campaigns /wp-admin/admin.php?page=mailoptin-optin-campaigns5.0343.23
Statistics /wp-admin/admin.php?page=mailoptin-statistics4.8041.95
Settings /wp-admin/admin.php?page=mailoptin-settings4.8039.91

Server storage [IO: ▲14.98MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 2,344 new files
Database: 7 new tables, 12 new options
New tables
wp_mo_conversions
wp_mo_campaign_log
wp_mo_email_campaignmeta
wp_mo_email_campaigns
wp_mo_optin_campaignmeta
wp_mo_optin_campaigns
wp_mo_campaign_logmeta
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
mo_plugin_activated
widget_recent-comments
mo_db_ver
mailoptin_settings
mo_install_date
can_compress_scripts
...

Browser metrics Passed 4 tests

Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber - MailOptin: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,159 ▲41313.69 ▼0.5814.18 ▲12.5437.94 ▼3.68
Dashboard /wp-admin2,427 ▲2495.81 ▲0.1095.16 ▼14.9346.63 ▲2.16
Posts /wp-admin/edit.php2,307 ▲2072.37 ▲0.3442.18 ▲1.3837.73 ▲2.35
Add New Post /wp-admin/post-new.php6,300 ▲4,76319.22 ▲1.05949.10 ▲297.6537.68 ▼31.35
Media Library /wp-admin/upload.php1,617 ▲2174.47 ▲0.26101.37 ▲3.4841.39 ▼2.53
Login Redirect /wp-admin/admin.php?page=mailoptin-loginwp1,1012.3839.1639.31
Integrations /wp-admin/admin.php?page=mailoptin-integrations3,8032.4548.39103.39
Emails /wp-admin/admin.php?page=mailoptin-emails1,4582.5134.0860.13
Leads /wp-admin/admin.php?page=mailoptin-lead-bank1,1562.6234.4257.05
User Sync NEW /wp-admin/admin.php?page=mailoptin-fusewp1,0982.4932.1139.54
Optin Campaigns /wp-admin/admin.php?page=mailoptin-optin-campaigns1,5462.5033.2965.11
Statistics /wp-admin/admin.php?page=mailoptin-statistics1,1132.4932.0073.76
Settings /wp-admin/admin.php?page=mailoptin-settings1,3202.3532.0078.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 7 tables in the database
    • wp_mo_campaign_log
    • wp_mo_optin_campaignmeta
    • wp_mo_email_campaignmeta
    • wp_mo_optin_campaigns
    • wp_mo_campaign_logmeta
    • wp_mo_conversions
    • wp_mo_email_campaigns
  • Zombie WordPress options detected upon uninstall: 12 options
    • widget_theysaidso_widget
    • db_upgraded
    • mo_db_ver
    • mo_plugin_activated
    • theysaidso_admin_options
    • widget_mo_optin_widgets
    • mailoptin_connections
    • mailoptin_settings
    • widget_recent-comments
    • mo_install_date
    • ...

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
  • 49 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailoptin-integrations
    • > Notice in wp-content/plugins/mailoptin/src/core/src/Functions/custom-settings-api.php+589
    Undefined index: value
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailoptin-integrations
    • > Notice in wp-content/plugins/mailoptin/src/core/src/Functions/custom-settings-api.php+570
    Undefined index: description
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailoptin-emails
    • > Notice in wp-content/plugins/mailoptin/src/core/src/Functions/custom-settings-api.php+122
    Undefined index: class
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailoptin-emails
    • > Notice in wp-content/plugins/mailoptin/src/core/src/Functions/custom-settings-api.php+123
    Undefined index: style
    • > GET request to /wp-admin/admin.php?page=mailoptin-emails
    • > Notice in wp-content/plugins/mailoptin/src/core/src/Admin/SettingsPage/Email_Campaign_List.php+405
    Undefined index: email-campaign-id
    • > GET request to /wp-admin/admin.php?page=mailoptin-optin-campaigns
    • > Notice in wp-content/plugins/mailoptin/src/core/src/Admin/SettingsPage/OptinCampaign_List.php+731
    Undefined index: optin-campaign

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/mailoptin/src/core/src/Connections/error-html-tmpl.php
    • > /wp-content/plugins/mailoptin/src/connections/MailjetConnect/confirm-email-tmpl.php
  • 798× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'League\\Csv\\AbstractCsv' not found in wp-content/plugins/mailoptin/vendor/league/csv/src/Writer.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailoptin/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'NF_Abstracts_ActionNewsletter' not found in wp-content/plugins/mailoptin/src/connections/NinjaFormsConnect/Integrations/MailerliteConnect.php:11
    • > PHP Fatal error
      require_once(): Failed opening required '/tmp/wordpress-tests-lib/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/mailoptin/src/core/tests/bootstrap.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'ActiveCampaign' not found in wp-content/plugins/mailoptin/src/connections/ActiveCampaignConnect/APIClass/includes/Webhook.class.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Exception\\RuntimeException' not found in wp-content/plugins/mailoptin/vendor/symfony/translation/Exception/ProviderException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailoptin/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Authifly\\Exception\\UnexpectedValueException' not found in wp-content/plugins/mailoptin/vendor/mailoptin/authifly/src/Exception/AuthorizationDeniedException.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/mailoptin/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'MailOptin\\SendlaneConnect\\AbstractSendlaneConnect' not found in wp-content/plugins/mailoptin/src/connections/SendlaneConnect/Connect.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: newsletter, popup, mailchimp, popup maker, popups

mailoptin/mailoptin.php Passed 13 tests

"Popup, Optin Form & Email Newsletters for Mailchimp, HubSpot, AWeber - MailOptin" version 1.2.65.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
59 characters long description:
Best lead generation, email automation & newsletter plugin.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please make sure to remedy the following
  • Do not include executable or dangerous files in your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/mailoptin/vendor/nesbot/carbon/bin/carbon.bat
155,020 lines of code in 1,921 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,73232,14052,255135,275
JavaScript1152,1398848,120
CSS28932975,229
XSD392482,803
JSON8001,988
Markdown102310965
YAML5523257
Bourne Shell34618251
XML371675
SVG110138
make14014
DOS Batch1004
HTML1001

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity13.49
▷ Minimum class complexity1.00
▷ Maximum class complexity351.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces175
Interfaces54
Traits35
Classes963
▷ Abstract classes424.36%
▷ Concrete classes92195.64%
▷ Final classes232.50%
Methods6,943
▷ Static methods1,11416.04%
▷ Public methods6,26290.19%
▷ Protected methods3645.24%
▷ Private methods3174.57%
Functions629
▷ Named functions15124.01%
▷ Anonymous functions47875.99%
Constants326
▷ Global constants8726.69%
▷ Class constants23973.31%
▷ Public constants21991.63%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
79 compressed PNG files occupy 2.92MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/core/src/assets/images/optin-themes/rescript-lightbox.png19.01KB19.01KB0.01%
src/core/src/assets/images/optin-themes/primrose-sidebar.png70.90KB70.91KB0.00%
src/core/src/assets/images/optin-themes/scilla/scilla-sidebar-slidein.png14.49KB15.00KB0.00%
src/core/src/assets/images/advanceanalytics.png229.91KB252.67KB0.00%
src/core/src/assets/images/optin-themes/letterbox-inpost.png12.58KB12.58KB0.00%