FreeMoby

My small doors.

Archive for the 'WordPress Plugins' Category

WordPress Plugin: Cookie Timeout

Posted by Moby on Saturday, May 21st, 2005 at 11:38 am in WordPress Plugins | 51 Comments

My wife called me to tell me that people could reach her site’s admin page (specifically her mother), and wanted me to check her site. I told her that she probably forgot to logout, and I was right. The default expiration for the login cookie is one year. I just wrote a small plugin to change that value to something more reasonable.

Version History:

  • 0.60 Compatible with WordPress 2.7. (2008-12-11)
  • 0.50 Compatible with WordPress 2.5. (2008-03-29)
  • 0.42 Fixed another redeclare error and the plugin can now be run from sub-directories. (2008-03-22)
  • 0.40 Added option to ignore the “Remember me” checkbox on the login page. (2006-06-13)
  • 0.36 Added nonce security. (2006-06-03)
  • 0.35 Fixed “Cannot redeclare wp_setcookie()” error when the plugin is activated. (2006-04-10)
  • 0.31 Compatible with WP 2.01. Simply some internal housekeeping on their part. (2006-01-31)
  • 0.30 Compatible with WP 2.0. Now respects the new “Remember me” checkbox on login (2005-12-21)
  • 0.20 Added ability to expire the cookie when the current browser session is closed (2005-06-27)
  • 0.11 Added message for the need to logoff after making changes (2005-05-23)
  • 0.10 Initial version

NOTE: If you want this plugin’s values to work on password protected posts you have to replace the wp-pass.php file in the root of your installation with the following version:

WordPress Plugin: Frame Buster

Posted by Moby on Thursday, March 31st, 2005 at 7:09 pm in WordPress Plugins | 8 Comments

I’ve written my first WordPress plugin. It’s called Frame Buster. This technique is also called a frame breaker or frame busting. It places some JavaScript in the heading of all pages that will prevent the page from appearing in someone else’s frame. This happened to one of my sites a couple of years ago and it was done to steal the site’s content. I did not like it. It should be noted that it will only work if the client browser has JavaScript enabled.

Version History:

  • 0.30 Changed name to avoid confusion with another plugin. (2010-02-18)
  • 0.20 Compatible with WP 2.0. It won’t bust out of the post preview frame. (2005-12-21)
  • 0.10 Initial version

This is the code that it uses:

<script type="text/JavaScript"><!-- 
if (parent.frames.length > 0) top.location.replace(document.location); //–->