84% sidebar-manager

Code Review | Lightweight Sidebar Manager

WordPress plugin Lightweight Sidebar Manager scored84%from 54 tests.

About plugin

  • Plugin page: sidebar-manager
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 26, 2017
  • Latest release: Aug 21, 2023
  • Number of updates: 28
  • Update frequency: every 78.1 days
  • Top authors: brainstormworg (64.29%)Nikschavan (25%)patilvikasj (17.86%)

Code review

54 tests

User reviews

17 reviews

Install metrics

100,000+ active /883,098 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.43MB] [CPU: ▼1.22ms] Passed 4 tests

An overview of server-side resources used by Lightweight Sidebar Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4442.69 ▼4.07
Dashboard /wp-admin3.77 ▲0.4648.95 ▲3.10
Posts /wp-admin/edit.php3.82 ▲0.4651.17 ▲4.45
Add New Post /wp-admin/post-new.php6.30 ▲0.4184.13 ▼4.40
Media Library /wp-admin/upload.php3.63 ▲0.3937.39 ▲0.48
Sidebars /wp-admin/edit.php?post_type=bsf-sidebar3.7339.42

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lightweight Sidebar Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.15 ▼1.071.67 ▼0.4641.49 ▼4.42
Dashboard /wp-admin2,207 ▲195.84 ▲0.95102.13 ▼18.5638.33 ▼9.83
Posts /wp-admin/edit.php2,096 ▲72.06 ▲0.0338.34 ▲2.4135.01 ▲2.30
Add New Post /wp-admin/post-new.php1,536 ▲323.36 ▲0.21670.69 ▼6.8256.19 ▲1.48
Media Library /wp-admin/upload.php1,392 ▲44.31 ▲0.1294.75 ▼5.1140.24 ▼6.69
Sidebars /wp-admin/edit.php?post_type=bsf-sidebar1,0651.9330.5729.66

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

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-sidebar.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-metabox.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-post-type.php:48
    • > PHP Warning
      Use of undefined constant BSF_SB_DIR - assumed 'BSF_SB_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-loader.php on line 58
    • > PHP Fatal error
      require_once(): Failed opening required 'BSF_SB_DIRclasses/modules/target-rule/class-bsf-sb-target-rules-fields.php' (include_path='.:/usr/share/php') in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-loader.php on line 58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-white-label.php:56
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sidebar-manager/classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:92
    • > PHP Warning
      require_once(BSF_SB_DIRclasses/modules/target-rule/class-bsf-sb-target-rules-fields.php): failed to open stream: No such file or directory in wp-content/plugins/sidebar-manager/classes/class-bsf-sb-loader.php on line 58

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: The official readme.txt might help

sidebar-manager/sidebar-manager.php 92% from 13 tests

The main file in "Lightweight Sidebar Manager" v. 1.1.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin6,914 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,2133064,627
PHP126191,0532,122
CSS6353162
JSON1103

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity41.80
▷ Minimum class complexity2.00
▷ Maximum class complexity250.00
Average method complexity4.64
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes440.00%
Methods107
▷ Static methods3128.97%
▷ Public methods8882.24%
▷ Protected methods00.00%
▷ Private methods1917.76%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected