84% n-letters-send-newsletters-to-your-websites-users

Code Review | N-letters. Send newsletters to your website's users

WordPress plugin N-letters. Send newsletters to your website's users scored84%from 54 tests.

About plugin

  • Plugin page: n-letters-send-ne...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Aug 28, 2023
  • Number of updates: 4
  • Update frequency: every 306.0 days
  • Top authors: markomaksym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /448 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.11ms] Passed 4 tests

Server-side resources used by N-letters. Send newsletters to your website's users
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0534.33 ▼3.88
Dashboard /wp-admin3.35 ▲0.0463.52 ▲15.38
Posts /wp-admin/edit.php3.46 ▲0.1148.38 ▲2.37
Add New Post /wp-admin/post-new.php5.95 ▲0.0792.50 ▼2.76
Media Library /wp-admin/upload.php3.27 ▲0.0434.23 ▼0.15
Newsletter /wp-admin/edit.php?post_type=mxsms_subscriptions3.3237.38
Create letter /wp-admin/post-new.php?post_type=mxsms_subscriptions3.3849.59
Subsc. Settings /wp-admin/options-general.php?page=mxsms_subsc_settings3.2831.45

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for N-letters. Send newsletters to your website's users
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,949 ▲17813.99 ▼0.389.01 ▲7.0840.02 ▼2.68
Dashboard /wp-admin2,243 ▲525.88 ▼0.0596.34 ▼4.8637.08 ▼5.44
Posts /wp-admin/edit.php2,126 ▲372.02 ▼0.0340.50 ▲3.4940.69 ▲7.60
Add New Post /wp-admin/post-new.php1,546 ▲2423.20 ▼0.12596.64 ▼36.9150.28 ▼7.57
Media Library /wp-admin/upload.php1,425 ▲374.23 ▲0.0599.33 ▲1.8842.36 ▲1.47
Newsletter /wp-admin/edit.php?post_type=mxsms_subscriptions1,0901.9933.2127.40
Create letter /wp-admin/post-new.php?post_type=mxsms_subscriptions2,2557.57176.7364.20
Subsc. Settings /wp-admin/options-general.php?page=mxsms_subsc_settings8602.3123.0727.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/n-letters-send-newsletters-to-your-websites-users/includes/admin/views/hidemenu-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/n-letters-send-newsletters-to-your-websites-users/includes/admin/views/sub-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/n-letters-send-newsletters-to-your-websites-users/includes/admin/views/main-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/n-letters-send-newsletters-to-your-websites-users/includes/admin/views/settings-page.php:3

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

readme.txt Passed 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
2 plugin tags: newsletter, email

n-letters-send-newsletters-to-your-websites-users/n-letters-send-newsletters.php 92% from 13 tests

"N-letters. Send newsletters to your website's users" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("n-letters-send-newsletters-to-your-websites-users.php" instead of "n-letters-send-newsletters.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 plugin3,866 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
CSS40152,227
PHP29620394872
SVG100685
JavaScript244249
PO File18833

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity2.90
▷ Minimum class complexity1.00
▷ Maximum class complexity10.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes21
▷ Abstract classes14.76%
▷ Concrete classes2095.24%
▷ Final classes15.00%
Methods64
▷ Static methods2539.06%
▷ Public methods64100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/icon-n.png5.81KB2.94KB▼ 49.38%