Kwayy HTML Sitemap permissions bug
-
We have this plugin installed on a multisite install of WordPress, but only activated on one site so far.
When a user who is not a multisite super-admin, and has a role of Editor tried to login after activating the plug, she saw a white screen and we found this error message in the log:
PHP Fatal error: Call to undefined function get_current_user_role() in /home/wpbarnha/public_html/wp-content/plugins/kwayy-html-sitemap/kwayy-html-sitemap.php on line 103
Here is the code that is failing in your plugin file:
}elseif(is_multisite() && !is_super_admin()){ $theRoles = get_option('global-admin-bar-roles'); if(!is_array($theRoles)){$theRoles = array();} if(!in_array(get_current_user_role(),$theRoles)){ add_options_page( 'Kwayy HTML Sitemap Options', 'Kwayy HTML Sitemap Options','manage_options', 'kwayyhs', 'kwayyhs_page' ); }
I think the function
get_current_user_role
ought to be defined by the time this is called, based on my limited knowledge of the load order, but it’s not.As a temporary fix, we commented out the inner if-statement, so that the menu option always loads. That’s not a problem for this site, but it will be overwritten if the plugin is updated, and it’s not a long-term solution.
(We also have the s2Member Pro plugin installed, which may be causing a conflict.)
Can anyone shed any light on this issue?
https://www.ads-software.com/extend/plugins/kwayy-html-sitemap/
- The topic ‘Kwayy HTML Sitemap permissions bug’ is closed to new replies.