68% mailchimp-for-woocommerce

Code Review | Mailchimp for WooCommerce

WordPress plugin Mailchimp for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: mailchimp-for-woo...
  • Plugin version: 3.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Oct 6, 2016
  • Latest release: Nov 13, 2023
  • Number of updates: 214
  • Update frequency: every 12.1 days
  • Top authors: ryanhungate (81.31%)MailChimp (19.16%)

Code review

54 tests

User reviews

705 reviews

Install metrics

400,000+ active /17,978,056 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
Install script ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼10.98ms] Passed 4 tests

Analyzing server-side resources used by Mailchimp for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.36 ▼0.63
Dashboard /wp-admin3.31 ▼0.0443.76 ▼18.82
Posts /wp-admin/edit.php3.36 ▲0.0043.59 ▼4.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.52 ▼20.26
Media Library /wp-admin/upload.php3.23 ▲0.0033.63 ▲2.45

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 121 new files
Database: 4 new tables, 10 new options
New tables
wp_actionscheduler_groups
wp_actionscheduler_claims
wp_actionscheduler_actions
wp_actionscheduler_logs
New WordPress options
schema-ActionScheduler_StoreSchema
action_scheduler_lock_async-request-runner
db_upgraded
widget_recent-comments
theysaidso_admin_options
action_scheduler_hybrid_store_demarkation
schema-ActionScheduler_LoggerSchema
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Mailchimp for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.69 ▲0.502.04 ▲0.2743.82 ▼0.97
Dashboard /wp-admin2,189 ▲125.65 ▲0.0588.02 ▼11.5039.97 ▼2.50
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0841.83 ▲6.0637.15 ▼0.45
Add New Post /wp-admin/post-new.php1,526 ▼023.30 ▲0.11600.46 ▼97.3953.17 ▼1.44
Media Library /wp-admin/upload.php1,403 ▲124.20 ▼0.1199.44 ▼6.4041.03 ▼1.76

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 4 tables
    • wp_actionscheduler_groups
    • wp_actionscheduler_logs
    • wp_actionscheduler_claims
    • wp_actionscheduler_actions
  • This plugin does not fully uninstall, leaving 10 options in the database
    • action_scheduler_lock_async-request-runner
    • widget_recent-posts
    • theysaidso_admin_options
    • schema-ActionScheduler_LoggerSchema
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • schema-ActionScheduler_StoreSchema
    • action_scheduler_hybrid_store_demarkation

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/mailchimp-for-woocommerce/admin/partials/tabs/notices.php
    • > /wp-content/plugins/mailchimp-for-woocommerce/public/partials/mailchimp-woocommerce-public-display.php
  • 92× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_Schema' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/vendor/action-scheduler/classes/schema/ActionScheduler_StoreSchema.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/vendor/action-scheduler/tests/phpunit/procedural_api/wc_get_scheduled_actions_Test.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/vendor/action-scheduler/tests/phpunit/logging/ActionScheduler_wpCommentLogger_Test.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Mailchimp_Woocommerce_Job' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/processes/class-mailchimp-woocommerce-single-order.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/vendor/action-scheduler/lib/cron-expression/CronExpression_DayOfMonthField.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Mailchimp_Woocommerce_Job' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/processes/class-mailchimp-woocommerce-subscriber-sync.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MailChimp_WooCommerce_Error' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/api/errors/class-mailchimp-rate-limit-error.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'MailChimp_WooCommerce_Abstract_Sync' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/processes/class-mailchimp-woocommerce-process-products.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_UnitTestCase' not found in wp-content/plugins/mailchimp-for-woocommerce/includes/vendor/action-scheduler/tests/phpunit/schedules/ActionScheduler_IntervalSchedule_Test.php:7
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/tests/phpunit/includes/bootstrap.php' (include_path='.:/usr/share/php') in wp-content/plugins/mailchimp-for-woocommerce/includes/vendor/action-scheduler/tests/bootstrap.php on line 24

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 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: workflows, email, mailchimp, ecommerce

mailchimp-for-woocommerce/mailchimp-woocommerce.php 92% from 13 tests

Analyzing the main PHP file in "Mailchimp for WooCommerce" version 3.3
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("mailchimp-for-woocommerce.php" instead of "mailchimp-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected49,246 lines of code in 229 files:
LanguageFilesBlank linesComment linesLines of code
PHP1804,66411,04722,667
JSON60021,180
CSS6698473,435
JavaScript14134651,119
Markdown123510604
Sass212062
HTML28055
XML32347
SVG10040
Bourne Shell110820
YAML24117

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity17.69
▷ Minimum class complexity1.00
▷ Maximum class complexity306.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity93.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes152
▷ Abstract classes1912.50%
▷ Concrete classes13387.50%
▷ Final classes00.00%
Methods1,547
▷ Static methods1086.98%
▷ Public methods1,26982.03%
▷ Protected methods22014.22%
▷ Private methods583.75%
Functions133
▷ Named functions11082.71%
▷ Anonymous functions2317.29%
Constants51
▷ Global constants1631.37%
▷ Class constants3568.63%
▷ Public constants35100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/action-scheduler/docs/android-chrome-256x256.png24.02KB12.98KB▼ 45.95%
admin/partials/tabs/images/Screenshot_sync.png62.70KB19.73KB▼ 68.53%
includes/vendor/action-scheduler/docs/favicon-32x32.png1.89KB1.55KB▼ 18.28%
includes/vendor/action-scheduler/docs/android-chrome-192x192.png16.63KB8.88KB▼ 46.62%
includes/vendor/action-scheduler/docs/favicon-16x16.png1.13KB0.73KB▼ 35.69%