94% adminbar-drag-hide

Code Review | adminbar drag & hide

WordPress plugin adminbar drag & hide scored 94% from 54 tests.

About plugin

  • Plugin page: adminbar-drag-hide
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Feb 3, 2020
  • Latest release: Feb 4, 2020
  • Number of updates: 7
  • Update frequency: every 0.6 days
  • Top authors: finsaspa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 322 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼301.89ms] Passed 4 tests

An overview of server-side resources used by adminbar drag & hide
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.0958.12 ▲1.02
Dashboard /wp-admin3.47 ▲0.0637.35 ▲1.35
Posts /wp-admin/edit.php3.69 ▲0.0546.61 ▲4.74
Add New Post /wp-admin/post-new.php6.93 ▼0.05102.70 ▼1,214.65
Media Library /wp-admin/upload.php3.34 ▲0.0528.89 ▲5.04

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for adminbar drag & hide
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,962 ▲20815.94 ▲0.5612.46 ▲6.583.03 ▲0.34
Dashboard /wp-admin2,911 ▲575.98 ▼0.09115.01 ▼20.64187.19 ▲24.63
Posts /wp-admin/edit.php2,711 ▲173.10 ▼0.1365.20 ▼1.89145.41 ▼0.71
Add New Post /wp-admin/post-new.php1,674 ▲1315.94 ▼0.74470.09 ▲37.66180.63 ▼3.46
Media Library /wp-admin/upload.php1,716 ▲185.62 ▲0.10122.36 ▼22.15208.29 ▲21.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/adminbar-drag-hide/adminbar-drag-hide.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adminbar-drag-hide/include/user-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adminbar-drag-hide/include/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/adminbar-drag-hide/include/front-end.php:52

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

adminbar-drag-hide/adminbar-drag-hide.php 92% from 13 tests

"adminbar drag & hide" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin464 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP49727310
CSS1281140
JavaScript17014

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png0.61KB0.49KB▼ 19.16%
images/icon-big.png1.18KB0.73KB▼ 37.71%