diff --git a/README.md b/README.md index 4638a32..fa0cdaf 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ -# biscotti -Biscotti bakes your WordPress logged in user cookie for an extended period of time. +# Biscotti + +Biscotti is a plugin that changes the expiration of the logged in user cookie in WordPress to one year. Because some people hate entering their passwords. + +To install this plugin, drop `biscotti.php` into your site's `wp-content/mu-plugins` directory. diff --git a/biscotti.php b/biscotti.php new file mode 100644 index 0000000..b0f7cd6 --- /dev/null +++ b/biscotti.php @@ -0,0 +1,39 @@ + + * @license GPL-3.0 + * + * @wordpress-plugin + * Plugin Name: Biscotti + * Plugin URI: https://github.com/boogah/biscotti + * Description: Bakes your cookie for an extended period of time. + * Version: 1.0.0 + * Author: Jason Cosper + * Author URI: https://jasoncosper.com/ + * License: GPL-3.0 + * License URI: http://www.gnu.org/licenses/gpl-3.0.txt + */ + +// If this file is called directly, abort. +if ( ! defined( 'WPINC' ) ) { + die; +} + +/** + * Set the login cookie's expiration date to one year. + * + * @since 1.0.0 + * @param int $expirein Seconds. + */ +function biscotti_wp_cookie_logout( $expirein ) { + return 31556926; +} +add_filter( 'auth_cookie_expiration', 'biscotti_wp_cookie_logout' );