10% moosend

Code Review | Moosend Subscription Forms for Wordpress

WordPress plugin Moosend Subscription Forms for Wordpress scored 10% from 54 tests.

About plugin

  • Plugin page: moosend
  • Plugin version: 1.0.117
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6.1
  • WordPress version: 5.8.1
  • First release: Jul 3, 2017
  • Latest release: Feb 16, 2021
  • Number of updates: 119
  • Update frequency: every 11.4 days
  • Top authors: moosend (98.32%)Otto42 (2.52%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 17,401 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/moosend/src/includes/class-moosend-for-wp.php+78
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.83MB] [CPU: ▼188.07ms] Passed 4 tests

Server-side resources used by Moosend Subscription Forms for Wordpress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼0.925.89 ▼11.78
Dashboard /wp-admin1.82 ▼1.247.15 ▼33.86
Posts /wp-admin/edit.php1.82 ▼1.297.13 ▼41.47
Add New Post /wp-admin/post-new.php1.82 ▼3.616.06 ▼651.34
Media Library /wp-admin/upload.php1.82 ▼1.186.28 ▼25.59

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 90 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Moosend Subscription Forms for Wordpress: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,846 ▲26416.40 ▲0.9013.46 ▲3.8649.54 ▲0.22
Dashboard /wp-admin2,979 ▲485.94 ▼0.04137.02 ▼5.20133.04 ▲23.69
Posts /wp-admin/edit.php2,759 ▲202.59 ▼0.1363.06 ▼4.9890.17 ▼1.80
Add New Post /wp-admin/post-new.php1,689 ▲19118.85 ▲0.06364.64 ▼3.64110.16 ▲1.43
Media Library /wp-admin/upload.php1,767 ▼404.99 ▼0.06132.21 ▼5.61147.88 ▲27.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/moosend/src/includes/class-moosend-for-wp.php+78
    Trying to access array offset on value of type bool

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/moosend/src/public/partials/moosend-for-wp-public-display.php
    • > /wp-content/plugins/moosend/src/admin/partials/fields/tabs/field-settings-tab.php
    • > /wp-content/plugins/moosend/src/admin/partials/moosend-for-wp-admin-add.php
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_userdata() in wp-content/plugins/moosend/src/admin/partials/fields/general_config/ms4wp-sing-up-form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/popup_config/exit-intent-field.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/form_config/form-type-field.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/general_config/api-key-field.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/form_config/after-subscription-field.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/moosend/src/admin/partials/fields/general_config/ms4wp-add-form-redirect.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/popup_config/popup-frequency-field.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/custom_fields/custom-fields-menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/popup_config/popup-delay-field.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/moosend/src/admin/partials/fields/form_config/mailing-lists-dropdown.php:3

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% 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
These attributes need your attention:
  • Screenshots: These screenshots need descriptions #1, #10, #2, #3, #4, #5, #6, #7, #8, #9 in moosend/assets to your readme.txt
The official readme.txt might help

moosend/moosend-for-wp.php 77% from 13 tests

The primary PHP file in "Moosend Subscription Forms for Wordpress" version 1.0.117 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("moosend.php" instead of "moosend-for-wp.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
Success! There were no dangerous files found in this plugin5,385 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP395691,0522,401
CSS14253771,854
JavaScript12180881,074
Markdown128053
LESS1103

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.90
▷ Minimum class complexity1.00
▷ Maximum class complexity124.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods128
▷ Static methods21.56%
▷ Public methods10178.91%
▷ Protected methods2116.41%
▷ Private methods64.69%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/admin/img/moo_icon32.png2.34KB1.59KB▼ 31.81%
src/admin/dependencies/jquery-ui-dialog/jquery-ui-icons/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
src/admin/dependencies/jquery-ui-dialog/jquery-ui-icons/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
src/admin/dependencies/jquery-ui-dialog/jquery-ui-icons/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
src/admin/img/moo_icon16.png1.42KB0.90KB▼ 36.79%