Title: Plugin blocks uploads
Last modified: August 30, 2016

---

# Plugin blocks uploads

 *  Resolved [shayatik](https://wordpress.org/support/users/shayatik/)
 * (@shayatik)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/plugin-blocks-uploads/)
 * Seems like the plugin blocks the upload process. What files do I need to whitelist
   in order for sign up uploads (I need them to upload I a picture) to work?
 * See example here – try to upload any jpg / png / pdf and the upload will fail:
   [http://pets.inpexny.com/index.php/reg-form/](http://pets.inpexny.com/index.php/reg-form/)
 * Thanks.
 * [https://wordpress.org/plugins/wp-force-login/](https://wordpress.org/plugins/wp-force-login/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Kevin Vess](https://wordpress.org/support/users/kevinvess/)
 * (@kevinvess)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/plugin-blocks-uploads/#post-6572845)
 * I’m not sure what URLs you would need to whitelist to allow the uploads to work,
   but you could try whitelisting any URL visited by localhost.
 *     ```
       /**
        * Filter Force Login to allow exceptions for specific URLs.
        *
        * @return array An array of URLs. Must be absolute.
        **/
       function my_forcelogin_whitelist($whitelist) {
         // list of single page URLs
         $whitelist[] = site_url( '/reg-form/' );
   
         // allow any page URL if localhost
         if($_SERVER['REMOTE_ADDR'] == 127.0.0.1) {
           $whitelist[] = site_url($_SERVER['REQUEST_URI']);
         }
         return $whitelist;
       }
       add_filter('v_forcelogin_whitelist', 'my_forcelogin_whitelist', 10, 1);
       ```
   
 * Or, you could just set user profile pictures/avatars using _Gravatars_ instead;
   which is builtin to WordPress.
    [https://codex.wordpress.org/Using_Gravatars](https://codex.wordpress.org/Using_Gravatars)
 *  Thread Starter [shayatik](https://wordpress.org/support/users/shayatik/)
 * (@shayatik)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/plugin-blocks-uploads/#post-6572850)
 * I solved it by whitelisting the wp-admin:
 * if( in_array(‘wp-admin’, explode(‘/’, $_SERVER[‘REQUEST_URI’])) ) {
    $whitelist[]
   = site_url($_SERVER[‘REQUEST_URI’]); }
 * Is it safe?
 *  Plugin Author [Kevin Vess](https://wordpress.org/support/users/kevinvess/)
 * (@kevinvess)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/plugin-blocks-uploads/#post-6572855)
 * Great, I’m glad you were able to get it working!
 * That should be safe; by “whitelisting” the _wp-admin_ folder, you’re only stopping
   my plugin from blocking access to it – default WordPress functionality doesn’t
   allow non-logged in visitors to view the admin directory anyway. 🙂
 *  [elyptic](https://wordpress.org/support/users/elyptic/)
 * (@elyptic)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-blocks-uploads/#post-6573057)
 * Note the above code will not work as expected, as this will never evaluate to
   true, in fact it should throw an error:
 *     ```
       if($_SERVER['REMOTE_ADDR'] == 127.0.0.1)
       ```
   
 * That IP address needs quotes.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Plugin blocks uploads’ is closed to new replies.

 * ![](https://ps.w.org/wp-force-login/assets/icon.svg?rev=1904031)
 * [Force Login](https://wordpress.org/plugins/wp-force-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-force-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-force-login/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-force-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-force-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-force-login/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [elyptic](https://wordpress.org/support/users/elyptic/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/plugin-blocks-uploads/#post-6573057)
 * Status: resolved