84% multisite-admin-bar-switcher

Code Review | Multisite Admin Bar Switcher

WordPress plugin Multisite Admin Bar Switcher scored 84% from 54 tests.

About plugin

  • Plugin page: multisite-admin-b...
  • Plugin version: 1.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Feb 17, 2013
  • Latest release: Jun 17, 2020
  • Number of updates: 72
  • Update frequency: every 37.2 days
  • Top authors: flynsarmy (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active / 5,962 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Analyzing server-side resources used by Multisite Admin Bar Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1338.50 ▼1.32
Dashboard /wp-admin3.41 ▲0.1146.46 ▼2.64
Posts /wp-admin/edit.php3.52 ▲0.1751.99 ▲5.08
Add New Post /wp-admin/post-new.php5.99 ▲0.1194.38 ▲3.37
Media Library /wp-admin/upload.php3.33 ▲0.1136.18 ▲4.18

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Multisite Admin Bar Switcher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.36 ▼1.071.75 ▼0.3640.01 ▼3.93
Dashboard /wp-admin2,206 ▲184.81 ▼1.11115.24 ▲1.5143.56 ▲3.33
Posts /wp-admin/edit.php2,092 ▼02.16 ▲0.1540.61 ▲0.1736.57 ▲0.09
Add New Post /wp-admin/post-new.php1,514 ▼1917.66 ▼5.57683.96 ▲48.2564.02 ▲1.87
Media Library /wp-admin/upload.php1,391 ▲34.17 ▼0.0094.68 ▼5.6542.72 ▲0.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

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
Good news, no errors were detected

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
The following issues need your attention
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/class-wp-admin-bar.php' (include_path='.:/usr/share/php') in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Warning
      require_once(ABSPATHWPINC/class-wp-admin-bar.php): failed to open stream: No such file or directory in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/multisite-admin-bar-switcher/partials/network-admin/settings.php:9
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Warning
      require_once(ABSPATHWPINC/class-wp-admin-bar.php): failed to open stream: No such file or directory in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/class-wp-admin-bar.php' (include_path='.:/usr/share/php') in wp-content/plugins/multisite-admin-bar-switcher/mabs_admin_bar.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: multisite, wpmu, switcher, toolbar, switch...

multisite-admin-bar-switcher/multisite-admin-bar-switcher.php Passed 13 tests

Analyzing the main PHP file in "Multisite Admin Bar Switcher" version 1.4.0
70 characters long description:
Replaces the built in 'My Sites' drop down with a better layed out one

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected563 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP390176445
CSS110066
JavaScript16228
Markdown17013
JSON10011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity25.00
▷ Minimum class complexity25.00
▷ Maximum class complexity25.00
Average method complexity13.00
▷ Minimum method complexity6.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions1359.09%
▷ Anonymous functions940.91%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png38.91KB11.85KB▼ 69.55%