| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: CryptX |
| 4 |
* Plugin URI: http://weber-nrw.de/wordpress/cryptx/ |
| 5 |
* Description: No more SPAM by spiders scanning you site for email adresses. With CryptX you can hide all your email adresses, with and without a mailto-link, by converting them using javascript or UNICODE. Although you can choose to add a mailto-link to all unlinked email adresses with only one klick at the settings. That's great, isn't it? |
| 6 |
* Version: 3.3.3.1 |
| 7 |
* Requires at least: 4.6 |
| 8 |
* Author: Ralf Weber |
| 9 |
* Author URI: http://weber-nrw.de/ |
| 10 |
* License: GPL v2 or later |
| 11 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 12 |
* Text Domain: cryptx |
| 13 |
*/ |
| 14 |
|
| 15 |
//avoid direct calls to this file, because now WP core and framework has been used |
| 16 |
if ( ! function_exists('add_action') ) { |
| 17 |
header('Status: 403 Forbidden'); |
| 18 |
header('HTTP/1.1 403 Forbidden'); |
| 19 |
exit(); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* some basics |
| 24 |
*/ |
| 25 |
global $wp_version; |
| 26 |
/** @const CryptX version */ |
| 27 |
define( 'CRYPTX_VERSION', "3.3.2"); |
| 28 |
define( 'CRYPTX_BASENAME', plugin_basename( __FILE__ ) ); |
| 29 |
define( 'CRYPTX_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) ); |
| 30 |
define( 'CRYPTX_DIR_URL', plugin_dir_url( __FILE__ ) ); |
| 31 |
define( 'CRYPTX_DIR_PATH', plugin_dir_path( __FILE__ ) ); |
| 32 |
define( 'CRYPTX_FILENAME', str_replace( CRYPTX_BASEFOLDER.'/', '', plugin_basename(__FILE__) ) ); |
| 33 |
|
| 34 |
require_once(CRYPTX_DIR_PATH . 'include/functions.php'); |
| 35 |
|
| 36 |
require_once(CRYPTX_DIR_PATH . 'include/admin_option_page.php'); |
| 37 |
|
| 38 |
$cryptX_var = get_option('cryptX'); |
| 39 |
/** |
| 40 |
* check for needed updates |
| 41 |
*/ |
| 42 |
if( isset( $cryptX_var['version'] ) && version_compare(CRYPTX_VERSION, $cryptX_var['version']) > 0 ) { |
| 43 |
cryptx_do_updates(); |
| 44 |
} |
| 45 |
$cryptX_var = rw_loadDefaults(); |
| 46 |
|
| 47 |
$is_js_needed = false; |
| 48 |
|
| 49 |
foreach($cryptX_var['filter'] as $filter) { |
| 50 |
if (@$cryptX_var[$filter]) { |
| 51 |
rw_cryptx_filter($filter); |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
add_action( 'activate_' . CRYPTX_BASENAME, 'rw_cryptx_install' ); |
| 56 |
|
| 57 |
// Hook into the 'wp_enqueue_scripts' action |
| 58 |
add_action( 'wp_enqueue_scripts', 'cryptx_javascripts_load' ); |
| 59 |
|
| 60 |
|
| 61 |
if (@$cryptX_var['metaBox']) { |
| 62 |
add_action('admin_menu', 'rw_cryptx_meta_box'); |
| 63 |
add_action('wp_insert_post', 'rw_cryptx_insert_post' ); |
| 64 |
add_action('wp_update_post', 'rw_cryptx_insert_post' ); |
| 65 |
} |
| 66 |
|
| 67 |
add_filter( 'plugin_row_meta', 'rw_cryptx_init_row_meta', 10, 2 ); |
| 68 |
|
| 69 |
add_filter( 'init', 'rw_cryptx_init_tinyurl'); |
| 70 |
// add_action( 'parse_request', 'rw_cryptx_parse_request'); |
| 71 |
|
| 72 |
add_shortcode( 'cryptx', 'rw_cryptx_shortcode'); |