84% wp-mailtrap

Code Review | WP Mailtrap

WordPress plugin WP Mailtrap scored84%from 54 tests.

About plugin

  • Plugin page: wp-mailtrap
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.2.2
  • WordPress version: 6.3.1
  • First release: Jul 23, 2015
  • Latest release: Jul 23, 2015
  • Number of updates: 7
  • Update frequency: every 62.4 days
  • Top authors: espellcaste (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,404 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.05ms] Passed 4 tests

Server-side resources used by WP Mailtrap
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0032.76 ▼6.93
Dashboard /wp-admin3.31 ▲0.0155.46 ▲8.44
Posts /wp-admin/edit.php3.36 ▲0.0144.10 ▼1.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0179.18 ▼21.13
Media Library /wp-admin/upload.php3.23 ▲0.0132.52 ▲1.58

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Mailtrap
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5814.81 ▲0.261.81 ▼0.0839.69 ▼4.28
Dashboard /wp-admin2,213 ▲255.92 ▲1.0196.04 ▼6.0238.28 ▼6.54
Posts /wp-admin/edit.php2,090 ▲12.02 ▲0.0236.87 ▲1.7832.12 ▼4.17
Add New Post /wp-admin/post-new.php1,536 ▼623.13 ▲5.11643.11 ▲26.6655.63 ▲1.82
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.0895.30 ▼0.9443.73 ▼2.15
WP Mailtrap /wp-admin/wp-mailtrap.php260.440.0813.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/wp-mailtrap.php
    • > Network (severe)
    wp-admin/wp-mailtrap.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (WP Mailtrap Settings)
You can take inspiration from this readme.txt

wp-mailtrap/wp-mailtrap.php 92% from 13 tests

The primary PHP file in "WP Mailtrap" version 1.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected132 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2379399
JSON10023
Markdown16010

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods112.50%
▷ Public methods675.00%
▷ Protected methods00.00%
▷ Private methods225.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
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
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
screenshot-1.png16.61KB8.07KB▼ 51.40%