Description
Feature Description
When the URLs for JS files are generated in the plugins, the plugin_dir_url()
function is used. Its output is concatenated with the relative path:
However, this is not ideal because the resulting URL is not directly filterable. It would be better to use plugins_url()
:
- add_query_arg( 'ver', OPTIMIZATION_DETECTIVE_VERSION, plugin_dir_url( __FILE__ ) . 'detect.js'
+ plugins_url( add_query_arg( 'ver', OPTIMIZATION_DETECTIVE_VERSION, 'detect.js' ), __FILE__ )
In this way, the plugins_url
filter can be used to potentially rewrite the URL to point to a CDN, for example.
Metadata
Metadata
Assignees
Labels
Issue particularly suitable to be worked on by new contributorsIssues for the Embed Optimizer plugin (formerly Auto Sizes)Issues for the Optimization Detective pluginIssue relates to work in the Performance Lab Plugin onlyIssues for the Web Worker Offloading plugin.A suggestion for improvement of an existing feature
Type
Projects
Status
Done 😃