79% newsletter-sign-up

Code Review | Newsletter Sign-Up

WordPress plugin Newsletter Sign-Up scored 79% from 54 tests.

About plugin

  • Plugin page: newsletter-sign-up
  • Plugin version: 2.0.9
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-5.3
  • WordPress version: 5.9.2
  • First release: Mar 22, 2011
  • Latest release: Dec 5, 2019
  • Number of updates: 106
  • Update frequency: every 30.0 days
  • Top authors: DvanKooten (100%)

Code review

54 tests

User reviews

29 reviews

Install metrics

10,000+ active / 387,437 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼299.95ms] Passed 4 tests

This is a short check of server-side resources used by Newsletter Sign-Up
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2054.98 ▼0.53
Dashboard /wp-admin3.60 ▲0.2034.78 ▼5.48
Posts /wp-admin/edit.php3.83 ▲0.1937.90 ▲1.21
Add New Post /wp-admin/post-new.php7.09 ▲0.1096.39 ▼1,193.32
Media Library /wp-admin/upload.php3.48 ▲0.1924.52 ▼0.48
Form Settings /wp-admin/admin.php?page=newsletter-sign-up-form-settings3.4627.43
List Settings /wp-admin/admin.php?page=newsletter-sign-up3.4625.15
Config Extractor /wp-admin/admin.php?page=newsletter-sign-up-config-helper3.4522.76
Checkbox Settings /wp-admin/admin.php?page=newsletter-sign-up-checkbox-settings3.4523.80

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 100 new files
Database: no new tables, 4 new options
New WordPress options
nsu_mailinglist
nsu_form
widget_nsu_widget
nsu_checkbox

Browser metrics Passed 4 tests

This is an overview of browser requirements for Newsletter Sign-Up
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,806 ▲5216.18 ▲0.445.85 ▼0.102.02 ▼0.73
Dashboard /wp-admin2,936 ▲786.03 ▼0.12121.38 ▼14.12176.93 ▲14.36
Posts /wp-admin/edit.php2,729 ▲383.13 ▼0.1265.29 ▼0.54141.99 ▼1.58
Add New Post /wp-admin/post-new.php1,689 ▼6316.44 ▼5.51415.87 ▼44.47159.45 ▼0.53
Media Library /wp-admin/upload.php1,744 ▲465.52 ▼0.03127.17 ▼17.94207.57 ▲24.23
Form Settings /wp-admin/admin.php?page=newsletter-sign-up-form-settings1,3522.6255.98144.56
List Settings /wp-admin/admin.php?page=newsletter-sign-up1,4322.7054.79184.61
Config Extractor /wp-admin/admin.php?page=newsletter-sign-up-config-helper1,1962.6256.06126.00
Checkbox Settings /wp-admin/admin.php?page=newsletter-sign-up-checkbox-settings1,3332.6453.47156.98

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
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • nsu_checkbox
    • nsu_form
    • nsu_mailinglist
    • widget_nsu_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/newsletter-sign-up/includes/views/parts/sidebar.php
    • > /wp-content/plugins/newsletter-sign-up/trunk/includes/views/parts/sidebar.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/newsletter-sign-up/includes/class-nsu-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/newsletter-sign-up/trunk/includes/class-nsu-widget.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, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: sign-up, newsletter, aweber, newsletter widget, mailchimp...

newsletter-sign-up/newsletter-sign-up.php Passed 13 tests

"Newsletter Sign-Up" version 2.0.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
92 characters long description:
Adds various ways for your visitors to sign-up to your mailing list (checkbox, widget, form)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,101 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP294844151,997
XML17042
CSS37133
JavaScript15029

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity25.00
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods138
▷ Static methods128.70%
▷ Public methods13497.10%
▷ Protected methods00.00%
▷ Private methods42.90%
Functions10
▷ Named functions880.00%
▷ Anonymous functions220.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
16 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/assets/img/mailchimp-for-wp-icon.png3.81KB1.27KB▼ 66.61%
assets/img/mailchimp-for-wp-icon.png3.81KB1.27KB▼ 66.61%
trunk/assets/img/overlay.png0.12KB0.09KB▼ 20.66%
assets/img/email-icon.png0.49KB0.42KB▼ 14.65%
assets/img/overlay.png0.12KB0.09KB▼ 20.66%