Support » Plugin: LiteSpeed Cache » Plugin Stopped Working, No Cache , No Image Optimization

  • Hello,

    The plugin stopped working. Version 3.5.0.2

    On Cache tab:

    WARNING
    LSCache caching functions on this page are currently unavailable!
    To use the caching functions you must have a LiteSpeed web server or be using QUIC.cloud CDN.

    We had already signed up for QUIC.cloud CDN, long ago. Checking on the status it says OK. refreshing the domain key says it’s “Approved”.

    Report number: RWICZKHN

    Regards,

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I don’t see this domain on QC CDN , it shows CDN Disabled

    for image optimization , it was due to WP REST API call blocked by cloudflare, please whitelist our IPs in CloudFlare firewall.

    https://quic.cloud/ips

    Best regards,

    Hi @qtwrk

    We looked at all the IP addresses you gave us (56) and none are being blocked by us on Cloudflare.

    We have also white listed all 56 addresses on Cloudlflare Firewall, see images below:

    https://imgur.com/a/TcwEULc

    https://imgur.com/a/a8kEwLe

    We only see one IP as being active from the white list, see images below

    https://imgur.com/a/hAtaNym

    https://imgur.com/a/uZghbFC

    We also tried cleaning up unfinished data, and also manually gathered image data.

    We still don’t have image optimization.

    Regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Could you please clean up unfinished data and re-send request ? I don’t see anything in log at this moment , but your next request should show up

    Best regards,

    Hi @qtwrk

    Cleaned Up Unfinished Data and re-sent the request

    Response : “Pushed 43 images to Cloud server, accepted 43 images”.

    But no image optimization showing up.

    Regards

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    from log I am seeing blocked by CF at least, or even possibly from your origin

    the 1005 is Cloudflare’s error code , 403 is probably from your origin.

    Please check

    Best regards,

    Hi @qtwrk

    This looks like the same situation we had 4 months ago and you were able to help us here.
    We have a restricted Rest API.

    You wrote:

    “For your situation , we added a new API. Please upgrade to v3.2.3 RC2 or wait for new release.”

    See the full information below:

    https://wordpress.org/support/topic/image-optimization-not-working-3/

    Regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    is this still the code you use ?

    //Restricts REST API Access With LiteSpeed Cache Modification
    add_filter( ‘rest_authentication_errors’, function( $result ) {
    if ( ! empty( $result ) ) {
    return $result;
    }
    if ( ! is_user_logged_in() && ( ! defined( ‘LSCWP_V’ ) || ! apply_filters( ‘litespeed_is_from_cloud’, false ) ) ) {
    return new WP_Error( ‘rest_not_logged_in’, ‘You do not have sufficient permission to access this endpoint. Access to REST API requests is restricted.’,
    array( ‘status’ => 401 ) );
    }
    return $result;
    });

    meanwhile , please make sure our IPs are whitelisted in cloudflare

    Best regards,

    lechon

    (@lechon)

    Hi @qtwrk

    This is the code we are using, it has been working for months with no issues:

    //Restricts REST API Access With LiteSpeed Cache Modification
        add_filter( 'rest_authentication_errors', function( $result ) {
            if ( ! empty( $result ) ) {
                return $result;
            }
            if ( ! is_user_logged_in() && ( ! defined( 'LSCWP_V' ) || ! apply_filters( 'litespeed_is_from_cloud', false ) ) ) {
                return new WP_Error( 'rest_not_logged_in', 'You do not have sufficient permission to access this endpoint. Access to REST API requests is restricted.', 
                array( 'status' => 401 ) );
            }
            return $result;
        });

    Hi @qtwrk

    it has been a while since I have asked for help with this issue. This is also affecting our other site with an enterprise LiseSpeeed server. Can you please help?

    Regards,

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Apologize for late response.

    please change this code from

    //Restricts REST API Access With LiteSpeed Cache Modification
        add_filter( 'rest_authentication_errors', function( $result ) {
            if ( ! empty( $result ) ) {
                return $result;
            }
            if ( ! is_user_logged_in() && ( ! defined( 'LSCWP_V' ) || ! apply_filters( 'litespeed_is_from_cloud', false ) ) ) {
                return new WP_Error( 'rest_not_logged_in', 'You do not have sufficient permission to access this endpoint. Access to REST API requests is restricted.', 
                array( 'status' => 401 ) );
            }
            return $result;
        });

    to

    //Restricts REST API Access With LiteSpeed Cache Modification
        add_filter( 'rest_authentication_errors', function( $result ) {
          error_log("\nstart1\n",3,"/path/to/your/public_html/lscwp.log");
          error_log( is_user_logged_in()  , 3, "/path/to/your/public_html/lscwp.log");
          error_log("\nend1\n",3,"/path/to/your/public_html/lscwp.log");
    
          error_log("\nstart2\n",3,"/path/to/your/public_html/lscwp.log");
          error_log( LSCWP_V , 3, "/path/to/your/public_html/lscwp.log");
          error_log("\nend2\n",3,"/path/to/your/public_html/lscwp.log");
    
          $is_from_cloud = apply_filters( 'litespeed_is_from_cloud', false );
    
          error_log("\nstart3\n",3,"/path/to/your/public_html/lscwp.log");
          error_log( $is_from_cloud , 3, "/path/to/your/public_html/lscwp.log");
          error_log("\nend3\n",3,"/path/to/your/public_html/lscwp.log");
          
            if ( ! empty( $result ) ) {
                return $result;
            }
            if ( ! is_user_logged_in() && ( ! defined( 'LSCWP_V' ) || ! apply_filters( 'litespeed_is_from_cloud', false ) ) ) {
                return new WP_Error( 'rest_not_logged_in', 'You do not have sufficient permission to access this endpoint. Access to REST API requests is restricted.', 
                array( 'status' => 401 ) );
            }
            return $result;
        });

    replace “/path/to/your/public_html” to your actual path

    then try optimize an image , after it fails , check the lscwp.log

    it should log something.

    Best regards,

    Hi @qtwrk .

    I implemented the code you have suggested. No image optimization took place.

    The lscwp.log only shows the following information after 6 hours

    start1

    end1

    start2
    3.5.2
    end2

    start3

    end3

    start1

    end1

    start2
    3.5.2
    end2

    start3

    end3

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    I tested the code I provided and it works on my site.

    I checked again in the log:

    [domain_id] xxx [site_url] http://www.dr__ko_ter.com[err] Notify failed: error code: 1005

    CloudFlare is blocking it.

    Our IPs has been updated , could you please double check the all IPs are up-to-date ?

    And if possible , please try it with CloudFlare proxy disabled.

    this way we can at least narrow down if issue is from CF or from your origin.

    Best regards,

    Hi @qtwrk

    We are currently checking all the new IPs that you have mentioned, one by one.

    What is the user agent that LiteSpeed uses when requesting images from a site?

    We have a wide variety of user agents that are banned at Cloudflare and we want to make sure that this not what is causing the problem. For example user agents like RestSharp, AHC and many others are blocked at Cloudflare.

    Let us know,

    Thanks

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    It should be QUIC.cloud image optimization

    Best regards,

Viewing 14 replies - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.