10% newsletter-composer

Code Review | Newsletter Composer

WordPress plugin Newsletter Composer scored10%from 54 tests.

About plugin

  • Plugin page: newsletter-composer
  • Plugin version: 1.01
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.7.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2013
  • Latest release: Nov 14, 2013
  • Number of updates: 4
  • Update frequency: every 2.3 days
  • Top authors: ralerin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,066 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/newsletter-composer/plugin.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; Newsletter has a deprecated constructor

Server metrics [RAM: ▼1.85MB] [CPU: ▼55.96ms] Passed 4 tests

A check of server-side resources used by Newsletter Composer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.339.17 ▼30.43
Dashboard /wp-admin2.16 ▼1.155.64 ▼43.35
Posts /wp-admin/edit.php2.16 ▼1.207.49 ▼43.64
Add New Post /wp-admin/post-new.php2.16 ▼3.737.29 ▼106.40
Media Library /wp-admin/upload.php2.16 ▼1.076.02 ▼29.92
Newsletter /wp-admin/admin.php?page=newsletter-composer/emails.php2.166.39
New /wp-admin/admin.php?page=newsletter-composer/emails-edit.php2.167.35

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 47 new files
Database: 1 new table, 7 new options
New tables
wp_newsletter_composer
New WordPress options
newsletter_main
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Newsletter Composer: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.05 ▼0.242.14 ▲0.4348.13 ▲8.83
Dashboard /wp-admin2,222 ▲425.63 ▼0.0495.23 ▲8.4842.56 ▲6.29
Posts /wp-admin/edit.php2,124 ▲242.12 ▲0.1135.64 ▼3.1132.32 ▼4.08
Add New Post /wp-admin/post-new.php1,548 ▲2223.67 ▲0.39623.82 ▼49.3352.94 ▲0.79
Media Library /wp-admin/upload.php1,427 ▲334.25 ▲0.0499.15 ▼2.5251.29 ▲6.28
Newsletter /wp-admin/admin.php?page=newsletter-composer/emails.php8302.0524.8848.00
New /wp-admin/admin.php?page=newsletter-composer/emails-edit.php1,3283.8766.3748.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/newsletter-composer/plugin.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; Newsletter has a deprecated constructor
  • Zombie tables were found after uninstall: 1 table
    • wp_newsletter_composer
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • newsletter_main
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Deprecated in wp-content/plugins/newsletter-composer/plugin.php+16
    Methods with the same name as their class will not be constructors in a future version of PHP; Newsletter has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/plugin.php+177
    Undefined index: na
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/commons.php+10
    Undefined index: act
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Deprecated in wp-content/plugins/newsletter-composer/commons.php+19
    Methods with the same name as their class will not be constructors in a future version of PHP; NewsletterControls has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/commons.php+47
    Undefined index: options
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+27
    Undefined variable: subject
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+155
    Undefined variable: tinymce_language
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+448
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+188
    Undefined variable: themes
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+189
    Undefined variable: themes_panel
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/commons.php+72
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Warning in wp-content/plugins/newsletter-composer/commons.php+73
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Warning in wp-content/plugins/newsletter-composer/emails-edit.php+314
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+418
    Undefined index: example_subject
    • > GET request to /wp-admin/admin.php?page=newsletter-composer/emails-edit.php
    • > Notice in wp-content/plugins/newsletter-composer/emails-edit.php+438
    Undefined index: editor

SRP 50% 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 fix the following items
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to a member function set_limits() on null in wp-content/plugins/newsletter-composer/commons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/newsletter-composer/plugin-menu.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/newsletter-composer/plugin-head.inc.php:1
    • > PHP Fatal error
      Uncaught Error: Call to a member function set_limits() on null in wp-content/plugins/newsletter-composer/commons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/newsletter-composer/plugin.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/newsletter-composer/emails.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/newsletter-composer/themes/classic-newsletter/theme.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/newsletter-composer/themes/table-newsletter/theme.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Query' not found in wp-content/plugins/newsletter-composer/themes/sidebar-newsletter/theme.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_path() in wp-content/plugins/newsletter-composer/plugin-activate.inc.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
6 plugin tags: newsletter maker, bulletin, newsletter, composer, html generator...

newsletter-composer/plugin.php 92% from 13 tests

The principal PHP file in "Newsletter Composer" v. 1.01 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("newsletter-composer.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
There were no executable files found in this plugin2,428 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP123251241,644
SVG200328
CSS85642271
JavaScript401185

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity30.00
▷ Minimum class complexity26.00
▷ Maximum class complexity34.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods44100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/table-newsletter/_img/facebook.png5.17KB1.89KB▼ 63.56%
themes/table-newsletter/_img/twitter.png5.30KB1.82KB▼ 65.57%
themes/table-newsletter/_img/logo_example.png1.18KB0.60KB▼ 49.21%
themes/classic-newsletter/_img/logo_example.png1.18KB0.60KB▼ 49.21%
themes/sidebar-newsletter/_img/logo_example.png1.18KB0.60KB▼ 49.21%