Code Change Suggestion
-
Hi there,
I’ve got a bit of a suggestion that I would like to give. Recently I encountered an issue with WP Ultimate CSV Importer. I’m logged in as an administrator but I can’t access the importer and an error message would show that says “Sorry, you are not allowed to access this page”. After checking the plugin code I found out that it checks whether the user is logged in and its role in index 0 is administrator. Upon checking with my admin roles; the user role did not start on 0 rather it started on index 12 https://prnt.sc/tXcXZ8jCpO1W.
My suggestion is that, on line 109 and 493 of file wp-ultimate-csv-importer.php, instead of using this line;
if(!empty($role) && !empty($role[0]==’administrator’)){
can you change it to like this below ?
if(!empty($role) && !empty( in_array( ‘administrator’ , $role ) )){
Cheers
The topic ‘Code Change Suggestion’ is closed to new replies.