Aja Lapus: Blogging with Standards

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 CSS Naked Day

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

123 Responses to “CSS Naked Day”

  1. 1

    Pingback Pinged on 30 March 2007, 00:57

  2. 2

    Great plugin! One question: shouldn’t there be a closing ?> at the end of the code?

    Jonathan posted on 2 April 2007, 05:50

  3. 3

    Pingback Pinged on 2 April 2007, 07:31

  4. 4

    @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.

    Aja posted on 2 April 2007, 10:13

  5. 5

    Pingback Pinged on 3 April 2007, 00:01

  6. 6

    Pingback Pinged on 3 April 2007, 01:23

  7. 7

    Pingback Pinged on 3 April 2007, 22:09

  8. 8

    Pingback Pinged on 3 April 2007, 22:11

  9. 9

    Pingback Pinged on 3 April 2007, 22:13

  10. 10

    Pingback Pinged on 3 April 2007, 22:32

  11. 11

    Pingback Pinged on 5 April 2007, 03:26

  12. 12

    Pingback Pinged on 5 April 2007, 06:05

  13. 13

    Pingback Pinged on 5 April 2007, 06:57

  14. 14

    Pingback Pinged on 5 April 2007, 14:32

  15. 15

    Pingback Pinged on 5 April 2007, 14:38

  16. 16

    Pingback Pinged on 5 April 2007, 16:16

  17. 17

    Pingback Pinged on 6 April 2007, 20:01

  18. 18

    Pingback Pinged on 9 April 2007, 22:43

  19. 19

    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.

    Steve posted on 4 April 2008, 05:18

  20. 20

    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. :)

    Aja posted on 4 April 2008, 09:34

  21. 21

    Plugin and plugin page updated, and submitted to Dustin. We’re good to go, guys! :)

    Aja posted on 4 April 2008, 11:28

  22. 22

    Pingback Pinged on 5 April 2008, 01:36

  23. 23

    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?

    joshnunn posted on 5 April 2008, 07:41

  24. 24

    Pingback Pinged on 5 April 2008, 11:31

  25. 25

    Pingback Pinged on 5 April 2008, 15:37

  26. 26

    Pingback Pinged on 5 April 2008, 17:06

  27. 27

    Pingback Pinged on 6 April 2008, 00:09

  28. 28

    Pingback Pinged on 6 April 2008, 09:51

  29. 29

    Yey! CSS Naked Day!

    Will use your plugin this year, Aja. Thanks.

    Dave posted on 6 April 2008, 14:46

  30. 30

    Pingback Pinged on 6 April 2008, 21:30

  31. 31

    Pingback Pinged on 7 April 2008, 09:44

  32. 32

    Pingback Pinged on 7 April 2008, 12:11

  33. 33

    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” />
    >

    Nikola posted on 7 April 2008, 23:49

  34. 34

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

    Nikola posted on 7 April 2008, 23:51

  35. 35

    Pingback Pinged on 8 April 2008, 02:00

  36. 36

    Pingback Pinged on 8 April 2008, 03:52

  37. 37

    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. :)

    Aja posted on 8 April 2008, 04:37

  38. 38

    Pingback Pinged on 8 April 2008, 04:39

  39. 39

    Pingback Pinged on 8 April 2008, 05:05

  40. 40

    @Aja, a very valid point :)

    Just add this in the is_naked_day() funtion.

    And you’re good to go :)

    reference

    Nikola posted on 8 April 2008, 06:01

  41. 41

    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;
    }

    Nikola posted on 8 April 2008, 06:03

  42. 42

    Pingback Pinged on 8 April 2008, 06:15

  43. 43

    Pingback Pinged on 8 April 2008, 06:45

  44. 44

    Pingback Pinged on 8 April 2008, 07:01

  45. 45

    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?

    Douglas Bell posted on 8 April 2008, 08:04

  46. 46

    Pingback Pinged on 8 April 2008, 09:34

  47. 47

    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. :)

    Aja posted on 8 April 2008, 09:55

  48. 48

    Pingback Pinged on 8 April 2008, 10:56

  49. 49

    Pingback Pinged on 8 April 2008, 13:12

  50. 50

    Pingback Pinged on 8 April 2008, 15:04

  51. 51

    Pingback Pinged on 8 April 2008, 15:23

  52. 52

    Pingback Pinged on 8 April 2008, 16:42

  53. 53

    let’s get naked again :)

    had posted on 8 April 2008, 17:09

  54. 54

    Pingback Pinged on 8 April 2008, 18:14

  55. 55

    Pingback Pinged on 8 April 2008, 18:39

  56. 56

    Pingback Pinged on 8 April 2008, 18:43

  57. 57

    Pingback Pinged on 8 April 2008, 18:45

  58. 58

    Pingback Pinged on 8 April 2008, 18:49

  59. 59

    Pingback Pinged on 8 April 2008, 19:19

  60. 60

    Can’t wait to join my first naked day! Woot! :)

    -Dulce

    DulceNegosyante Helps You Make Money Online posted on 8 April 2008, 19:24

  61. 61

    Pingback Pinged on 8 April 2008, 19:29

  62. 62

    Pingback Pinged on 8 April 2008, 19:36

  63. 63

    Pingback Pinged on 8 April 2008, 20:04

  64. 64

    Pingback Pinged on 8 April 2008, 21:04

  65. 65

    Pingback Pinged on 8 April 2008, 22:02

  66. 66

    Oh!

    this time is 8.April 2008 but your plugin stripped off all my style.css not 9.april 2008 ;);)

    /shocking/

    and your site is also without style.css hours before 9.04.2008 ;)

    regards

    Monika posted on 8 April 2008, 22:31

  67. 67

    Pingback Pinged on 8 April 2008, 22:35

  68. 68

    Pingback Pinged on 8 April 2008, 22:36

  69. 69

    Monika, my plugin defaults to 48 hours of April 9 anywhere around the world to activate. Maybe you wanted to set your blog to just the local time. Look for the Options/Settings on your WordPress admin. :)

    Aja posted on 9 April 2008, 00:21

  70. 70

    Pingback Pinged on 9 April 2008, 00:24

  71. 71

    Pingback Pinged on 9 April 2008, 00:53

  72. 72

    Pingback Pinged on 9 April 2008, 01:03

  73. 73

    Pingback Pinged on 9 April 2008, 01:31

  74. 74

    Pingback Pinged on 9 April 2008, 01:31

  75. 75

    Pingback Pinged on 9 April 2008, 01:34

  76. 76

    Pingback Pinged on 9 April 2008, 01:42

  77. 77

    Pingback Pinged on 9 April 2008, 02:59

  78. 78

    Pingback Pinged on 9 April 2008, 03:09

  79. 79

    Pingback Pinged on 9 April 2008, 05:56

  80. 80

    Pingback Pinged on 9 April 2008, 07:47

  81. 81

    Pingback Pinged on 9 April 2008, 08:04

  82. 82

    Pingback Pinged on 9 April 2008, 09:53

  83. 83

    Pingback Pinged on 9 April 2008, 10:10

  84. 84

    Pingback Pinged on 9 April 2008, 10:20

  85. 85

    Pingback Pinged on 9 April 2008, 10:33

  86. 86

    Pingback Pinged on 9 April 2008, 13:07

  87. 87

    Pingback Pinged on 9 April 2008, 14:03

  88. 88

    Pingback Pinged on 9 April 2008, 15:17

  89. 89

    Pingback Pinged on 9 April 2008, 15:31

  90. 90

    Pingback Pinged on 9 April 2008, 15:34

  91. 91

    Pingback Pinged on 9 April 2008, 15:42

  92. 92

    Pingback Pinged on 9 April 2008, 15:57

  93. 93

    Pingback Pinged on 9 April 2008, 16:02

  94. 94

    Pingback Pinged on 9 April 2008, 16:53

  95. 95

    Pingback Pinged on 9 April 2008, 17:51

  96. 96

    Pingback Pinged on 9 April 2008, 18:04

  97. 97

    Pingback Pinged on 9 April 2008, 18:55

  98. 98

    Pingback Pinged on 9 April 2008, 20:11

  99. 99

    Pingback Pinged on 9 April 2008, 20:31

  100. 100

    Pingback Pinged on 9 April 2008, 21:00

  101. 101

    Pingback Pinged on 9 April 2008, 21:01

  102. 102

    Pingback Pinged on 9 April 2008, 21:57

  103. 103

    I miss accesskeys on this website

    Andi posted on 9 April 2008, 22:39

  104. 104

    Pingback Pinged on 9 April 2008, 23:20

  105. 105

    Pingback Pinged on 9 April 2008, 23:43

  106. 106

    Pingback Pinged on 9 April 2008, 23:44

  107. 107

    Pingback Pinged on 10 April 2008, 00:05

  108. 108

    Pingback Pinged on 10 April 2008, 00:16

  109. 109

    Great Plugin! Thank you.

    tex posted on 10 April 2008, 00:17

  110. 110

    Pingback Pinged on 10 April 2008, 00:22

  111. 111

    Pingback Pinged on 10 April 2008, 00:45

  112. 112

    Pingback Pinged on 10 April 2008, 01:55

  113. 113

    Pingback Pinged on 10 April 2008, 02:15

  114. 114

    Pingback Pinged on 10 April 2008, 04:30

  115. 115

    Pingback Pinged on 10 April 2008, 05:14

  116. 116

    Pingback Pinged on 10 April 2008, 06:01

  117. 117

    Pingback Pinged on 10 April 2008, 20:15

  118. 118

    Pingback Pinged on 13 April 2008, 13:45

  119. 119

    Pingback Pinged on 19 April 2008, 18:43

  120. 120

    Pingback Pinged on 29 April 2008, 03:38

  121. 121

    Pingback Pinged on 2 May 2008, 18:44

  122. 122

    hi there .thanks for plugin:

    Does anybody know if tis script is compatible with Wordpress 2.5.1?

    Thanks in advance for any help on this!

    best regards

    baron posted on 6 May 2008, 23:34

  123. 123

    Yes, it is compatible with the latest WordPress. :D

    Aja posted on 10 May 2008, 17:54

Post another response »

Leave a Reply

Reply guidelines: Only the XHTML elements <a href="" title="">, <abbr title="">, <acronym title="">, <blockquote cite="">, <code>, <em> and <strong> are allowed. Line breaks and paragraphs are automatically generated. I am using a comment spam filter. Don't fret if your replies do not appear right away—don't repeatedly submit them. I have the right to remove or edit comments I feel inappropriate for my site.

Copyright and Publication Information

Copyright © 2005–2008, Aja Lorenzo Lapus. All rights reserved.
All content are properties of Aja Lorenzo Lapus unless stated otherwise.