62% yaysmtp

Code Review | YaySMTP - Simple WP SMTP Mail

WordPress plugin YaySMTP - Simple WP SMTP Mail scored62%from 54 tests.

About plugin

  • Plugin page: yaysmtp
  • Plugin version: 2.5.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 10, 2020
  • Latest release: Nov 28, 2023
  • Number of updates: 94
  • Update frequency: every 11.5 days
  • Top authors: yaycommerce (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

8,000+ active /102,017 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲2.38MB] [CPU: ▲11.18ms] Passed 4 tests

Server-side resources used by YaySMTP - Simple WP SMTP Mail
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.83 ▲2.3756.27 ▲13.35
Dashboard /wp-admin5.76 ▲2.4171.38 ▲13.11
Posts /wp-admin/edit.php5.81 ▲2.4565.88 ▲16.14
Add New Post /wp-admin/post-new.php8.28 ▲2.39101.35 ▲2.10
Media Library /wp-admin/upload.php5.60 ▲2.3752.71 ▲17.30
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins5.5952.39
YaySMTP /wp-admin/admin.php?page=yaysmtp6.6972.20
Help /wp-admin/admin.php?page=yaycommerce-help5.4639.66

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 813 new files
Database: 3 new tables, 8 new options
New tables
wp_yaysmtp_event_email_opened
wp_yaysmtp_email_logs
wp_yaysmtp_event_email_clicked_link
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
yaysmtp_settings
yay_smtp_version
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for YaySMTP - Simple WP SMTP Mail
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,229 ▲48216.99 ▲2.3453.53 ▲51.6628.75 ▼13.61
Dashboard /wp-admin2,634 ▲4547.59 ▲1.93187.12 ▲97.9052.91 ▲15.91
Posts /wp-admin/edit.php2,332 ▲2323.91 ▲1.8954.21 ▲13.4729.58 ▼5.24
Add New Post /wp-admin/post-new.php1,565 ▲3423.54 ▲0.72649.48 ▲9.8035.82 ▼12.84
Media Library /wp-admin/upload.php1,472 ▲725.11 ▲0.9988.97 ▼7.1441.63 ▼0.89
Other plugins /wp-admin/admin.php?page=yaycommerce-other-plugins1,3113.7358.0330.35
YaySMTP /wp-admin/admin.php?page=yaysmtp5,7634.6892.5137.44
Help /wp-admin/admin.php?page=yaycommerce-help280.410.063.55

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_yaysmtp_email_logs
    • wp_yaysmtp_event_email_opened
    • wp_yaysmtp_event_email_clicked_link
  • Zombie WordPress options detected upon uninstall: 8 options
    • yay_smtp_version
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • yaysmtp_settings
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=yaysmtp
    • > POST request to /wp-admin/admin-ajax.php
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 351× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/yaysmtp/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/yaysmtp/vendor/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/yaysmtp/vendor/google/apiclient-services/src/Google/Service/Gmail/ListForwardingAddressesResponse.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/yaysmtp/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'YaySMTP\\Aws3\\GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/yaysmtp/vendor_amazon/GuzzleHttp/Promise/FulfilledPromise.php:11
    • > PHP Warning
      Class 'Google\\Client' not found in wp-content/plugins/yaysmtp/vendor/google/apiclient/src/aliases.php on line 33
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\CredentialsLoader' not found in wp-content/plugins/yaysmtp/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Model' not found in wp-content/plugins/yaysmtp/vendor/google/apiclient-services/src/Google/Service/Gmail/Draft.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/yaysmtp/vendor/guzzlehttp/promises/src/RejectedPromise.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/yaysmtp/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=yaycommerce-help
    • > Network (severe)
    wp-admin/admin.php?page=yaycommerce-help - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
The official readme.txt is a good inspiration

yaysmtp/yay-smtp.php 92% from 13 tests

Analyzing the main PHP file in "YaySMTP - Simple WP SMTP Mail" version 2.5.5
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("yaysmtp.php" instead of "yay-smtp.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected102,802 lines of code in 777 files:
LanguageFilesBlank linesComment linesLines of code
PHP71310,97639,82190,624
Markdown271,56604,715
CSS4228522,580
JavaScript82301712,430
JSON17001,766
PO File2186206553
Python1222572
YAML12025
XML10015
Dockerfile18010
make1409
SVG1003

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity17.47
▷ Minimum class complexity1.00
▷ Maximum class complexity633.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces84
Interfaces63
Traits25
Classes558
▷ Abstract classes193.41%
▷ Concrete classes53996.59%
▷ Final classes366.68%
Methods4,682
▷ Static methods56612.09%
▷ Public methods3,73379.73%
▷ Protected methods2755.87%
▷ Private methods67414.40%
Functions464
▷ Named functions14130.39%
▷ Anonymous functions32369.61%
Constants609
▷ Global constants7512.32%
▷ Class constants53487.68%
▷ Public constants534100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/postsmtp.png3.38KB3.49KB0.00%
assets/img/mailbank.png1.21KB1.25KB0.00%
assets/img/wpsmtp.png3.05KB3.19KB0.00%
assets/img/mail-icon.png0.32KB0.32KB0.00%
assets/img/failed-icon.png0.36KB0.37KB0.00%