Skip to content

Instantly share code, notes, and snippets.

@groucho75
groucho75 / db_escape.php
Last active December 17, 2015 00:29
Minimal security for Database Queries and Results: MySQLi Prepared Statement & XSS Mitigation functions. Based on: https://www.owasp.org/index.php/PHP_Security_Cheat_Sheet
<?php
/**
* DB Configuration
*/
$Host ='localhost';
$Username = 'root';
$Password = 'root';
$DatabaseName = 'test';
@groucho75
groucho75 / maintenance.php
Last active December 11, 2015 20:38
Quick maintenance mode in WordPress. Only admin can browse the blog, other people get a maintenance message. Put this php file in /mu-plugins.php
<?php
/**
* Quick maintenance mode in WordPress, using a bit of custom css and html
*
* Only admin can browse the blog, other people get a maintenance message
*
* Put this file in /wp-content/mu-plugins folder
*/
function alo_maintenance_mode() {
@groucho75
groucho75 / custom_avatar_tooltip.php
Last active December 10, 2015 22:29
Avatar Tooltip plugin customization: How to show only user bio and social links. Put this file in /wp-content/mu-plugins folder
<?php
/**
* Customization for Avatar Tooltip plugin, for WordPress
* How to show only user bio and social links. Put this file in /wp-content/mu-plugins folder
*
* More info and screenshot:
* http://www.eventualo.net/blog/2013/01/avatar-tooltip-plugin-how-to-show-only-user-bio-and-social-links/
*
* Avatar Tooltip plugin:
* http://wordpress.org/extend/plugins/avatar-tooltip/