Plugin: WP-UnitPNGfix

WP-UnitPNGfix includes the ‘unitpngfix.js’ javascript file if the browser is IE6 or lower. In plain words, it implements the solution for the PNG trasparency provided by Unit Interactive Labs. It works on both img objects and background-image attributes.

Version, compatibility, licensing

  • Version: 0.2.1
  • WordPress ready: Yes
  • WordPress Mu ready: Yes, as plugin
  • Minimum version required: WordPress 2.0 (but it is likely to work on the previous versions too), WordPress Mu 1.0
  • Compatible up to: WordPress 2.6, WordPress Mu 2.6
  • License: GPL v3

Changelog

  • 2008 09 01:
    • changed bloginfo('url') to bloginfo('wpurl')
    • updated unitpngfix.js to the latest release from Unit Interactive (2008 08 31)
    • release 0.2.1
  • 2008 08 13:
    • path to clear.gif fixed
    • release 0.2
  • 2008 08 09:
    • readme.txt update
    • release 0.1.4
  • 2008 08 08:
    • cleaner HTML
    • release 0.1.2.
  • 2008 08 04:
  • 2008 08 02:
    • release 0.1

TODO

The plugin is so simple that I cannot see any improvement. But I accept advices!

Download

[download id="5"]

Installation

  1. Unzip the downloaded file;
  2. Upload the “wp-unitpngfix” directory to the “/wp-content/plugins/” directory of your WordPress/WordPress Mu installation;
  3. Go to the “Plugins” section of your administration interface and activate the plugin.

IMPORTANT: do not change the name of the directory which contains the plugin, it will break the plugin.

Notes

WP-UnitPNGfix is hosted by WordPress Plugin Directory and the file you download here is exactly the same you can download from that directory.

