72% sidebar-manager-light

Code Review | Sidebar Manager Light

WordPress plugin Sidebar Manager Light scored 72% from 54 tests.

About plugin

  • Plugin page: sidebar-manager-l...
  • Plugin version: 1.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 6.3.1
  • First release: Aug 24, 2012
  • Latest release: Mar 4, 2022
  • Number of updates: 51
  • Update frequency: every 68.2 days
  • Top authors: OTWthemes (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

1,000+ active / 69,115 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.53MB] [CPU: ▲1.53ms] Passed 4 tests

This is a short check of server-side resources used by Sidebar Manager Light
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5646.63 ▲3.85
Dashboard /wp-admin3.87 ▲0.5750.81 ▲1.71
Posts /wp-admin/edit.php3.92 ▲0.5749.56 ▲5.81
Add New Post /wp-admin/post-new.php6.39 ▲0.5188.85 ▼2.31
Media Library /wp-admin/upload.php3.73 ▲0.5140.16 ▲2.85
License Manager /wp-admin/admin.php?page=otw-sml-lm3.77258.05
Plugin Options /wp-admin/admin.php?page=otw-sml-options3.7039.06
Manage widget /wp-admin/admin.php?page=otw-sml-action3.7137.30
otwfcr /wp-admin/admin.php?page=otwfcr3.7036.93
Add Sidebar /wp-admin/admin.php?page=otw-sml-add3.8037.28
Sidebars /wp-admin/admin.php?page=otw-sml3.7138.72

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

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

Browser metrics Passed 4 tests

Sidebar Manager Light: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲8713.79 ▼0.561.95 ▼0.2242.80 ▼1.05
Dashboard /wp-admin2,231 ▲464.94 ▼0.9696.62 ▼19.2681.78 ▲33.93
Posts /wp-admin/edit.php2,134 ▲422.00 ▲0.0135.90 ▼1.6234.70 ▼3.06
Add New Post /wp-admin/post-new.php1,442 ▼9220.21 ▼2.92709.48 ▼70.2862.74 ▼12.19
Media Library /wp-admin/upload.php1,430 ▲424.21 ▲0.0595.37 ▼21.5586.64 ▲36.27
License Manager /wp-admin/admin.php?page=otw-sml-lm9452.0324.6424.33
Plugin Options /wp-admin/admin.php?page=otw-sml-options9042.1724.7138.01
Manage widget /wp-admin/admin.php?page=otw-sml-action6991.536.6816.26
otwfcr /wp-admin/admin.php?page=otwfcr8032.0224.2519.96
Add Sidebar /wp-admin/admin.php?page=otw-sml-add1,7982.1339.5835.93
Sidebars /wp-admin/admin.php?page=otw-sml8602.0125.7530.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • otw_widget_settings
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=otw-sml-add
    • > POST request to /wp-admin/admin-ajax.php?action=otw_sml_items_by_type
    • > Notice in wp-content/plugins/sidebar-manager-light/include/otw_sbm_items_by_type.php+272
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/sidebar-manager-light/include/otw_components/otw_factory/views/action_message.php
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sidebar-manager-light/include/otw_list_sidebars.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otw_get() in wp-content/plugins/sidebar-manager-light/include/otw_sidebar_action.php:17
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/sidebar-manager-light/include/otw_components/otw_factory/views/license_manager.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sidebar-manager-light/include/otw_sbm_items_by_type.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/sidebar-manager-light/include/otw_functions.php:210
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sidebar-manager-light/include/otw_labels/otw_sml_factory_object.labels.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/sidebar-manager-light/include/otw_sidebar_info.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/sidebar-manager-light/otw_sidebar_manager.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sidebar-manager-light/include/otw_sidebar_options.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'OTW_Component' not found in wp-content/plugins/sidebar-manager-light/include/otw_components/otw_factory/otw_factory.class.php:2

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 93% from 29 tests

readme.txt 94% 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:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Create a custom sidebar(widget area), replace existing sidebar, select pages to display the new custom sidebar), #2 (Go to your widgets section (Appearance -> Widgets) and drop some widgets in your new sidebar)
Please take inspiration from this readme.txt

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

The primary PHP file in "Sidebar Manager Light" version 1.18 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sidebar-manager-light.php" instead of "otw_sidebar_manager.php")

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 plugin10,034 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP181,1093494,282
CSS42112,751
SVG1002,671
JavaScript1801330

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.70
Average class complexity148.50
▷ Minimum class complexity104.00
▷ Maximum class complexity193.00
Average method complexity8.76
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3181.58%
▷ Protected methods00.00%
▷ Private methods718.42%
Functions65
▷ Named functions65100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.20MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/swm-notselected.png3.76KB0.21KB▼ 94.34%
images/application_side_boxes.png0.47KB0.46KB▼ 1.45%
screenshot-1.png131.59KB42.61KB▼ 67.62%
images/swm-selected.png3.81KB0.25KB▼ 93.36%
images/otw-sbm-icon.png0.13KB0.14KB0.00%