67% twinklesmtp

Code Review | twinklesmtp - Email Service Provider For WordPress

WordPress plugin twinklesmtp - Email Service Provider For WordPress scored 67% from 54 tests.

About plugin

  • Plugin page: twinklesmtp
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-6.1
  • WordPress version: 6.3.1
  • First release: Jul 20, 2022
  • Latest release: Nov 17, 2022
  • Number of updates: 3
  • Update frequency: every 58.4 days
  • Top authors: wpcommerz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 338 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by twinklesmtp - Email Service Provider For WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2539.88 ▼2.51
Dashboard /wp-admin3.36 ▲0.0652.55 ▲0.95
Posts /wp-admin/edit.php3.47 ▲0.1247.63 ▲0.78
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.91 ▲0.29
Media Library /wp-admin/upload.php3.28 ▲0.0546.65 ▲9.93

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 73 new files
Database: 2 new tables, 6 new options
New tables
wp_twinkle_smtp_settings
wp_twinkle_smtp_mail_logs
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by twinklesmtp - Email Service Provider For WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲17213.33 ▼1.081.73 ▼0.1539.39 ▼8.51
Dashboard /wp-admin2,324 ▲1505.00 ▼0.9395.89 ▼20.8183.80 ▲36.57
Posts /wp-admin/edit.php2,111 ▲192.10 ▲0.1136.08 ▼1.7630.67 ▼3.70
Add New Post /wp-admin/post-new.php1,688 ▲15222.40 ▼0.85714.19 ▲29.7879.20 ▲27.18
Media Library /wp-admin/upload.php1,404 ▲164.16 ▼0.07109.83 ▲2.2570.90 ▲25.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_twinkle_smtp_mail_logs
    • wp_twinkle_smtp_settings
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/twinklesmtp/backend/templates/dashboard.php
    • > /wp-content/plugins/twinklesmtp/backend/templates/views/email-logs.php
    • > /wp-content/plugins/twinklesmtp/backend/templates/views/analytics.php
    • > /wp-content/plugins/twinklesmtp/backend/templates/views/email-test.php
    • > /wp-content/plugins/twinklesmtp/backend/templates/views/settings.php
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      include(TWINKLE_SMTP_PATHbackend/templates/views/email-logs.php): failed to open stream: No such file or directory in wp-content/plugins/twinklesmtp/backend/templates/dashboard.php on line 21
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/twinklesmtp/backend/templates/views/settings/sender-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/twinklesmtp/backend/api/twinkle_smtp_general_settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/twinklesmtp/backend/api/twinkle_smtp_analytics.php:4
    • > PHP Warning
      include(TWINKLE_SMTP_PATHbackend/templates/views/settings/sender-settings.php): failed to open stream: No such file or directory in wp-content/plugins/twinklesmtp/backend/templates/views/settings.php on line 13
    • > PHP Warning
      include(): Failed opening 'TWINKLE_SMTP_PATHbackend/templates/views/settings/general-settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/twinklesmtp/backend/templates/views/settings.php on line 14
    • > PHP Warning
      include(): Failed opening 'TWINKLE_SMTP_PATHbackend/templates/views/settings.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/twinklesmtp/backend/templates/dashboard.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/twinklesmtp/backend/api/twinkle_smtp_email_logs_datatable.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/twinklesmtp/backend/api/twinkle_smtp_default_mailer.php:4
    • > PHP Warning
      Use of undefined constant TWINKLE_SMTP_PATH - assumed 'TWINKLE_SMTP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/twinklesmtp/backend/templates/views/settings.php on line 14

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 86% 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
These attributes need your attention:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3 in twinklesmtp/assets to your readme.txt
You can take inspiration from this readme.txt

twinklesmtp/twinkle-smtp.php 77% from 13 tests

The primary PHP file in "twinklesmtp - Email Service Provider For WordPress" version 1.0.3 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Main file name: The principal plugin file should be the same as the plugin slug ("twinklesmtp.php" instead of "twinkle-smtp.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected13,460 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript132,5347,1488,778
PHP356081882,591
CSS7275632,087
SVG1004

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity29.50
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/sparkpost.png1.80KB0.88KB▼ 51.33%
assets/img/sendgrid.png0.60KB0.39KB▼ 35.71%
assets/img/trash.png0.36KB0.32KB▼ 10.87%
assets/img/postmark.png1.86KB1.12KB▼ 39.76%
assets/img/php.png4.69KB2.88KB▼ 38.50%