73% hamail

Code Review | Hamail - Send Email via SendGrid

WordPress plugin Hamail - Send Email via SendGrid scored73%from 54 tests.

About plugin

  • Plugin page: hamail
  • Plugin version: 2.3.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 10, 2021
  • Latest release: Jun 10, 2021
  • Number of updates: 5
  • Update frequency: every 1.6 days
  • Top authors: Takahashi_Fumiki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /442 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼0.80ms] Passed 4 tests

A check of server-side resources used by Hamail - Send Email via SendGrid
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1543.89 ▲2.13
Dashboard /wp-admin3.45 ▲0.1455.02 ▼0.54
Posts /wp-admin/edit.php3.50 ▲0.1454.59 ▼0.65
Add New Post /wp-admin/post-new.php6.00 ▲0.1191.38 ▼4.14
Media Library /wp-admin/upload.php3.31 ▲0.0842.85 ▲4.35
Hamail Setting /wp-admin/options-general.php?page=hamail-setting3.2737.57

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 289 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Hamail - Send Email via SendGrid
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8913.18 ▼1.572.00 ▲0.1945.20 ▲0.44
Dashboard /wp-admin2,231 ▲375.86 ▲0.95113.42 ▼2.4443.74 ▼2.69
Posts /wp-admin/edit.php2,110 ▲72.01 ▼0.0038.59 ▼3.9335.62 ▼1.61
Add New Post /wp-admin/post-new.php1,554 ▲2823.22 ▲5.55619.28 ▼36.1754.71 ▲4.47
Media Library /wp-admin/upload.php1,410 ▲104.29 ▲0.08109.03 ▼0.4348.81 ▲1.86
Hamail Setting /wp-admin/options-general.php?page=hamail-setting8692.0727.5433.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% 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 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/hamail/vendor/sendgrid/php-http-client/examples/example.php
  • 134× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > Composer autoloader not found. Execute 'composer install' in the project folder first.
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid' not found in wp-content/plugins/hamail/vendor/sendgrid/sendgrid/examples/geo/geo.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hamail/vendor/sendgrid/php-http-client/test/unit/ResponseTest.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid' not found in wp-content/plugins/hamail/vendor/sendgrid/sendgrid/examples/apikeys/apikeys.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/hamail/vendor/sendgrid/php-http-client/test/unit/FilesExistTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid' not found in wp-content/plugins/hamail/vendor/sendgrid/sendgrid/examples/clients/clients.php:8
    • > Composer autoloader not found. Execute 'composer install' in the project folder first.
    • > Composer autoloader not found. Execute 'composer install' in the project folder first.
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hamail/hooks/assets.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SendGrid' not found in wp-content/plugins/hamail/vendor/sendgrid/sendgrid/examples/templates/templates.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=hamail-setting
    • > Javascript (severe) in unknown
    /wp-content/plugins/hamail/assets/js/hamail-setting.js?ver=0ca32811ccf914da1534d78932ff6a29 1:113 Uncaught TypeError: Cannot read properties of undefined (reading 'split')

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
3 plugin tags: marketing, email, sendgrid

hamail/hamail.php Passed 13 tests

The main PHP script in "Hamail - Send Email via SendGrid" version 2.3.5 is automatically included on every request by WordPress
51 characters long description:
A WordPress plugin for sending e-mail via SendGrid.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin16,800 lines of code in 256 files:
LanguageFilesBlank linesComment linesLines of code
PHP1942,7817,86413,775
Markdown163490943
JSON800645
JavaScript1580115596
Sass6600343
PO File19496293
XML2468083
YAML59083
Dockerfile29020
Bourne Shell1207
make1307
CSS55115

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity7.44
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces33
Interfaces6
Traits4
Classes132
▷ Abstract classes129.09%
▷ Concrete classes12090.91%
▷ Final classes43.33%
Methods851
▷ Static methods495.76%
▷ Public methods76089.31%
▷ Protected methods657.64%
▷ Private methods263.06%
Functions148
▷ Named functions5939.86%
▷ Anonymous functions8960.14%
Constants43
▷ Global constants36.98%
▷ Class constants4093.02%
▷ Public constants40100.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
6 PNG files occupy 0.25MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/sendgrid/php-http-client/static/img/github-sign-up.png84.82KB29.94KB▼ 64.70%
vendor/sendgrid/sendgrid/static/img/github-fork.png14.83KB6.73KB▼ 54.66%
vendor/sendgrid/php-http-client/twilio_sendgrid_logo.png14.25KB5.54KB▼ 61.17%
vendor/sendgrid/sendgrid/twilio_sendgrid_logo.png14.25KB5.54KB▼ 61.17%
vendor/sendgrid/php-http-client/static/img/github-fork.png13.53KB6.38KB▼ 52.82%