83% woocommerce-mailchimp

Code Review | WP WooCommerce Mailchimp

WordPress plugin WP WooCommerce Mailchimp scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-mailc...
  • Plugin version: 2.4.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 10, 2013
  • Latest release: Aug 10, 2023
  • Number of updates: 190
  • Update frequency: every 18.9 days
  • Top authors: anderly (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

10,000+ active /539,245 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
Installer ran successfully

Server metrics [RAM: ▲0.78MB] [CPU: ▼6.69ms] Passed 4 tests

An overview of server-side resources used by WP WooCommerce Mailchimp
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7743.19 ▼0.19
Dashboard /wp-admin4.13 ▲0.8356.06 ▲0.74
Posts /wp-admin/edit.php4.18 ▲0.8257.37 ▼0.30
Add New Post /wp-admin/post-new.php6.67 ▲0.7890.26 ▼27.01
Media Library /wp-admin/upload.php3.99 ▲0.7643.53 ▲7.93
Scheduled Actions /wp-admin/tools.php?page=action-scheduler4.1540.21

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 90 new files
Database: no new tables, 19 new options
New WordPress options
widget_recent-posts
ss_wc_mailchimp_double_opt_in
ss_wc_mailchimp_opt_in_label
ss_wc_mailchimp_version
ss_wc_mailchimp_list
ss_wc_mailchimp_display_opt_in
widget_theysaidso_widget
ss_wc_mailchimp_interest_groups
ss_wc_mailchimp_opt_in_checkbox_default_status
ss_wc_mailchimp_tags
...

Browser metrics Passed 4 tests

WP WooCommerce Mailchimp: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6714.22 ▼0.071.89 ▼0.0943.90 ▼5.38
Dashboard /wp-admin2,209 ▲325.66 ▼0.0384.94 ▼6.4442.28 ▼2.20
Posts /wp-admin/edit.php2,117 ▲172.00 ▼0.0039.41 ▲3.3338.59 ▲0.58
Add New Post /wp-admin/post-new.php1,539 ▲1123.69 ▲0.56627.69 ▼46.5160.39 ▲4.76
Media Library /wp-admin/upload.php1,414 ▲144.29 ▲0.1696.50 ▼27.2645.32 ▼6.81
Scheduled Actions /wp-admin/tools.php?page=action-scheduler9952.0627.3331.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 19 options
    • ss_wc_mailchimp_double_opt_in
    • widget_recent-comments
    • ss_wc_mailchimp_opt_in_label
    • ss_wc_mailchimp_tags
    • ss_wc_mailchimp_interest_groups
    • ss_wc_mailchimp_opt_in_checkbox_display_location
    • ss_wc_mailchimp_display_opt_in
    • widget_recent-posts
    • ss_wc_mailchimp_debug
    • can_compress_scripts
    • ...

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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 32× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Action' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_NullAction.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/lib/cron-expression/CronExpression_DayOfWeekField.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Logger' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_wpCommentLogger.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_WPCLI_QueueRunner.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Schedule' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_NullSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_AdminView_Deprecated' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_AdminView.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CronExpression_AbstractField' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/lib/cron-expression/CronExpression_MonthField.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'ActionScheduler_Schedule' not found in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_CronSchedule.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_Abstract_ListTable.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-mailchimp/includes/lib/action-scheduler/classes/ActionScheduler_Abstract_ListTable.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: mailchimp, ecommerce, email, woocommerce

woocommerce-mailchimp/woocommerce-mailchimp.php 85% from 13 tests

The primary PHP file in "WP WooCommerce Mailchimp" version 2.4.12 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: Use only dashes and lowercase characters for the domain path ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

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
Success! There were no dangerous files found in this plugin5,947 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP701,8093,5385,251
JavaScript17123350
PO File15566152
SVG101140
CSS17041
XML22013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity12.21
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces3
Traits0
Classes60
▷ Abstract classes915.00%
▷ Concrete classes5185.00%
▷ Final classes917.65%
Methods503
▷ Static methods5811.53%
▷ Public methods38576.54%
▷ Protected methods9318.49%
▷ Private methods254.97%
Functions22
▷ Named functions1881.82%
▷ Anonymous functions418.18%
Constants33
▷ Global constants1030.30%
▷ Class constants2369.70%
▷ Public constants23100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.52MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png8.86KB4.57KB▼ 48.42%
assets/icon-500x500.png35.29KB15.56KB▼ 55.92%
assets/icon-256x256.png17.98KB8.53KB▼ 52.58%
assets/screenshot-2.png127.91KB44.09KB▼ 65.53%
assets/screenshot-1.png144.82KB52.06KB▼ 64.05%