Skip to content

No version # on wp_enqueue() function #13

@SteelWagstaff

Description

@SteelWagstaff

We recently updated to the newest release of this plugin, but ran into some issues caused by users having cached versions of the wp-h5p-xapi.js still loading when they called various pages with H5P activities embedded. It appears that this plugin isn't adding a version to the end of the wp_enqueue() functions, so there is no automatic cache busting of updated scripts/styles (and wp-h5p-xapi.js received an update in the latest release). The enqueue functions in question appear to live here:

function h5pxapi_enqueue_scripts()
{
wp_register_script("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.js", array("jquery"));
wp_enqueue_script("wp-h5p-xapi");
wp_register_style("wp-h5p-xapi", plugins_url() . "/wp-h5p-xapi/wp-h5p-xapi.css");
wp_enqueue_style("wp-h5p-xapi");

For ideas about how to implement a fix, see https://wordimpress.com/wordpress-css-and-js-cache-busting/ and https://themetry.com/cache-busting-wordpress/ or https://developer.wordpress.org/reference/functions/wp_enqueue_script/#parameters. I'm not the most skilled developer, but could help with a PR if desired?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions