Sage 10: enqueuing scripts from plugin issue

Hi! I’m trying to use Slide Anything – Responsive Content / HTML Slider and Carousel – WordPress plugin | WordPress.org plugin with Sage 10. Looks like there’s an issue similar to this one with Sage 9: https://discourse.roots.io/t/sage-9-plugin-scripts-not-enqueued/8618
Scripts from the plugin are not loaded if in_footer is true. However, plugin is woking perfect with ‘Twentytwentythree’ theme.
Will be grateful for any help.

Scripts enqueued for footer should be outputted in the theme with the wp_footer function, in Sage this happens in index.php:
https://github.com/roots/sage/blob/41c7f2c50897b2ea1ddb5fb2e8a79075601b60f0/index.php#L18

Do you see the missing script when you check for the enqueued scripts (e.g. by using something like https://gist.github.com/omurphy27/d63222e4940c3afa9d8afd10d9375df4)?

Following along the process in which the footer scripts should be finally outputted:

The wp_footer function in turn does the wp_footer hook of same name.

Into that wp_footer hook, by default in core, the wp_print_footer_scripts function hooks in.
That in turn does another hook with the same name, wp_print_footer_scripts.

Into that hooks the private _wp_footer_scripts function (same name but prefixed with an underscore).

That function in turn calls the print_footer_scripts function.

That function uses the $wp_scripts global and calls its do_footer_items method.

So (in a development environment) you could halt at that point and check the contents of $wp_scripts, whether the missing script is there.

Thank you for responding.
Looks like the issue was in the compatibility of Sage and the plugin. The latest version - 2.4.7 has the behavior I described above, but 2.4.5 is ok:


So the older plugin works fine, but the newer plugin release does not?

Yes, the older version of the plugin looks good.

For further narrowing this down: Does the issue already occur with 2.4.6?

Yes, 2.4.6 has the behavior I described. Please see the first screenshot above.

Those are all the changes that were done on the release 2.4.6 compared to the previously, working release 2.4.5:
https://plugins.trac.wordpress.org/changeset/2769458/

:thinking:

+add_action( 'admin_enqueue_scripts', 'cpt_slider_register_admin_scripts', 999999 );

So this was moved to admin scripts I suppose?

Your screenshot shows the admin area, not the frontend, so the footer script handling of the theme should not be relevant.

Sorry for the misunderstanding, I mean that scripts from cpt_slider_register_admin_scripts function (lines 202 - 253 of slide-anything-admin.php) are not enqueued. But if remove in_footer parameter on line 233, that particular script will be present:

wp_register_script( 'sa-slider-admin-script', SA_PLUGIN_PATH . 'js/slide-anything-admin.js', array( 'jquery' ), $plugin_ver, true );

Anyway, the working solution for me is to use 2.4.5 version, thank you for your time.