Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No version # on wp_enqueue() function #13

Open
SteelWagstaff opened this issue May 29, 2018 · 1 comment
Open

No version # on wp_enqueue() function #13

SteelWagstaff opened this issue May 29, 2018 · 1 comment

Comments

@SteelWagstaff
Copy link

SteelWagstaff commented May 29, 2018

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?

@SteelWagstaff
Copy link
Author

PR with proposed fix here: #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant