Skip Navigation

[Resolved] Attachment filename appends running afoul of Adblock rules

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by monicaB 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#551127

I am trying to: Display a custom post type custom image field using content template (single page)

I expected to see: Displayed images on hidden link

Instead, I got: Image blocked by Adblock (EasyList)

Warning, this is somewhat obscure. I've since fixed this issue by cropping and re-uploading the problem image, but thought you should know about this very strange and unexpected issue.

I have a custom post type called Services, and one of the custom fields is a featured image field. I have six services and each has its own featured image. However, when I reviewed each single service page, one of the services wasn't showing an image (inspection of the image indicated a "display:none !important" style had been added by Adblock.

Reuploading a renamed image file didn't fix the problem, so I troubleshooted Adblock and found that one of the standard AdBlock lists (EasyList) has a number of blocked URL items (hidden link), including quite a few strings such as "_300x250." Turns out, one of my images had this appended to the end of the filename by Toolset, so the image got blocked.

Wordpress core creates new filenames when images are uploaded, but the filename is appended with a "-WWWxHHH" syntax. A hyphen, rather than an underscore. It is the underscore that Toolset uses to make the append that cause my image to be blocked. As you can see looking at that blocklist, there are over 200 such blocked strings, that are likely to cause others problems given how the filenames are appended by the plugin.

Since cropping my image slightly, I have skirted the issue by making sure the image filename ends in "_300x252.png" rather than "_300x250.png" but this seems precarious.

I might suggest that you change your file renaming syntax to match that of WordPress (using a hyphen rather than an underscore), because I doubt Adblock is going to change their rule list.

#551294

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - you have a good suggestion here to change underscore to hyphen and we will consider this as a new feature request as its the standard of WordPress.

Please note that the feature will be sent to Devs for assessment and they will be the right person to decide whether they will consider this change or not.

For now, the only solution for you will be to change the image size a bit as you already done using "_300x252.png" rather than "_300x250.png".

#552349

Just figured I'd send it in for the devs to consider. Thanks!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.