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
global $wpdb; | |
/** | |
* Get todays date and the last post date to compare | |
*/ | |
$query_date = date( 'Y-m-d' ); | |
$last_date = $wpdb->get_var( "SELECT DATE(MAX(post_date)) FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_type = 'post' LIMIT 1" ); | |
// Check if the last post is from today or not | |
if ( $last_date != $query_date ) { |
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 | |
class SymmetricEncryption { | |
private $cipher; | |
public function __construct($cipher = 'aes-256-cbc') { | |
$this->cipher = $cipher; | |
} |
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('wo_set_access_token', 'check_user_before_auth'); | |
function check_user_before_auth( $info ) { | |
if ( ! isset( $info['user_id'] ) ) { | |
return; | |
} | |
$user_id = $info['user_id']; | |
// Do query to checl the |
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
/** | |
* Breakdown of the RSSI return for AT+CSQ command. The return from the command gives a value that needs to be | |
* converted in many instances. | |
* | |
* @link https://m2msupport.net/m2msupport/atcsq-signal-quality/ | |
*/ | |
$values = array( | |
'2' => array( | |
'dB' => '-109', | |
'condition' => 'Marginal' |
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
{ | |
"issuer": "https://wordpress.site", | |
"authorization_endpoint": "http://wordpress.site/oauth/authorize/", | |
"token_endpoint": "http://wordpress.site/oauth/token/", | |
"userinfo_endpoint": "http://wordpress.site/oauth/me/", | |
"end_session_endpoint": "http://wordpress.site/oauth/destroy/", | |
"jwks_uri": "http://wordpress.site/.well-known/keys/", | |
"revocation_endpoint": "http://wordpress.site/oauth/revoke/", | |
"introspection_endpoint": "http://wordpress.site/oauth/introspection/", | |
"registration_endpoint": null, |
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
/** | |
* UPDATES AN ACCESS TOKEN'S EXPIRE TIME BY X AMOUNT OF TIME WHEN SUCCESSFULLY USED FOR AUTHENTICATION | |
* | |
* NOTE: This will override any token settings used within the plugin but does allow for active tokens to | |
* stay active instead of expiring. This is useful for auto deauthentication tht is traditionally handled on the | |
* client side. | |
*/ | |
add_action( 'wo_endpoint_user_authenticated', 'wp_oauth_successful_authentication_action' ); | |
function wp_oauth_successful_authentication_action( $token ) { | |
//$current_expires = $token[0]['expires']; |
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
/*************************************************** | |
Titanium Cache Module | |
Modified By: Justin Greer | |
https://justin-greer.com | |
Original Author: Joe Maffia | |
http://about.me/joemaffia | |
A cache module to be used for Titanium app. http://www.appcelerator.com/ |
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 all OAuth access tokens when a user logs out of the WordPress | |
* @param $user_id | |
*/ | |
function wo_example_destroy_authorizations( $user_id ) { | |
global $wpdb; | |
$wpdb->delete( "{$wpdb->prefix}oauth_access_tokens", array( "user_id" => $user_id ) ); | |
$wpdb->delete( "{$wpdb->prefix}oauth_refresh_tokens", array( "user_id" => $user_id ) ); | |
} |
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: Custom Redirect Trigger | |
* | |
* This plugin allows all redirects to be processed. It can be dangerous if used incorrectly. This includes | |
* not adding a whitelist domain redirect. Having this wide open will all hackish redirects. | |
*/ | |
class Custom_Redirect_Rewrites { | |
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
<p>Introspection Test</p> | |
<form action="your-site.com/oauth/introspection/" method="POST"> | |
<input type="text" name="access_token" value=""/> | |
<button type="submit">Run Introspection Test</button> | |
</form> |
NewerOlder