94% mt-game-server-status

Code Review | MT Game Server Status

WordPress plugin MT Game Server Status scored 94% from 54 tests.

About plugin

  • Plugin page: mt-game-server-st...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.4
  • WordPress version: 5.9.2
  • First release: May 14, 2017
  • Latest release: May 15, 2017
  • Number of updates: 17
  • Update frequency: every 0.1 days
  • Top authors: mitchbrooks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,133 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲1.14MB] [CPU: ▼292.21ms] Passed 4 tests

An overview of server-side resources used by MT Game Server Status
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3360.27 ▲0.68
Dashboard /wp-admin4.87 ▲1.4641.58 ▲4.61
Posts /wp-admin/edit.php5.07 ▲1.4347.92 ▲6.73
Add New Post /wp-admin/post-new.php8.32 ▲1.35142.01 ▼1,179.47
Media Library /wp-admin/upload.php4.75 ▲1.4634.38 ▲5.33
Servers /wp-admin/edit.php?post_type=servers4.7932.36
Add New /wp-admin/post-new.php?post_type=servers5.3056.95

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 443 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for MT Game Server Status
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲5915.13 ▼0.496.40 ▲0.242.43 ▲0.01
Dashboard /wp-admin2,940 ▲826.10 ▼0.10138.62 ▲2.41180.02 ▲7.88
Posts /wp-admin/edit.php2,732 ▲413.27 ▲0.0369.17 ▲3.74200.11 ▲52.64
Add New Post /wp-admin/post-new.php1,789 ▲10017.21 ▼3.55438.95 ▼14.22160.57 ▼70.97
Media Library /wp-admin/upload.php1,739 ▲415.56 ▲0.06144.40 ▼1.01192.69 ▼66.90
Servers /wp-admin/edit.php?post_type=servers1,4123.1769.74117.60
Add New /wp-admin/post-new.php?post_type=servers3,3619.91193.89229.95

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 117× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mt-game-server-status/cmb2/includes/helper-functions.php:111
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mt-game-server-status/templates/hooks.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/mt-game-server-status/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GameQ\\Filters\\Base' not found in wp-content/plugins/mt-game-server-status/GameQ/Filters/Test.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'GameQ\\Protocols\\Bf2' not found in wp-content/plugins/mt-game-server-status/GameQ/Protocols/Projectrealitybf2.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/mt-game-server-status/cmb2/includes/types/CMB2_Type_File_List.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GameQ\\Filters\\Base' not found in wp-content/plugins/mt-game-server-status/GameQ/Filters/Normalize.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/mt-game-server-status/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GameQ\\Protocols\\Source' not found in wp-content/plugins/mt-game-server-status/GameQ/Protocols/Aa3.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'GameQ\\Protocols\\Arma3' not found in wp-content/plugins/mt-game-server-status/GameQ/Protocols/Armedassault3.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
No tags were found

mt-game-server-status/game-server.php 92% from 13 tests

The entry point to "MT Game Server Status" version 1.0.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("mt-game-server-status.php" instead of "game-server.php")

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
There were no executable files found in this plugin45,098 lines of code in 294 files:
LanguageFilesBlank linesComment linesLines of code
PO File11912,73116,33829,151
PHP1432,9589,1839,216
CSS141,0021,0344,497
Sass13238251,149
JavaScript3172125697
Markdown21340388

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.27
▷ Minimum class complexity1.00
▷ Maximum class complexity145.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes146
▷ Abstract classes85.48%
▷ Concrete classes13894.52%
▷ Final classes00.00%
Methods491
▷ Static methods265.30%
▷ Public methods38177.60%
▷ Protected methods10721.79%
▷ Private methods30.61%
Functions54
▷ Named functions5092.59%
▷ Anonymous functions47.41%
Constants31
▷ Global constants39.68%
▷ Class constants2890.32%
▷ Public constants28100.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
14 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
cmb2/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
cmb2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%