Skip to content

Instantly share code, notes, and snippets.

Brandon Hubbard bhubbard

Block or report user

Report or block bhubbard

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e91dde3cd46ed5db259c3c6dc53d5b96
#!/usr/bin/env bash
command -v bc > /dev/null || { echo "bc was not found. Please install bc."; exit 1; }
{ command -v drill > /dev/null && dig=drill; } || { command -v dig > /dev/null && dig=dig; } || { echo "dig was not found. Please install dnsutils."; exit 1; }
NAMESERVERS=`cat /etc/resolv.conf | grep ^nameserver | cut -d " " -f 2 | sed 's/\(.*\)/&#&/'`
PROVIDERS="
@bhubbard
bhubbard / delete-orphans-usermeta.sql
Created Apr 8, 2019 — forked from carlosleopoldo/delete-orphans-usermeta.sql
Delete all orphans user meta in WordPress
View delete-orphans-usermeta.sql
DELETE FROM wp_usermeta
WHERE NOT EXISTS (
SELECT * FROM wp_users
WHERE wp_usermeta.user_id = wp_users.ID
)
View gist:44ace4313ff5719b9494c7ac2c502cc8
#!/usr/bin/env bash
# purpose delete inactive WordPress themes
WPPATH=""
WPFLAGS="--path=${WPPATH} --skip-plugins --skip-themes --allow-root"
THEMEEXCEPTIONS=(
twentynineteen
)
View datatables-wp-admin-style
.dataTables_info {
float:right;
margin-right:7px;
padding:10px;
}
.dataTables_paginate {
float:right;
height:28px;
margin-top:3px;
View class-phpass.php
<?php
/**
* Portable PHP password hashing framework.
*
* @package phpass
* @since 2.5.0
* @version 0.3 / WordPress
* @link http://www.openwall.com/phpass/
*/
View class-ftp-pure.php
<?php
/**
* PemFTP - A Ftp implementation in pure PHP
*
* @package PemFTP
* @since 2.5.0
*
* @version 1.0
* @copyright Alexey Dotsenko
* @author Alexey Dotsenko
View gist:894040fec6421f891f1f88f2c6428ef0
DELETE FROM wp_og6o50l3ph_options WHERE option_name LIKE '%jpsq_sync-%'
https://wordpress.org/support/topic/jpsq_sync-table-constantly-generated-to-the-db/
View gist:b4e873aa2f5936c8a8ff9d8ca5260a49
// Use only to test/check object cache.
add_action( 'wp_footer', function () {
$GLOBALS['wp_object_cache']->stats();
echo '<style>.site-menu { display:none!important;}</style>';
var_dump( wp_json_encode( $GLOBALS['wp_object_cache']->stats() ) );
} );
View get-all-metakeys.php
<?php
function get_all_meta_keys(){
global $wpdb;
$table = $wpdb->prefix . 'postmeta';
$results = $wpdb->get_results("SELECT DISTINCT meta_key FROM $table;");
var_dump($results);
View get-queries.php
<?php
/**
* Default Get Queries
*
* @access public
* @param WP_REST_Request $request
* @return void
*/
public function get_queries( WP_REST_Request $request ) {
You can’t perform that action at this time.