62% newsletter

Code Review | Newsletter - Send awesome emails from WordPress

WordPress plugin Newsletter - Send awesome emails from WordPress scored62%from 54 tests.

About plugin

  • Plugin page: newsletter
  • Plugin version: 8.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 23, 2009
  • Latest release: Nov 14, 2023
  • Number of updates: 800
  • Update frequency: every 6.6 days
  • Top authors: satollo (88.38%)webagile (11.75%)

Code review

54 tests

User reviews

1122 reviews

Install metrics

300,000+ active /22,610,447 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.51MB] [CPU: ▼2.57ms] Passed 4 tests

A check of server-side resources used by Newsletter - Send awesome emails from WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3241.85 ▼0.69
Dashboard /wp-admin3.90 ▲0.5556.04 ▼2.78
Posts /wp-admin/edit.php3.93 ▲0.5751.25 ▲7.97
Add New Post /wp-admin/post-new.php6.48 ▲0.5996.86 ▼10.70
Media Library /wp-admin/upload.php3.85 ▲0.6237.48 ▲3.89
Presets /wp-admin/admin.php?page=newsletter_emails_presets-edit3.8535.02
Presets /wp-admin/admin.php?page=newsletter_emails_presets3.90190.90
Newsletters /wp-admin/admin.php?page=newsletter_emails_index3.8741.91
Email List /wp-admin/admin.php?page=newsletter_emails_list3.8643.06
Subscribers /wp-admin/admin.php?page=newsletter_users_index3.9344.12
Forms /wp-admin/admin.php?page=newsletter_subscription_forms3.8643.17
Status /wp-admin/admin.php?page=newsletter_system_status4.18227.70
Statistics /wp-admin/admin.php?page=newsletter_statistics_view3.8638.78
Statistics /wp-admin/admin.php?page=newsletter_users_statistics3.9249.23
Export /wp-admin/admin.php?page=newsletter_users_export3.8643.69

Server storage [IO: ▲9.18MB] [DB: ▲0.12MB] 67% from 3 tests

Input-output and database impact of this plugin
Just a few items left to fix
  • There were 2 files (1.06KB) illegally modified outside of "wp-content/plugins/newsletter/" and "wp-content/uploads/"
    • (new file) wp-content/logs/newsletter/index.html
    • (new file) wp-content/logs/newsletter/upgrade-2023-11-3ff5d190.txt
