90% wp-mailhog-smtp

Code Review | MailHog for WordPress

WordPress plugin MailHog for WordPress scored90%from 54 tests.

About plugin

  • Plugin page: wp-mailhog-smtp
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 26, 2018
  • Latest release: Jul 28, 2021
  • Number of updates: 5
  • Update frequency: every 189.0 days
  • Top authors: tareq1988 (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

100+ active /6,679 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.41ms] Passed 4 tests

Server-side resources used by MailHog for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0135.78 ▼3.50
Dashboard /wp-admin3.31 ▲0.0145.56 ▼8.87
Posts /wp-admin/edit.php3.36 ▲0.0045.20 ▼2.67
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.74 ▼10.59
Media Library /wp-admin/upload.php3.23 ▲0.0038.55 ▲4.75

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for MailHog for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.111.84 ▲0.0040.43 ▼5.57
Dashboard /wp-admin2,206 ▲184.85 ▼1.05108.13 ▼4.6838.05 ▼7.92
Posts /wp-admin/edit.php2,089 ▼02.04 ▼0.0141.00 ▲3.3234.57 ▲0.91
Add New Post /wp-admin/post-new.php1,533 ▲1923.54 ▲5.94574.93 ▼108.1364.29 ▲0.49
Media Library /wp-admin/upload.php1,391 ▲64.18 ▼0.0994.02 ▼9.1140.55 ▼4.72

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: wp mail smtp, phpmailer, mailer, smtp, email...

wp-mailhog-smtp/mailhog.php 92% from 13 tests

The main PHP script in "MailHog for WordPress" version 1.0.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-mailhog-smtp.php" instead of "mailhog.php")

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
Good job! No executable or dangerous file extensions detected25 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP182325

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected