93% wp-better-emails

Code Review | WP Better Emails

WordPress plugin WP Better Emails scored 93% from 54 tests.

About plugin

  • Plugin page: wp-better-emails
  • Plugin version: 0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.5.1
  • WordPress version: 5.9.2
  • First release: Nov 29, 2010
  • Latest release: Oct 5, 2020
  • Number of updates: 132
  • Update frequency: every 27.3 days
  • Top authors: nlemoine (100%)

Code review

54 tests

User reviews

110 reviews

Install metrics

20,000+ active / 239,052 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼289.96ms] Passed 4 tests

An overview of server-side resources used by WP Better Emails
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.1658.87 ▲2.79
Dashboard /wp-admin3.51 ▲0.1140.89 ▲4.02
Posts /wp-admin/edit.php3.74 ▲0.1040.75 ▼4.88
Add New Post /wp-admin/post-new.php6.98 ▲0.0196.63 ▼1,161.75
Media Library /wp-admin/upload.php3.39 ▲0.1033.38 ▲7.98
WP Better Emails /wp-admin/options-general.php?page=wpbe_options3.4328.49

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 62 new files
Database: no new tables, 1 new option
New WordPress options
wpbe_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Better Emails
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,786 ▲4115.10 ▼0.676.27 ▼0.142.80 ▲0.48
Dashboard /wp-admin2,883 ▲326.12 ▼0.07118.57 ▼18.91163.08 ▲4.13
Posts /wp-admin/edit.php2,696 ▲53.37 ▲0.2867.18 ▲1.08146.38 ▲3.86
Add New Post /wp-admin/post-new.php1,719 ▲5821.75 ▲5.48485.06 ▲49.89162.38 ▼1.04
Media Library /wp-admin/upload.php1,706 ▲85.50 ▼0.03145.35 ▲0.92191.58 ▼3.25
WP Better Emails /wp-admin/options-general.php?page=wpbe_options2,2199.48173.04224.63

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-better-emails/views/help.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-better-emails/templates/template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-better-emails/wpbe-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-better-emails/wpbe.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is missing
  • Screenshots: These screenshots do not have images: #1 (The default template provided with WP Better Emails. Tested on many email clients like Gmail, Yahoo!, Live/Hotmail, etc.), #2 (WP Better Emails settings screen with the default WP TinyMCE editor.), #3 (Editor in source mode using CodeMirror syntax highlighting.), #4 (Live preview your template in a thickbox.), #5 (Help tab with information about available tags.)
Please take inspiration from this readme.txt

wp-better-emails/wpbe.php 92% from 13 tests

The main file in "WP Better Emails" v. 0.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-better-emails.php" instead of "wpbe.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin3,382 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PO File167839402,682
PHP5118255430
JavaScript93010170
JSON20048
Sass22236
HTML10014
CSS2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png48.84KB24.38KB▼ 50.08%
screenshot-1.png36.58KB22.13KB▼ 39.50%
screenshot-5.png37.26KB24.94KB▼ 33.05%
screenshot-2.png43.02KB25.41KB▼ 40.93%
screenshot-4.png22.26KB13.41KB▼ 39.77%