Preventing Patreon Plugin from changing .htaccess

I tried installing the Patreon plugin for the first time yesterday, and found that it broke all the images on my site that had been uploaded to the WordPress uploads folder. This problem persisted even after deactivating and deleting the Patreon plugin. After an hour or two of looking for what was wrong with my images, I found the Patreon plugin put this code into the .htaccess file, which changed the permission settings of all the images.

BEGIN Patreon WordPress Image Protection

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} (.png|.jpg|.gif|.jpeg|.bmp)
RewriteCond %{HTTP_REFERER} !/wp-admin/ [NC]
RewriteRule ^wp-content/uploads(.*)$ index.php?patreon_action=serve_patron_only_image&patron_only_image=$1 [QSA,L]

END Patreon WordPress

Deleting this code fixed the problem. Before I reinstall the plugin, is there any setting that prevents Patreon’s plugin from changing image permissions and/or preventing it from accessing the .htaccess? If not, can I delete this code from the .htaccess without the plugin putting it back in?

Hey @sapphirefoxx

Nick here from the Patreon platform team, I hope your day is going well!

I moved this topic over to the Wordpress plugin section and will have the team look into this on Monday!

1 Like

This should not happen with 1.1.1, since it doesnt automatically modify htaccess or activate image feature. Additionally the file doesnt change permission settings of files on the filesystem.

Checking the htaccess rule, i can confirm that it is from 1.1.0, and not the code that went out with 1.1.1. This means that somehow you got 1.1.0 installed from somewhere, or its a remnant code.

For the solution, i would advise you to make sure you updated to or installed 1.1.1. Best way would be to deactivate, delete the existing plugin and reinstall the plugin from WP admin. And then make sure the image feature is turned off in plugin settings. After that, going to your Permalink settings and clicking save should refresh your permalinks and make the htaccess rule go away unless you enable image/file locking in plugin settings.

Please note that your web host or a plugin in your site may be caching things, and they may need being refreshed/emptied.

In case problem persists, please arrange me a WP administrator username/login and mail it to . The password should be complex enough and this account should be deleted after debugging.

Also, if you installed the plugin just yesterday, please let us know from which source you installed the plugin.