66% mailchimp-forms-by-mailmunch

Code Review | MailChimp Forms by MailMunch

WordPress plugin MailChimp Forms by MailMunch scored66%from 54 tests.

About plugin

  • Plugin page: mailchimp-forms-b...
  • Plugin version: 3.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 15, 2014
  • Latest release: Nov 7, 2023
  • Number of updates: 198
  • Update frequency: every 16.7 days
  • Top authors: mailmunch (100%)

Code review

54 tests

User reviews

368 reviews

Install metrics

30,000+ active /932,453 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼3.28ms] 75% from 4 tests

A check of server-side resources used by MailChimp Forms by MailMunch
It is recommended to improve the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 859.33ms on /wp-admin/admin.php?page=mailchimp-mailmunch-broadcasts)
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3843.64 ▲0.36
Dashboard /wp-admin3.70 ▲0.3948.44 ▼5.70
Posts /wp-admin/edit.php3.74 ▲0.3948.72 ▲3.15
Add New Post /wp-admin/post-new.php6.23 ▲0.3590.58 ▼10.94
Media Library /wp-admin/upload.php3.55 ▲0.3343.72 ▲7.43
Autoresponders /wp-admin/admin.php?page=mailchimp-mailmunch-autoresponders3.622,731.69
Add New Page /wp-admin/post-new.php?post_type=mailmunch_page3.81863.88
MailChimp /wp-admin/options-general.php?page=mailchimp-mailmunch3.61376.41
Settings /wp-admin/admin.php?page=mailchimp-mailmunch-settings3.61366.82
Landing Pages /wp-admin/edit.php?post_type=mailmunch_page3.6740.87
Forms /wp-admin/admin.php?page=mailchimp-mailmunch3.61359.34
Broadcasts /wp-admin/admin.php?page=mailchimp-mailmunch-broadcasts3.64859.33

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 41 new files
Database: no new tables, 11 new options
New WordPress options
mc_mm_site_id
widget_recent-posts
widget_mc_mm_widget
widget_theysaidso_widget
widget_recent-comments
mc_mm_activation_date
can_compress_scripts
db_upgraded
mc_mm_user_token
theysaidso_admin_options
...

Browser metrics Passed 4 tests

A check of browser resources used by MailChimp Forms by MailMunch
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,068 ▲30613.56 ▼0.7317.22 ▲15.4231.25 ▼18.86
Dashboard /wp-admin2,316 ▲1355.60 ▼0.0590.55 ▼18.8791.75 ▲49.66
Posts /wp-admin/edit.php2,178 ▲782.06 ▲0.1236.72 ▼0.5332.38 ▼4.27
Add New Post /wp-admin/post-new.php1,746 ▲21122.41 ▲4.02701.77 ▲58.6162.15 ▼2.49
Media Library /wp-admin/upload.php1,472 ▲694.26 ▲0.0599.38 ▼8.0864.77 ▲22.34
Autoresponders /wp-admin/admin.php?page=mailchimp-mailmunch-autoresponders1,9148.00308.4030.72
Add New Page /wp-admin/post-new.php?post_type=mailmunch_page1,5792.5452.0270.60
MailChimp /wp-admin/options-general.php?page=mailchimp-mailmunch1,1122.2125.4723.92
Settings /wp-admin/admin.php?page=mailchimp-mailmunch-settings9852.2025.4228.04
Landing Pages /wp-admin/edit.php?post_type=mailmunch_page1,1661.9434.7829.65
Forms /wp-admin/admin.php?page=mailchimp-mailmunch1,1092.1726.0923.15
Broadcasts /wp-admin/admin.php?page=mailchimp-mailmunch-broadcasts1,8397.77263.6627.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_mc_mm_widget
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=mailmunch_page
    • > Notice in wp-content/plugins/mailchimp-forms-by-mailmunch/includes/class-mailchimp-mailmunch-post-type.php+91
    Undefined offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=mailmunch_page
    • > Notice in wp-content/plugins/mailchimp-forms-by-mailmunch/includes/class-mailchimp-mailmunch-post-type.php+91
    Trying to get property 'id' of non-object

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mailchimp-forms-by-mailmunch/public/partials/mailchimp-mailmunch-public-display.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-modals.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-connect.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-autoresponders.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-integrate.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-tabs.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/mailchimp-forms-by-mailmunch/public/mailchimp-mailmunch-landing-page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-admin-display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailchimp-forms-by-mailmunch/includes/class-mailchimp-mailmunch-sidebar-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/mailchimp-forms-by-mailmunch/admin/partials/mailchimp-mailmunch-broadcasts.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=mailchimp-mailmunch-autoresponders
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=mailchimp-mailmunch-autoresponders 203:34 Uncaught ReferenceError: currentUser is not defined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailchimp-mailmunch-broadcasts
    • > Console-api (warning) in unknown
    https://static.hotjar.com/c/hotjar-1291326.js?sv=7 2:5946 "Hotjar not launching due to suspicious userAgent:" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/119.0.6045.105 Safari/537.36"
    • > GET request to /wp-admin/admin.php?page=mailchimp-mailmunch-broadcasts
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=mailchimp-mailmunch-broadcasts 203:34 Uncaught ReferenceError: currentUser is not defined

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

mailchimp-forms-by-mailmunch/mailchimp-mailmunch.php 85% from 13 tests

"MailChimp Forms by MailMunch" version 3.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("mailchimp-forms-by-mailmunch.php" instead of "mailchimp-mailmunch.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 167 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin2,357 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
PHP253948781,657
CSS1732468
JavaScript12828232

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.17
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods125
▷ Static methods21.60%
▷ Public methods11491.20%
▷ Protected methods00.00%
▷ Private methods118.80%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/icon.png1.08KB0.91KB▼ 15.78%
admin/img/mailchimp_logo.png14.52KB5.25KB▼ 63.83%
admin/img/close.png0.26KB0.27KB0.00%
admin/img/warning.png5.31KB1.95KB▼ 63.30%
admin/img/smallcheck.png0.85KB0.79KB▼ 7.47%