73% newsletter-subscriptions

Code Review | Newsletter Subscriptions

WordPress plugin Newsletter Subscriptions scored 73% from 54 tests.

About plugin

  • Plugin page: newsletter-subscr...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0+
  • WordPress version: 5.8.1
  • First release: Mar 20, 2019
  • Latest release: Aug 21, 2019
  • Number of updates: 9
  • Update frequency: every 43.1 days
  • Top authors: hanif khan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 438 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼139.26ms] Passed 4 tests

This is a short check of server-side resources used by Newsletter Subscriptions
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.1834.87 ▲12.02
Dashboard /wp-admin3.20 ▲0.1447.59 ▲0.11
Posts /wp-admin/edit.php3.27 ▲0.1648.08 ▲9.59
Add New Post /wp-admin/post-new.php5.49 ▲0.0589.26 ▼564.11
Media Library /wp-admin/upload.php3.08 ▲0.0732.58 ▼2.63
Subscriptions Setting /wp-admin/admin.php?page=newsletter-subscriptions-setting3.0527.73
My Subscriptions /wp-admin/admin.php?page=newsletter-subscriptions3.0833.35

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: 1 new table, 1 new option
New tables
tbl_news_letter
New WordPress options
widget_newsletter_wpb_widget

Browser metrics Passed 4 tests

Newsletter Subscriptions: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,024 ▲42817.96 ▲2.2913.48 ▲3.1248.16 ▼5.04
Dashboard /wp-admin3,201 ▲2708.06 ▲1.91156.30 ▼2.13147.45 ▲26.06
Posts /wp-admin/edit.php3,008 ▲2694.08 ▲1.3782.09 ▲19.29119.97 ▲27.47
Add New Post /wp-admin/post-new.php1,538 ▼33420.64 ▲1.45354.66 ▼16.71129.16 ▲21.02
Media Library /wp-admin/upload.php1,800 ▼75.04 ▲0.02116.55 ▼30.80150.82 ▲30.43
Subscriptions Setting /wp-admin/admin.php?page=newsletter-subscriptions-setting1,4313.7569.18102.05
My Subscriptions /wp-admin/admin.php?page=newsletter-subscriptions1,4103.6966.8690.13

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • tbl_news_letter
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_newsletter_wpb_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=newsletter-subscriptions
    • > Notice in wp-content/plugins/newsletter-subscriptions/newsletter_subcriptions.php+328
    Trying to access array offset on value of type null

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Newsletter Subscriptions Setting.), #2 (Newsletter Subscriptions users list.)
You can take inspiration from this readme.txt

newsletter-subscriptions/newsletter_subcriptions.php 77% from 13 tests

The entry point to "Newsletter Subscriptions" version 2.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/lang/")
  • Main file name: The principal plugin file should be the same as the plugin slug ("newsletter-subscriptions.php" instead of "newsletter_subcriptions.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin500 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP211545413
JavaScript2472087

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.00
▷ Minimum class complexity4.00
▷ Maximum class complexity14.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions1184.62%
▷ Anonymous functions215.38%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png36.83KB14.64KB▼ 60.26%
images/news_subscription.png0.88KB1.06KB0.00%
images/news_subscription-1.png0.98KB0.56KB▼ 42.43%
screenshot-1.png27.15KB14.97KB▼ 44.84%