62% wp-my-admin-bar

Code Review | Wp My Admin Bar

WordPress plugin Wp My Admin Bar scored 62% from 54 tests.

About plugin

  • Plugin page: wp-my-admin-bar
  • Plugin version: 3.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.4
  • WordPress version: 5.9.2
  • First release: Mar 2, 2012
  • Latest release: Apr 12, 2020
  • Number of updates: 83
  • Update frequency: every 35.7 days
  • Top authors: tribalNerd (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 11,117 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: ▲4.61MB] [CPU: ▼274.93ms] Passed 4 tests

Analyzing server-side resources used by Wp My Admin Bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.45 ▲4.9374.88 ▲24.06
Dashboard /wp-admin8.47 ▲5.0655.75 ▲23.70
Posts /wp-admin/edit.php8.47 ▲4.8355.49 ▲19.98
Add New Post /wp-admin/post-new.php10.59 ▲3.62111.37 ▼1,166.67
Media Library /wp-admin/upload.php8.47 ▲5.1747.74 ▲23.28
WP My Admin Bar /wp-admin/options-general.php?page=wp-my-admin-bar8.4744.72
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius8.4743.73

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 217 new files
Database: no new tables, 5 new options
New WordPress options
fs_debug_mode
wp-my-admin-bar
fs_active_plugins
fs_accounts
fs_gdpr

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wp My Admin Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,941 ▲18715.75 ▲0.115.96 ▼0.062.95 ▲0.15
Dashboard /wp-admin2,998 ▲1376.06 ▼0.12118.94 ▼13.53174.59 ▲18.53
Posts /wp-admin/edit.php2,765 ▲713.26 ▲0.0264.29 ▲0.65156.75 ▲16.20
Add New Post /wp-admin/post-new.php1,772 ▲11122.62 ▲6.27449.66 ▲18.42155.11 ▲5.30
Media Library /wp-admin/upload.php1,806 ▲1055.55 ▲0.00140.75 ▲2.60205.84 ▲15.95
WP My Admin Bar /wp-admin/settings.php?page=wp-my-admin-bar260.940.0422.48
WP My Admin Bar /wp-admin/options-general.php?page=wp-my-admin-bar1,3522.4555.63164.90
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius1,4562.7455.78112.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wp-my-admin-bar/sdk/freemius/includes/class-freemius.php+8218
    Undefined property: stdClass::$plugins
  • Zombie WordPress options detected upon uninstall: 4 options
    • fs_gdpr
    • fs_accounts
    • fs_debug_mode
    • fs_active_plugins

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/ajax-loader.php
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php on line 6
    • > PHP Warning
      Use of undefined constant WPMYADMINBAR_FILE - assumed 'WPMYADMINBAR_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-my-admin-bar/sdk/wpmyadminbar-fs.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-my-admin-bar/sdk/freemius/templates/account/partials/addon.php on line 7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/settings.php?page=wp-my-admin-bar
    • > Network (severe)
    wp-admin/settings.php?page=wp-my-admin-bar - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

wp-my-admin-bar/wp-my-admin-bar.php 92% from 13 tests

The main PHP script in "Wp My Admin Bar" version 3.1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 216 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin49,162 lines of code in 164 files:
LanguageFilesBlank linesComment linesLines of code
PHP1337,53716,88031,386
PO File137,5319,16116,474
CSS1300889
JavaScript33459194
Markdown1610192
JSON10027

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,772)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity64.36
▷ Minimum class complexity1.00
▷ Maximum class complexity2,772.00
Average method complexity4.48
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces1
Interfaces0
Traits4
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes1322.41%
Methods1,198
▷ Static methods18115.11%
▷ Public methods84470.45%
▷ Protected methods151.25%
▷ Private methods33928.30%
Functions95
▷ Named functions95100.00%
▷ Anonymous functions00.00%
Constants128
▷ Global constants10380.47%
▷ Class constants2519.53%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
sdk/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
sdk/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
sdk/freemius/assets/img/wp-my-admin-bar.png29.27KB5.43KB▼ 81.46%