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 | |
use Carbon_Fields\Container; | |
use Carbon_Fields\Field; | |
Container::make('theme_options', 'thisThing Options') | |
->add_fields([ | |
Field::make('complex', 'thisThing_options') | |
->set_min(1) | |
->set_max(1) | |
->add_fields('Basic', [ |
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
// Directly executing ruby | |
wpscan.rb --url https://website.com --wordlist darkc0de.lst --username admin | |
ruby ./wpscan.rb --url https://website.com --wordlist darkc0de.lst --username admin | |
ruby ./wpscan.rb --url https://website.com | |
ruby ./wpscan.rb -u https://website.com --wordlist darkc0de.lst --username admin threads 50 | |
ruby wpscan.rb --url https://website.com --wordlist passwords.txt threads 50 |
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
# shortform git commands | |
alias g='git' | |
# get most modified files and counts | |
git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count\tfile"} {print $1 "\t" $2}' | sort -g | |
# Locally checkout all remote branches of a repository | |
git branch -r | cut -d '/' -f2 | grep -Ev '( |master)' | xargs -Ibranch git checkout -b branch origin/branch | |
# Open current Git repository URL |
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
DELETE FROM `wp_options` WHERE `option_name` LIKE ('%\_transient\_%') |
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
SET @start = '2016-1-01'; | |
SELECT AVG(CHAR_LENGTH(post_content)) AS avgLength | |
FROM wp_posts | |
WHERE post_type = 'post' | |
AND post_status = 'publish' | |
AND post_date >= @start | |
AND post_date < @start + INTERVAL 1 MONTH; |
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
add_action( 'init', function () { | |
global $current_user; | |
$username = $current_user->user_login; | |
if ( ($username == 'the-username') ) { | |
if ( is_admin() && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { | |
wp_redirect( home_url() ); | |
exit; | |
} | |
} |
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
UPDATE wp_posts SET comment_status = 'closed', ping_status = 'closed'; |
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
# As stated here: https://www.siteground.com/kb/how_to_disable_trackbacks_in_wordpress/ | |
UPDATE wp_options SET option_value = 'closed' WHERE wp_options.option_id =20 AND wp_options.blog_id =0; |
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 | |
ob_start(); | |
// Run code with here, must include 'echo' or alike | |
$output = ob_get_contents(); | |
ob_end_clean(); |
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 | |
$time_start = microtime(true); | |
// Run code here | |
$time_end = microtime(true); | |
$time = $time_end - $time_start; | |
echo '<br> <h1> Time = '.$time.' seconds. </h1> <br>'; |