83% bnfw

Code Review | Customize WordPress Emails and Alerts - Better Notifications for WP

WordPress plugin Customize WordPress Emails and Alerts - Better Notifications for WP scored83%from 54 tests.

About plugin

  • Plugin page: bnfw
  • Plugin version: 1.9.3
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.2
  • WordPress version: 6.3.1
  • First release: Mar 16, 2013
  • Latest release: May 16, 2023
  • Number of updates: 109
  • Update frequency: every 34.1 days
  • Top authors: voltronik (88.07%)jackmcconnell (10.09%)peterrocker (3.67%)

Code review

54 tests

User reviews

174 reviews

Install metrics

40,000+ active /829,444 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.06MB] [CPU: ▲6.89ms] Passed 4 tests

Server-side resources used by Customize WordPress Emails and Alerts - Better Notifications for WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /57.60 ▲54.0911,223,652.40 ▲11,223,610.10
Dashboard /wp-admin4.41 ▲1.0658.28 ▲8.95
Posts /wp-admin/edit.php4.45 ▲1.0555.17 ▲5.27
Add New Post /wp-admin/post-new.php7.01 ▲1.0894.31 ▼2.32
Media Library /wp-admin/upload.php4.32 ▲1.0550.94 ▲15.65

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 38 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Customize WordPress Emails and Alerts - Better Notifications for WP
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲9614.59 ▲0.031.69 ▼0.1044.27 ▲6.11
Dashboard /wp-admin2,257 ▲825.60 ▼0.1185.71 ▼14.9938.34 ▼6.33
Posts /wp-admin/edit.php2,165 ▲652.04 ▲0.0735.52 ▼5.0335.65 ▼0.12
Add New Post /wp-admin/post-new.php1,581 ▲5523.63 ▲0.50628.83 ▼84.7258.37 ▲2.67
Media Library /wp-admin/upload.php1,465 ▲684.19 ▼0.10108.09 ▲3.1846.59 ▲5.04

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
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bnfw/includes/admin/bnfw-settings.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/bnfw/includes/helpers/ajax-helpers.php:68

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

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: A description for screenshot #3 is required in bnfw/assets to your readme.txt
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

bnfw/bnfw.php 92% from 13 tests

The principal PHP file in "Customize WordPress Emails and Alerts - Better Notifications for WP" v. 1.9.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 149 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin8,518 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP171,1522,3535,097
PO File51,0601,4642,558
JavaScript38012588
CSS22914138
Markdown2390110
JSON10027

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity66.58
▷ Minimum class complexity3.00
▷ Maximum class complexity190.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods222
▷ Static methods94.05%
▷ Public methods17578.83%
▷ Protected methods125.41%
▷ Private methods3515.77%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants8
▷ Global constants112.50%
▷ Class constants787.50%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/icon-256x256.png22.58KB13.67KB▼ 39.46%