CSS Naked Day

CSS Naked Day plugin for WordPress automatically strips off XML/HTML stylesheet references, embedded stylesheets and inline styles—all without editing your template! It also provides a function to determine whether it is the 9th of April on the recommended worldwide 48-hour CSS Naked Day period or just your local 24-hour period if ever you want to automate a message telling viewers why your site is in the nude.

Download Plugin

Usable Functions

bool is_naked_day(void)

returns true when it is the 9th of April on the time span you’ve set, false otherwise. Sample usage:

<?php
  if (is_naked_day()) {
?>  <h3>What happened to the design?</h3>
    <p>To know more about why styles are disabled on this website
      visit the <a href="http://naked.dustindiaz.com" title="Web
      Standards Naked Day Host Website">Annual CSS Naked Day</a>
      website for more information.</p>
<?php
  }
?>

Known Issues

The plugin would also delete occurences of inline styles (style="") that are intended as text and not as the attribute for styling markup itself. For example, in CSS tutorial pages.

Resolved in Version 1.1.2

In versions prior to 1.1.2, the plugin would cause errors for some inline styles that have escaped quotation marks of the same type as the attribute value delimiter.

For example:

style="font-family:\"Lucida Grande\",\"Lucida Sans Unicode\",sans-serif;"

… would leave …

Lucida Grande\",\"Lucida Sans Unicode\",sans-serif;"

… in the markup, as the regular expression could only remove code from the style attribute only up to the first matching quotation mark without regard to the escaped ones.

Change Log

Version 1.2
Released 4 April 2008

Changes:

  • Changed CSS Naked Day date to reflect event move from April 5 to 9.
Version 1.1.2
Released 6 April 2007

Changes:

  • Fixed regex for patterns to avoid possible conflicts.
  • Fixed known issue about escaped quotation marks in inline styles.
Version 1.1.1
Released 5 April 2007

Changes:

  • Fixed stylesheet reference regex/consuming all <link> elements before targetted one.
Version 1.1
Released 31 March 2007

Changes:

  • Added option to activate only during the 24-hour local time.
  • Added configuration page.
Version 1.0.1
Released 30 March 2007:

Changes:

  • Fixed embedded stylesheet regex/conflict with delimiter.
Version 1.0
Released 28 March 2007
  • First release of the CSS Naked Day plugin.

License

Copyright © 2007-2008 Aja Lorenzo Lapus

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Read the full license

179 Replies to “CSS Naked Day”

  1. @Jonathan:

    It isn’t necessary, an EOF is an automatic closing PHP tag. It ensures that no whitespace or any character for that matter would be sent to the browser before the HTTP headers are processed.

  2. UH OH!

    Just so you know, CSS Naked day has been changed to April 9th this year. (Naked Day Homepage) So if you are able, you may want to get an update out there pronto so all the nudists with your plugin don’t reveal themselves too early.

  3. Thanks for that Steve. I was actually watching the CSS Naked Day homepage earlier today, but it seemed to me that Dustin wasn’t updating the day before the event. Now I know why. I’ll be changing that immediately. 🙂

  4. Thanks for updating this – I awoke to a naked site thismorning, only to learn that the date had moved, and found your plugin was ready to be updated on the spot.

    I wonder though – I have some javascript that makes my naked page look ugly. How might I go about getting that removed on the day with your plugin? I tried to alter it myself, but all those lines of regex look complicated. The line is:

    What do you think, is this something I can add to the plugin?

  5. Aja, great plugin. Works like charm.

    I’ve just thrown in a small change allowing to test-drive one’s nudity. Here is a diff.

    43a44,47
    > if (get_option('aja_naked_day_testdrive')) {
    > return true;
    > }
    >
    66a71,72
    > $aja_setting = ($_POST['aja_textdrive']) ? true : false;
    > update_option('aja_naked_day_testdrive', $aja_setting);
    80a87,90
    >
    > You could also test drive your nudity any time you want. Now?
    > <input type="checkbox" name="aja_textdrive" checked="checked" />
    >

  6. P.S. The sentence in the options pane and the checkbox should be surrounded by p-tags but they obviously got stripped.

  7. Maybe I’ll try to incorporate “nudity testing” with authorization, so that only administrators would see the site naked before the scheduled date and time. Thanks for that suggestion! It would really be useful. 🙂

  8. A? It maybe got stripped because of the PHP tags. Now it must work fine.

    global $user_ID;
    if ( $user_ID && current_user_can('level_10') && get_option('aja_naked_day_testdrive') ) {
    return true;
    }

  9. Question:

    I’m trying to figure out the 24 hour vs. 48 hour thing and haven’t found any answers. I assume that the 24 hour option makes the naked view active for the day of April 9th as defined by the timezone settings of my WordPress installation, and that the 48 hour thing does it based on a range of when it’s April 9th anywhere in the world. Am I correct about this? If so, at what precise time does the 48 hour option turn the site naked?

  10. Yes, you are correct, Douglas. That date/time of the 48-hour option would be from 12 noon of the 8th of April, up to 12 noon of the 10th of April—both times in GMT/UTC. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *