78% custom-sidebars

Code Review | Custom Sidebars - Dynamic Sidebar Widget Area Manager

WordPress plugin Custom Sidebars - Dynamic Sidebar Widget Area Manager scored78%from 54 tests.

About plugin

  • Plugin page: custom-sidebars
  • Plugin version: 3.36
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 23, 2010
  • Latest release: Aug 10, 2023
  • Number of updates: 366
  • Update frequency: every 12.9 days
  • Top authors: iworks (38.52%)marquex (24.32%)WPMUDEV (23.77%)jdailey (7.1%)WebFactory (6.56%)

Code review

54 tests

User reviews

1027 reviews

Install metrics

100,000+ active /4,900,864 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
Installer ran successfully

Server metrics [RAM: ▲0.55MB] [CPU: ▲0.52ms] Passed 4 tests

This is a short check of server-side resources used by Custom Sidebars - Dynamic Sidebar Widget Area Manager
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8547.11 ▲5.28
Dashboard /wp-admin3.33 ▲0.0243.37 ▼8.43
Posts /wp-admin/edit.php4.71 ▲1.3663.12 ▲8.24
Add New Post /wp-admin/post-new.php7.20 ▲1.32101.47 ▲6.59
Media Library /wp-admin/upload.php3.25 ▲0.0234.19 ▼1.38

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Sidebars - Dynamic Sidebar Widget Area Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲4813.19 ▼1.351.60 ▼0.7540.64 ▼3.85
Dashboard /wp-admin2,219 ▲315.84 ▲0.98109.03 ▲1.5450.08 ▲8.54
Posts /wp-admin/edit.php2,257 ▲1652.54 ▲0.5745.90 ▲4.3143.04 ▲6.77
Add New Post /wp-admin/post-new.php6,269 ▲4,75021.97 ▼1.19902.21 ▲210.3639.77 ▼13.26
Media Library /wp-admin/upload.php1,398 ▲194.22 ▼0.02101.25 ▲1.2047.86 ▲1.73

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 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • cs_modifiable

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/custom-sidebars/inc/external/wpmu-lib/view/list.php
  • 37× 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 add_action() in wp-content/plugins/custom-sidebars/inc/integrations/class-custom-sidebars-integration-wpml.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CustomSidebarsExport' not found in wp-content/plugins/custom-sidebars/views/import.php:8
    • > PHP Notice
      Undefined variable: items in wp-content/plugins/custom-sidebars/inc/external/wpmu-lib/view/list.php on line 48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/custom-sidebars/inc/external/wpmu-lib/view/pointer.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'TheLib' not found in wp-content/plugins/custom-sidebars/inc/external/wpmu-lib/inc/class-thelib-array.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/custom-sidebars/views/widgets-editor.php:12
    • > PHP Warning
      require_once(CSB_INC_DIRclass-custom-sidebars-widgets.php): failed to open stream: No such file or directory in wp-content/plugins/custom-sidebars/inc/class-custom-sidebars.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'CustomSidebars' not found in wp-content/plugins/custom-sidebars/views/quick-edit.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/custom-sidebars/customsidebars.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'TheLib' not found in wp-content/plugins/custom-sidebars/inc/external/wpmu-lib/inc/class-thelib-updates.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: custom widget area, footer, manage sidebars, custom sidebar, flexible layout...

custom-sidebars/customsidebars.php 92% from 13 tests

The main file in "Custom Sidebars - Dynamic Sidebar Widget Area Manager" v. 3.36 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("custom-sidebars.php" instead of "customsidebars.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected29,110 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
CSS251,75538710,870
PHP371,3013,8339,222
JavaScript162,1252,3018,323
SVG100640
Markdown116055

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 142)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity62.28
▷ Minimum class complexity1.00
▷ Maximum class complexity245.00
Average method complexity5.90
▷ Minimum method complexity1.00
▷ Maximum method complexity142.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes28.00%
▷ Concrete classes2392.00%
▷ Final classes00.00%
Methods316
▷ Static methods5718.04%
▷ Public methods20765.51%
▷ Protected methods4213.29%
▷ Private methods6721.20%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants50
▷ Global constants1530.00%
▷ Class constants3570.00%
▷ Public constants35100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
23 PNG files occupy 0.18MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/external/wpmu-lib/img/select2x2.png0.83KB0.77KB▼ 6.15%
inc/external/wpmu-lib/img/jquery-ui/ui-icons_A44_256x240.png4.44KB4.17KB▼ 6.02%
assets/img/heart.png1.38KB1.22KB▼ 11.95%
assets/img/devman.png13.12KB5.79KB▼ 55.84%
assets/img/wp-force-ssl.png23.38KB12.25KB▼ 47.59%