• Resolved Audiomonk

    (@audiomonk)


    I can’t remember if I’ve contacted you about this before, I can’t see it on my list of replies or topics created.

    I use litespeed server, and the image optimisation feature of the caching program won’t run with cron unless wp-hide is deactivated. What I have to do, is run everything manually, by deactivating wp-hide, manually pull images then post them to server, then pull back when optimised, then enable wp-hide (which clears all the cache).

    It would be so much better, if the cron for litespeed could function with wp-hide running. I’ve contacted them also, but they’re taking ages to respond to it.

    Any ideas what I can do ?

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Maya

    (@tdgu)

    Hi,
    Can you try to set to No the “Block wp-cron.php” at WP Hide > Rewrite > Root Files ? The cron might be blocked internally if the server call it using a different ip than what domain use.

    Thanks

    Thread Starter Audiomonk

    (@audiomonk)

    Hi,

    Thanks for your reply, the wp-cron isn’t blocked in the rewrite root files section?

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    I’ll try to replicate the issue on this side, can you send more details upon the cache application you use, also how to replicate the reported issue.

    Or please feel free to contact us directly.

    Thanks

    Thread Starter Audiomonk

    (@audiomonk)

    Hi, thanks for your reply, missed the notification.

    Replication should be simple, install wp-hide and try the cron based image optimisation. It fails. I checked access to the media folders inside of wp-hide, they’re not blocked.

    The cache is Litespeeds own cache plugin.

    https://en-gb.www.ads-software.com/plugins/litespeed-cache/

    It’s so frustrating to have to disable wp-hide each time to manually send the optimisation request, then wait, then pull the optimised images back. Normally, with cron enabled it should just do this automatically, but for some reason, something inside of wp-hide is blocking the communication between litespeed and their servers? Or maybe it’s a path issue ?

    Thread Starter Audiomonk

    (@audiomonk)

    From their response when I showed sample .htaccess from wp-hide…

    from that htaccess content

    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule ^wp-content(.+) /index.php?wph-throw-404 [L]
    so if I am interpreting it correctly :

    If the incoming request doesn’t have REDIRECT_STATUS status , and doesn’t have wordpress_logged_in cookie , then every request to wp-content, like image URL /wp-content/uploads/2020/02/some.jpg will redirect to index.php?wph-throw-404

    Am not sure how to solve this, have asked them if they have a solution, but is this the problem?

    Thread Starter Audiomonk

    (@audiomonk)

    They found the problem, they said that their requests were being redirected to a 404, so suggested the following workaround. I tested it and it does work. Something to think about for new versions maybe?

    Yeah , it seems redirect it to 404 page as I assumed.

    A quick workaround , try make that block to be

    RewriteCond %{HTTP_USER_AGENT} !LiteSpeed-Image
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in.*$ [NC]
    RewriteRule ^wp-content(.+) /index.php?wph-throw-404 [L]
    this will add a condition check

    RewriteCond %{HTTP_USER_AGENT} !LiteSpeed-Image

    that if user agent is LiteSpeed-Image, which is our image server uses , will bypass that 404 redirect rule.

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    Thanks for your additional feedback, it does make sense. I’am not sure why they are still calling the images through the old urls, but I’ll check it further. Or the rewrite update you provided, will be fine too.

    Thanks

    Thread Starter Audiomonk

    (@audiomonk)

    Something removed the entry from the .htaccess and it failed again, is there anywhere inside of wp-hide that I can make sure this entry stays in place?

    I think (not that I know much) that the reason they’re calling the old URLs is because their entries in .htaccess come before the ones for wp-hide? Would that be a reason?

    It would be really good to have wp-hide compatible with all litespeed servers out there that are using image optimisation.

    Plugin Contributor Maya

    (@tdgu)

    Hi,
    If the permalinks updated/re-generate, the wp-hide outputs the default rewrite. Until we include a fix for this issue, you can change the permission of .htaccess file so it won’t be changed from php.

    Thanks

    Thread Starter Audiomonk

    (@audiomonk)

    Great idea about permissions, thanks.

    Thread Starter Audiomonk

    (@audiomonk)

    Just saying thanks for adding this now to new versions going forward.

    • This reply was modified 4 years, 8 months ago by Audiomonk.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Litespeed image optimisation won’t work with WP-Hide’ is closed to new replies.