84% admin-bar-position

Code Review | Admin Bar Position

WordPress plugin Admin Bar Position scored84%from 54 tests.

About plugin

  • Plugin page: admin-bar-position
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 23, 2016
  • Latest release: Apr 3, 2023
  • Number of updates: 13
  • Update frequency: every 197.5 days
  • Top authors: kanakogi (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

4,000+ active /25,758 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.10ms] Passed 4 tests

Analyzing server-side resources used by Admin Bar Position
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.90 ▲2.72
Dashboard /wp-admin3.32 ▲0.0142.15 ▼8.24
Posts /wp-admin/edit.php3.37 ▲0.0146.17 ▼0.79
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.64 ▼10.09
Media Library /wp-admin/upload.php3.24 ▲0.0135.73 ▲3.17

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Admin Bar Position
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲14513.64 ▼0.578.13 ▲6.4437.44 ▼2.54
Dashboard /wp-admin2,206 ▲544.87 ▼0.78113.31 ▲10.4742.30 ▼1.45
Posts /wp-admin/edit.php2,092 ▼02.05 ▲0.0440.44 ▲0.1034.95 ▼1.47
Add New Post /wp-admin/post-new.php1,542 ▲918.18 ▼5.04600.31 ▼23.9156.77 ▲5.92
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0394.62 ▼1.5041.04 ▼2.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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)
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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_theme_support() in wp-content/plugins/admin-bar-position/position-adminbar.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Requires at least: The plugin version is formatted incorrectly
You can look at the official readme.txt

admin-bar-position/position-adminbar.php 92% from 13 tests

The main file in "Admin Bar Position" v. 1.1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("admin-bar-position.php" instead of "position-adminbar.php")

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
Good job! No executable or dangerous file extensions detected51 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14932
JavaScript10219

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
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
There are no PNG files in this plugin