78% sticky-topbar

Code Review | Sticky Topbar

WordPress plugin Sticky Topbar scored78%from 54 tests.

About plugin

  • Plugin page: sticky-topbar
  • Plugin version: 2.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.2.2
  • WordPress version: 6.3.1
  • First release: Jan 16, 2020
  • Latest release: Jan 26, 2020
  • Number of updates: 4
  • Update frequency: every 2.8 days
  • Top authors: anwerashif (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,324 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
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼2.23ms] Passed 4 tests

Analyzing server-side resources used by Sticky Topbar
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.1960.62 ▲16.83
Dashboard /wp-admin3.76 ▲0.2052.94 ▲1.42
Posts /wp-admin/edit.php3.87 ▲0.1951.97 ▼0.39
Add New Post /wp-admin/post-new.php6.36 ▲0.2189.07 ▼9.72
Media Library /wp-admin/upload.php3.68 ▲0.1940.24 ▼0.21
Sticky Topbar /wp-admin/options-general.php?page=topbar-options3.6644.95

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Sticky Topbar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7613.31 ▼1.007.85 ▲5.9658.82 ▲12.11
Dashboard /wp-admin2,235 ▲585.87 ▲0.21100.21 ▲6.4447.28 ▲3.52
Posts /wp-admin/edit.php2,142 ▲422.33 ▲0.2435.89 ▼1.7336.28 ▲1.53
Add New Post /wp-admin/post-new.php1,557 ▲1223.32 ▲0.10681.22 ▼3.6236.75 ▼24.18
Media Library /wp-admin/upload.php1,440 ▲404.53 ▲0.43110.16 ▼10.3449.88 ▼0.05
Sticky Topbar /wp-admin/options-general.php?page=topbar-options2,8292.6967.7841.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sticky-topbar/inc/css.php
  • 11× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: tcolor in wp-content/plugins/sticky-topbar/inc/css.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-topbar/sticky-topbar.php:13
    • > PHP Notice
      Undefined variable: bgcolor in wp-content/plugins/sticky-topbar/inc/css.php on line 11
    • > PHP Notice
      Undefined variable: t_height in wp-content/plugins/sticky-topbar/inc/css.php on line 12
    • > PHP Notice
      Undefined variable: hide_social_on_mob in wp-content/plugins/sticky-topbar/inc/css.php on line 21
    • > PHP Warning
      Use of undefined constant sticky_topbar_inc - assumed 'sticky_topbar_inc' (this will throw an Error in a future version of PHP) in wp-content/plugins/sticky-topbar/sticky-topbar.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sticky-topbar/inc/admin.php:10
    • > PHP Warning
      include(sticky_topbar_incadmin.php): failed to open stream: No such file or directory in wp-content/plugins/sticky-topbar/sticky-topbar.php on line 10
    • > PHP Notice
      Undefined variable: tcolor in wp-content/plugins/sticky-topbar/inc/css.php on line 13
    • > PHP Notice
      Undefined variable: font_size in wp-content/plugins/sticky-topbar/inc/css.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 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
6 plugin tags: alert message bar, social media icons, utility bar, notification bar, sticky topbar...

sticky-topbar/plugin.php 85% from 13 tests

Analyzing the main PHP file in "Sticky Topbar" version 2.0.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sticky-topbar.php" instead of "plugin.php")
  • Text Domain: Please use dashes and lowercase characters for text domains

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin6,154 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
SVG1002,671
CSS349282,647
PHP45448657
JavaScript34759179

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin