| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: The GDPR Framework |
| 5 |
* Plugin URI: https://codelight.eu/wordpress-gdpr-framework/ |
| 6 |
* Description: Tools to help make your website GDPR-compliant. Fully documented, extendable and developer-friendly. |
| 7 |
* Version: 1.0.4 |
| 8 |
* Author: Codelight |
| 9 |
* Author URI: https://codelight.eu/ |
| 10 |
* Text Domain: gdpr |
| 11 |
* Domain Path: /languages |
| 12 |
*/ |
| 13 |
|
| 14 |
if (!defined('WPINC')) { |
| 15 |
die; |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* Helper function for prettying up errors |
| 20 |
* |
| 21 |
* @param string $message |
| 22 |
* @param string $subtitle |
| 23 |
* @param string $title |
| 24 |
*/ |
| 25 |
$gdpr_error = function($message, $subtitle = '', $title = '') { |
| 26 |
$title = $title ?: _x('WordPress GDPR › Error', '(Admin)', 'gdpr-framework'); |
| 27 |
$message = "<h1>{$title}<br><small>{$subtitle}</small></h1><p>{$message}</p>"; |
| 28 |
wp_die($message, $title); |
| 29 |
}; |
| 30 |
|
| 31 |
/** |
| 32 |
* Ensure compatible version of PHP is used |
| 33 |
*/ |
| 34 |
if (version_compare(phpversion(), '5.6.33', '<')) { |
| 35 |
$gdpr_error( |
| 36 |
_x('You must be using PHP 5.6.33 or greater.', '(Admin)', 'gdpr-framework'), |
| 37 |
_x('Invalid PHP version', '(Admin)', 'gdpr-framework') |
| 38 |
); |
| 39 |
} |
| 40 |
|
| 41 |
/** |
| 42 |
* Ensure compatible version of WordPress is used |
| 43 |
*/ |
| 44 |
if (version_compare(get_bloginfo('version'), '4.3', '<')) { |
| 45 |
$gdpr_error( |
| 46 |
_x('You must be using WordPress 4.3.0 or greater.', '(Admin)', 'gdpr-framework'), |
| 47 |
_x('Invalid WordPress version', '(Admin)', 'gdpr-framework') |
| 48 |
); |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* Load dependencies |
| 53 |
*/ |
| 54 |
if (!class_exists('\Codelight\GDPR\Container')) { |
| 55 |
|
| 56 |
if (!file_exists($composer = __DIR__ . '/vendor/autoload.php')) { |
| 57 |
$gdpr_error( |
| 58 |
_x( |
| 59 |
'You appear to be running a development version of GDPR. You must run <code>composer install</code> from the plugin directory.', |
| 60 |
'(Admin)', |
| 61 |
'gdpr-framework' |
| 62 |
), |
| 63 |
_x( |
| 64 |
'Autoloader not found.', |
| 65 |
'(Admin)', |
| 66 |
'gdpr-framework' |
| 67 |
) |
| 68 |
); |
| 69 |
} |
| 70 |
require_once $composer; |
| 71 |
} |
| 72 |
|
| 73 |
require_once('bootstrap.php'); |
| 74 |
|