Skip to content

Conversation

@adamsilverstein
Copy link
Member

Addresses #402

*
* @return array Error message.
*/
public function getError() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied this bit from other classes, so i'm assuming it is required?

@adamsilverstein adamsilverstein requested a review from aristath May 23, 2022 14:07

checkcount();

if ( ! preg_match( '/wp_enqueue_script\(\s?("|\')jquery("|\')/i', $php ) ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will catch enqueueing jQuery successfully. However, it will not catch cases where jQuery is a dependency of another script - in which case it also gets loaded.
Most themes don't enqueue jQuery directly, it is simply used as a dependency for their own scripts, so we should check for that scenario as well.

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

Successfully merging this pull request may close these issues.

2 participants