Support » Plugin: Force Login » Plugin Installation failed after including bypass

  • Resolved kufuorkofi

    (@kufuorkofi)


    I tried to add the following bypass to the plugin:
    /**
    * Bypass Force Login to allow for exceptions.
    *
    * @param bool $bypass Whether to disable Force Login. Default false.
    * @return bool
    */
    function my_forcelogin_bypass( $bypass ) {
    if ( is_home() ) {
    $bypass = true;
    }
    return $bypass;
    }
    add_filter( ‘v_forcelogin_bypass’, ‘my_forcelogin_bypass’ );

    I did this by extracting the plugin zip file, opening wp-force-login in Visual Studio Code, pasting the bypass code in at the end, and compressing the folder into a new zip file. When I attempted to upload this to WordPress I got the following error “The package could not be installed. No valid plugins were found.” Where did I go wrong?

Viewing 1 replies (of 1 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    Hi– thanks for using Force Login!

    Without seeing the full edited code you tried to upload, I can’t tell exactly why you got that error message. Did you zip the directory or just the files inside?

    Ideally, you wouldn’t edit the plugin code. I recommend you add this bypass filter to your theme’s functions.php file to ensure future updates to Force Login don’t override your custom changes.

    Good Luck!

Viewing 1 replies (of 1 total)
  • The topic ‘Plugin Installation failed after including bypass’ is closed to new replies.