Restrict role to use a plugin

Your current code disables plugins for logged in users with contributor capabilities on non-admin pages. The is_admin() function checks if the current page is “/wp-admin” page, to disable plugins just on the admin pages change this condition to: if ( current_user_can( ‘contributor’ ) && is_admin() ) { But to make this code work you need … Read more

adding existing menu page on new customer user role

Okay, I give you an answer based on capabilities and not role. You’ll find a way to hide it for other role if you want (you have the code in your question). add_menu_page requires some parameters, hook and callback to work : https://developer.wordpress.org/reference/functions/add_menu_page/ // Here is your hook to add page to the menu add_action(‘admin_menu’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)