78% wp-sendgrid-mailer

Code Review | SendGrid for WordPress

WordPress plugin SendGrid for WordPress scored 78% from 54 tests.

About plugin

  • Plugin page: wp-sendgrid-mailer
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.8.2
  • WordPress version: 6.3.1
  • First release: Aug 18, 2017
  • Latest release: Dec 7, 2021
  • Number of updates: 8
  • Update frequency: every 216.9 days
  • Top authors: smackcoders (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 13,898 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.31ms] Passed 4 tests

Analyzing server-side resources used by SendGrid for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.74 ▲0.95
Dashboard /wp-admin3.41 ▲0.1047.81 ▲0.59
Posts /wp-admin/edit.php3.46 ▲0.1049.75 ▲7.05
Add New Post /wp-admin/post-new.php5.92 ▲0.0485.57 ▼13.23
Media Library /wp-admin/upload.php3.33 ▲0.1033.83 ▼1.55
Logs /wp-admin/admin.php?page=wp-mailplus-logs3.7137.18
Settings /wp-admin/admin.php?page=wp-mailplus-settings3.3128.82

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 88 new files
Database: 1 new table, 9 new options
New tables
wp_mailplus_logs
New WordPress options
_wp_mailplus_from_info
theysaidso_admin_options
db_upgraded
_wp_mailplus_enabled_service
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
_wp_mailplus_service_info

Browser metrics Passed 4 tests

Checking browser requirements for SendGrid for WordPress
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲7713.21 ▼1.091.70 ▼0.0344.07 ▲4.30
Dashboard /wp-admin2,229 ▲405.79 ▲0.8996.47 ▼14.9940.29 ▲0.43
Posts /wp-admin/edit.php2,112 ▲202.01 ▲0.0138.70 ▲1.5335.91 ▲3.30
Add New Post /wp-admin/post-new.php1,539 ▲223.22 ▲0.09659.12 ▼15.8666.34 ▼0.23
Media Library /wp-admin/upload.php1,414 ▲264.22 ▲0.0297.16 ▼17.5644.57 ▼1.67
Logs /wp-admin/admin.php?page=wp-mailplus-logs1,0561.9326.5543.43
Settings /wp-admin/admin.php?page=wp-mailplus-settings1,0431.8926.6823.10

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% 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 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/scripts/generate_upload_policy.php
  • 71× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/apikeys/apikeys.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/stats/stats.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/test/unit/helpers/mail/MailTest.php:4
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/php-http-client/test/unit/../../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/php-http-client/test/unit/bootstrap.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/helpers/mail<PATH_TO>/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/helpers/mail/example.php on line 5
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/trackingsettings/trackingsettings.php on line 3
    • > PHP Warning
      require(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/asm/asm.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/alerts/alerts.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/sendgrid/examples/scopes/scopes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid\\Client' not found in wp-content/plugins/wp-sendgrid-mailer/vendor/sendgrid/php-http-client/examples/example.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (SendGrid Plugin Settings), #2 (WP SendGrid Plugin Log)
The official readme.txt might help

wp-sendgrid-mailer/wp-sendgrid-mailer.php 92% from 13 tests

"SendGrid for WordPress" version 1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin22,896 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
CSS31,7513510,207
PHP531,3661,8077,260
Markdown101,81504,323
JavaScript3238208800
JSON410168
YAML20066
Bourne Shell213363
XML1009

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity8.03
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity1.48
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces4
Interfaces1
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods514
▷ Static methods122.33%
▷ Public methods48894.94%
▷ Protected methods193.70%
▷ Private methods71.36%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png15.55KB7.08KB▼ 54.45%
screenshot-1.png16.23KB6.69KB▼ 58.78%