84% mailchimp-for-wp

Code Review | MC4WP: Mailchimp for WordPress

WordPress plugin MC4WP: Mailchimp for WordPress scored 84% from 54 tests.

About plugin

  • Plugin page: mailchimp-for-wp
  • Plugin version: 4.8.7
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9
  • WordPress version: 5.9.2
  • First release: Jun 19, 2013
  • Latest release: Mar 2, 2022
  • Number of updates: 512
  • Update frequency: every 6.2 days
  • Top authors: DvanKooten (100%)

Code review

54 tests

User reviews

1396 reviews

Install metrics

2,000,000+ active / 37,892,043 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.89MB] [CPU: ▼289.40ms] Passed 4 tests

This is a short check of server-side resources used by MC4WP: Mailchimp for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.26 ▲0.7562.45 ▲4.11
Dashboard /wp-admin4.34 ▲0.9345.74 ▲9.56
Posts /wp-admin/edit.php4.63 ▲0.9951.43 ▲11.41
Add New Post /wp-admin/post-new.php7.87 ▲0.90108.69 ▼1,180.56
Media Library /wp-admin/upload.php4.29 ▲0.9936.40 ▲9.28
Mailchimp /wp-admin/admin.php?page=mailchimp-for-wp4.3636.41
Add-ons /wp-admin/admin.php?page=mailchimp-for-wp-extensions4.3330.59
Form /wp-admin/admin.php?page=mailchimp-for-wp-forms4.2928.89
Other /wp-admin/admin.php?page=mailchimp-for-wp-other4.4031.49
Integrations /wp-admin/admin.php?page=mailchimp-for-wp-integrations4.4533.21

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 196 new files
Database: no new tables, 3 new options
New WordPress options
mc4wp_version
widget_mc4wp_form_widget
mc4wp

Browser metrics Passed 4 tests

An overview of browser requirements for MC4WP: Mailchimp for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,853 ▲13115.64 ▼0.365.77 ▲0.172.05 ▼0.28
Dashboard /wp-admin2,951 ▲906.13 ▼0.07125.67 ▼16.14154.63 ▼8.56
Posts /wp-admin/edit.php2,761 ▲673.25 ▲0.0263.45 ▲0.94133.30 ▼13.58
Add New Post /wp-admin/post-new.php1,677 ▼4619.24 ▼2.22487.07 ▲57.17182.54 ▲24.63
Media Library /wp-admin/upload.php1,775 ▲775.53 ▲0.00140.43 ▲0.51188.22 ▼1.09
Mailchimp /wp-admin/admin.php?page=mailchimp-for-wp1,3112.7457.34142.49
Add-ons /wp-admin/admin.php?page=mailchimp-for-wp-extensions1,2602.6557.62170.43
Form /wp-admin/admin.php?page=mailchimp-for-wp-forms1,2802.7756.54124.29
Other /wp-admin/admin.php?page=mailchimp-for-wp-other1,4552.7555.70151.78
Integrations /wp-admin/admin.php?page=mailchimp-for-wp-integrations1,7282.8354.38140.67

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 3 options
    • mc4wp
    • mc4wp_version
    • widget_mc4wp_form_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
Please fix the following
  • 23× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/mailchimp-for-wp/includes/forms/views/tabs/form-appearance.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MC4WP_API_Exception' not found in wp-content/plugins/mailchimp-for-wp/includes/api/class-connection-exception.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WPForms_Field' not found in wp-content/plugins/mailchimp-for-wp/integrations/wpforms/class-field.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mc4wp_register_integration() in wp-content/plugins/mailchimp-for-wp/integrations/wpforms/bootstrap.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MC4WP_API_Exception' not found in wp-content/plugins/mailchimp-for-wp/includes/api/class-resource-not-found-exception.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_thickbox() in wp-content/plugins/mailchimp-for-wp/includes/forms/views/tabs/form-fields.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mailchimp-for-wp/integrations/ninja-forms/admin-before.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/mailchimp-for-wp/includes/forms/views/tabs/form-settings.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mailchimp-for-wp/integrations/contact-form-7/admin-before.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mailchimp-for-wp/integrations/gravity-forms/admin-before.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

mailchimp-for-wp/mailchimp-for-wp.php Passed 13 tests

The entry point to "MC4WP: Mailchimp for WordPress" version 4.8.7 is a PHP file that has certain tags in its header comment area
97 characters long description:
Mailchimp for WordPress by ibericode. Adds various highly effective sign-up methods to your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin13,231 lines of code in 187 files:
LanguageFilesBlank linesComment linesLines of code
PHP1342,5795,7589,074
JavaScript394273422,106
CSS88940988
Markdown16510877
SVG31195
XML210091

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.47
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.35
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes70
▷ Abstract classes34.29%
▷ Concrete classes6795.71%
▷ Final classes11.49%
Methods595
▷ Static methods254.20%
▷ Public methods51686.72%
▷ Protected methods477.90%
▷ Private methods325.38%
Functions61
▷ Named functions5793.44%
▷ Anonymous functions46.56%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin