• Resolved Evolvingdoor

    (@evolvingdoor)


    This is very weird and awkward to explain, so please bear with me. When I insert an image into a page, it sometimes won’t display, in the editor and/or on the live page. This varies by browser too. Seems to show in IE and Firefox Developer, but not in Firefox regular or Chrome. I’m using the WordPress TwentyFourteen template.

    Another weird thing is that when the image is inserted and the page published or saved, there is a weird CSS class that gets added to the image tag that is a long string of seemingly random lower case letters, and this class name changes; that is, it’s not the same one every time, but seems to change if I login again (and maybe reload the browser?).

    I’ve tried inserting the image from different browsers into a fresh page, but it still mostly displays only in FF-dev and IE, but not Chrome or FF-reg.

    I don’t always see that weird CSS class either. I see it most consistently from FF-reg, both in the Text tab of the page and from FF-reg WebDev-Inspector or Firebug. I don’t see it in Chrome but I do see a local style=”display: none !important” added to the tag. IE and FF-dev show no weird extra classes or styles.

    Even if I try to disable the style or class from inside WebDev or Firebug, it snaps back anyway. I have no clue where this stuff gets added. It seems to behave like some kind of malware but I don’t know how to begin to find out more, and so far it seems to be more a nuisance than dangerous. I’m running Wordfence and I don’t see anything serious coming up in the scans. I’ve tried disabling all but the most essential plugins (e.g. Wordfence) and there was no change.

    An example of the altered tag (in FF-reg) is:

    <img 
      class="alignnone size-full wp-image-2462 <strong>wzxehmwknkjwmsonqgze</strong>" 
      src="http://mydomain.com/wp/wp-content/mymedia/banner160x600.jpg" 
      alt="banner image" 
      srcset="http://mydomain.com/wp/wp-content/mymedia/banner160x600.jpg 160w, 
        http://mydomain.com/wp/wp-content/mymedia/banner160x600-80x300.jpg 80w" 
      sizes="(max-width: 160px) 100vw, 160px" 
      width="160" 
      height="600"
    >

    I only just discovered this today, but it’s probably been close to a year since I inserted any images to the pages of this site, so I have no idea how long this has been going on. When I Google the problem, I’m seeing reports of similar problems from an old update from a little over a year ago, but people mostly talk about checking for potentially interfering plugins, like slideshows or photo galleries. This site has nothing like that.

    Any insights about this would be most appreciated! I need to do some work with images and I need to have a clean installation, especially since we want other sites to link to these images.

    Let me know if you need more info. Thanks very much in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Evolvingdoor

    (@evolvingdoor)

    Sorry, I thought I would be able to edit the post after submitting. I tried to bold the weird css class but it came out with just the strong-tag code. Ignore that part of the example tag.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    1. This may be a plugin or theme conflict. Please attempt to disable all plugins, and use one of the default (Twenty*) themes. If the problem goes away, enable them one by one to identify the source of your troubles.

    2. Please provide a link to a page on your site where we can see this. Thanks.

    Thread Starter Evolvingdoor

    (@evolvingdoor)

    Hi Steve. Thanks for getting back to me. In the process of preparing a sample page for you, I think I have figured out what the problem is, which is that AdBlockPlus (installed on FF-reg and Chrome) was blocking the image (which is 160×600, a standard ad size). This explains why I’m getting it on those browsers but not on others where AdBlockPlus is not installed.

    I’m still not sure why there’s a weird class being inserted, but maybe that’s being inserted by AdBlock?? (If so, that concerns me a lot…)

    In any case, sorry for the false alarm. And many thanks for your help.

    Wendy

    Thread Starter Evolvingdoor

    (@evolvingdoor)

    I’ve discovered more information about this problem. It seems what is adding this CSS class is AdBlockPlus. What is especially disturbing is that it even alters the source code (!!). That is, it doesn’t just change the display settings within the browser, but actually changes the source code. I’ve tested this. It seems to do this for JPG images (and I think it does it when the image is close to a standard ad size) but doesn’t seem to do it for PNG. I haven’t tested it using a GIF.

    When I disable ABP on my site and add a media image, it displays fine and no extra CSS class is added. But as soon as I turn ABP back on and refresh the page, not only is the image no longer visible but there is now the signature string of letters added as a CSS class. When I went back to check the source code from inside the WP editor, I found the class was added, even though it had not been there before.

    I find this greatly disturbing! How is ABP able to reach in and alter source code?? And how is this not considered malware??

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you have an issue with ABP, you should take it up with them. 🙂 When you install browser plugins, they alter what happens in the browser. That’s what they’re supposed to do.

    However, thanks for letting us know what the issue is/was.

    Thread Starter Evolvingdoor

    (@evolvingdoor)

    Of course plugins alter how a browser renders a site, but they shouldn’t be reaching in and changing a website’s source code, and that’s what ABP is doing. I would think this should be considered a security issue for WordPress.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Images not loading, weird CSS class inserted’ is closed to new replies.