83% top-bar

Code Review | Top Bar

WordPress plugin Top Bar scored83%from 54 tests.

About plugin

  • Plugin page: top-bar
  • Plugin version: 3.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3
  • WordPress version: 6.3.1
  • First release: Dec 2, 2014
  • Latest release: Aug 28, 2023
  • Number of updates: 59
  • Update frequency: every 54.1 days
  • Top authors: spwebguy (100%)

Code review

54 tests

User reviews

41 reviews

Install metrics

20,000+ active /233,401 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by Top Bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0945.63 ▼4.24
Dashboard /wp-admin3.40 ▲0.1052.78 ▼4.16
Posts /wp-admin/edit.php3.45 ▲0.0949.36 ▼1.71
Add New Post /wp-admin/post-new.php5.98 ▲0.0987.92 ▼10.85
Media Library /wp-admin/upload.php3.33 ▲0.0939.69 ▼0.29

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Top Bar: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,055 ▲29413.45 ▼1.1614.37 ▲12.4855.11 ▲6.91
Dashboard /wp-admin2,213 ▲335.61 ▼0.0591.79 ▼3.7340.50 ▼3.09
Posts /wp-admin/edit.php2,118 ▲182.16 ▲0.1535.86 ▼5.2837.98 ▲0.02
Add New Post /wp-admin/post-new.php1,541 ▲1223.22 ▼0.22673.11 ▼35.5158.37 ▲3.27
Media Library /wp-admin/upload.php1,418 ▲184.18 ▲0.01105.21 ▼1.6353.93 ▲4.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 5× 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/top-bar/inc/topbar-text-domain.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/top-bar/inc/topbar-front-scripts.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/top-bar/inc/topbar-text-domain.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/top-bar/inc/topbar-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/top-bar/inc/topbar-admin-scripts.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
Please take inspiration from this readme.txt

top-bar/topbar.php 85% from 13 tests

The entry point to "Top Bar" version 3.0.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("top-bar.php" instead of "topbar.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 439 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 plugin810 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP54526349
JavaScript411760290
CSS3231160
SVG10011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/darko.png1.84KB2.02KB0.00%