84% floating-admin-button

Code Review | Floating Admin Button

WordPress plugin Floating Admin Button scored84%from 54 tests.

About plugin

  • Plugin page: floating-admin-bu...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-5.8
  • WordPress version: 6.3.1
  • First release: Jul 6, 2015
  • Latest release: Jul 10, 2021
  • Number of updates: 25
  • Update frequency: every 87.8 days
  • Top authors: cageehv (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,776 total downloads

Benchmarks

Plugin footprint 83% from 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.01MB] [CPU: ▼2.56ms] Passed 4 tests

Server-side resources used by Floating Admin Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.47 ▲4.30
Dashboard /wp-admin3.32 ▲0.0246.46 ▼0.03
Posts /wp-admin/edit.php3.37 ▲0.0147.53 ▼0.63
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.17 ▼9.39
Media Library /wp-admin/upload.php3.24 ▲0.0134.45 ▼0.20
Floating Admin Button /wp-admin/options-general.php?page=fab_settings3.3130.34

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
fab_options

Browser metrics Passed 4 tests

An overview of browser requirements for Floating Admin Button
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,990 ▲22913.88 ▼0.6714.11 ▲12.6043.84 ▲2.02
Dashboard /wp-admin2,199 ▲195.60 ▼0.0191.15 ▲3.6340.10 ▼0.18
Posts /wp-admin/edit.php2,101 ▲11.97 ▼0.0438.22 ▲2.4939.42 ▲0.55
Add New Post /wp-admin/post-new.php1,530 ▲422.29 ▼1.46668.79 ▲15.5956.10 ▲7.47
Media Library /wp-admin/upload.php1,407 ▲104.14 ▼0.0693.56 ▼13.2745.68 ▲1.03
Floating Admin Button /wp-admin/options-general.php?page=fab_settings1,1572.0527.2643.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • fab_options
    • can_compress_scripts

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

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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/floating-admin-button/floating-admin-button.php:40

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)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: frontend, admin panel, jquery, tool, button...

floating-admin-button/floating-admin-button.php Passed 13 tests

The entry point to "Floating Admin Button" version 1.1.2 is a PHP file that has certain tags in its header comment area
84 characters long description:
On frontend pages this plugin shows a floating admin button instead of the admin bar

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected764 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP25594413
JavaScript42872172
PO File1202404113
CSS201266

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/wp_logo.png3.67KB2.15KB▼ 41.46%