Skip to content

Warn about jQuery usage on the front end #402

@adamsilverstein

Description

@adamsilverstein

While it has been widely known that you might not need jQuery for most of your interactive theme features, jQuery is still a common JavaScript dependency found in WordPress themes - for example, 7 out of the 11 default themes since Twenty Ten use jQuery in the frontend.

A recent analysis of the performance impact of using jQuery in WordPress themes determined that jQuery is the most common JavaScript-based performance problem in themes and that Removing jQuery may lead to 80% less JavaScript load. According to the analysis, most themes can easily substitute (modern) vanilla JavaScript and remove their reliance on jQuery with only minor changes.

To help theme developers make better choices in the future, I would like to add a warning to the theme-check plugin when themes enqueue 'jquery' on the front end (eg. wp_enqueue_script). The warning could reference the analysis and perhaps offer a link to an article explaining how to switch to vanilla JavaScript.

If this idea seems reasonable, I am happy to work on a PR to add this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions