78% woo-mailerlite

Code Review | MailerLite - WooCommerce integration

WordPress plugin MailerLite - WooCommerce integration scored78%from 54 tests.

About plugin

  • Plugin page: woo-mailerlite
  • Plugin version: 2.0.4
  • PHP compatiblity: 7.2.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3.2
  • WordPress version: 6.3.1
  • First release: May 11, 2017
  • Latest release: Nov 28, 2023
  • Number of updates: 161
  • Update frequency: every 14.9 days
  • Top authors: mailerlite (95.65%)flowdee (4.97%)

Code review

54 tests

User reviews

53 reviews

Install metrics

20,000+ active /536,970 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.57MB] [CPU: ▼3.16ms] Passed 4 tests

A check of server-side resources used by MailerLite - WooCommerce integration
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6144.45 ▲2.19
Dashboard /wp-admin3.90 ▲0.6050.44 ▼9.65
Posts /wp-admin/edit.php3.96 ▲0.6053.62 ▲7.49
Add New Post /wp-admin/post-new.php6.43 ▲0.5485.92 ▼10.03
Media Library /wp-admin/upload.php3.77 ▲0.5339.70 ▲4.86

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 60 new files
Database: 1 new table, 6 new options
New tables
wp_mailerlite_checkouts
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by MailerLite - WooCommerce integration
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲1814.37 ▲0.131.71 ▼0.4642.48 ▼5.84
Dashboard /wp-admin2,198 ▲245.61 ▲0.1089.26 ▼17.5637.54 ▼8.64
Posts /wp-admin/edit.php2,097 ▼01.95 ▼0.0339.29 ▼1.1034.43 ▼2.88
Add New Post /wp-admin/post-new.php1,526 ▼021.10 ▼2.21701.51 ▲42.3258.36 ▲6.46
Media Library /wp-admin/upload.php1,397 ▼34.20 ▲0.0697.54 ▲3.3240.92 ▲1.08

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% 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)
Even though no errors were found, this is by no means an exhaustive test

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
Please take a closer look at the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-mailerlite/includes/views/components/woo-mailerlite-modals.php
    • > /wp-content/plugins/woo-mailerlite/includes/views/components/wizard-breadcrumb-component.php
  • 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'MailerLite\\Includes\\Classes\\Singleton' not found in wp-content/plugins/woo-mailerlite/includes/classes/process/CheckoutProcess.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'MailerLite\\Includes\\Classes\\Singleton' not found in wp-content/plugins/woo-mailerlite/includes/classes/settings/ShopSettings.php:11
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-mailerlite/includes/views/app.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'MailerLite\\Includes\\Classes\\Settings\\MailerLiteSettings' not found in wp-content/plugins/woo-mailerlite/includes/hooks.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'MailerLite\\Includes\\Classes\\Singleton' not found in wp-content/plugins/woo-mailerlite/includes/classes/process/OrderProcess.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'MailerLite\\Includes\\Classes\\Singleton' not found in wp-content/plugins/woo-mailerlite/includes/classes/settings/SynchronizeSettings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woo-mailerlite/includes/functions.php:143
    • > PHP Notice
      Undefined variable: currentStep in wp-content/plugins/woo-mailerlite/includes/views/components/wizard-breadcrumb-component.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-mailerlite/includes/admin/hooks.php:103
    • > PHP Notice
      Undefined variable: currentStep in wp-content/plugins/woo-mailerlite/includes/views/components/wizard-breadcrumb-component.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Donate link: Please fix this invalid url: "Donate link: https://www.mailerlite.com/"
The official readme.txt is a good inspiration

woo-mailerlite/woo-mailerlite.php 85% from 13 tests

The principal PHP file in "MailerLite - WooCommerce integration" v. 2.0.4 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 238 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "3.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected9,346 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP362,2163,6096,789
JavaScript92721611,391
CSS4629992
LESS2191489
JSON20048
Markdown19022
SVG20115

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity22.95
▷ Minimum class complexity1.00
▷ Maximum class complexity83.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes22
▷ Abstract classes29.09%
▷ Concrete classes2090.91%
▷ Final classes00.00%
Methods403
▷ Static methods20.50%
▷ Public methods38896.28%
▷ Protected methods20.50%
▷ Private methods133.23%
Functions88
▷ Named functions7989.77%
▷ Anonymous functions910.23%
Constants10
▷ Global constants770.00%
▷ Class constants330.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin