73% newsletter-subscription-form

Code Review | Newsletter Subscription Form - User Subscriptions Form, Capture Email

WordPress plugin Newsletter Subscription Form - User Subscriptions Form, Capture Email scored73%from 54 tests.

About plugin

  • Plugin page: newsletter-subscr...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 30, 2016
  • Latest release: Oct 27, 2023
  • Number of updates: 74
  • Update frequency: every 35.3 days
  • Top authors: weblizar (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

2,000+ active /112,399 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼9.76ms] Passed 4 tests

This is a short check of server-side resources used by Newsletter Subscription Form - User Subscriptions Form, Capture Email
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1336.79 ▲0.77
Dashboard /wp-admin3.43 ▲0.0844.12 ▼13.98
Posts /wp-admin/edit.php3.54 ▲0.1845.53 ▲0.37
Add New Post /wp-admin/post-new.php6.01 ▲0.1279.36 ▼26.18
Media Library /wp-admin/upload.php3.35 ▲0.1236.42 ▲2.69

Server storage [IO: ▲4.79MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 73 new files
Database: 1 new table, 10 new options
New tables
wp_nls_subscribers
New WordPress options
weblizar_nls_madmimi_list
widget_theysaidso_widget
weblizar_nls_mailchimp_key
theysaidso_admin_options
db_upgraded
weblizar_nls_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_nls_form_widget

Browser metrics Passed 4 tests

A check of browser resources used by Newsletter Subscription Form - User Subscriptions Form, Capture Email
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲3414.11 ▼0.241.59 ▼0.1138.75 ▼0.77
Dashboard /wp-admin2,210 ▲335.63 ▼0.2184.67 ▼2.9938.37 ▼3.94
Posts /wp-admin/edit.php2,112 ▲121.96 ▼0.0633.81 ▼1.4135.57 ▲3.64
Add New Post /wp-admin/post-new.php1,536 ▲823.15 ▼0.09654.65 ▼20.7356.07 ▼1.98
Media Library /wp-admin/upload.php1,406 ▲34.18 ▼0.0993.84 ▼8.4743.82 ▼0.62

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_nls_subscribers
  • Zombie WordPress options detected upon uninstall: 10 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • weblizar_nls_madmimi_list
    • weblizar_nls_mailchimp_key
    • weblizar_nls_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_nls_form_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/newsletter-subscription-form/options/themes/form-include/confirmation-mail-from.php on line 3
    • > PHP Notice
      Undefined variable: wl_nls_options in wp-content/plugins/newsletter-subscription-form/options/themes/css/custom-css-2.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/newsletter-subscription-form/options/themes/css/custom-css-2.php:34
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/newsletter-subscription-form/options/themes/form-include/confirmation-mail-from.php:4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/newsletter-subscription-form/options/themes/css/custom-css-2.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/newsletter-subscription-form/options/themes/css/custom-css-1.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/newsletter-subscription-form/newsletter-subscription-form.php:21

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 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #10 (Subscriber General Settings), #11 (Newsletter Subscription Form two with color scheme)
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

newsletter-subscription-form/newsletter-subscription-form.php 85% from 13 tests

"Newsletter Subscription Form - User Subscriptions Form, Capture Email" version 1.5.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 174 characters long)
  • Domain Path: The domain path folder does not exist ("/options/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin42,369 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,6106015,890
JavaScript132,9287,42411,334
SVG30128,777
PHP175462,5535,135
PO File21,3832,5381,233

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.26
Average class complexity60.20
▷ Minimum class complexity11.00
▷ Maximum class complexity215.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods210
▷ Static methods104.76%
▷ Public methods16176.67%
▷ Protected methods00.00%
▷ Private methods4923.33%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.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
7 PNG files occupy 0.28MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
options/images/logo.png47.73KB14.85KB▼ 68.88%
(invalid) options/images/screen-shot3.png60.46KB0.00KB▼ 100.00%
options/images/screen-shot1.png42.08KB14.23KB▼ 66.18%
(invalid) options/images/screen-shot4.png42.10KB0.00KB▼ 100.00%
(invalid) options/images/screen-shot5.png33.93KB0.00KB▼ 100.00%