68% mail-mage

Code Review | Mail Mage

WordPress plugin Mail Mage scored68%from 54 tests.

About plugin

  • Plugin page: mail-mage
  • Plugin version: 0.0.24
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jan 19, 2021
  • Latest release: Oct 19, 2022
  • Number of updates: 19
  • Update frequency: every 33.6 days
  • Top authors: mailmage (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /1,342 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.49MB] [CPU: ▲1.73ms] Passed 4 tests

An overview of server-side resources used by Mail Mage
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.5044.34 ▲7.65
Dashboard /wp-admin3.81 ▲0.4650.71 ▼11.24
Posts /wp-admin/edit.php3.86 ▲0.5052.19 ▲4.76
Add New Post /wp-admin/post-new.php6.42 ▲0.5395.24 ▲5.75
Media Library /wp-admin/upload.php3.74 ▲0.5044.47 ▲12.25
Mail Mage /wp-admin/tools.php?page=mail-mage3.7036.27

Server storage [IO: ▲1.50MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 189 new files
Database: 4 new tables, 7 new options
New tables
wp_ewp_automation_queue_activity
wp_ewp_subscribers
wp_ewp_automation_woocommerce_carts
wp_ewp_automation_queue
New WordPress options
widget_theysaidso_widget
can_compress_scripts
ewp_last_ran
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Mail Mage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.45 ▲0.071.79 ▲0.0838.09 ▼1.91
Dashboard /wp-admin2,210 ▲255.88 ▼0.00107.51 ▲4.4139.35 ▼6.07
Posts /wp-admin/edit.php2,090 ▼21.99 ▲0.0236.47 ▼0.0431.78 ▼2.45
Add New Post /wp-admin/post-new.php1,545 ▲1223.33 ▲0.25682.76 ▼7.9953.91 ▲0.57
Media Library /wp-admin/upload.php1,392 ▲104.22 ▼0.06110.59 ▲11.2849.02 ▲4.36
Mail Mage /wp-admin/tools.php?page=mail-mage8044.57111.3631.56

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 4 tables in the database
    • wp_ewp_subscribers
    • wp_ewp_automation_queue_activity
    • wp_ewp_automation_queue
    • wp_ewp_automation_woocommerce_carts
  • This plugin does not fully uninstall, leaving 7 options in the database
    • ewp_last_ran
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/mail-mage/frontend/views/emails/elements/button.php
    • > /wp-content/plugins/mail-mage/frontend/views/admin.php
    • > /wp-content/plugins/mail-mage/frontend/views/unsubscribe/layout/footer.php
  • 98× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to a member function view() on null in wp-content/plugins/mail-mage/frontend/views/unsubscribe/success.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/mail-mage/vendor/symfony/css-selector/Node/SelectorNode.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\XPath\\Extension\\ExtensionInterface' not found in wp-content/plugins/mail-mage/vendor/symfony/css-selector/XPath/Extension/AbstractExtension.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Tests\ode\\AbstractNodeTest' not found in wp-content/plugins/mail-mage/vendor/symfony/css-selector/Tests/Node/FunctionNodeTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'EmailWP\\Common\\Automation\\AutomationManager' not found in wp-content/plugins/mail-mage/class/Free/Automation/AutomationManager.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mail-mage/vendor/symfony/css-selector/Tests/Parser/Handler/AbstractHandlerTest.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/mail-mage/frontend/views/unsubscribe/layout/header.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'EmailWP\\Common\\Event\\AbstractEvent' not found in wp-content/plugins/mail-mage/class/Common/Event/PostStatusChangeEvent.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/mail-mage/vendor/symfony/css-selector/Tests/Node/AbstractNodeTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Pelago\\Emogrifier\\HtmlProcessor\\AbstractHtmlProcessor' not found in wp-content/plugins/mail-mage/vendor/pelago/emogrifier/src/Emogrifier/CssInliner.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 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
7 plugin tags: review reminder, cart recovery, product reviews, cart abandonment, customer reviews...

mail-mage/emailwp.php 85% from 13 tests

The primary PHP file in "Mail Mage" version 0.0.24 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("mail-mage.php" instead of "emailwp.php")
  • Description: The description should be shorter than 140 characters (currently 169 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin13,493 lines of code in 183 files:
LanguageFilesBlank linesComment linesLines of code
PHP1662,8375,91311,799
Markdown52260966
HTML200356
JSON300284
XML33051
JavaScript204026
CSS24011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.36
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces42
Interfaces9
Traits2
Classes138
▷ Abstract classes107.25%
▷ Concrete classes12892.75%
▷ Final classes00.00%
Methods997
▷ Static methods363.61%
▷ Public methods76576.73%
▷ Protected methods313.11%
▷ Private methods20120.16%
Functions33
▷ Named functions39.09%
▷ Anonymous functions3090.91%
Constants50
▷ Global constants36.00%
▷ Class constants4794.00%
▷ Public constants3574.47%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
dist/img/avatar-72x72.png3.55KB2.23KB▼ 37.11%