Skip to content

Instantly share code, notes, and snippets.

View timnashcouk's full-sized avatar

Tim Nash timnashcouk

View GitHub Profile
@timnashcouk
timnashcouk / wp-config.php
Last active October 25, 2023 15:51
Simple WordPress Memory Management
/**
* Memory Management for WordPress
* Provides different resources based on logged in user or not
*/
ini_set( 'memory_limit', '64M' ); // Set to the lowest possible value as this is the default.
$logged_in_user = false;
if( !empty( $_COOKIE ) ){ // $_COOKIE is super variable is always defined, but often empty
foreach ( $_COOKIE as $cookie_name => $cookie_value ) {
if ( 0 === strpos( $cookie_name, 'wordpress_logged_in_' ) ) { // Look for if cookie is present for logged in user
$logged_in_user = true;
@timnashcouk
timnashcouk / wp-pgp-email.php
Last active April 19, 2017 19:42
Using PGP in WordPress
<?php
/**
* Plugin Name: WP PGP Email
* Version: 0.1
* Description: Provides mechanism to encrypt outgoing email using PGP
* Author: Tim Nash
* Author URI: https://timnash.co.uk
* Plugin URI: https://timnash.co.uk/wordpress-pgp-email
*
*