Filesystem: 598 new files
Database: 6 new tables, 14 new options
New tables
wp_newsletter
wp_newsletter_user_logs
wp_newsletter_user_meta
wp_newsletter_stats
wp_newsletter_emails
wp_newsletter_sent
New WordPress options
recovery_mode_email_last_sent
newsletter_version
newsletter_statistics
widget_newsletterwidgetminimal
newsletter_news_updated
db_upgraded
widget_recent-posts
newsletter_logger_secret
widget_recent-comments
widget_newsletterwidget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Newsletter - Send awesome emails from WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲9614.27 ▼0.071.87 ▲0.0035.80 ▼8.63
Dashboard /wp-admin2,231 ▲565.55 ▼0.0493.67 ▼23.4484.99 ▲41.55
Posts /wp-admin/edit.php2,148 ▲481.97 ▼0.0634.03 ▼2.9937.09 ▲2.20
Add New Post /wp-admin/post-new.php6,404 ▲4,87827.61 ▲4.53889.37 ▲244.5538.41 ▼11.58
Media Library /wp-admin/upload.php1,451 ▲514.21 ▲0.01103.71 ▲4.7481.20 ▲39.61
Presets /wp-admin/admin.php?page=newsletter_emails_presets-edit1,0283.6860.9028.17
Presets /wp-admin/admin.php?page=newsletter_emails_presets1,3853.7553.53112.36
Newsletters /wp-admin/admin.php?page=newsletter_emails_index1,4303.7943.8941.39
Email List /wp-admin/admin.php?page=newsletter_emails_list7691.8817.9132.25
Subscribers /wp-admin/admin.php?page=newsletter_users_index1,5223.6948.4148.68
Forms /wp-admin/admin.php?page=newsletter_subscription_forms1,6063.4850.07100.24
Status /wp-admin/admin.php?page=newsletter_system_status2,3314.1249.54100.49
Statistics /wp-admin/admin.php?page=newsletter_statistics_view1,4754.1547.90103.41
Statistics /wp-admin/admin.php?page=newsletter_users_statistics1,8787.75151.17103.83
Export /wp-admin/admin.php?page=newsletter_users_export1,4143.7045.2487.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 6 tables
    • wp_newsletter_emails
    • wp_newsletter_stats
    • wp_newsletter
    • wp_newsletter_sent
    • wp_newsletter_user_meta
    • wp_newsletter_user_logs
  • This plugin does not fully uninstall, leaving 14 options in the database
    • widget_recent-posts
    • newsletter_statistics
    • newsletter_logger_secret
    • newsletter_news
    • widget_newsletterwidget
    • can_compress_scripts
    • theysaidso_admin_options
    • newsletter_news_updated
    • widget_newsletterwidgetminimal
    • widget_recent-comments
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter_statistics_view
    • > Notice in wp-content/plugins/newsletter/statistics/view.php+9
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=newsletter_emails_list
    • > Warning in wp-content/plugins/newsletter/includes/module-admin.php+178
    require(wp-content/plugins/newsletter/emails/list.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=newsletter_emails_list
    • > Compile error in wp-content/plugins/newsletter/includes/module-admin.php+178
    require(): Failed opening required 'wp-content/plugins/newsletter/emails/list.php' (include_path='.:/usr/share/php')
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter_statistics_view
    • > Notice in wp-content/plugins/newsletter/statistics/nav.php+12
    Trying to get property 'id' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter_statistics_view
    • > Notice in wp-content/plugins/newsletter/statistics/view.php+14
    Trying to get property 'status' of non-object
    • > GET request to /wp-admin/admin.php?page=newsletter_statistics_view
    • > Notice in wp-content/plugins/newsletter/statistics/view.php+27
    Trying to get property 'subject' of non-object

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
The following issues need your attention
  • 10× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/newsletter/emails/blocks/html/block.php
    • > /wp-content/plugins/newsletter/emails/blocks/header/block.php
    • > /wp-content/plugins/newsletter/emails/themes/default/social_main.php
    • > /wp-content/plugins/newsletter/emails/blocks/giphy/block.php
    • > /wp-content/plugins/newsletter/emails/themes/default/social.php
    • > /wp-content/plugins/newsletter/emails/blocks/preheader/block.php
    • > /wp-content/plugins/newsletter/emails/blocks/header/layout-logo.php
    • > /wp-content/plugins/newsletter/emails/blocks/separator/block.php
    • > /wp-content/plugins/newsletter/users/statistics-countries.php
    • > /wp-content/plugins/newsletter/subscription/nav.php
  • 196× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TNP_Composer' not found in wp-content/plugins/newsletter/emails/blocks/header/layout-titlemotto.php:2
    • > PHP Notice
      Undefined index: page in wp-content/plugins/newsletter/subscription/nav.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/newsletter/emails/blocks/giphy/block.php on line 35
    • > PHP Notice
      Undefined variable: fields in wp-content/plugins/newsletter/emails/blocks/posts/options.php on line 55
    • > PHP Notice
      Undefined variable: fields in wp-content/plugins/newsletter/emails/blocks/separator/options.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'TNP_Composer' not found in wp-content/plugins/newsletter/emails/blocks/posts/layout-two.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'TNP_Composer' not found in wp-content/plugins/newsletter/emails/blocks/posts/layout-one.php:6
    • > PHP Notice
      Undefined variable: controls in wp-content/plugins/newsletter/emails/blocks/cta/options.php on line 22
    • > PHP Notice
      Undefined variable: user in wp-content/plugins/newsletter/users/edit-nav.php on line 5
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/newsletter/emails/blocks/social/block.php on line 20

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

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

newsletter/plugin.php 85% from 13 tests

"Newsletter - Send awesome emails from WordPress" version 8.0.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 255 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("newsletter.php" instead of "plugin.php")

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
No dangerous file extensions were detected106,887 lines of code in 402 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1733,5291,96275,550
PHP1645,3193,39923,801
CSS348904464,696
JSON13101,551
HTML14174231,072
SVG200195
Markdown28022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity37.09
▷ Minimum class complexity1.00
▷ Maximum class complexity302.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes58
▷ Abstract classes00.00%
▷ Concrete classes58100.00%
▷ Final classes00.00%
Methods862
▷ Static methods13715.89%
▷ Public methods83897.22%
▷ Protected methods30.35%
▷ Private methods212.44%
Functions50
▷ Named functions3774.00%
▷ Anonymous functions1326.00%
Constants64
▷ Global constants2031.25%
▷ Class constants4468.75%
▷ Public constants44100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
125 PNG files occupy 1.67MB with 0.66MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/social-1/youtube.png0.71KB0.43KB▼ 39.09%
images/social-2/vk.png1.21KB1.63KB0.00%
emails/blocks/separator/icon.png4.87KB2.19KB▼ 55.09%
emails/presets/black-friday-2/icon.png68.92KB30.76KB▼ 55.37%
emails/images/automated.png1.99KB1.02KB▼ 48.58%