68% simple-newsletter

Code Review | Simple newsletter

WordPress plugin Simple newsletter scored68%from 54 tests.

About plugin

  • Plugin page: simple-newsletter
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 20, 2018
  • Latest release: Jan 27, 2019
  • Number of updates: 5
  • Update frequency: every 833.8 days
  • Top authors: ebrahimzadeh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,448 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼10.65ms] Passed 4 tests

This is a short check of server-side resources used by Simple newsletter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.06 ▼5.62
Dashboard /wp-admin3.46 ▲0.1644.53 ▼13.99
Posts /wp-admin/edit.php3.56 ▲0.2044.68 ▼8.58
Add New Post /wp-admin/post-new.php6.17 ▲0.2880.86 ▼14.41
Media Library /wp-admin/upload.php3.40 ▲0.1733.75 ▼1.41
Email Newsletter /wp-admin/admin.php?page=wbnl3.3335.27
Setting /wp-admin/admin.php?page=Setting3.3238.48

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: 1 new table, 6 new options
New tables
wp_wbnl
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Simple newsletter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,932 ▲17113.98 ▼0.395.48 ▲3.8140.12 ▼5.36
Dashboard /wp-admin2,252 ▲464.93 ▲0.08105.36 ▲2.1339.76 ▼3.74
Posts /wp-admin/edit.php2,131 ▲312.03 ▲0.0335.35 ▼5.8734.18 ▼3.62
Add New Post /wp-admin/post-new.php1,552 ▲723.03 ▼0.24650.62 ▲3.2248.67 ▼8.74
Media Library /wp-admin/upload.php1,428 ▲314.20 ▼0.0299.34 ▼6.6646.92 ▲3.48
Email Newsletter /wp-admin/admin.php?page=wbnl1,0531.7625.7028.92
Setting /wp-admin/admin.php?page=Setting8681.8425.9625.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_wbnl
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-newsletter/includes/email.export.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-newsletter/includes/newsletter_list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-newsletter/languages/common-strings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-newsletter/simple-newsletter.php:15
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-newsletter/includes/newsletter_list.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/simple-newsletter/includes/newsletter_list.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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: These screenshots have no corresponding images in /assets: #1 (Settings page), #2 (Email lists), #3 (Output form)
You can look at the official readme.txt

simple-newsletter/simple-newsletter.php Passed 13 tests

"Simple newsletter" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
57 characters long description:
Simple and custom newsletter that can use on any website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin538 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP468116430
PO File1425786
JavaScript20020
CSS2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity13.50
▷ Minimum class complexity10.00
▷ Maximum class complexity17.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods525.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions1076.92%
▷ Anonymous functions323.08%
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
3 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png14.70KB7.48KB▼ 49.13%
screenshot-2.png24.93KB14.16KB▼ 43.19%
screenshot-1.png7.63KB4.28KB▼ 43.94%