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

Check: Including Libraries Already In WP Core (including jquery) #702

Open
davidperezgar opened this issue Oct 6, 2024 · 0 comments · May be fixed by #715
Open

Check: Including Libraries Already In WP Core (including jquery) #702

davidperezgar opened this issue Oct 6, 2024 · 0 comments · May be fixed by #715
Labels
Checks Audit/test of the particular part of the plugin [Team] Plugin Review Issues owned by Plugin Review Team

Comments

@davidperezgar
Copy link
Member

We warn developer to not reinvent the wheel. They should use the external libraries that WordPress has already.

As we say in the review:

Including Libraries Already In Core

Your plugin has included a copy of a library that WordPress already includes.

WordPress includes a number of useful libraries, such as jQuery, Atom Lib, SimplePie, PHPMailer, PHPass, and more. For security and stability reasons, plugins may not include those libraries in their own code, but instead must use the versions of those libraries packaged with WordPress.

You can see the list of JS Libraries here:

https://developer.wordpress.org/reference/functions/wp_enqueue_script/#default-scripts-and-js-libraries-included-and-registered-by-wordpress

While we do not YET have a decent public facing page to list all these libraries, we do have a list here:

https://meta.trac.wordpress.org/browser/sites/trunk/api.wordpress.org/public_html/core/credits/wp-59.php#L739

It’s fine to locally include add-ons not in core, but please ONLY add those additional files. For example, you do not need the entire jquery UI library for one file. If your code doesn't work with the built-in versions of jQuery, it's most likely a noConflict issue.

@davidperezgar davidperezgar added Checks Audit/test of the particular part of the plugin [Team] Plugin Review Issues owned by Plugin Review Team labels Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checks Audit/test of the particular part of the plugin [Team] Plugin Review Issues owned by Plugin Review Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant