• Resolved phbyerly

    (@phbyerly)


    I have a plugin that doesn’t work properly when “Lock and Protect System Folders” is activated. Is there any way to whitelist the plugin?

    I understand the risk, but whitelisting one is better than not activating the feature at all.

    I am comfortable with editing code.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Dimo Dimov

    (@dimodi)

    Hello @phbyerly,

    If the “Lock and Protect System Folders” option blocks a script used by a plugin on your website, you can whitelist the specific script by using the filters we’ve created for that purpose.

    More information about the filters you can use is available in the plugin’s readme file or directly at:

    https://www.ads-software.com/plugins/sg-security/#description

    Best regards,
    Dimo

    Thread Starter phbyerly

    (@phbyerly)

    Thanks.

    However, it doesn’t say where to put the code. Would that be wp-config.php?

    • This reply was modified 2 years, 2 months ago by phbyerly.
    • This reply was modified 2 years, 2 months ago by phbyerly.
    Plugin Support Pavel Dosev

    (@pdosev)

    Hello @phbyerly,

    You can add the code in the functions.php file of your active theme. The code can be placed directly below the opening PHP tag.

    You can also look at the thread below from SG-Optimizer, where a step by step instructions is provided on how to use a plugin called Code Snippets, and you can enter the code in it:

    https://www.ads-software.com/support/topic/how-to-use-sg-optimizers-filters-procedure/

    Thread Starter phbyerly

    (@phbyerly)

    How much of the file path is needed? I’ve tried every combination possible both directly and with Code Snippets

    The file is at

    /public_html/wp-content/plugins/ozh-admin-drop-down-menu/wp_ozh_adminmenu.php

    TIA

    Plugin Support Pavel Dosev

    (@pdosev)

    Thank you, @phbyerly.

    I installed the plugin on a test site and was able to recreate the issue.

    Adding these lines to the functions.php of the active theme resolved the issue after I reactivated the Lock and Protect System Folders option, and the plugin is now loading correctly:

    <?php
    add_filter( 'sgs_whitelist_wp_content' , 'whitelist_file_in_wp_content' );
    function whitelist_file_in_wp_content( $whitelist ) {
       // $whitelist[] = 'plugins/ozh-admin-drop-down-menu/wp_ozh_adminmenu.php';
    	//    $whitelist[] = 'plugins/ozh-admin-drop-down-menu/inc/adminmenu.css.php';
    		    $whitelist[] = 'wp_ozh_adminmenu.php';
    	    $whitelist[] = 'adminmenu.css.php';
    
        return $whitelist;
    }
    Thread Starter phbyerly

    (@phbyerly)

    Bingo. Many thanks.
    I will post this to the plugin site for others.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need to exclude a plugin from Lock and Protect System Folders’ is closed to new replies.