• Resolved evalast

    (@evalast)


    Hi, i created a custom menu item in the backend a page with the following and tried to deactivate all plugins for the admin page with the Backend URLs Setting – but it does not work. Any idea why? my url is

    mydomain.com/wp-admin/admin.php?page=welcome-subenin-yoneticisi
    *admin.php?page=welcome-subenin-yoneticisi*
    		// Create a welcome menu for redirection after login to avoid problems and missing mobile menu on mobile view
    	add_menu_page( 
    	__( 'Welcome', 'woocommerce' ).' ID '.$current_user->ID,
    	__( 'Welcome', 'woocommerce' ).' ID '.$current_user->ID,
    	'manage_woocommerce',
    	'welcome-subenin-yoneticisi', 
    	'newrole_test',
    	'dashicons-smiley' 
    	);				
    	// Page content for Welcome page			
    	function newrole_test() {
    	global $current_user;
    	$author = wp_get_current_user();
    
    	// Define child theme path
    	define( 'CHILD_PATH', get_stylesheet_directory() . '' );
    	include_once( CHILD_PATH . '/include-parts-from-functions-php/test-welcome-page.php'); 	
    
    	}	

    • This topic was modified 1 year, 11 months ago by evalast.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jose

    (@giuse)

    Hi @evalast

    why do you say it doesn’t work? Still seeing the admin menu item doesn’t mean it doesn’t work. Maybe it doesn’t work, but not for that reason.
    FDP rebuilds the admin menu, and it shows also the menu items that are added by the disabled plugins.

    Administrators can see the disabled plugins in the console.
    Go to a backend page, Right-click => Inspect => Click on Console.

    Do you see the comment “*** PLUGINS DISABLED BY FREESOUL DEACTIVATE PLUGINS ***”?

    If you see it, on that backend page all the plugins that are listed after the comment are disabled.

    Have a great day!

    Jose

    Thread Starter evalast

    (@evalast)

    Hi – sorry, there was a other setting which caused the problem. I had a

    *admin.php?page=welcome*

    saved above the

    *admin.php?page=welcome-subenin-yoneticisi*

    but i cant see the console message. I checked the number of scripts loaded on the network page. best

    • This reply was modified 1 year, 11 months ago by evalast.
    • This reply was modified 1 year, 11 months ago by evalast.
    Plugin Author Jose

    (@giuse)

    Hi @evalast

    when you have multiple rows that match the same backend URL the rows that are higher up in the settings table have the priority.

    I suggest you disable some plugins with this pattern:

    *testing-backend-urls=true*

    Then visit some backend pages where you add testing-backend-urls=true to the URL. For example https://yoursite.com/wp-admin/edit.php?post_type=page&testing-backend-urls=true, or https://yoursite.com/wp-admin/edit.php?testing-backend-urls=true
    Check if the plugins are disabled. If they are disabled, then try with https://yoursite.com/wp-admin/admin.php?page=welcome-subenin-yoneticisi&testing-backend-urls=true

    You may have two scenarios:

    1) The deactivation works on other backend pages, but it doesn’t work on https://yoursite.com/wp-admin/admin.php?page=welcome-subenin-yoneticisi&testing-backend-urls=true

    2) It doesn’t work on any backend page

    Depending on the case, I will suggest how to investigate deeper. Just tell me if it’s case 1, or case 2.

    Have a great day!

    Jose

    Thread Starter evalast

    (@evalast)

    Hi – im not sure if i was clear enough. So im checking the number of request in the the network tab to see if plugins get deactivated or not. At the moment it works fine BUT i do not see the Plugins deactivated message in the console for my custom user role backend sites. I DO see the message for the admin role on default admin pages.

    I also tried your suggestions – changed nothing. No message in the console for my custom user role backend sites. best

    Plugin Author Jose

    (@giuse)

    Hi @evalast

    you will see the message in the console only if the current user has the capability “activate_plugins”.
    If you want to see it for any user, you can add this in your wp-config.php before the comment /* That’s all, stop editing! Happy publishing. */:

    define( 'EOS_DP_DEBUG',true );

    Have a great day!

    Jose

    Thread Starter evalast

    (@evalast)

    Thx a lot Jose

    Plugin Author Jose

    (@giuse)

    You are welcome @evalast !

    Have a great day!

    Jose

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disabling on custom admin pages dont work’ is closed to new replies.