56% wp-mailscout

Code Review | WP MailScout

WordPress plugin WP MailScout scored56%from 54 tests.

About plugin

  • Plugin page: wp-mailscout
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.0
  • WordPress version: 6.3.1
  • First release: Feb 13, 2019
  • Latest release: Feb 13, 2019
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: themesgrove (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /524 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.49ms] Passed 4 tests

This is a short check of server-side resources used by WP MailScout
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0548.05 ▲8.66
Dashboard /wp-admin3.38 ▲0.0752.52 ▲3.24
Posts /wp-admin/edit.php3.47 ▲0.1152.66 ▲0.26
Add New Post /wp-admin/post-new.php5.97 ▲0.0996.41 ▼10.20
Media Library /wp-admin/upload.php3.30 ▲0.0745.20 ▲10.05
About /wp-admin/admin.php?page=ms_about3.2639.79
Campaigns /wp-admin/admin.php?page=ms_campaigns3.2640.29
Installation /wp-admin/admin.php?page=ms_installation3.2638.54
Mail Accounts /wp-admin/admin.php?page=ms_mail_accounts3.2640.83
Help /wp-admin/admin.php?page=ms_help3.2636.00
Subscribers /wp-admin/admin.php?page=ms_subscribers3.2639.15
Dashboard /wp-admin/admin.php?page=mailscout_plugin3.2639.44
Settings /wp-admin/admin.php?page=ms_settings3.2638.31
New Campaign /wp-admin/admin.php?page=ms_campaign_form3.2839.56

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 601 new files
Database: 6 new tables, 7 new options
New tables
wp_ms_templates
wp_ms_mail_accounts
wp_ms_broadcasts
wp_ms_subscriber_groups
wp_ms_subscribers
wp_ms_campaign_messages
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
mailscout_db_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP MailScout
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲21814.77 ▲0.544.71 ▲2.8840.47 ▼10.96
Dashboard /wp-admin2,270 ▲796.26 ▲1.37122.34 ▲12.9343.00 ▼1.64
Posts /wp-admin/edit.php2,159 ▲673.08 ▲1.0445.79 ▲5.7536.92 ▲1.85
Add New Post /wp-admin/post-new.php1,572 ▲5223.96 ▲0.91682.28 ▼8.6936.23 ▼22.85
Media Library /wp-admin/upload.php1,455 ▲645.45 ▲1.24106.44 ▲1.2541.88 ▼2.70
About /wp-admin/admin.php?page=ms_about8463.0140.5460.58
Campaigns /wp-admin/admin.php?page=ms_campaigns9953.8253.3237.07
Installation /wp-admin/admin.php?page=ms_installation9663.8351.1747.91
Mail Accounts /wp-admin/admin.php?page=ms_mail_accounts1,0233.6659.3741.97
Help /wp-admin/admin.php?page=ms_help9753.2453.2929.81
Subscribers /wp-admin/admin.php?page=ms_subscribers1,0133.7759.2834.32
Dashboard /wp-admin/admin.php?page=mailscout_plugin9753.8254.1330.65
Settings /wp-admin/admin.php?page=ms_settings9433.9048.3235.70
New Campaign /wp-admin/admin.php?page=ms_campaign_form1,1545.5468.1030.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 6 tables
    • wp_ms_templates
    • wp_ms_campaign_messages
    • wp_ms_subscriber_groups
    • wp_ms_subscribers
    • wp_ms_mail_accounts
    • wp_ms_broadcasts
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • mailscout_db_version
    • widget_recent-posts
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=ms_help
    • > Error in wp-content/plugins/wp-mailscout/app/Services/Router.php+44
    Uncaught Exception: Invalid Request in wp-content/plugins/wp-mailscout/app/Services/Router.php:44
    Stack trace:
    #0 wp-content/plugins/wp-mailscout/app/MailScout.php(31): MS\Services\Router->callRoute()
    #1 wp-content/plugins/wp-mailscout/admin/class-mailscout-admin.php(402): MS\MailScout->run()
    #2 wp-includes/class-wp-hook.php(310): MailScout_Admin->request_handler()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin-ajax.php(188): do_action()
    #6 {main}
    thrown

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-mailscout/public/partials/plugin-mailscout-display.php
    • > /wp-content/plugins/wp-mailscout/public/partials/auth-code.php
  • 343× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-mailscout/vendor/monolog/monolog/tests/Monolog/Processor/PsrLogMessageProcessorTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\CredentialsLoader' not found in wp-content/plugins/wp-mailscout/vendor/google/auth/src/Credentials/UserRefreshCredentials.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-mailscout/vendor/monolog/monolog/tests/Monolog/Handler/SocketHandlerTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Raven_Client' not found in wp-content/plugins/wp-mailscout/vendor/monolog/monolog/tests/Monolog/Handler/MockRavenClient.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\CredentialsLoader' not found in wp-content/plugins/wp-mailscout/vendor/google/auth/src/Credentials/ServiceAccountJwtAccessCredentials.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\TestCase' not found in wp-content/plugins/wp-mailscout/vendor/monolog/monolog/tests/Monolog/Handler/MailHandlerTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Google_Collection' not found in wp-content/plugins/wp-mailscout/vendor/google/apiclient-services/src/Google/Service/Oauth2/Jwk.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/wp-mailscout/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/wp-mailscout/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Auth\\Tests\\BaseTest' not found in wp-content/plugins/wp-mailscout/vendor/google/auth/tests/HttpHandler/Guzzle6HttpHandlerTest.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=ms_help
    • > Network (severe)
    wp-admin/admin-ajax.php?action=ms_request&_nonce=463e7cc481&route=help%2Fget-campaign-message-list - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=ms_help
    • > Javascript (severe) in unknown
    /wp-content/plugins/wp-mailscout/admin/js/ms-help.js?ver=0.1.1 0:707 Uncaught TypeError: Cannot read properties of undefined (reading 'errors')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Requires php: The plugin version is formatted incorrectly
The official readme.txt might help

wp-mailscout/mailscout.php 85% from 13 tests

Analyzing the main PHP file in "WP MailScout" version 0.1.1
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-mailscout.php" instead of "mailscout.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin62,406 lines of code in 563 files:
LanguageFilesBlank linesComment linesLines of code
PHP49110,41030,22455,713
Markdown271,43804,672
JSON18001,210
CSS5015405
SVG100288
YAML28051
XML23035
JavaScript1624223
make1409

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 103)
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.77
▷ Minimum class complexity1.00
▷ Maximum class complexity627.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity103.00
Code structure
Namespaces46
Interfaces27
Traits8
Classes477
▷ Abstract classes112.31%
▷ Concrete classes46697.69%
▷ Final classes91.93%
Methods3,678
▷ Static methods1784.84%
▷ Public methods3,19086.73%
▷ Protected methods2125.76%
▷ Private methods2767.50%
Functions273
▷ Named functions7627.84%
▷ Anonymous functions19772.16%
Constants362
▷ Global constants246.63%
▷ Class constants33893.37%
▷ Public constants338100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.23MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/plugin-logo.png79.37KB26.24KB▼ 66.94%
public/images/plugin-logo.png75.23KB28.26KB▼ 62.44%
admin/images/upload.png4.09KB2.56KB▼ 37.31%
admin/images/gmail-logo.png3.24KB3.24KB0.00%
images/plugin-logo.png75.23KB28.26KB▼ 62.44%