71% mailplatform

Code Review | MailPlatform

WordPress plugin MailPlatform scored71%from 54 tests.

About plugin

  • Plugin page: mailplatform
  • Plugin version: 1.4.8-1...
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 18, 2015
  • Latest release: Nov 9, 2015
  • Number of updates: 15
  • Update frequency: every 5.9 days
  • Top authors: Mailplatform (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,052 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼3.44ms] Passed 4 tests

This is a short check of server-side resources used by MailPlatform
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.89 ▼2.28
Dashboard /wp-admin3.42 ▲0.1148.66 ▼5.27
Posts /wp-admin/edit.php3.53 ▲0.1748.91 ▲1.57
Add New Post /wp-admin/post-new.php6.00 ▲0.1192.90 ▼7.69
Media Library /wp-admin/upload.php3.34 ▲0.1136.47 ▲1.49
List Overview /wp-admin/admin.php?page=mailplatform-list-options3.4042.68
API Settings /wp-admin/admin.php?page=mailplatform&type=settings3.4034.97
XML Feed Settings /wp-admin/admin.php?page=mailplatform&type=feeds3.4334.14

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 56 new files
Database: 1 new table, 8 new options
New tables
wp_mailplatform
New WordPress options
widget_recent-comments
jal_db_version
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_mailplatform_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for MailPlatform
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6314.26 ▼0.131.71 ▼0.1636.53 ▼7.40
Dashboard /wp-admin2,230 ▲535.62 ▼0.0394.60 ▲4.5440.69 ▼3.12
Posts /wp-admin/edit.php2,139 ▲422.20 ▲0.2239.58 ▼0.0135.10 ▼0.10
Add New Post /wp-admin/post-new.php1,564 ▲2825.10 ▲1.91619.81 ▼17.6660.43 ▲8.62
Media Library /wp-admin/upload.php1,435 ▲354.17 ▲0.0698.51 ▲2.0440.69 ▼1.55
List Overview /wp-admin/admin.php?page=mailplatform-list-options9371.9230.1662.58
API Settings /wp-admin/admin.php?page=mailplatform&type=settings9431.7728.2833.63
XML Feed Settings /wp-admin/admin.php?page=mailplatform&type=feeds9781.8927.5736.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • jal_db_version
    • can_compress_scripts
    • widget_mailplatform_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=mailplatform-list-options
    • > Notice in wp-content/plugins/mailplatform/mailplatform.views.php+9
    Undefined index: type
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailplatform&type=settings
    • > Notice in wp-content/plugins/mailplatform/mailplatform.views.php+52
    Undefined variable: success_text
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailplatform&type=settings
    • > Notice in wp-content/plugins/mailplatform/mailplatform.views.php+54
    Undefined variable: _SESSION
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailplatform&type=feeds
    • > Notice in wp-content/plugins/mailplatform/mailplatform.views.php+143
    Undefined variable: sidebarBox
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailplatform&type=feeds
    • > Notice in wp-content/plugins/mailplatform/wraps/feed-settings.php+110
    Trying to get property 'term_id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mailplatform&type=feeds
    • > Notice in wp-content/plugins/mailplatform/wraps/feed-settings.php+110
    Trying to get property 'name' of non-object

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
  • 17× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/mailplatform/__MACOSX/._mailplatform.widget.php
    • > /wp-content/plugins/mailplatform/__MACOSX/._mailplatform.php
    • > /wp-content/plugins/mailplatform/__MACOSX/feeds/._woocommerce-feed.php
    • > /wp-content/plugins/mailplatform/__MACOSX/_inc/._feed-functions.php
    • > /wp-content/plugins/mailplatform/__MACOSX/wraps/._list.php
    • > /wp-content/plugins/mailplatform/__MACOSX/._class.list-table.php
    • > /wp-content/plugins/mailplatform/__MACOSX/feeds/._feed-header.php
    • > /wp-content/plugins/mailplatform/__MACOSX/._mailplatform.views.php
    • > /wp-content/plugins/mailplatform/__MACOSX/wraps/._delete.php
    • > /wp-content/plugins/mailplatform/__MACOSX/wraps/._edit.php
  • 20× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require_once(mailplatform__PLUGIN_DIR_inc/feed-functions.php): failed to open stream: No such file or directory in wp-content/plugins/mailplatform/feeds/feed-header.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mailplatform/feeds/pages-feed.php:7
    • > PHP Warning
      Use of undefined constant mailplatform__PLUGIN_DIR - assumed 'mailplatform__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mailplatform/feeds/feed-header.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/mailplatform/mailplatform.php:14
    • > PHP Fatal error
      require_once(): Failed opening required 'mailplatform__PLUGIN_DIR_inc/feed-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/mailplatform/wraps/feed-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/mailplatform/wraps/edit.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/mailplatform/feeds/woocommerce-feed.php:7
    • > PHP Warning
      Use of undefined constant mailplatform__PLUGIN_DIR - assumed 'mailplatform__PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/mailplatform/wraps/feed-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function redirect() in wp-content/plugins/mailplatform/wraps/delete.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function mailplatform_xmlrequest() in wp-content/plugins/mailplatform/wraps/list.php:5

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)
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Requires at least: Invalid plugin version format
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === mailplatform === )
  • Tested up to: Invalid plugin version format
The official readme.txt is a good inspiration

mailplatform/mailplatform.php 85% from 13 tests

The primary PHP file in "MailPlatform" version 1.4.8-1... is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 153 characters long)
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "1.4.8-1...")

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
Good job! No executable or dangerous file extensions detected2,371 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP162761141,260
CSS100510
LESS1850465
JavaScript1320110
Markdown111026

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity8.00
▷ Minimum class complexity5.00
▷ Maximum class complexity10.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
8 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) __MACOSX/content/._arrow.png0.22KB0.00KB▼ 100.00%
(invalid) __MACOSX/content/._unchecked_checkbox.png0.22KB0.00KB▼ 100.00%
content/mailplatform-logo.png16.87KB6.18KB▼ 63.34%
content/arrow.png0.82KB0.91KB0.00%
content/checked_checkbox.png12.97KB7.30KB▼ 43.67%