-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbrutus.php
53 lines (48 loc) · 1.69 KB
/
brutus.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* Plugin Name: Brutus
* Plugin URI: https://pluginsloaded.com/plugins/brutus/
* Author: John James Jacoby
* Author URI: https://jjj.blog
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Description: Your bouncer; your muscle; your protector & defender
* Version: 1.2.0
* Text Domain: brutus
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
// Includes
require_once dirname( __FILE__ ) . '/classes/brutus.php';
require_once dirname( __FILE__ ) . '/classes/cookie.php';
if ( ! function_exists( 'wp_verify_nonce' ) ) :
/**
* Verify that correct nonce was used with time limit.
*
* The user is given an amount of time to use the token, so therefore, since the
* UID and $action remain the same, the independent variable is the time.
*
* @since 1.1.0 Brutus
*
* @param string $nonce Nonce that was used in the form to verify
* @param string|int $action Should give context to what is taking place and be the same when nonce was created.
* @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between
* 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
*/
function wp_verify_nonce( $nonce = '', $action = -1 ) {
return Brutus::pluggable_verify_nonce( $nonce, $action );
}
endif;
if ( ! function_exists( 'wp_create_nonce' ) ) :
/**
* Creates a cryptographic token tied to a specific action, user, and window of time.
*
* @since 1.1.0 Brutus
*
* @param string|int $action Scalar value to add context to the nonce.
* @return string The token.
*/
function wp_create_nonce( $action = -1 ) {
return Brutus::pluggable_create_nonce( $action );
}
endif;