61% wp-topbar

Code Review | WP-TopBar

WordPress plugin WP-TopBar scored 61% from 54 tests.

About plugin

  • Plugin page: wp-topbar
  • Plugin version: 5.36
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.7
  • WordPress version: 5.9.2
  • First release: Sep 25, 2011
  • Latest release: Jan 7, 2017
  • Number of updates: 317
  • Update frequency: every 6.9 days
  • Top authors: rfgoetz (100%)

Code review

54 tests

User reviews

39 reviews

Install metrics

1,000+ active / 112,696 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.25MB] [CPU: ▼288.18ms] Passed 4 tests

This is a short check of server-side resources used by WP-TopBar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2460.80 ▲8.07
Dashboard /wp-admin3.71 ▲0.3036.13 ▲0.65
Posts /wp-admin/edit.php3.93 ▲0.2939.72 ▲0.78
Add New Post /wp-admin/post-new.php7.17 ▲0.2097.21 ▼1,156.38
Media Library /wp-admin/upload.php3.59 ▲0.2924.82 ▲2.22

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 171 new files
Database: 1 new table, 2 new options
New tables
wp_wp_topbar_data
New WordPress options
wptb_db_version
wptb_global_options

Browser metrics Passed 4 tests

A check of browser resources used by WP-TopBar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,963 ▲21016.17 ▲1.088.72 ▲2.352.86 ▲0.43
Dashboard /wp-admin2,950 ▲966.22 ▲0.06117.91 ▼28.32178.80 ▲11.56
Posts /wp-admin/edit.php2,744 ▲503.05 ▼0.3166.80 ▲1.39157.37 ▲12.69
Add New Post /wp-admin/post-new.php1,698 ▲3722.05 ▲5.25390.72 ▼14.51186.45 ▲29.23
Media Library /wp-admin/upload.php1,756 ▲585.49 ▼0.04123.46 ▼19.34197.62 ▲11.49
Global Settings /wp-admin/wp-topbar.php&action=globalsettings260.940.0419.76
FAQ /wp-admin/wp-topbar.php&action=mainfaq260.940.0314.82
Export Options /wp-admin/wp-topbar.php&action=export260.940.0714.88
Test Priority /wp-admin/wp-topbar.php&action=testpriority260.940.0314.77
Close Button /wp-admin/wp-topbar.php&action=bulkclosebutton260.940.0514.50
All TopBars /wp-admin/wp-topbar.php&action=table260.940.0414.99
WP TopBar /wp-admin/wp-topbar.php260.940.0415.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_wp_topbar_data
  • This plugin did not uninstall successfully, leaving 2 options in the database
    • wptb_global_options
    • wptb_db_version

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-topbar/lib/SAMPLE_wptb_custom_default_values.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/wp-topbar/wp-topbar.php:42

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/wp-topbar.php&action=globalsettings
    • > Network (severe)
    wp-admin/wp-topbar.php&action=globalsettings - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/wp-topbar.php&action=mainfaq
    • > Network (severe)
    wp-admin/wp-topbar.php&action=mainfaq - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/wp-topbar.php&action=export
    • > Network (severe)
    wp-admin/wp-topbar.php&action=export - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/wp-topbar.php&action=testpriority
    • > Network (severe)
    wp-admin/wp-topbar.php&action=testpriority - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/wp-topbar.php&action=bulkclosebutton
    • > Network (severe)
    wp-admin/wp-topbar.php&action=bulkclosebutton - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/wp-topbar.php&action=table
    • > Network (severe)
    wp-admin/wp-topbar.php&action=table - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/wp-topbar.php
    • > Network (severe)
    wp-admin/wp-topbar.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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 need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is how it will look on your website), #2 (All TopBars Screen), #3 (Sample TopBar Screen), #4 (Export Options Screen), #5 (Main Options Screen for a single TopBar)
  • Tags: You are using too many tags: 19 tag instead of maximum 10
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-topbar === )
Please take inspiration from this readme.txt

wp-topbar/wp-topbar.php 92% from 13 tests

The main PHP file in "WP-TopBar" ver. 5.36 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 171 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin15,414 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP231,5525316,279
PO File52,1904,3165,665
JavaScript104745083,350
SVG10078
CSS5141241
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity167.00
▷ Minimum class complexity167.00
▷ Maximum class complexity167.00
Average method complexity7.38
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods2596.15%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions59
▷ Named functions59100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
106 PNG files occupy 1.57MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/samples/filmstrip.png10.47KB4.90KB▼ 53.21%
lib/icons/PNG/delicious.png3.23KB2.64KB▼ 18.11%
lib/icons/PNG/google.png5.44KB2.96KB▼ 45.57%
lib/icons/PNG/deviantart.png4.47KB2.88KB▼ 35.53%
lib/samples/blue_clouds.png16.71KB6.04KB▼ 63.88%