78% metatrader-web-terminal

Code Review | MetaTrader Web Terminal

WordPress plugin MetaTrader Web Terminal scored 78% from 54 tests.

About plugin

  • Plugin page: metatrader-web-te...
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 6.3.1
  • First release: Apr 18, 2019
  • Latest release: Jul 26, 2021
  • Number of updates: 7
  • Update frequency: every 119.7 days
  • Top authors: mql5 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 9,366 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Analyzing server-side resources used by MetaTrader Web Terminal
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1243.88 ▲5.37
Dashboard /wp-admin3.41 ▲0.1144.57 ▼5.12
Posts /wp-admin/edit.php3.53 ▲0.1747.70 ▼4.76
Add New Post /wp-admin/post-new.php5.99 ▲0.1095.35 ▼12.14
Media Library /wp-admin/upload.php3.34 ▲0.1036.77 ▼3.34

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_metatrader_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

MetaTrader Web Terminal: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲11013.26 ▼1.125.03 ▲3.2335.98 ▼7.03
Dashboard /wp-admin2,208 ▲204.86 ▼1.04107.32 ▼2.1836.43 ▼7.07
Posts /wp-admin/edit.php2,094 ▲82.01 ▲0.0238.57 ▼1.4636.18 ▲2.14
Add New Post /wp-admin/post-new.php6,592 ▲5,07829.35 ▲11.85838.93 ▲151.8352.97 ▼4.80
Media Library /wp-admin/upload.php1,387 ▼14.28 ▲0.0896.79 ▼18.2641.65 ▼6.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_metatrader_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/metatrader-web-terminal/inc/class.metatrader.php
    • > /wp-content/plugins/metatrader-web-terminal/metatrader.php
    • > /wp-content/plugins/metatrader-web-terminal/inc/class.shortcode.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/metatrader-web-terminal/views/widget-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/metatrader-web-terminal/inc/class.widget.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: mt5, webterminal, trading, metatrader, mt4

metatrader-web-terminal/metatrader.php 85% from 13 tests

"MetaTrader Web Terminal" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("metatrader-web-terminal.php" instead of "metatrader.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected8,642 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
JSON5007,322
PHP77425616
JavaScript54230580
PO File1325398
Sass20012
SVG3007
HTML1004
CSS20113

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity14.75
▷ Minimum class complexity3.00
▷ Maximum class complexity39.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods312.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin