79% mailarchiver

Code Review | MailArchiver

WordPress plugin MailArchiver scored79%from 54 tests.

About plugin

  • Plugin page: mailarchiver
  • Plugin version: 2.12.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Dec 2, 2019
  • Latest release: Oct 25, 2023
  • Number of updates: 26
  • Update frequency: every 54.7 days
  • Top authors: PierreLannoy (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,558 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.13MB] [CPU: ▼1.17ms] Passed 4 tests

Analyzing server-side resources used by MailArchiver
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1137.14 ▼0.86
Dashboard /wp-admin3.49 ▲0.1548.37 ▼8.91
Posts /wp-admin/edit.php3.54 ▲0.1952.06 ▲9.86
Add New Post /wp-admin/post-new.php6.03 ▲0.1494.62 ▲0.39
Media Library /wp-admin/upload.php3.35 ▲0.1237.25 ▲4.69
MailArchiver /wp-admin/admin.php?page=mailarchiver-settings4.7452.97

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 938 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

MailArchiver: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲4714.36 ▼0.301.76 ▼0.1937.04 ▼4.37
Dashboard /wp-admin2,228 ▲545.57 ▼0.1089.60 ▲4.1239.82 ▲0.74
Posts /wp-admin/edit.php2,129 ▲292.00 ▲0.0342.22 ▲6.7334.06 ▼0.75
Add New Post /wp-admin/post-new.php1,538 ▲1023.76 ▲0.50654.31 ▼8.1655.77 ▲6.33
Media Library /wp-admin/upload.php1,432 ▲324.28 ▲0.1294.39 ▼3.9943.02 ▼2.66
MailArchiver /wp-admin/admin.php?page=mailarchiver-settings1,5801.7226.2834.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/mailarchiver/public/partials/mailarchiver-public-display.php
  • 413× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Elasticsearch\\ConnectionPool\\Selectors\\SelectorInterface' not found in wp-content/plugins/mailarchiver/includes/libraries/elasticsearch/ConnectionPool/Selectors/StickyRoundRobinSelector.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'MAMonolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/mailarchiver/includes/libraries/monolog/Handler/SqsHandler.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Elasticsearch\\Endpoints\\AbstractEndpoint' not found in wp-content/plugins/mailarchiver/includes/libraries/elasticsearch/Endpoints/Cat/Master.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Elasticsearch\\Endpoints\\AbstractEndpoint' not found in wp-content/plugins/mailarchiver/includes/libraries/elasticsearch/Endpoints/Indices/Stats.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'MAMonolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/mailarchiver/includes/formatters/class-fluentformatter.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'MAMonolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/mailarchiver/includes/libraries/monolog/Processor/HostnameProcessor.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/mailarchiver/includes/libraries/guzzlehttp/Psr7/FnStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Elasticsearch\\Endpoints\\AbstractEndpoint' not found in wp-content/plugins/mailarchiver/includes/libraries/elasticsearch/Endpoints/Indices/GetMapping.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'MAGuzzleHttp\\Stream\\StreamInterface' not found in wp-content/plugins/mailarchiver/includes/libraries/guzzlehttp/Stream/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\ResponseInterface' not found in wp-content/plugins/mailarchiver/includes/libraries/guzzlehttp/Psr7/Response.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: email log, email, log, archive, mail

mailarchiver/mailarchiver.php Passed 13 tests

The principal PHP file in "MailArchiver" v. 2.12.0 is loaded by WordPress automatically on each request
63 characters long description:
Automatically archive and store all emails sent from your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin45,940 lines of code in 900 files:
LanguageFilesBlank linesComment linesLines of code
PHP5998,14625,91141,068
SVG283004,167
Markdown72100553
CSS514183
JSON20053
JavaScript40016

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity9.75
▷ Minimum class complexity1.00
▷ Maximum class complexity155.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces58
Interfaces42
Traits25
Classes504
▷ Abstract classes152.98%
▷ Concrete classes48997.02%
▷ Final classes234.70%
Methods3,237
▷ Static methods43413.41%
▷ Public methods2,52578.00%
▷ Protected methods32810.13%
▷ Private methods38411.86%
Functions215
▷ Named functions6429.77%
▷ Anonymous functions15170.23%
Constants183
▷ Global constants5127.87%
▷ Class constants13272.13%
▷ Public constants9773.48%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin