78% wp-mail-gateway

Code Review | WP Mail Gateway

WordPress plugin WP Mail Gateway scored78%from 54 tests.

About plugin

  • Plugin page: wp-mail-gateway
  • Plugin version: 1.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 6.3.1
  • First release: Oct 13, 2019
  • Latest release: Mar 24, 2021
  • Number of updates: 30
  • Update frequency: every 17.6 days
  • Top authors: shaharia.azam (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /2,495 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.66MB] [CPU: ▲3.49ms] Passed 4 tests

Analyzing server-side resources used by WP Mail Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6939.57 ▲0.09
Dashboard /wp-admin4.00 ▲0.7048.81 ▲0.34
Posts /wp-admin/edit.php4.05 ▲0.7053.99 ▲9.92
Add New Post /wp-admin/post-new.php6.52 ▲0.6396.79 ▲4.40
Media Library /wp-admin/upload.php3.86 ▲0.6339.80 ▲9.14

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

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

Browser metrics Passed 4 tests

WP Mail Gateway: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲4513.58 ▼1.101.64 ▼0.8739.68 ▼7.35
Dashboard /wp-admin2,222 ▲314.88 ▲0.02104.08 ▼16.1939.26 ▼8.28
Posts /wp-admin/edit.php2,108 ▲192.06 ▲0.0641.43 ▲3.5635.70 ▼0.07
Add New Post /wp-admin/post-new.php1,546 ▲2723.05 ▼0.01613.83 ▼90.3153.61 ▼12.64
Media Library /wp-admin/upload.php1,407 ▲164.21 ▼0.01104.80 ▲3.0443.22 ▲0.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% 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 0% 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
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-mail-gateway/vendor/sendgrid/php-http-client/examples/example.php
    • > /wp-content/plugins/wp-mail-gateway/vendor/phpmailer/phpmailer/get_oauth_token.php
    • > /wp-content/plugins/wp-mail-gateway/vendor/sendgrid/sendgrid/scripts/generate_upload_policy.php
    • > /wp-content/plugins/wp-mail-gateway/vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial1.php
  • 449× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\HttpClient' not found in wp-content/plugins/wp-mail-gateway/vendor/php-http/guzzle6-adapter/src/Client.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/wp-mail-gateway/vendor/wildbit/postmark-php/tests/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-mail-gateway/vendor/wildbit/postmark-php/tests/PostmarkClientBaseTest.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/wp-mail-gateway/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Discovery\\Exception\\StrategyUnavailableException' not found in wp-content/plugins/wp-mail-gateway/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php:10
    • > PHP Warning
      require_once(wp-content/plugins/wp-mail-gateway/vendor/wildbit/postmark-php/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-mail-gateway/vendor/wildbit/postmark-php/tests/PostmarkClientBaseTest.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'Mailgun\\Model\\ApiResponse' not found in wp-content/plugins/wp-mail-gateway/vendor/mailgun/mailgun-php/src/Mailgun/Model/Domain/IndexResponse.php:17
    • > PHP Notice
      Array to string conversion in wp-content/plugins/wp-mail-gateway/vendor/sendgrid/php-http-client/examples/example.php on line 20
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/wp-mail-gateway/vendor/php-http/client-common/src/Plugin/AuthenticationPlugin.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/wp-mail-gateway/vendor/php-http/client-common/src/Plugin/BaseUriPlugin.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Omnimail\\MailerInterface' not found in wp-content/plugins/wp-mail-gateway/vendor/omnimail/omnimail/src/Sendgrid.php:15

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)
Everything seems fine on the user side

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
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-mail-gateway/wp-mail-gateway.php 92% from 13 tests

The main file in "WP Mail Gateway" v. 1.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 155 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected97,589 lines of code in 923 files:
LanguageFilesBlank linesComment linesLines of code
PHP6679,85626,00945,071
HTML1016,140325,821
Markdown824,793012,172
CSS4119289,643
JSON39303,216
JavaScript61731811,217
YAML8242172
Bourne Shell5236119
XML673103
Dockerfile320239
make27016

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.26
▷ Minimum class complexity1.00
▷ Maximum class complexity479.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces117
Interfaces46
Traits16
Classes527
▷ Abstract classes142.66%
▷ Concrete classes51397.34%
▷ Final classes15329.82%
Methods3,674
▷ Static methods40110.91%
▷ Public methods3,20687.26%
▷ Protected methods1153.13%
▷ Private methods3539.61%
Functions393
▷ Named functions14336.39%
▷ Anonymous functions25063.61%
Constants235
▷ Global constants5021.28%
▷ Class constants18578.72%
▷ Public constants185100.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
18 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/mailgun_logo.png8.19KB5.07KB▼ 38.05%
vendor/wildbit/postmark-php/tests/postmark-logo.png4.18KB4.35KB0.00%
assets/img/mailjet_logo.png8.45KB8.83KB0.00%
assets/img/amazon_ses_logo.png18.47KB7.50KB▼ 59.40%
vendor/mandrill/mandrill/docs/resources/tree-hasnext.png0.13KB0.09KB▼ 31.25%