83% swifty-bar

Code Review | Swifty Bar, sticky bar by WPGens

WordPress plugin Swifty Bar, sticky bar by WPGens scored83%from 54 tests.

About plugin

  • Plugin page: swifty-bar
  • Plugin version: 1.2.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 4, 2015
  • Latest release: Sep 10, 2023
  • Number of updates: 100
  • Update frequency: every 29.9 days
  • Top authors: Goran87 (100%)

Code review

54 tests

User reviews

48 reviews

Install metrics

800+ active /32,046 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.22MB] [CPU: ▼2.21ms] Passed 4 tests

Analyzing server-side resources used by Swifty Bar, sticky bar by WPGens
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.85 ▲1.391,011.88 ▲963.09
Dashboard /wp-admin3.54 ▲0.2448.51 ▼7.50
Posts /wp-admin/edit.php3.62 ▲0.2651.80 ▼1.70
Add New Post /wp-admin/post-new.php6.08 ▲0.2099.43 ▲0.74
Media Library /wp-admin/upload.php3.43 ▲0.2036.79 ▼0.39
Swifty Bar /wp-admin/options-general.php?page=sb_bar3.4245.18

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Swifty Bar, sticky bar by WPGens
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲13313.37 ▼0.9910.16 ▲8.3745.36 ▼0.47
Dashboard /wp-admin2,199 ▲195.58 ▼0.0891.42 ▲2.0343.23 ▲2.48
Posts /wp-admin/edit.php2,104 ▲71.96 ▼0.0340.82 ▲6.1236.29 ▲0.47
Add New Post /wp-admin/post-new.php1,531 ▲523.22 ▲0.12637.91 ▼57.7853.03 ▼3.29
Media Library /wp-admin/upload.php1,398 ▼24.22 ▲0.11100.14 ▼15.8647.85 ▲0.28
Swifty Bar /wp-admin/options-general.php?page=sb_bar1,2062.2741.6827.31

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'sb_bar_Admin' not found in wp-content/plugins/swifty-bar/admin/settings/class-sb-bar-enable-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_reset_query() in wp-content/plugins/swifty-bar/public/partials/sb-bar-public-display.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function flush_rewrite_rules() in wp-content/plugins/swifty-bar/admin/partials/sb-bar-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'sb_bar_Admin' not found in wp-content/plugins/swifty-bar/admin/settings/class-sb-bar-settings.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt is a good inspiration

swifty-bar/sb-bar.php 85% from 13 tests

Analyzing the main PHP file in "Swifty Bar, sticky bar by WPGens" version 1.2.11
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("swifty-bar.php" instead of "sb-bar.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 271 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin1,713 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP123366571,081
CSS22416455
JavaScript23336156
SVG10021

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity9.50
▷ Minimum class complexity1.00
▷ Maximum class complexity19.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods65
▷ Static methods00.00%
▷ Public methods5889.23%
▷ Protected methods00.00%
▷ Private methods710.77%
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
No PNG files were detected