87% server-info

Code Review | Server Info

WordPress plugin Server Info scored 87% from 54 tests.

About plugin

  • Plugin page: server-info
  • Plugin version: 2.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 5.8.1
  • First release: Mar 2, 2016
  • Latest release: Mar 26, 2021
  • Number of updates: 27
  • Update frequency: every 68.5 days
  • Top authors: usmanaliqureshi (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

5,000+ active / 43,237 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼145.85ms] Passed 4 tests

This is a short check of server-side resources used by Server Info
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1633.57 ▲12.05
Dashboard /wp-admin3.15 ▲0.1037.23 ▼6.42
Posts /wp-admin/edit.php3.20 ▲0.1041.91 ▼0.34
Add New Post /wp-admin/post-new.php5.73 ▲0.3079.54 ▼571.16
Media Library /wp-admin/upload.php3.11 ▲0.1131.31 ▼5.48
Server Info /wp-admin/options-general.php?page=server_info_display3.0535.39

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 208 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Server Info
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,840 ▲24416.15 ▲0.559.53 ▼1.2350.22 ▲1.66
Dashboard /wp-admin3,101 ▲1705.94 ▲0.00148.18 ▲5.99133.05 ▲24.22
Posts /wp-admin/edit.php2,730 ▼92.60 ▼0.1263.68 ▲2.4289.83 ▲3.40
Add New Post /wp-admin/post-new.php2,066 ▲38319.44 ▲0.91385.01 ▲29.62115.18 ▲6.58
Media Library /wp-admin/upload.php1,744 ▼665.01 ▼0.01142.58 ▲1.30120.93 ▼1.07
Server Info /wp-admin/options-general.php?page=server_info_display1,3692.0951.52127.68

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

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
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 5× PHP files output text when accessed directly:
    • > /wp-content/plugins/server-info/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/server-info/index.php
    • > /wp-content/plugins/server-info/functions.php
    • > /wp-content/plugins/server-info/classes/classes.php
    • > /wp-content/plugins/server-info/actions/actions.php
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/server-info/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/server-info/freemius/templates/partials/network-activation.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: widget, dashboard, operating system, wordpress, version...

server-info/index.php 77% from 13 tests

"Server Info" version 2.5.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 325 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("server-info.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin41,546 lines of code in 162 files:
LanguageFilesBlank linesComment linesLines of code
PHP1086,45414,55026,438
PO File105,5506,66712,010
Sass28399772,515
JavaScript45499301
Markdown1610192
CSS1176090

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,360)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity73.78
▷ Minimum class complexity1.00
▷ Maximum class complexity2,360.00
Average method complexity4.28
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes24.35%
▷ Concrete classes4495.65%
▷ Final classes00.00%
Methods1,051
▷ Static methods17116.27%
▷ Public methods73770.12%
▷ Protected methods151.43%
▷ Private methods29928.45%
Functions91
▷ Named functions91100.00%
▷ Anonymous functions00.00%
Constants117
▷ Global constants9782.91%
▷ Class constants2017.09%
▷ Public constants20100.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
4 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
screenshot-2.png86.97KB32.79KB▼ 62.29%
screenshot-1.png17.78KB6.95KB▼ 60.94%