| 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 addresses. With CryptX you can hide all your email addresses, with and without a mailto-link, by converting them using javascript or UNICODE. |
| 6 |
* Version: 3.4.5 |
| 7 |
* Requires at least: 6.0 |
| 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 |
/** @const CryptX version */ |
| 23 |
define( 'CRYPTX_VERSION', "3.4.1" ); |
| 24 |
define( 'CRYPTX_BASENAME', plugin_basename( __FILE__ ) ); |
| 25 |
define( 'CRYPTX_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) ); |
| 26 |
define( 'CRYPTX_DIR_URL', rtrim( plugin_dir_url( __FILE__ ), "/" ) . "/" ); |
| 27 |
define( 'CRYPTX_DIR_PATH', plugin_dir_path( __FILE__ ) ); |
| 28 |
define( 'CRYPTX_FILENAME', str_replace( CRYPTX_BASEFOLDER . '/', '', plugin_basename( __FILE__ ) ) ); |
| 29 |
|
| 30 |
require_once( CRYPTX_DIR_PATH . 'classes/CryptX.php' ); |
| 31 |
require_once( CRYPTX_DIR_PATH . 'include/admin_option_page.php' ); |
| 32 |
|
| 33 |
$CryptX_instance = Cryptx\CryptX::getInstance(); |
| 34 |
$CryptX_instance->startCryptX(); |
| 35 |
|
| 36 |
/** |
| 37 |
* Encrypts the given content using the Cryptx shortcode. |
| 38 |
* |
| 39 |
* @param string $content The content to be encrypted. |
| 40 |
* @param string $args (optional) Additional arguments is deprecated and are not used anymore. |
| 41 |
* |
| 42 |
* @return string The encrypted content wrapped in the Cryptx shortcode. |
| 43 |
*/ |
| 44 |
function encryptx( ?string $content, ?array $args ): string { |
| 45 |
$CryptX_instance = Cryptx\CryptX::getInstance(); |
| 46 |
return do_shortcode( '[cryptx'. $CryptX_instance->convertArrayToArgumentString( $args ).']' . $content . '[/cryptx]' ); |
| 47 |
} |