• Resolved hellogerowsky

    (@hellogerowsky)


    Hey there,

    I am trying to make some functions work in ESI.

    I tried it with shortcodes and a custom function – no luck.

    Here’s what I did:

    Shortcode
    I created a new shortcode. When I add it as [shortcode] it works as I want.
    If I add it as [esi shortcode] the shortcode doesn’t execute – I only see the text.

    custom function

    I also tried the function described here:
    https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:esi_sample

    As a function I just wrote echo “ESI working” (for the ESI enabled part of the if-statement) and “ESI not working” (for the else-part).
    I always get “ESI not working” as a result.

    It seems ESI isn’t loading, but it’s enabled in the plugin.
    Any idea why it isn’t working? How can I check if ESI is running on my website?

    Best
    Robert

Viewing 15 replies - 1 through 15 (of 16 total)
  • I’m having the exact same issue with shortcodes, widgets work, but not shortcodes, I just see the text when I put [esi at the start.

    I believe that guide is out of date, but I also tried the one here:

    https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url

    Still doesn’t work, just gives an error when trying to use it in a shortcode.

    I’m definitely using litespeed enterprise on cyberpanel, esi enabled in htaccess and everywhere I can find it in the webadmin console, still nothing.

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”

    Best regards,

    not meaning to hijack the thread, but as me and hellogerowsky have the same issue, maybe it’s the same cause and theres little point opening another thread right?, my report number:

    FLQUAKRT

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    yeah , if you are using elementor…

    there was a bug with ESI with elementor , you can try the latest dev branch

    please go to toolbox -> beta test -> click “dev” and upgrade.

    Best regards,

    Thanks @qtwrk, I didn’t know elementor was breaking the shortcodes even on non-elementor pages :O

    Using the latest dev branch fixes it for me!

    Just out of interest, that php sammple hellogerowsky linked is completely outdated right? any chance you can get someone to put a warning message that the below code is out of date and no longer works or something with the new doc link at the top of that page? it’s plastered all over google search results and I spent hours trying to use that sample until I saw a post from you in another support thread that you now use applyfilters and not the class directly.

    Plugin Support qtwrk

    (@qtwrk)

    the code snippet on doc just works on me

    wordpress 5.8.2 + LSCWP 4.4.5 + defualt Twenty Seventeen theme

    I added this at end of header.php

    <?php
    echo apply_filters( 'litespeed_esi_url', 'my_esi_block', 'Custom ESI block' );
    ?>

    then add

    add_action( 'litespeed_esi_load-my_esi_block', 'my_esi_block_esi_load' );
    function my_esi_block_esi_load()
    {
    do_action( 'litespeed_control_set_nocache' );
    echo "Hello world".rand (1,99999);
    }

    into functions.php

    now in my page I got

    and refresh updates me that random number

    Thread Starter hellogerowsky

    (@hellogerowsky)

    Hey, sorry for the late reply. Here’s my support number: MIYNCXWY

    I am not using Elementor but Oxygen Builder. Is there also a bug?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    which page is your shortcode located ?

    Best regards,

    Thread Starter hellogerowsky

    (@hellogerowsky)

    It’s here:

    https://kunst-aber-witzig.de/versandarten/

    (sorry, hidden under the header)

    I tried various shortcodes. This one is currently on this page:
    [esi payment_methods_info]

    (it outputs payment methods from another plugin)

    Plugin Support qtwrk

    (@qtwrk)

    emmm? wait a second , why do you want to do this to payment gateway ?

    Thread Starter hellogerowsky

    (@hellogerowsky)

    Actually: I don’t… at leat not in ESI, as the info is rather static:

    It just outputs which payment methods are available.

    I just used this shortcode to see if ESI works. I tried others, but everywhere is the same: it just writes the shortcode, but not executing it.

    Might this be because I am using Oxygen Builder?
    This is deactivating all plugins.

    Plugin Support qtwrk

    (@qtwrk)

    well , I have sent a request for a dev license to debug with oxygen builder, let’s see if they would help us : )

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    okay , oxygen team has kindly provided me a dev license , which I have set up a site

    in my case, the ESI shortcode just works

    in backend , and

    in front

    how do I reproduce the issue ?

    Best regards,

    Thread Starter hellogerowsky

    (@hellogerowsky)

    Great! Super nice of them. ??

    However, I tried the exact same shortcode in the shortcode-element, but still: I get just the shortcode outputted as text.

    Is there something I have to enable/disable in WP/LiteSpeed or on the server to make it work?

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    please screenshot me how exactly did you set the shortcode

    and also , please create a php file , name it like test.php , put it at same directory as your wp-config.php , with code

    <?php
    require( './wp-load.php' );
    
    $esi_status = apply_filters( 'litespeed_esi_status', false );
    var_dump($esi_status);

    then access it by browser, see what it returns

    Best regards,

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘ESI not working’ is closed to new replies.