• Hello. I have a bunch of shortcodes that slow my page down when they load at once, so I want their execution to be delayed and tied to user-triggered events.

    I have medium JS knowledge but none in PHP or AJAX, that’s why I think my only hope of achieving this would be with a plugin, but the only results I could find using relevant keywords are image lazyloading plugins.

    Does anyone know of any plugins or methods for achieving my goal without using PHP or AJAX?

    • This topic was modified 4 years, 2 months ago by SinanDira.
    • This topic was modified 4 years, 2 months ago by SinanDira.
Viewing 3 replies - 1 through 3 (of 3 total)
  • You might be trying to solve the wrong problem. Several large page builder plugins make pages that are full of shortcodes, and that is not slow. Shortcodes execute on the server, so they are PHP. You can’t simply move them to JS, since they need the server environment. And triggering one from JS means you would use AJAX to do it, so your limitation “without using PHP or AJAX” means it can’t really be done.

    Perhaps your page is slow for a different reason.

    Thread Starter SinanDira

    (@sinandira)

    Thanks, Joy. My wording was a bit off. The component loading from the shortcodes of that particular plugin is sluggish, and it blocks scroll for about three seconds, but I couldn’t find a better plugin to do what it does nonetheless. With the plugin disabled, my page loads and is scrollable in half a second.

    Since AJAX is the only way, do you think it’s a feasible idea to learn how to do it without delving too deep into PHP or advanced AJAX topics?

    So, with that explanation, it is obvious that it is not the shortcodes or PHP that is slowing your page. The slowness is on the rendering of the page, not the generation of it in PHP. So the culprit could be Javascript or large resources like videos or images that are loaded.
    Again, you might be trying to solve the wrong problem.
    Use the Developer Tools in your browser to watch the timing of the page load to isolate what exactly is slow.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Does anyone know of a way to delay shortcode execution?’ is closed to new replies.