• Resolved StevenWoolston

    (@stevenwoolston)


    I don’t know if anyone else has come across this, but I had trouble with it and thought I would share.

    Restoring an image reads from the file system and writes from the backup folder to the media library folder. This is fine, but if you have firewall software/plugin installed (like Wordfence) you will get errors when trying to do this. The reason is logical, because the firewall is blocking write access to the file system.

    I resolved by temporarily disabling the firewall and running my watermark processes. Then make sure to turn the firewall back on.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Kuba Mikita

    (@kubitomakita)

    Thanks for the note! Are you using Wordfence specifically?

    This doesn’t seem like a good idea to block writing to the uploads directory. I’d like to replicate this issue.

    Thread Starter StevenWoolston

    (@stevenwoolston)

    I am sure an exception could be applied to the firewall rules but that kind of defeats the purpose.

    The exception is was getting was very unhelpful. It was something like ‘could not restore {file name}’ and then appended ‘[Object Object]’.

    I can’t imagine that you could circumvent the firewall. Are you using the WP core methods to read/write to the uploads folder? I haven’t checked the code.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Yes, we are using WP Filesystem in our plugin. Will test the restoration process with Wordfence then.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    @stevenwoolston we checked this one more time and tried to replicate it with Wordfence with no luck. Are you able to share your Wordfence configuration?

    Also confirmed we are using just the PHP rename() function which moves the file into uploads dir. So if that’s not possible, any other operation in the uploads directory shouldn’t be possible as well.

    Thread Starter StevenWoolston

    (@stevenwoolston)

    I have to apologise for this because I don’t think it’s actually an issue. I had problems doing the restore originally and thought it was FW related but I think the actual issue was to do with the file path in the postmeta table for the media items. I raised another topic related to this and I think THAT was the reason for the exception. I mentioned in that other topic that I migrate data between different environments with different physical media locations. So when the database is updated in the new site, the path to the _ew-backup folder is wrong. I fixed the path and all works ok.

    Once again, apologies for the red herring.

    Plugin Author Kuba Mikita

    (@kubitomakita)

    Ha! This makes sense! Anyway, it was worth checking 🙂

    Thank you

    Thread Starter StevenWoolston

    (@stevenwoolston)

    Should there always be records with _ew-backup location values in postmeta for media attachments? There is something going on with my db and I’m sure it’s related to the initial issue I had with environment syncing. I was able to restore originals successfully but when I try to re-apply the watermark I get an exception. I checked the postmeta table and now I don’t have records with _ew-backup any more. Weirdly enough, the watermark IS applied even though I get the exception. So I can apply the watermark if I do ‘Bulk Select’ and select one at a time (which is very labour intensive). Thoughts?

    Plugin Author Kuba Mikita

    (@kubitomakita)

    This can be related to the issue with had with an upgrader. The fix was released today in version 1.0.10

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

The topic ‘Firewall restrictions’ is closed to new replies.