77% mailpoet-wysija-mandrill-spam-and-bounce-cleaner

Code Review | MailPoet Newsletters - Mandrill Spam and Bounce Cleaner

WordPress plugin MailPoet Newsletters - Mandrill Spam and Bounce Cleaner scored77%from 54 tests.

About plugin

  • Plugin page: mailpoet-wysija-m...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.1
  • WordPress version: 6.3.1
  • First release: May 6, 2015
  • Latest release: May 9, 2015
  • Number of updates: 26
  • Update frequency: every 0.1 days
  • Top authors: chrismedina (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /3,617 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼4.56ms] Passed 4 tests

A check of server-side resources used by MailPoet Newsletters - Mandrill Spam and Bounce Cleaner
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.96 ▼2.31
Dashboard /wp-admin3.31 ▼0.0349.40 ▼16.80
Posts /wp-admin/edit.php3.37 ▲0.0054.53 ▲3.86
Add New Post /wp-admin/post-new.php5.90 ▲0.0094.18 ▼2.42
Media Library /wp-admin/upload.php3.24 ▲0.0039.11 ▲3.31

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 68 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for MailPoet Newsletters - Mandrill Spam and Bounce Cleaner
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7014.23 ▼0.381.71 ▼0.0341.83 ▲0.20
Dashboard /wp-admin2,228 ▲505.62 ▼0.0394.83 ▼13.1445.79 ▲2.71
Posts /wp-admin/edit.php2,142 ▲422.15 ▲0.1640.28 ▲0.8236.96 ▲2.33
Add New Post /wp-admin/post-new.php1,442 ▼8617.96 ▼5.33605.65 ▼143.1351.09 ▼5.63
Media Library /wp-admin/upload.php1,442 ▲394.19 ▲0.0294.08 ▼7.1743.33 ▲0.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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
Good news, no errors were detected

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 items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/WNC_Mandrill_Cleaner/features.tab.php
    • > /wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/core/autoloader.php
    • > /wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/index.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/WNC_Mandrill_Cleaner/clean.tab.php:34
    • > PHP Notice
      Undefined variable: viewmodel in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/WNC_Mandrill_Cleaner/settings.tab.php on line 2
    • > PHP Warning
      array_key_exists() expects parameter 2 to be array, unknown given in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/WNC_Mandrill_Cleaner/settings.tab.php on line 2
    • > PHP Warning
      array_key_exists() expects parameter 2 to be array, unknown given in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/WNC_Mandrill_Cleaner/wnc_settings.view.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/core/constants.php:13
    • > PHP Fatal error
      require_once(): Failed opening required 'WNC_CLASSESMandrill/Mandrill.php' (include_path='.:/usr/share/php') in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/classes/WNC_Mandrill.php on line 10
    • > PHP Warning
      Use of undefined constant WNC_REQUIRED_PHP_VERSION - assumed 'WNC_REQUIRED_PHP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/requirements-error.php on line 5
    • > PHP Warning
      Use of undefined constant WNC_REQUIRED_WP_VERSION - assumed 'WNC_REQUIRED_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/requirements-error.php on line 9
    • > PHP Warning
      require_once(WNC_CLASSESMandrill/Mandrill.php): failed to open stream: No such file or directory in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/classes/WNC_Mandrill.php on line 10
    • > PHP Notice
      Undefined variable: viewmodel in wp-content/plugins/mailpoet-wysija-mandrill-spam-and-bounce-cleaner/views/WNC_Mandrill_Cleaner/wnc_settings.view.php on line 22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: There are too many tags (32 tag instead of maximum 10)
You can look at the official readme.txt

mailpoet-wysija-mandrill-spam-and-bounce-cleaner/index.php 77% from 13 tests

"MailPoet Newsletters - Mandrill Spam and Bounce Cleaner" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • 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
  • Main file name: Name the main plugin file the same as the plugin slug ("mailpoet-wysija-mandrill-spam-and-bounce-cleaner.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 257 characters long)

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
No dangerous file extensions were detected11,557 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript62,2357,2768,541
PHP396162,1151,861
CSS345531,153
Markdown1002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity3.73
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods174
▷ Static methods10.57%
▷ Public methods17298.85%
▷ Protected methods10.57%
▷ Private methods10.57%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
css/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
css/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
css/images/ui-icons_2e83ff_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%