I’m wondering where the sidebar and widgets should be registered. There are 2 options, the first is that widgets and sidebars will be registered in the theme itself, and also the files that extend the standard widgets will be in the theme itself. Or the second option will all this be in the plugin, regardless of the theme ? Thank you.
The Widget/Sidebar area should be registered in the theme itself (that is the place where default WP widget should work fine).
But, if you will add some custom Widgets (let’s say Custom Video Widget) - that part must be in the plugin.
So, the area/space where the widgets will be visible - theme part.
Custom widgets - plugin.
I have registered the same widgets in terms of functionality as the standard ones: search, last posts, last comments and tags. Only the widgets design is completely different.
You are allowed to add custom CSS for default WP widgets directly in the theme style.css (and you must do that anyway) - to suit the style of theme but if you will create a new widgets (no matter what is functionality of the widget) you must do that via plugin - any widget registration must be in the plugin.