77% mailup-email-and-newsletter-subscription-form

Code Review | MailUp for Wordpress - Email and Newsletter Subscription Form

WordPress plugin MailUp for Wordpress - Email and Newsletter Subscription Form scored 77% from 54 tests.

About plugin

  • Plugin page: mailup-email-and-...
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7.2-5.8.2
  • WordPress version: 5.9.2
  • First release: Aug 10, 2021
  • Latest release: Dec 20, 2021
  • Number of updates: 19
  • Update frequency: every 7.0 days
  • Top authors: mailup (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active / 1,969 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼324.51ms] Passed 4 tests

An overview of server-side resources used by MailUp for Wordpress - Email and Newsletter Subscription Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.7152.05 ▼119.25
Dashboard /wp-admin3.68 ▲0.2735.29 ▲0.74
Posts /wp-admin/edit.php3.91 ▲0.2639.05 ▼2.99
Add New Post /wp-admin/post-new.php7.21 ▲0.2497.35 ▼1,176.54
Media Library /wp-admin/upload.php3.63 ▲0.3326.24 ▲3.18
MailUP Login Page /wp-admin/admin.php?page=mailup-login-platform3.5124.42

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 184 new files
Database: no new tables, 2 new options
New WordPress options
mailup_version
widget_mailup-widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for MailUp for Wordpress - Email and Newsletter Subscription Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,907 ▲16516.08 ▲0.309.98 ▲2.682.27 ▲0.04
Dashboard /wp-admin2,900 ▲396.05 ▼0.14117.67 ▼19.31157.69 ▼18.77
Posts /wp-admin/edit.php2,710 ▲253.24 ▲0.0062.58 ▼4.25137.57 ▼14.66
Add New Post /wp-admin/post-new.php1,767 ▲10621.09 ▲5.05456.93 ▲25.55159.27 ▲4.28
Media Library /wp-admin/upload.php1,720 ▲225.54 ▲0.07139.52 ▲1.90190.25 ▲1.54
MailUP Login Page /wp-admin/admin.php?page=mailup-login-platform9732.5452.7771.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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_mailup-widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=mailup-login-platform
    • > Warning in wp-includes/class-wp-hook.php+307
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Mailup_Admin' does not have a method 'login_platform_contents'

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 11× 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 _e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-advanced-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-fields.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-fields.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-terms.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/public/partials/mailup-public-display.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-form.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-login-platform.php:21
    • > PHP Notice
      Undefined variable: api_list in wp-content/plugins/mailup-email-and-newsletter-subscription-form/admin/partials/mailup-admin-form.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/mailup-email-and-newsletter-subscription-form/widgets/class-mailup-widget.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 35 tag instead of maximum 10
You can look at the official readme.txt

mailup-email-and-newsletter-subscription-form/mailup.php 77% from 13 tests

"MailUp for Wordpress - Email and Newsletter Subscription Form" version 1.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("mailup-email-and-newsletter-subscription-form.php" instead of "mailup.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 302 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin5,519 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1271134862,439
PHP294027082,041
PO File3234321576
CSS210640462
SVG1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.29
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods120
▷ Static methods1915.83%
▷ Public methods8772.50%
▷ Protected methods2117.50%
▷ Private methods1210.00%
Functions13
▷ Named functions323.08%
▷ Anonymous functions1076.92%
Constants19
▷ Global constants526.32%
▷ Class constants1473.68%
▷ Public constants14100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.59MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png106.96KB39.07KB▼ 63.47%
assets/screenshot-3.png99.29KB35.42KB▼ 64.33%
assets/screenshot-4.png121.34KB45.69KB▼ 62.35%
assets/screenshot-2.png107.48KB45.67KB▼ 57.51%
admin/images/logo_vector.png5.53KB4.09KB▼ 26.02%