84% email-trap

Code Review | Email Trap

WordPress plugin Email Trap scored84%from 54 tests.

About plugin

  • Plugin page: email-trap
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.7
  • WordPress version: 6.3.1
  • First release: Jul 22, 2020
  • Latest release: Apr 3, 2021
  • Number of updates: 11
  • Update frequency: every 28.2 days
  • Top authors: soliddigital (90.91%)danwright (18.18%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /478 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.03MB] [CPU: ▼2.71ms] Passed 4 tests

This is a short check of server-side resources used by Email Trap
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.48 ▼5.28
Dashboard /wp-admin3.34 ▲0.0448.26 ▼3.12
Posts /wp-admin/edit.php3.39 ▲0.0348.44 ▼2.94
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.38 ▲0.82
Media Library /wp-admin/upload.php3.27 ▲0.0333.43 ▲0.52

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Email Trap
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲8513.37 ▼1.193.86 ▲2.1341.89 ▼5.20
Dashboard /wp-admin2,229 ▲414.86 ▼1.01109.65 ▼7.2342.81 ▼0.77
Posts /wp-admin/edit.php2,104 ▲152.00 ▼0.0547.72 ▲12.1236.10 ▲0.86
Add New Post /wp-admin/post-new.php1,543 ▲1023.26 ▲0.17593.91 ▼86.7962.31 ▼3.84
Media Library /wp-admin/upload.php1,400 ▲94.23 ▲0.0497.24 ▼1.9340.62 ▼3.06

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

Smoke tests 75% from 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 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Solid\\add_action() in wp-content/plugins/email-trap/classes/options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Solid\\add_action() in wp-content/plugins/email-trap/trunk/classes/options.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: security, trap, email

email-trap/email-trap.php Passed 13 tests

The primary PHP file in "Email Trap" version 1.0.1 is used by WordPress to initiate all plugin functionality
53 characters long description:
An email trap that sends emails to the WP Admin Email

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
No dangerous file extensions were detected145 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP43330145

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.33
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.26MB with 0.20MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png262.28KB62.07KB▼ 76.33%