Skip to content

Instantly share code, notes, and snippets.

View bhowe's full-sized avatar

Blake Howe bhowe

View GitHub Profile
@bhowe
bhowe / server-timing-extra.php
Created February 9, 2023 02:59 — forked from felixarntz/server-timing-extra.php
Mini WordPress plugin that uses the Server Timing API of the Performance Lab plugin (also see https://github.com/WordPress/performance/pull/553) to capture additional metrics
<?php
/**
* Plugin Name: Server Timing Extra
* Plugin URI: https://gist.github.com/felixarntz/63c05392dbf7d51cc7f8f4a424b1ff39
* Description: Exposes additional Server-Timing metrics using the Performance Lab plugin's Server Timing API.
* Requires at least: 6.1
* Requires PHP: 5.6
* Version: 0.1.0
* Author: Felix Arntz
* Author URI: https://felix-arntz.me
@bhowe
bhowe / t5-plugin-log.php
Created August 26, 2020 17:33 — forked from thefuxia/t5-plugin-log.php
Plugin Log: Log all plugin (de)activations.
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Plugin Log
* Description: Log all plugin (de)activations.
* Version: 2012.05.27
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*
@bhowe
bhowe / Wordpress-Database-Overview.md
Last active January 1, 2020 17:55 — forked from manfromanotherland/Wordpress-Database-Overview.md
Wordpress database overview and useful SQL Queries for Wordpress sites

Wordpress Database

Overview of Wordpress database tables:

  • wp_commentmeta: contains information about comments posted on the Wordpress site, it has four fields: meta_id, comment_id, meta_key, and meta_value. Each meta_id is related to a comment_id. Example of meta information would be the status of a comment.
  • wp_comments: it contains comment author name, url, email, comment, etc.
  • wp_links: used to manage blogrolls
  • wp_options: contains most of Wordpress settings such as site url, admin email, default category, posts per page, etc. This table is also used by numerous plugins to store plugins settings.
  • wp_postmeta: contains meta information about posts, pages, and custom post types. Examples of meta information would be which template to use to display a page, custom fields, and so on. Some plugins also store plugin data in this table.
  • wp_posts: contains all posts, pages, revisions, and custom post types.
@bhowe
bhowe / fix-wordpress-permissions.sh
Last active July 22, 2018 21:15 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#this is real cute but you can also just ssh to the public HTML paste this
#root@theweb [/home2/whatever/public_html]# find . -type d -exec chmod 755 {} \;
#root@wtheeb [/home2/whatever/public_html]# find . -type f -exec chmod 644 {} \;
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
@bhowe
bhowe / temp_mail_server.md
Created June 14, 2018 18:29 — forked from gowtham1337/temp_mail_server.md
A quick guide for creating your own temporary mail server

##Overview You might have a need for a temporary mail service like mailinator.com on your own machine. This guide provides the minimum required steps to do that. The setup we will use is as follows

Procmail (Receive mail and forward to script)--->PHP Script(Parse Mail and put in Database)--->MySQL(Store the mails)--->JSON

Note: This is intended as a quick DIY for simple projects. Hence, we will not go into more details like spam detection and memory optimization.

##Instructions ####Setup Infrastructure

  1. Get a Top level domain name (Note: Getting this to work with a sub-domain will require more work and setup)
@bhowe
bhowe / .htaccess
Last active June 7, 2018 03:48 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#when troubleshooting remember htaccess is read from top to bottom with the top directives being run first.
#If there is a re-direct there, then it may be interfering with what you have added through the cPanel.
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
@bhowe
bhowe / Deployment
Last active August 29, 2015 14:00 — forked from oodavid/README.md
# Deploy your site with git
This gist assumes:
* you have a local git repo
* with an online remote repository (github / bitbucket etc)
* and a cloud server (Rackspace cloud / Amazon EC2 etc)
* your (PHP) scripts are served from /var/www/html/
* your webpages are executed by apache
* apache's home directory is /var/www/