forked from rtCamp/rtAntiSpam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrt-anti-spam.php
executable file
·47 lines (38 loc) · 1.72 KB
/
rt-anti-spam.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
<?php
/*
Plugin Name: AntiSpam
Description: Keep spammers out of your site using this plugin.
Version: 1.0
Author: rtcamp
Author URI: http://rtcamp.com
Tags: login, registration, ajax, antispam, anti-spam, register, widget, widgets
*/
/* Define Plugin Constants */
define( 'RTAS_BASENAME', plugin_basename(__FILE__) );
define( 'RTAS_DIR_PATH', plugin_dir_path(__FILE__) );
define( 'RTAS_DIR_URL', plugin_dir_url(__FILE__) );
/* Define Directory Path Constants */
define( 'RTAS_CSS', RTAS_DIR_PATH . 'css' );
define( 'RTAS_JS', RTAS_DIR_PATH . 'js' );
define( 'RTAS_IMG', RTAS_DIR_PATH . 'img' );
/* Define Directory URL Constants */
define( 'RTAS_CSS_DIR_URL', RTAS_DIR_URL . 'css' );
define( 'RTAS_JS_DIR_URL', RTAS_DIR_URL . 'js' );
define( 'RTAS_IMG_DIR_URL', RTAS_DIR_URL . 'img' );
/* Define common URL's to be used */
define( 'RTAS_LOGIN_URL', wp_login_url() );
define( 'RTAS_REGISTER_URL', site_url( 'wp-login.php?action=register', 'login_post' ) );
define( 'RTAS_LOSTPSWD_URL', wp_lostpassword_url() );
register_activation_hook( __FILE__, 'rt_anti_spam_defaults' );
$rt_anti_spam_settings = ( function_exists( 'is_multisite' ) && is_multisite() ) ? get_site_option( 'rt_anti_spam_settings' ) : get_option( 'rt_anti_spam_settings' );
/* Define Public & Private Keys */
define( 'RTAS_PUBLIC_KEY', $rt_anti_spam_settings['recaptcha']['public_key'] );
define( 'RTAS_PRIVATE_KEY', $rt_anti_spam_settings['recaptcha']['private_key'] );
/* Includes PHP files located in 'libs' folder */
foreach ( glob( RTAS_DIR_PATH . "php/libs/*.php" ) as $lib_filename ) {
require_once( $lib_filename );
}
/* Includes PHP files located in 'php' folder */
foreach ( glob( RTAS_DIR_PATH . "php/*.php" ) as $php_filename ) {
require_once( $php_filename );
}