| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: eRecht24 Legal Texts |
| 4 |
* Plugin URI: https://www.e-recht24.de/ |
| 5 |
* Description: This plugin allows the easy integration of imprint and privacy policy of eRecht24. |
| 6 |
* Version: 4.0.2 |
| 7 |
* Requires at least: 6.3 |
| 8 |
* Requires PHP: 7.4 |
| 9 |
* Author: eRecht24 |
| 10 |
* License: GPLv2 or later |
| 11 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 12 |
* Text Domain: erecht24 |
| 13 |
* Domain Path: /languages |
| 14 |
* @package ERecht24LegalText |
| 15 |
*/ |
| 16 |
|
| 17 |
defined( 'ABSPATH' ) || exit; |
| 18 |
|
| 19 |
define( 'ERECHT24_LEGAL_TEXT_VERSION', '4.0.2' ); |
| 20 |
define( 'ERECHT24_LEGAL_TEXT_FILE', __FILE__ ); |
| 21 |
define( 'ERECHT24_LEGAL_TEXT_PATH', plugin_dir_path( __FILE__ ) ); |
| 22 |
define( 'ERECHT24_LEGAL_TEXT_URL', plugin_dir_url( __FILE__ ) ); |
| 23 |
define( 'ERECHT24_LEGAL_TEXT_BASENAME', plugin_basename( __FILE__ ) ); |
| 24 |
|
| 25 |
spl_autoload_register( |
| 26 |
static function ( $class_name ) { |
| 27 |
$prefix = 'ERecht24LegalText\\'; |
| 28 |
|
| 29 |
if ( 0 !== strpos( $class_name, $prefix ) ) { |
| 30 |
return; |
| 31 |
} |
| 32 |
|
| 33 |
$relative_class = substr( $class_name, strlen( $prefix ) ); |
| 34 |
$relative_path = str_replace( '\\', '/', $relative_class ); |
| 35 |
$file = ERECHT24_LEGAL_TEXT_PATH . 'src/' . $relative_path . '.php'; |
| 36 |
$real = realpath( $file ); |
| 37 |
$src_base = realpath( ERECHT24_LEGAL_TEXT_PATH . 'src' ); |
| 38 |
|
| 39 |
if ( false === $real || false === $src_base || 0 !== strpos( $real, $src_base . DIRECTORY_SEPARATOR ) ) { |
| 40 |
return; |
| 41 |
} |
| 42 |
|
| 43 |
require_once $real; |
| 44 |
} |
| 45 |
); |
| 46 |
|
| 47 |
register_activation_hook( __FILE__, array( 'ERecht24LegalText\\Plugin', 'activate' ) ); |
| 48 |
|
| 49 |
add_action( |
| 50 |
'plugins_loaded', |
| 51 |
static function () { |
| 52 |
ERecht24LegalText\Plugin::instance()->init(); |
| 53 |
} |
| 54 |
); |
| 55 |
|