84% remove-admin-bar-from-previews

Code Review | Remove Admin Bar from Previews

WordPress plugin Remove Admin Bar from Previews scored84%from 54 tests.

About plugin

  • Plugin page: remove-admin-bar-...
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.0
  • WordPress version: 6.3.1
  • First release: May 15, 2014
  • Latest release: Sep 2, 2014
  • Number of updates: 6
  • Update frequency: every 18.3 days
  • Top authors: morganestes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,332 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Remove Admin Bar from Previews
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0143.49 ▲1.97
Dashboard /wp-admin3.33 ▼0.0248.38 ▼17.19
Posts /wp-admin/edit.php3.38 ▲0.0245.42 ▼4.85
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.35 ▼15.30
Media Library /wp-admin/upload.php3.25 ▲0.0238.22 ▼1.13

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
abp_preview_settings
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Remove Admin Bar from Previews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.101.88 ▲0.0137.84 ▼5.90
Dashboard /wp-admin2,192 ▲175.59 ▲0.0393.83 ▼5.7341.84 ▲1.85
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0440.84 ▼1.4235.91 ▼0.36
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▼0.75691.10 ▼21.6956.19 ▲2.95
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0796.99 ▼29.6240.71 ▼12.09

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 were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× 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/remove-admin-bar-from-previews/remove-admin-bar-from-previews.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/remove-admin-bar-from-previews/inc/abp-notice-bar-template.php:11

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)
Everything seems fine, but this is not an exhaustive test

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
4 plugin tags: editor, preview, admin bar, posts

remove-admin-bar-from-previews/remove-admin-bar-from-previews.php Passed 13 tests

The main PHP script in "Remove Admin Bar from Previews" version 0.2.0 is automatically included on every request by WordPress
41 characters long description:
Removes the Admin Bar from Post Previews.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected99 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3164680
CSS10019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin