I have a plugin rejected by wordpress.org, one of the resasons is this:
Unsafe Requiring of Common Libraries Since you're using a common library, it's important that you enqueue it safely. Example(s):
require_once('jsonld.php');
Since that is a common library, you need to detect IF the code is already included and not re-include it, as doing so will cause conflicts if two people call the same defines and functions.
I understand about enqueueing jQuery and CSS - but this is a PHP script with multiple functions.
- If this script is common do I need to just reference it in the WP Core?
- Otherwise do I need to just look at the functions I'm calling and wrap them in a class (I'm uncertain about this) or can I refer to the whole php script?
- What is the standard way of doing this?
Thanks
Dan