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( 'rest_endpoints', function( $endpoints ){ | |
if ( isset( $endpoints['/wp/v2/users'] ) ) { | |
unset( $endpoints['/wp/v2/users'] ); | |
} | |
if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) { | |
unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ); | |
} | |
return $endpoints; | |
}); |
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 | |
/** | |
* Recover or Reset the default WordPress user roles and caps | |
* Install it as a WordPress plugin, activate it and deativate. That's it. | |
* | |
* @wordpress-plugin | |
* Plugin Name: tinyGod Recover User Roles | |
* Plugin URI: | |
* Author: luistinygod | |
* Author URI: https://tinygod.pt |
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
final class HexSHA512 { | |
public static final function Hash($s) { | |
return (bin2hex(hash('sha512', $s.bin2hex($s), true))); | |
} | |
public static final function Verify($s, $h) { | |
return (HexSHA512::Hash($s) == $h); | |
} | |
} | |
$s = "hello there"; |
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_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_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
<?php | |
// Replace EMAIL/API_KEY/ZONE_ID with your details. | |
// Zone ID is on the dashboard for the domain in the bottom right. | |
// Api keys are generated from the account settings. You must give cache purge permissions | |
// Place this script on your webserver and point a Github Webhook at it, and you'll clear | |
// the Cloudflare cache every time you do a push to GH. | |
try { | |
$head = []; | |
$head[] = 'Content-Type: application/json'; |
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 | |
/** | |
* simple method to encrypt or decrypt a plain text string | |
* initialization vector(IV) has to be the same when encrypting and decrypting | |
* | |
* @param string $action: can be 'encrypt' or 'decrypt' | |
* @param string $string: string to encrypt or decrypt | |
* | |
* @return string | |
*/ |