84% mailtrap-for-wp

Code Review | Mailtrap for WordPress

WordPress plugin Mailtrap for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: mailtrap-for-wp
  • Plugin version: 0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.5.3
  • WordPress version: 6.3.1
  • First release: May 4, 2015
  • Latest release: Nov 21, 2020
  • Number of updates: 17
  • Update frequency: every 119.4 days
  • Top authors: eduardo.marcolino (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /16,484 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.31ms] 75% from 4 tests

Analyzing server-side resources used by Mailtrap for WordPress
The following require your attention
  • CPU: Total CPU usage must kept under 500.00ms (currently 605.24ms on /wp-admin/admin.php?page=mailtrap-inbox)
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0540.85 ▼7.30
Dashboard /wp-admin3.36 ▲0.0546.46 ▼0.21
Posts /wp-admin/edit.php3.48 ▲0.1248.83 ▲2.85
Add New Post /wp-admin/post-new.php5.94 ▲0.0582.32 ▼4.59
Media Library /wp-admin/upload.php3.29 ▲0.0537.32 ▲3.27
Mailtrap /wp-admin/options-general.php?page=mailtrap-settings3.2633.42
Mailtrap Inbox /wp-admin/admin.php?page=mailtrap-inbox3.27605.24
Mailtrap Test /wp-admin/admin.php?page=mailtrap-test3.2533.07

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

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

Browser metrics Passed 4 tests

Mailtrap for WordPress: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.29 ▼1.451.63 ▼0.5545.82 ▲0.21
Dashboard /wp-admin2,210 ▲195.86 ▲1.0097.98 ▼1.9839.64 ▼0.19
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0239.70 ▲3.1635.23 ▲1.85
Add New Post /wp-admin/post-new.php1,517 ▼2617.45 ▼0.88664.61 ▲66.2254.70 ▲4.64
Media Library /wp-admin/upload.php1,395 ▲74.20 ▼0.0498.35 ▲0.8341.88 ▼1.39
Mailtrap /wp-admin/options-general.php?page=mailtrap-settings9072.1721.6528.41
Mailtrap Inbox /wp-admin/admin.php?page=mailtrap-inbox7792.0624.8822.17
Mailtrap Test /wp-admin/admin.php?page=mailtrap-test8082.0523.2523.53

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • 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
Good news, no errors were detected

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
Please fix the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/mailtrap-for-wp/includes/page-header.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/mailtrap-for-wp/includes/page-header.php:4
    • > PHP Notice
      Undefined variable: email_sent in wp-content/plugins/mailtrap-for-wp/includes/notices.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/mailtrap-for-wp/includes/page-header.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/mailtrap-for-wp/includes/page-header.php:4

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: mailtrap, email, mailtrap for wp, email test, smtp test...

mailtrap-for-wp/mailtrap-for-wp.php Passed 13 tests

"Mailtrap for WordPress" version 0.7's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
56 characters long description:
Easily configure wordpress to send emails to Mailtrap.io

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected408 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP66824360
PO File1171644
Markdown1404

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.55
Average class complexity21.00
▷ Minimum class complexity4.00
▷ Maximum class complexity38.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes150.00%
Methods16
▷ Static methods637.50%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin