CRITICAL: Custom Sidebar Pro regression bug

Hello,

We have noticed a critical regression in the Custom Sidebars Pro plugin. The widget visibility class (class-custom-sidebars-visibility.php) performs expensive SQL queries for each registered widget without caching the results, causing the PHP process to timeout.

The solution is to set the $Loaded variable to true appropriately in admin_widget_button().

Attached you'll find a patch that resolves the issue. Please, deploy the bugfix to production as soon as possbile, as otherwise we are not able to access wp-admin/widgets.php at all.

diff -Naur custom-sidebars/inc/class-custom-sidebars-visibility.php custom-sidebars.2/inc/class-custom-sidebars-visibility.php
--- custom-sidebars/inc/class-custom-sidebars-visibility.php	2015-11-30 12:36:08.000000000 +0200
+++ custom-sidebars.2/inc/class-custom-sidebars-visibility.php	2016-05-04 10:17:19.000000000 +0300
@@ -163,6 +163,8 @@
 					unset( $tax_list[ $index ] );
 				}
 			}
+
+                        $Loaded = true;
 		}

 		$is_visible = ('1' == @$_POST['csb_visible'] ? 1 : 0);
@@ -1004,4 +1006,4 @@

 		return $data;
 	}
-};
\ No newline at end of file
+};

All the best,
Developers at Aste Helsinki Oy