zao-web / asset-queue-manager

A WordPress plugin for experienced frontend performance engineers to take control over the scripts and styles enqueued on their site.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some assets cannot be dequeued

ikanc opened this issue · comments

Hi,

Some assets could not be dequeued, in some ways (2 different to be exact):

  1. Cannot expand the asset box by clicking on it (have about 5 or so out of 40 on list)
  2. Some assets are displayed both on queue and dequeue list. They are listed in the DB, but they cannot be fully dequeued, and whenever they are already in the dequeue list, they cannot be removed from it (even when they are in the dequeue list they are not really dequeued)

I can show this in my project. Not sure exactly how to reproduce on other sites.

HI ikanc,

Not sure I understand what you're saying in 1. Can you expand on that issue further?

The second issue sounds like maybe the assets are enqueued in an abnormal way. The plugin hooks in to a couple places to gather information and dequeue specific assets, but if the assets aren't enqueued in a fairly standard way it's not going to work with them. You may need to dig in to the plugin/theme associated with the problematic assets to figure out what's going on there.

Hi, i'll take a look regarding 2.
Regarding 1 - see this - http://snag.gy/ID0Z9.jpg

I'll bet the issue is because the assets have a . in their name. This probably messes up the jQuery selector for the asset panel here.

I think I need to escape the selector with a \\. Are you able to try this out asset.handle.replace( '.', '\\.' ) and issue a PR if it works?

I'll try that later, thanks

Hi,

It almost fixed it. Changed to .replace(/\./g, "\\.") and it fixed cases of multiple dots.
I'll add it later

Thanks @ikanc! I'll try to push the new version out soon.