View goawayxmlrpc.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Plugin Name: goawayxmlrpc | |
Plugin URI: | |
Description: DDoS have your sysadmin's aggroed? Place this in your /wp-content/mu-plugins/ for immediate drop-in activation. Disable XMLRPC pingback.ping and pingback.extensions.getPingbacks methods blog/site/network wide. Thanks WP Tavern, kowata, fris, Brad Vincent. pingbackの停止! | |
Version: 0.1 | |
Author: kaichi, WP Tavern, kowata, fris, Brad Vincent | |
Author URI: | |
*/ | |
if ( ! defined( 'WPINC' ) ) { |
View gist:9f5a3bf2e8c3a37808a83f2379a9ee23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# query db to see the largest tables | |
SELECT | |
table_schema as `Database`, | |
table_name AS `Table`, | |
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` | |
FROM information_schema.TABLES | |
ORDER BY (data_length + index_length) DESC; |
View gist:ea3e262b1ba61e9cb03dc9dec676935d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# revisions genocide | |
DELETE a,b,c | |
FROM wp_posts a | |
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id) | |
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id ) | |
LEFT JOIN wp_term_taxonomy d ON ( b.term_taxonomy_id = d.term_taxonomy_id) | |
WHERE a.post_type = 'revision' | |
AND d.taxonomy != 'link_category'; |
View gist:bf5e249997eeb59eeae599deb182cd40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT CONCAT( 'DROP TABLE `', TABLE_NAME, '`;' ) AS query | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_NAME LIKE '%_gmp_%' |
View gist:9f3efa56b50841280811b2ef8696b12b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* bodymargin.js | |
* | |
* Dynamic margin-top for body element. | |
*/ | |
if (typeof jQuery === 'undefined') { | |
throw new Error('Flation Theme\' requires jQuery') | |
} |
View gist:8c9e3b701ac138b19a7d012a34d34c6c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName localhost | |
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs" | |
<Directory "/Applications/XAMPP/xamppfiles/htdocs"> | |
ServerSignature Off | |
Options Indexes FollowSymLinks IncludesNoExec | |
AllowOverride All | |
Require all granted | |
</Directory> | |
ErrorLog "logs/localhost-error_log" |
View gist:dd63a34c7b05229ca01ec464b669814e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$to = "test@email.com"; | |
$header = "From: {$to}"; | |
$subject = "Test Subject Here"; | |
$body = "Hi this is a test email to see if the mail() function is working properly on your site."; | |
if (mail($to, $subject, $body, $header)) { | |
echo ("<p>Message successfully sent!</p>"); | |
} else { | |
echo("<p>Message delivery failed...</p>"); |
View gist:d1395aa4aa37c8a74be729ea3b4a0a1b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Personal Options | |
add_action( 'personal_options_update', 'save_custom_profile_fields' ); | |
add_action( 'edit_user_profile_update', 'save_custom_profile_fields' ); | |
function save_custom_profile_fields( $user_id ) { | |
update_user_meta( $user_id, 'phone_number', $_POST['phone_number'], get_user_meta( $user_id, 'phone_number', true ) ); | |
update_user_meta( $user_id, 'greeting', $_POST['greeting'], get_user_meta( $user_id, 'greeting', true ) ); | |
} | |
add_filter( 'user_contactmethods', 'add_contact_option', 10, 2 ); | |
function add_contact_option( $user_contactmethods, $user ) { |
View gist:371b19c759e990e82eba306c47ad4626
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Personal Options | |
add_action( 'personal_options_update', 'save_custom_profile_fields' ); | |
add_action( 'edit_user_profile_update', 'save_custom_profile_fields' ); | |
function save_custom_profile_fields( $user_id ) { | |
update_user_meta( $user_id, 'teampage', $_POST['teampage'], get_user_meta( $user_id, 'teampage', true ) ); | |
} | |
add_action( 'personal_options', 'add_profile_options'); | |
function add_profile_options( $profileuser ) { |
View gist:c3213ede9e1eb56c7daf924719d2c886
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove Default personal_options | |
add_filter('user_contactmethods','hide_profile_fields',10,1); | |
function hide_profile_fields( $contactmethods ) { | |
unset($contactmethods['aim']); | |
unset($contactmethods['jabber']); | |
unset($contactmethods['yim']); | |
return $contactmethods; | |
} |
OlderNewer