Skip to content

Feature Improvement: Allow relative URLs in Extra > Preload specific requests #432

Description

@rdhutchins

You can inject URLs to preload under "Preload specific requests (advanced users)", but this only works for full URLs, not relative URLs.

The output <link rel="preload"...> tag should work with relative URLs, but in the plugin code it looks like we are validating specifically full urls:

// classes/autoptimizeExtra.php
            if ( filter_var( $preload, FILTER_VALIDATE_URL ) !== $preload ) {
                continue;
            }

Would it be as simple as changing the validation to allow relative URLs? Is there a reason full URLs are required?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions