File classes/class-dw-admin.php, line #355.
BB_Power_Dashboard_Admin::get_current_role() method modifies global WordPress variable $current_user (removes a role from it) without having a reason for that.
Take attention that $current_user is used by many other plugins and WordPress core itself. $user here contains a reference to a global $current_user. You should work with copy of $user->roles array at your method, do not send it to unshift() directly.
I suggest you replace:
$user = wp_get_current_user();
$roles = array_shift( $user->roles );
with
$user = wp_get_current_user();
$roles = $user->roles;
$roles = array_shift( $roles );
This way you leave $current_user->roles array unchanged. Original code removes a role from it, so my plugin can not apply access rule set for that role, as current user does have it after your intervention.
Pay attention on init_hooks(), line #131:
if ( ! is_admin() && ! class_exists( 'FLBuilder' ) ) {
return;
}
Your code tries to set action with FLBuilder::register_layout_styles_scripts even when FLBilder does not exist, but user open wp-admin/index.php
I think you have to use logic OR operator here instead of AND:
if ( ! is_admin() || ! class_exists( 'FLBuilder' ) ) {