88% swift-mailer

Code Review | Swift Mailer

WordPress plugin Swift Mailer scored 88% from 53 tests.

About plugin

  • Plugin page: swift-mailer
  • Plugin version: 5.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5.3
  • WordPress version: 5.8.1
  • First release: Jan 15, 2013
  • Latest release: Sep 4, 2016
  • Number of updates: 23
  • Update frequency: every 57.7 days
  • Top authors: Turn On Social (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

5,000+ active / 31,654 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼363.23ms] Passed 4 tests

This is a short check of server-side resources used by Swift Mailer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1234.76 ▲7.77
Dashboard /wp-admin3.07 ▲0.0139.81 ▼1.02
Posts /wp-admin/edit.php3.12 ▲0.0139.18 ▼6.48
Add New Post /wp-admin/post-new.php5.43 ▼0.0083.50 ▼1,439.03
Media Library /wp-admin/upload.php3.01 ▲0.0032.24 ▼6.40

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 176 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Swift Mailer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,678 ▲7215.93 ▲0.388.58 ▲0.0444.03 ▼4.50
Dashboard /wp-admin2,962 ▲1095.93 ▲0.10140.13 ▲2.0597.90 ▼2.20
Posts /wp-admin/edit.php2,706 ▼02.69 ▲0.0164.31 ▼2.3083.61 ▼3.88
Add New Post /wp-admin/post-new.php1,481 ▼56118.22 ▼1.17351.05 ▼19.15103.87 ▼4.14
Media Library /wp-admin/upload.php1,778 ▲65.01 ▼0.00148.85 ▼3.55109.44 ▼6.07

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

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 no errors were found, this is by no means an exhaustive test

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
Please fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/swift-mailer/lib/swiftmailer_generate_mimes_config.php
  • 133× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_Mime_SimpleMimeEntity' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Mime/Attachment.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_SwiftException' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/IoException.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Encoder' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Mime/ContentEncoder.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_Events_EventObject' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Events/SendEvent.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_Mime_Headers_UnstructuredHeader' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_DependencyContainer' not found in wp-content/plugins/swift-mailer/lib/dependency_maps/message_deps.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Plugins_Logger' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Mime_HeaderSet' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Mime/SimpleHeaderSet.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Swift_Mime_Headers_AbstractHeader' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Swift_Events_EventListener' not found in wp-content/plugins/swift-mailer/lib/classes/Swift/Events/CommandListener.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)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: mail, swift mailer

swift-mailer/index.php 92% from 13 tests

"Swift Mailer" version 5.4.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("swift-mailer.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected10,385 lines of code in 172 files:
LanguageFilesBlank linesComment linesLines of code
PHP1722,3369,56110,385

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.05
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.06
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces47
Traits0
Classes114
▷ Abstract classes54.39%
▷ Concrete classes10995.61%
▷ Final classes00.00%
Methods1,096
▷ Static methods333.01%
▷ Public methods88981.11%
▷ Protected methods12111.04%
▷ Private methods867.85%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants45
▷ Global constants36.67%
▷ Class constants4293.33%
▷ Public constants42100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.02MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png20.88KB21.96KB0.00%