77% custom-top-bar

Code Review | Custom top bar

WordPress plugin Custom top bar scored77%from 54 tests.

About plugin

  • Plugin page: custom-top-bar
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5
  • WordPress version: 6.3.1
  • First release: Sep 7, 2015
  • Latest release: Aug 14, 2020
  • Number of updates: 11
  • Update frequency: every 267.1 days
  • Top authors: sumanbiswas013 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /7,424 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▲3.61ms] Passed 4 tests

Analyzing server-side resources used by Custom top bar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0949.64 ▲0.05
Dashboard /wp-admin3.39 ▲0.0852.97 ▲3.28
Posts /wp-admin/edit.php3.48 ▲0.1257.40 ▲6.73
Add New Post /wp-admin/post-new.php5.97 ▲0.08104.32 ▲5.93
Media Library /wp-admin/upload.php3.30 ▲0.0840.90 ▲5.19
Top Bar Setting /wp-admin/edit.php?post_type=social-post&page=ctb_fallback_setting3.2944.31
Add New Social Link /wp-admin/post-new.php?post_type=social-post3.1640.04
Top Bar Section /wp-admin/edit.php?post_type=social-post3.3342.89

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Custom top bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲10713.35 ▼1.321.57 ▼0.3139.60 ▼8.60
Dashboard /wp-admin2,257 ▲695.05 ▲0.15108.39 ▲0.6541.47 ▲0.04
Posts /wp-admin/edit.php2,142 ▲532.31 ▲0.3539.95 ▼1.8036.63 ▲1.82
Add New Post /wp-admin/post-new.php1,563 ▲2618.48 ▼4.57588.69 ▼81.2335.53 ▼16.35
Media Library /wp-admin/upload.php1,433 ▲484.40 ▲0.23101.41 ▼0.8241.89 ▼2.02
Top Bar Setting /wp-admin/edit.php?post_type=social-post&page=ctb_fallback_setting1,1952.2451.6326.33
Add New Social Link /wp-admin/post-new.php?post_type=social-post1,6963.9368.9537.23
Top Bar Section /wp-admin/edit.php?post_type=social-post1,1032.2533.4030.51

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=social-post
    • > Notice in wp-content/plugins/custom-top-bar/top-bar.php+106
    Undefined index: social_link
    • > GET request to /wp-admin/post-new.php?post_type=social-post
    • > Warning in wp-content/plugins/custom-top-bar/top-bar.php+121
    Use of undefined constant ctb_do_thumb - assumed 'ctb_do_thumb' (this will throw an Error in a future version of PHP)

SRP 50% 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
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-top-bar/setting.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-top-bar/top_bar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-top-bar/top-bar.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: ""
  • License uri: Please fix this invalid url: ""
  • Screenshots: These screenshots lack descriptions #1, #2, #3 in custom-top-bar/assets to your readme.txt
Please take inspiration from this readme.txt

custom-top-bar/top-bar.php 92% from 13 tests

"Custom top bar" version 2.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-top-bar.php" instead of "top-bar.php")

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
Good job! No executable or dangerous file extensions detected352 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP44120270
CSS11182

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions12
▷ Named functions12100.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
No PNG files were detected