72% dotmailer-sign-up-widget

Code Review | Dotdigital for WordPress

WordPress plugin Dotdigital for WordPress scored72%from 54 tests.

About plugin

  • Plugin page: dotmailer-sign-up...
  • Plugin version: 7.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 16, 2010
  • Latest release: Nov 28, 2023
  • Number of updates: 154
  • Update frequency: every 31.9 days
  • Top authors: dotMailer (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active /12,704 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: ▲2.21MB] [CPU: ▲170.19ms] Passed 4 tests

Analyzing server-side resources used by Dotdigital for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.89 ▲1.4254.83 ▲13.59
Dashboard /wp-admin5.77 ▲2.47387.06 ▲339.36
Posts /wp-admin/edit.php5.83 ▲2.47258.78 ▲215.34
Add New Post /wp-admin/post-new.php8.39 ▲2.50308.65 ▲211.71
Media Library /wp-admin/upload.php5.71 ▲2.48276.12 ▲240.12
/wp-admin/admin.php?page=dm_form_settings5.65475.86

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 1,529 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_dotdigital-for-wordpress_widget_signup_form
dm_API_messages
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_dm_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Dotdigital for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15413.77 ▼0.609.84 ▲8.0948.03 ▲2.15
Dashboard /wp-admin2,235 ▲615.64 ▼0.0183.38 ▼10.1237.23 ▼8.12
Posts /wp-admin/edit.php2,142 ▲422.05 ▲0.0539.27 ▲1.1133.13 ▼1.96
Add New Post /wp-admin/post-new.php6,434 ▲4,89929.32 ▲4.36859.95 ▲251.0338.17 ▼28.54
Media Library /wp-admin/upload.php1,441 ▲444.22 ▲0.0494.88 ▼6.6941.37 ▼1.78
/wp-admin/admin.php?page=dm_form_settings8141.7923.8524.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_dotdigital-for-wordpress_widget_signup_form
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dm_form_settings
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/dotmailer-sign-up-widget/admin/view/partials/dotdigital-wordpress-admin-settings-tab-links.php
  • 402× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught LogicException: You cannot use "Http\\Message\\MessageFactory\\GuzzleStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead in wp-content/plugins/dotmailer-sign-up-widget/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotdigital_WordPress_Vendor\\Symfony\\Component\\Translation\\TranslatorBagInterface' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/symfony/translation/TranslatorBag.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dotdigital_WordPress_Vendor\\esc_attr() in wp-content/plugins/dotmailer-sign-up-widget/public/view/widget/dotdigital-wordpress-widget-sign-up.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotdigital_WordPress_Vendor\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/guzzlehttp/psr7/src/PumpStream.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Dotdigital_WordPress_Vendor\\esc_html() in wp-content/plugins/dotmailer-sign-up-widget/admin/view/form/dotdigital-wordpress-setting-form-radio-group.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotdigital_WordPress_Vendor\\Http\\Client\\HttpClient' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/php-http/client-common/src/HttpClientRouterInterface.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Dotdigital_WordPress_Vendor\\Http\\Message\\Encoding\\FilteredStream' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/php-http/message/src/Encoding/DechunkStream.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Dotdigital_WordPress_Vendor\\Symfony\\Component\\Translation\\Extractor\\AbstractFileExtractor' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/symfony/translation/Extractor/PhpExtractor.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotdigital_WordPress_Vendor\\PHPStan\\Reflection\\MethodsClassReflectionExtension' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotdigital_WordPress_Vendor\\Http\\Client\\Common\\HttpClientPool' not found in wp-content/plugins/dotmailer-sign-up-widget/vendor/php-http/client-common/src/HttpClientPool/HttpClientPool.php:16

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: newsletter signup, email marketing

dotmailer-sign-up-widget/dm_signup_form.php 85% from 13 tests

The principal PHP file in "Dotdigital for WordPress" v. 7.1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dotmailer-sign-up-widget.php" instead of "dm_signup_form.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin47,222 lines of code in 1,299 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,2562,66938,80540,516
JSON31003,669
XSD392482,803
JavaScript4101159
CSS5171075

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity9.81
▷ Minimum class complexity1.00
▷ Maximum class complexity351.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces104
Interfaces77
Traits44
Classes452
▷ Abstract classes235.09%
▷ Concrete classes42994.91%
▷ Final classes13932.40%
Methods3,400
▷ Static methods57116.79%
▷ Public methods2,87084.41%
▷ Protected methods1845.41%
▷ Private methods34610.18%
Functions582
▷ Named functions18832.30%
▷ Anonymous functions39467.70%
Constants225
▷ Global constants156.67%
▷ Class constants21093.33%
▷ Public constants18286.67%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/dotdigital-applogo-32x32.png4.25KB1.79KB▼ 57.78%
assets/large.png0.26KB0.10KB▼ 60.31%
assets/dotdigital-logo.png5.69KB3.38KB▼ 40.56%