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 | |
$user_agent = $_SERVER['HTTP_USER_AGENT']; | |
if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'WP-Rocket' ) === false ) { | |
if ( strpos( $_SERVER['HTTP_X_ROCKET'], 'WP-Rocket' ) === false ) { | |
die( 'BAD_UA_XR: ' . ( isset( $_SERVER['HTTP_USER_AGENT'] ) ? htmlspecialchars( $_SERVER['HTTP_USER_AGENT'] ) : 'not set' ) . ' & ' . ( isset( $_SERVER['HTTP_X_ROCKET'] ) ? htmlspecialchars( $_SERVER['HTTP_X_ROCKET'] ) : 'not set' ) ); | |
} | |
$user_agent = $_SERVER['HTTP_X_ROCKET']; | |
} |
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 | |
function AWS_S3_PresignDownload($AWSAccessKeyId, $AWSSecretAccessKey, $BucketName, $AWSRegion, $canonical_uri, $expires = 8400) { | |
// Creates a signed download link for an AWS S3 file | |
// Based on https://gist.github.com/kelvinmo/d78be66c4f36415a6b80 | |
$encoded_uri = str_replace('%2F', '/', rawurlencode($canonical_uri)); | |
// Specify the hostname for the S3 endpoint | |
if($AWSRegion == 'us-east-1') { |
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 | |
require_once('vendor/autoload.php'); | |
use BitWasp\Bitcoin\Bitcoin; | |
use BitWasp\Bitcoin\Address\AddressCreator; | |
use BitWasp\Bitcoin\Key\Deterministic\HdPrefix\GlobalPrefixConfig; | |
use BitWasp\Bitcoin\Key\Deterministic\HdPrefix\NetworkConfig; | |
use BitWasp\Bitcoin\Network\Slip132\BitcoinRegistry; | |
use BitWasp\Bitcoin\Key\Deterministic\Slip132\Slip132; |
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
import XCTest | |
extension XCTestCase { | |
/// Simple helper for asynchronous testing. | |
/// Usage in XCTestCase method: | |
/// func testSomething() { | |
/// doAsyncThings() | |
/// eventually { | |
/// /* XCTAssert goes here... */ |
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 | |
/* | |
Plugin Name: Error For WP backend | |
Plugin URI: https://github.com/Mte90/ | |
Description: Wrap the PHP errors in the WP admin backend with the native notice | |
Author: Mte90 | |
Version: 1.0.0 | |
*/ |