Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Best practices #1

Open
steveadamsfixedit opened this issue Aug 23, 2021 · 0 comments
Open

Best practices #1

steveadamsfixedit opened this issue Aug 23, 2021 · 0 comments

Comments

@steveadamsfixedit
Copy link

I've used the boilerplate to create a custom plugin to track user engagement analytics on live streamed video assets. included in the plugin within the /public directory are some fairly robust JavaScripts that mesh with a webhook from the stream provider and a AJAX call to track real time player events.
It's my understanding that these scripts added to the enqueue_scripts() function in the public/class-plugin-name-public.php run on every single page in the rather vast WP site I'm intending to deploy it on. This seems inefficient and rather insecure...
What's best practice as far as only getting the scripts to run on specific pages...for instance, making a custom theme template and only applying that template file to a page containing video assets?

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

No branches or pull requests

1 participant