83% gmail-smtp

Code Review | Gmail SMTP

WordPress plugin Gmail SMTP scored83%from 54 tests.

About plugin

  • Plugin page: gmail-smtp
  • Plugin version: 1.2.3.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.3
  • WordPress version: 6.3.1
  • First release: Nov 12, 2015
  • Latest release: Sep 11, 2023
  • Number of updates: 67
  • Update frequency: every 42.7 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

98 reviews

Install metrics

20,000+ active /593,875 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼8.10ms] Passed 4 tests

This is a short check of server-side resources used by Gmail SMTP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.38 ▼6.08
Dashboard /wp-admin3.45 ▲0.1552.95 ▼7.22
Posts /wp-admin/edit.php3.57 ▲0.2158.03 ▲4.38
Add New Post /wp-admin/post-new.php6.03 ▲0.1591.32 ▼15.47
Media Library /wp-admin/upload.php3.38 ▲0.1541.61 ▼3.62
Gmail SMTP /wp-admin/options-general.php?page=gmail-smtp-settings3.3437.91

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Gmail SMTP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.25 ▼0.112.06 ▲0.4044.14 ▲4.28
Dashboard /wp-admin2,208 ▲285.63 ▲0.0291.95 ▼0.1239.68 ▼4.79
Posts /wp-admin/edit.php2,111 ▲112.01 ▼0.0140.31 ▼1.7736.57 ▼2.02
Add New Post /wp-admin/post-new.php1,535 ▲923.15 ▼0.17627.74 ▲17.1451.28 ▼1.52
Media Library /wp-admin/upload.php1,410 ▲74.09 ▼0.21100.88 ▼3.1744.95 ▲1.07
Gmail SMTP /wp-admin/options-general.php?page=gmail-smtp-settings9992.1326.9133.00

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please take a closer look at the following
  • 251× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\BadResponseException' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Exception' not found in wp-content/plugins/gmail-smtp/google-api-php-client/src/Google/Service/Exception.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/monolog/monolog/tests/Monolog/LoggerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/monolog/monolog/tests/Monolog/Formatter/LineFormatterTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php:52
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Cache\\CacheItemInterface' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/google/auth/src/Cache/Item.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gmail-smtp/google-api-php-client/vendor/monolog/monolog/tests/Monolog/ErrorHandlerTest.php:16

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)
No browser errors were detected

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
These attributes need your attention:
  • Screenshots: These screenshots need descriptions #1, #2 in gmail-smtp/assets to your readme.txt
You can look at the official readme.txt

gmail-smtp/main.php 92% from 13 tests

This is the main PHP file of "Gmail SMTP" version 1.2.3.10, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gmail-smtp.php" instead of "main.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
Success! There were no dangerous files found in this plugin54,948 lines of code in 413 files:
LanguageFilesBlank linesComment linesLines of code
PHP3729,39225,96149,703
Markdown241,24404,122
JSON12001,023
CSS10034
XML23032
YAML16025
make1409

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.25
▷ Minimum class complexity1.00
▷ Maximum class complexity592.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces37
Interfaces25
Traits5
Classes367
▷ Abstract classes102.72%
▷ Concrete classes35797.28%
▷ Final classes92.52%
Methods2,912
▷ Static methods1254.29%
▷ Public methods2,46284.55%
▷ Protected methods2047.01%
▷ Private methods2468.45%
Functions248
▷ Named functions7630.65%
▷ Anonymous functions17269.35%
Constants331
▷ Global constants267.85%
▷ Class constants30592.15%
▷ Public constants305100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
addons/images/gmail-smtp-cc.png1.71KB0.83KB▼ 51.26%
images/connected.png2.81KB1.86KB▼ 33.91%
addons/images/gmail-smtp-reply-to.png5.07KB2.60KB▼ 48.79%
images/not-connected.png2.87KB1.89KB▼ 34.10%