78% smtpcom

Code Review | SMTP.com

WordPress plugin SMTP.com scored 78% from 54 tests.

About plugin

  • Plugin page: smtpcom
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.1-6.0
  • WordPress version: 6.3.1
  • First release: Jan 19, 2022
  • Latest release: Jul 10, 2023
  • Number of updates: 7
  • Update frequency: every 76.7 days
  • Top authors: smtpcom (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active / 1,224 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.34MB] [CPU: ▲0.59ms] 75% from 4 tests

Analyzing server-side resources used by SMTP.com
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,164.60ms on /wp-admin/options-general.php?page=smtpcommail-setting)
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3645.95 ▲6.67
Dashboard /wp-admin3.68 ▲0.3749.42 ▲1.75
Posts /wp-admin/edit.php3.73 ▲0.3747.40 ▲1.78
Add New Post /wp-admin/post-new.php6.22 ▲0.3393.57 ▼7.70
Media Library /wp-admin/upload.php3.54 ▲0.3141.10 ▲6.53
SMTP.com /wp-admin/options-general.php?page=smtpcommail-setting4.531,164.60

Server storage [IO: ▲1.30MB] [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: 463 new files
Database: 1 new table, 6 new options
New tables
wp_smtp_com_mail
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by SMTP.com
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8413.42 ▼0.961.76 ▲0.1742.83 ▲2.97
Dashboard /wp-admin2,213 ▲285.22 ▲0.32104.37 ▼1.6137.29 ▼3.86
Posts /wp-admin/edit.php2,111 ▲222.25 ▲0.1236.89 ▲0.6533.81 ▼0.23
Add New Post /wp-admin/post-new.php1,365 ▼17717.21 ▼0.90566.39 ▼79.6845.47 ▼11.82
Media Library /wp-admin/upload.php1,407 ▲194.29 ▲0.10115.10 ▲0.3346.53 ▼0.15
SMTP.com /wp-admin/options-general.php?page=smtpcommail-setting1,1501.9329.5828.42

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
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=smtpcommail-setting
    • > Warning in wp-content/plugins/smtpcom/includes/settings.php+235
    fsockopen(): unable to connect to send.smtp.com:25 (Connection timed out)

SRP 50% from 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
Please fix the following items
  • 210× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/smtpcom/vendor/php-http/client-common/src/Plugin/DecoderPlugin.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/smtpcom/vendor/php-http/client-common/src/Plugin/CookiePlugin.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Http\\Client\\Common\\Plugin' not found in wp-content/plugins/smtpcom/vendor/php-http/client-common/src/Plugin/AddPathPlugin.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Buzz\\Middleware\\MiddlewareInterface' not found in wp-content/plugins/smtpcom/vendor/kriswallsmith/buzz/lib/Middleware/ContentTypeMiddleware.php:12
    • > PHP Fatal error
      Cannot declare class JsonException, because the name is already in use in wp-content/plugins/smtpcom/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/smtpcom/vendor/psr/http-message/src/ResponseInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/smtpcom/vendor/smtpcom/smtpcom-php/tests/Response/ReportsIndexTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/smtpcom/vendor/smtpcom/smtpcom-php/tests/Response/CallbackIndexTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Exception\\TransferException' not found in wp-content/plugins/smtpcom/vendor/php-http/client-common/src/Exception/HttpClientNotFoundException.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Http\\Client\\Common\\HttpClientPool\\HttpClientPool' not found in wp-content/plugins/smtpcom/vendor/php-http/client-common/src/HttpClientPool/LeastUsedClientPool.php:16

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 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

smtpcom/smtp-com-mail.php 92% from 13 tests

"SMTP.com" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("smtpcom.php" instead of "smtp-com-mail.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
There were no executable files found in this plugin21,635 lines of code in 414 files:
LanguageFilesBlank linesComment linesLines of code
PHP3454,37310,90416,888
JSON23002,160
Markdown331,06101,982
JavaScript2274269
CSS245225
XML40058
YAML4132445
Bourne Shell1448

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.37
▷ Minimum class complexity1.00
▷ Maximum class complexity213.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces74
Interfaces46
Traits13
Classes263
▷ Abstract classes83.04%
▷ Concrete classes25596.96%
▷ Final classes9336.47%
Methods1,387
▷ Static methods20314.64%
▷ Public methods1,22288.10%
▷ Protected methods473.39%
▷ Private methods1188.51%
Functions86
▷ Named functions3641.86%
▷ Anonymous functions5058.14%
Constants115
▷ Global constants54.35%
▷ Class constants11095.65%
▷ Public constants10393.64%

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
14 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/images/ui-bg_glass_75_d0e5f5_1x400.png0.38KB0.16KB▼ 59.39%
admin/css/images/ui-bg_glass_95_fef1ec_1x400.png0.38KB0.15KB▼ 61.54%
admin/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png0.38KB0.13KB▼ 66.24%
admin/css/images/ui-icons_6da8d5_256x240.png4.51KB4.18KB▼ 7.28%
admin/images/logoSMTP.png2.73KB1.54KB▼ 43.69%