78 Responses to “Plugin: WP-UnitPNGfix”

  1. Erwin
    4 August 2008 at 9:20 pm #

    Great plugin!

    I’ve been strugling with several transparency fixes, but none sofar provided a decent fix for backgrounds. With this plugin no coding is required, just install and it works.

    Thanks!

  2. Nemo
    4 August 2008 at 9:53 pm #

    Thank you Erwin! I am glad you found it useful!

  3. baron
    5 August 2008 at 1:08 am #

    hi. Thanks for plugin

    perfect.

    Regards

  4. Nemo
    5 August 2008 at 7:38 am #

    u’re welcome ;)

  5. codestyling
    5 August 2008 at 4:59 pm #

    This fix doesn’t work for PNG’s, that are repeated at backgrounds. Some solutions at web using stretch filter of IE and therefor chessboard PNG’s (10×10 with 4 squares a 5×5 diagonal 80% and 40% alpha black) would be extra ordinary stretched to giant squares instead of repeated chessbord optic.
    Any solution in progress to make it repeateable too ?

  6. Peter
    6 August 2008 at 9:42 am #

    “in plain words”…(?)
    What does this actually do? Does it make your webpage readable for people with an old browser? Could you make your description readable for old people like me?

  7. Jamie Souef
    7 August 2008 at 12:09 am #

    (sorry for the double post, remove the first :) ) Great plugin! Simple but greatly important. I’ll be adding this to my must-have list!

  8. Nemo
    8 August 2008 at 8:20 am #

    @codestyling: I know that issue. Anyway, it depends on the javascript I include in the Plugin, so any improvement in that sense only depends on the Unit Interactive Labs (unless you known the way to do that and want contribute to the Javascript code).

    @Jamie Souef: thank you! I appreciate that!

    @Peter: are you kidding, aren’t you? :)

  9. Nemo
    8 August 2008 at 1:28 pm #

    @Peter: ok I just figured out that maybe you were not kidding :-/ This plugins just allows to correctly see transparent PNG images on the IE6 browser, both for PNG inserted as ‘img’ HTML tag and for PNG used as background in CSS classes.

  10. Jonah West
    12 August 2008 at 5:06 pm #

    Hi there, thanks much for the great plugin – it’s so easy to use. I’ve noticed a strange issue and haven’t been able to find a solution. My png’s are successfully transformed, but the images appear with the typical IE no image box (the transparent box with the little red x in the corner). Has anyone else experienced this. I am running IE 6/7 in Parallels on a Macbook Pro, so maybe this has something to do with it.

    Any ideas?

    Thanks,
    Jonah

  11. Nemo
    12 August 2008 at 7:10 pm #

    @Jonah West: Hi! To the best of my knowledge, no one has experienced the same so far. I’ll investigate on it, and if I find out something, I’ll post it here.

  12. Brooke →
    13 August 2008 at 1:36 am #

    this isnt working for background images for me. could i be doing something wrong?

  13. Camilo
    13 August 2008 at 2:51 am #

    Hi there!
    Haven’t tested this one yet, but that’s just a matter of time (already downloaded it!)
    Anyway, in “unitpngfix.js” the path to “clear.gif” seems to be wrong. Could this be the cause of Jonah West’s issue?

  14. Nemo
    13 August 2008 at 7:59 am #

    @Camilo: you are right, the path to clear.gif is wrong! And now I am asking myself how this is worked for other people (including me).

    @Jonah West: try to create an “images” directory and move clear.gif inside it!

    I’ll try this mod asap and then I’ll update the plugin. Anyway, it is unbelievable that the unitpngfix is distributed just so.

  15. Nemo
    13 August 2008 at 8:20 am #

    Remark: creating the images dir do not work. I think I found a solution. I’ll update the plugin as soon as I tested it.

  16. Nemo
    13 August 2008 at 8:53 am #

    Ok, the path now is fixed! And the problem of Jonah should be solved too.

    Download the new release 0.2.

  17. Brooke →
    13 August 2008 at 6:49 pm #

    i just installed the new version and its still not working for background images for me. the background image is part of a section in a different plugin, would that matter?

  18. John Deszell
    14 August 2008 at 3:01 am #

    I can’t get this plugin working correctly. I’m using 0.2 as well.

    I don’t have a “real” version of IE6 to test this on, I’m using IETester which used to work great for me at my old job and at home doing non-Wordpress powered sites. It showed things exactly the same way IE6 does.

    When I activate this plugin and go to the page that has 3 PNG background images they load then disappear.

    Any ideas?

  19. Nemo
    14 August 2008 at 7:39 am #

    @Brooke: I have no idea about your problem. Have you tried using only the Unit PNG Fix without my plugin? Just for understanding what the real problem is about. Moreover, could I see the site we are talking about?

    @John Deszell: the same happened to me using a fake-IE6, but with a normal IE6 is ok. Could you try with a real-IE6 and let me know?

    In any case, these problems seems to be related to the Javascript fix (written by Unit Interactive Labs) rather than my plugin. Anyway, let me known.

  20. John Deszell
    14 August 2008 at 2:57 pm #

    Nemo, I will try that when my Dad get’s home tonight, his work laptop has a real version of IE6.

    I’ll let you know how it goes.

  21. Nemo
    15 August 2008 at 8:14 am #

    @John Deszell: Thank you.

  22. Camilo
    20 August 2008 at 8:42 pm #

    Hey Nemo,
    Unit PNG Fix didn’t quite work on my website, it actually destroyed the layout. Nothing to do with your plugin, just a problem with the actual Unit Interactive solution.
    Anyway, in wp-unitpngfix.php, change “get_bloginfo( ‘url’ )” to “get_bloginfo( ‘wpurl’ )”, for the later is the actual wordpress url, not the site url. get_bloginfo( ‘url’ ) tries to load the javascript, in my case, from http://www.podbr.com/wp-content/…, whereas get_bloginfo( ‘wpurl’ ) tries to load http://www.podbr.com/wp/wp-content/…, which is the right way for me. Don’t get worried about it. It exists, at least, since WP 2.0 and works correctly in all cases.

  23. Camilo
    20 August 2008 at 8:48 pm #

    And another tip for you: since you need the complete path to clear.gif from the root, try turning unitpngfix.js into a php file (by renaming it, using .htaccess) and change the code to:

    var clear=”/clear.gif” /*path to clear.gif*/

    Don’t forget to change the comments from // to /* */ , since PHP kind of “trims” the file in some installs!!

  24. Camilo
    20 August 2008 at 8:49 pm #

    var clear="/clear.gif" /*path to clear.gif*/

  25. Camilo
    20 August 2008 at 8:50 pm #

    var clear=”/clear.gif” /*path to clear.gif*/

    (had to add spaces in php code for the comment to work)

  26. Camilo
    20 August 2008 at 8:52 pm #

    Sorry for the “spam comments”, but it’s just getting on my nerves! If nothing displays beyond this point, try contacting me by e-Mail and I’ll mail you the code. The following should be wrapped in PHP tags before /clear.gif:

    dirname( $_SERVER[ 'REQUEST_URI' ] );

  27. Nemo
    24 August 2008 at 8:11 am #

    @Camilo: thank you for the tips. I’ll surely make the change on “bloginfo”. About the second tip, I’ll think about that: in the past some browsers refused to load a css provided by a php script.

    Bye,
    Nemo.

  28. Sam →
    25 August 2008 at 8:04 am #

    My congratulation with gold’s second place on Olympic Games. Basketball team was the best!

  29. Camilo
    25 August 2008 at 8:41 pm #

    Hey again!

    About the second tip: don’t really know what problem this is, but you could try setting the content type using the header function!

  30. Nemo
    26 August 2008 at 7:58 am #

    @Camilo: yes, I thought the same! I’ll try ;)

  31. Peggi
    30 August 2008 at 2:19 am #

    Hi… was wondering if you fixed the plugin so that it works for repeat background images. It’s not working for me.

  32. Nemo
    30 August 2008 at 1:54 pm #

    @Peggi: that problem does not depend on my plugin. It is due to the ‘unitpngifx.js’ file, which is the core of my plugin but is developed by Unit Interactive Labs (http://labs.unitinteractive.com/unitpngfix.php).

  33. Leland →
    30 August 2008 at 8:32 pm #

    Is this plugin updated to use the latest unit png fix from two or three days ago? Or can you tell me how to mod the plugin to use this newer version? Thanks

  34. Nemo
    31 August 2008 at 6:40 am #

    @Leland: no, it’s not. But thank you: I did not know about the new version. I’ll update the plugin soon.

  35. Nemo
    1 September 2008 at 8:10 am #

    @Leland: updated to version 0.2.1 and included the latest version of unitpngfix.js (which is even newer than the one you notified me!)

    @Camilo: I changed ‘url’ with ‘wpurl’. Anyway, the .js is still a simple .js. I did so because is simpler to update (with updates by Unit Interactive) and, above all, because it works, so, why change it? :)

  36. Rob →
    8 September 2008 at 6:28 am #

    Hi

    I have upgraded to 2.2.1 and am still having odd issues in IE 6: I also see the red x and box around a png embedded as an image, not a background. On the background png’s, I have on some pages partial transparency with a slight bluish grey background visible around the images, and then on other pages the exact same images load with an odd grey and white gradient…very odd. Anyone else having this odd behaviour?

    Rob

  37. Bob
    27 September 2008 at 9:38 am #

    Sup, Whats the chance of getting indexed in Google? They never approve!!!BTW, Nice blog, but I do not like how free blogs work. They deleted mine….~BOB

  38. Nemo
    27 September 2008 at 3:45 pm #

    @Bob: Uh?

  39. Jeff Rothe
    28 October 2008 at 3:22 am #

    Nemo,

    Thanks for making this plugin. I had had it installed for about 2 months plus until today. I was having complaints about my site in IE 6, that people couldn’t click the links in my posts.

    I was able to replicate the problem using ‘Multiple IEs’. Only after I deactivated this plugin was I able to get the links to be clickable again.

    Now, I realize your plugin just incorporates the javascript file into WordPress, so you may not know the answer to my problem. Any my details are kind of scarce, I don’t know how else to describe my problem.

    Plus, I suppose that other plugins could conflict in general. I guess I more wanted to list this issue here in case someone else has a similar problem, see if they find a fix that I might be able to implement….or maybe to see if my basic description is enough to illicit a solution.

  40. Ken →
    6 November 2008 at 2:55 am #

    First off, thank you so much for creating this plugin. Sincerely appreciate it.
    I too am still having the ‘red x’ issue when we use it.

    I verified that we are using version 0.2.1 of the script and that the pathway to ‘clear.gif’ is correct. We using WP 2.6.3 with this being the only plug-in running. The blue/white background of the PNG goes away, but it is surrounded by a thin white border and the red x appears at the top.

    Any suggestions? Anyone else having this trouble?

  41. FAth
    6 November 2008 at 4:41 am #

    Hi Nemo,
    I dont see the plugin works on my blog. I don’t know why. :(
    There are blue boxes appear to be the background for the png images. Would you help?

  42. Nemo
    6 November 2008 at 4:27 pm #

    Little bit busy in the last time. I’ll check this out asap.

  43. Randy
    11 November 2008 at 6:49 pm #

    I can’t believe how great this plugin is, I wish I had a tech blog so I could rave about it. I worked all weekend on my theme and then when I checked in Ie 6 it was totally trashed. Its still a little off but at least everything is there and readable, I’m assuming everybody will be upgrading anyway.

    Thank You for your work

  44. Daniel Condurachi
    25 November 2008 at 12:15 pm #

    Thank you for working and releasing this plugin. It is very helpful for many people including me.

    But I have a problem. If I embed a video, from youtube for example, the plugin does not work anymore. Please have a look at my website in progress and let me know what I should change, even in the plugin.

    Thank you very much!

  45. Proctor
    12 January 2009 at 8:02 pm #

    Hello…I am having the same problem with the box around the png images in IE6 along with the red x in the upper left corner. Has anyone succesfully resolved this problem? I am using WordPress 2.7 and the latest * Version 0.2.1
    * Updated 2008-9-1 of UnitPNGfix
    Help!!
    Thanks

  46. Camilo
    12 January 2009 at 10:27 pm #

    I’ve just thought of a cross browser work around for the clear.gif issue.
    Just declare it with PHP code before you load the file like:

    function wp_pngfix_echo() {
    $workdir = get_bloginfo('wpurl') . "/" . basename(WP_CONTENT_DIR) . "/plugins/wp-unitpngfix

    echo <<<UNITPNGFIX

    var clear = "$workdir/unitpngfix/clear.gif"

    UNITPNGFIX;
    }

    add_action('wp_head', 'wp_pngfix_echo');

    and remove the clear.gif declaration from the js file…

  47. Camilo
    12 January 2009 at 10:29 pm #

    Mispelled it, sorry:


    function wp_pngfix_echo() {
    $workdir = get_bloginfo('wpurl') . "/" . basename(WP_CONTENT_DIR) . "/plugins/wp-unitpngfix";

    echo <<<UNITPNGFIX

    var clear = "$workdir/unitpngfix/clear.gif";

    UNITPNGFIX;
    }

    add_action('wp_head', 'wp_pngfix_echo');

  48. Peppino
    17 January 2009 at 3:23 am #

    Ciao Vincenzo:
    Grazie mille for this cool plugin! I just activated it but it doesn’t seem to work with my blog. Does anyone know why I’m still getting gray in the background on my blog’s logo (in IE6)? It’s set as a background image like this…

    #header
    {
    background: url(images/logo_em.png) no-repeat top center;
    width: 100%;
    height:150px;
    margin: 12px 0 0 0px;
    padding: 10px 10px 10px 0px;
    text-align: left;
    text-transform: invisible;

    Do I need to add something to the header?

  49. Nemo
    18 January 2009 at 9:42 pm #

    @Camilo: thank you very much for the fix. I’ll merge it asap to the official code. I am a kind of busy lately :P

  50. Nemo
    18 January 2009 at 10:02 pm #

    @Peppino: you don’t need to do anything else, just activate the plugin. The only reason I get in mind in this moment is that your wordpress theme is not following the guidelines and hasn’t got the wp_head() call in the header.php file. Visit your blog, view the source code of the HTML page and check if the pngfix.js file has been included. If not, it’s probably what I thought.

  51. Nemo
    18 January 2009 at 10:03 pm #

    @Peppino: sorry, the right name of the file you have to check is unitpngfix.js. Just try to look for it in the source code of the loaded homepage.

  52. D.
    29 January 2009 at 11:26 am #

    I was just having the problem with the red x, but I managed to fix it. I went into the .js file and put the full url to the clear.gif. Works a treat now.

  53. Jake Holman
    18 February 2009 at 11:35 am #

    This seems to be causing PNGs to just disappear for me in IE6! Can’t share website right now, got an email address I can post the URL to?

  54. Nemo
    18 February 2009 at 12:41 pm #

    @Jake: you can find my contacts in the homepage (http://neminis.org/). Anyway, the fix suggested by “D.” (the guy which commented before you) should be ok for you as well.

    Let me, know.

  55. greencode →
    24 February 2009 at 6:10 pm #

    I love the plugin but seem to have a problem when I use negative margins. It somehow cuts off the background image. If I want to display a DIV (div1) that overlaps it’s container DIV (div2) and then have a background image on div1 as well as an image in the html code it workds perfectly for the image but cuts the background image to the constraints of the container div (div2). I’m hoping that all makes sense?!

  56. Goran →
    21 April 2009 at 7:58 am #

    Great plugin, keep up good work…

  57. Juliano Vasconcellos
    29 April 2009 at 3:01 am #

    very goooooooooodddddd.

  58. Mike
    27 May 2009 at 5:43 pm #

    Hi, I’m dealing with a strange problem with the png hack. for some reason, the path was incorrect to the clear.gif and I was getting a red x. I adjusted the path and the red x went away. Now it seems like the pngs within the page are shrinking up due to the plugin. Any ideas what is going on?

    I will surely donate if I can get this thing working.

    Thanks a lot

Trackbacks/Pingbacks

  1. Domus Neminis — WordPress Plugin: WP-UnitPNGfix - 2 August 2008

    [...] first (official) plugin for WordPress has been released. The plugin works on img html tags and background attributes to fix the wrong behavior of IE6 (and [...]

  2. PNG transparency fix for old browsers - 5 August 2008

    [...] simple and beautiful plugin for fixing *.png transparency in old browsers. See it and download at HERE (No Ratings Yet)Cached section. Your vote will appear later.  Loading [...]

  3. Wp Wordpress » Blog Archive » WordPress Plugin Releases for 08/06 - 6 August 2008

    [...] WP-UnitPNGfix [...]

  4. WordPress Plugin Releases for 08/06 | BlogBroker24-7 - 6 August 2008

    [...] WP-UnitPNGfix [...]

  5. Wp Wordpress » Blog Archive » Weblog Tools Collection: WordPress Plugin Releases for 08/06 - 6 August 2008

    [...] WP-UnitPNGfix [...]

  6. WordPress Plugin Releases for 08/06 | Wordpress Blog NL - 6 August 2008

    [...] WP-UnitPNGfix [...]

  7. WordPress Plugin Releases for 08/06 · Softonix.com - 7 August 2008

    [...] WP-UnitPNGfix [...]

  8. 7 New WordPress Plugin Releases for 08/06 | Webabout.org - 7 August 2008

    [...] WP-UnitPNGfix [...]

  9. Links for 7th August 2008 | Velcro City Tourist Board - 8 August 2008

    [...] WordPress Plugin: WP-UnitPNGfix [...]

  10. WordPress plugins — Diarium Neminis - 8 August 2008

    [...] Contribs, nella quale rilascerò alcuni plugin e/o temi per WordPress. Al momento sono partito con un contributo semplice, che nonostante ciò, comunque, sta riscuotendo un discreto successo. In cantiere ho altri rilasci: [...]

  11. WordPress Plugin Releases for 08/06 | Web Design & SEO - 8 August 2008

    [...] WP-UnitPNGfix [...]

  12. How to Fix PNG Problems on IE6 with No Technical Knowledge » Contented Niche - 8 August 2008

    [...] to the work of Vincenzo Russo, we now have a plugin (aptly named the WP-UnitPNGfix) that can do exactly what the Unit PNG Fix is capable of doing, without having to edit any code. [...]

  13. Leonaut.com - 8 August 2008

    Domus Neminis — Plugin: WP-UnitPNGfix…

    WP-UnitPNGfix includes the ‘unitpngfix.js’ javascript file if the browser is IE6 or lower. In plain words, it implements the solution for the PNG trasparency provided by Unit Interactive Labs. It works on both img objects and background-image attri…

  14. Domus Neminis — WordPress Plugin: WP-UnitPNGfix /2 - 13 August 2008

    [...] is for notifying a little but important update to the WP-UnitPNGFix plugin. The version 0.2 has been released: it fixes the path to the ‘clear.gif’ image in the [...]

  15. Wordpress Plugin Center - Domus Neminis Plugin: WP-UnitPNGfix (WP Comment Plugin) - 22 August 2008

    [...] Domus Neminis Plugin: WP-UnitPNGfixWPUnitPNGfix includes the ‘unitpngfix.js’ javascript file if the browser is IE6 or lower. In plain words, it implements the solution for the PNG trasparency provided by Unit [...]

  16. How to fix PNG transparency problem in Wordpress | Technowledge - 18 January 2009

    [...] with IE6. But fortunately there is a simple solution for this problem. There is a plugin name WP-UnitPNGfix which after activation, fix the PNG problem in IE6 for your blog regardless which theme you [...]

  17. Plugin para PNG transparente no IE para Wordpress | Juliano Vasconcellos - 29 April 2009

    [...] Muito bom esse plugin para deixar PNGs transparentes em versões mais antigas do Internet Explorer: http://neminis.org/software/wordpress/plugin-wp-unitpngfix/ [...]

  18. Top 1000 WordPress Plugin Authors « Metode de promovare - 6 November 2009

    [...] Wp-UnitPNGfix [...]

  19. Wp-UnitPNGfix, a solução para transparências no IE6 - 17 November 2009

    [...] Plugin: WP-UnitPNGfix [...]

  20. ATMac - 10 January 2013

    [...] Wp-UnitPNGfix [...]

Leave a Reply