Hello, thank you for your response, I have reviewed the changes made to the plugin.
Also check the documentation that was added.
https://assetcleanup.com/docs/?p=21#wpacu-method-2
The option is available: “Load it for URLs with request URI matching this RegEx”
As I previously mentioned in an email I sent you, in my case I would need an option that would not be used to unload assets via regex.
Something like: “Unload it for URLs with request URI matching this RegEx”
There are cases when you want to unload an asset on a few pages or a group of pages. That’s where “Unload it for URLs with request URI matching this RegEx” is useful.
Case Scenario #1
You’re using WooCommerce and you know a certain CSS/JS file is NOT needed only on the product page. To do that, you tick the “Unload it for URLs with request URI matching this RegEx:”. In the input, you can just type “#/product/#” (a string is enough, no regular expression needed in this case).
Any URL (request URI to be more precise which is anything after the hostname) that contains “/product/” will unload the CSS/JS file. Anywhere else, it will be unloaded. For instance, it could be a jQuery plugin that is not needed for a lightbox gallery only shown on the single product page. Or a CSS file that is not needed to style the customer reviews shown only on the product page, etc.
Case Scenario #2
You’re using a plugin that generates surveys and you know that the URL will always contain words like “survey”. However, you also not need that plugin on a few other pages such as “Contact”, “Feature request”, “Book a reservation”. You want to exclude all the plugin’s files on the pages that were just mentioned.
You first tick “Unload it for URLs with request URI matching this RegEx:” checkboxes, then the input value for the later choice will be “#(-survey/|/contact/|feature-request|book-a-reservation)#“. In this scenario, it would be any page’s URL that contains “-survey/” (it could be the ending of each URL having a survey form), “/contact/“, “feature-request“, and “book-a-reservation“).
Do you also consider adding this option?