• Resolved o2xav

    (@o2xav)


    Hi,

    Great plugin, good job.
    But scripts and styles should be enqueued only when shortcodes are present on a page.
    I got more than 100 pages on my site, only 5 contain wpvr shortcodes.
    Yet, a lot of useless ressources are loaded on every page.
    Maybe you should consider this detail in future updates.

    Thanks for reading.

Viewing 4 replies - 1 through 4 (of 4 total)
  • That would be awesome, cause it makes my page about 300kb bigger and slows it down quite a lot! Even on pages where it’s not implemented.

    Plugin Author RexTheme

    (@rextheme)

    We are working on it.

    Thread Starter o2xav

    (@o2xav)

    That’s awesome, please keep us informed !

    Regards,

    Plugin Author RexTheme

    (@rextheme)

    Hi,

    We’ve added the feature on the latest version of the plugin.

    Go to WPVR > Settings, and turn on the ‘Enable script control to load the WPVR scripts on listed pages only’ option.

    Now at the bottom, on the ‘Allowed pages to enqueue WPVR scripts:’ field, you can add the URLs of the pages where you’ve published tours made by WPVR.

    If you have multiple pages where WPVR shortcodes are present, just simply use a comma after each URL.

    As like: https://example1.com/, https://example2.com/

    Now you have to click on Save.

    So, the scripts and styles will only be enqueued where you allow.

    If you’re using any optimization plugin, you have to clear the cache.

    If you’re having any issue using this feature, let us know.

    Thanks.

    • This reply was modified 4 years, 10 months ago by RexTheme.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Scripts and Styles should only be enqueued when needed’ is closed to new replies.