After finally getting at least some feedback to the original idea for my Google Summer of Code project, Widget Collections, I review it in this post.
I still stick to the initial problem: When changing themes the widget setup is often lost and at the moment there is no way to avoid reassigning widgets one by one to the new sidebars.
My original approach was to introduce a new WordPress core feature called „Widget Collections“. The idea was to be able to group widgets in collections and assign them to the sidebars in groups. These collections won’t be lost when the theme is changed, which would make it simple to reassign them. While collections might be useful to some users who often change their widget setups they would for most users just add complexity.
The new approach is all about not adding complexity to core while still enhancing the experience. It consists of two parts: An unobtrusive layout for the user to migrate the old sidebars and their widgets to the new and enhanced auto reassigning in the background.
WordPress will remember the old widget setup and the first time widgets.php is visited after a theme change the user will be prompted to migrate the old widgets. Here I have got two different ideas which need to be discussed: Either an overlay or own widgets-migrate page which fills the whole admin content wrap. This would contain a new interface: Old sidebars on the left, new on the right. Move widgets or whole sidebars from the left to a sidebar on the right for migration. The user can also ignore this page and move on to the old widgets.php and everything will be back to normal. The second way to do this would be to stick to the default interface and group widgets, which previously were assigned to the same sidebar, together in the inactive widgets area and still notify the user to reassign them this way.
The second part, enhancing auto assigning would require a mentor who is native with how WordPress handles widgets. I would need some support understanding the different widgets.php’s in core. The idea here is to auto reassign the widgets in the new interface and highlight them in some way so the user can just check if everything migrated to his appeal. This could be partly accomplished by matching the old sidebar ids and (english) names to the new. Many themes already use sidebar-1 sidebar-2 etc. Fuzzy string matching could be accomplished using the Levenshtein distance – PHP has a integrated function for this.
My initial idea of Widget Collections could still be used in a plugin and so in combination with the core changes described above would make everyone happy while only adding complexity for those who need the added functionality. This would be something I could work on after GSoC. The here proposed project also should start off as a plugin – at least until midterm. Depending on feedback I could work on core integration afterwards or refine the plugin for releasing it to github and the WordPress.org plugin repository.
Update: While this project did not make it into GSoC there is now work going on to enhance the WordPress widget experience: Read more.