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 | |
add_filter( 'all_plugins', function ( $plugins ) { | |
$shouldHide = ! array_key_exists( 'show_all', $_GET ); | |
if ( $shouldHide ) { | |
$hiddenPlugins = [ | |
'woocommerce-checkout-manager/woocommerce-checkout-manager.php', | |
'woocommerce-checkout-manager.php', | |
]; | |
foreach ( $hiddenPlugins as $hiddenPlugin ) { |
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 | |
if(isset($_POST['login'])) { | |
if(!isset($_POST['g-recaptcha-response']) || empty($_POST['g-recaptcha-response'])) { | |
echo 'reCAPTHCA verification failed, please try again.'; | |
} else { | |
$secret = 'google_secret_key'; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
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 | |
/* Fetch XML feeds using PHP SimpleXML and cURL */ | |
/* Step 1) Parse xml url in curl and assign all data into a variable | |
Step 2) Pass Xml data into SimpleXML and access elements using returned object */ | |
/* =================The SimpleXML ========================= | |
The SimpleXML extension provides a very simple and easily usable toolset to convert XML to an object that can be processed with normal property selectors and array iterators. | |
This extension requires the libxml PHP extension. This means that passing in --enable-libxml is also required, although this is implicitly accomplished because libxml is enabled by default. The SimpleXML extension requires PHP 5. |
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_usermeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_users | |
WHERE wp_usermeta.user_id = wp_users.ID | |
) |