-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathaxeptio-wordpress-plugin.php
More file actions
61 lines (49 loc) · 2.29 KB
/
axeptio-wordpress-plugin.php
File metadata and controls
61 lines (49 loc) · 2.29 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
Plugin Name: Axeptio
Plugin URI: https://www.axeptio.eu/
Description: Axeptio allows you to make your website compliant with GDPR.
Version: 2.6.2
Author: axeptio
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: axeptio-wordpress-plugin
Domain Path: /languages
Requires Plugins: wp-consent-api
**/
define( 'XPWP_VERSION', '2.6.2' );
define( 'XPWP_URL', plugin_dir_url( __FILE__ ) );
define( 'XPWP_PATH', plugin_dir_path( __FILE__ ) );
define( 'XPWP_BASENAME', plugin_basename( __FILE__ ) );
define( 'XPWP_INC', XPWP_PATH . 'includes/' );
define( 'XPWP_MIN_PHP_VERSION', '7.4' );
if ( ! defined( 'XPWP_SHOW_ALL_ERRORS' ) ) {
define( 'XPWP_SHOW_ALL_ERRORS', false );
}
if ( ! defined( 'DS' ) ) {
define( 'DS', DIRECTORY_SEPARATOR ); // PHPCS:Ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
}
if ( version_compare( PHP_VERSION, XPWP_MIN_PHP_VERSION, '<' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
deactivate_plugins( XPWP_BASENAME );
$axeptio_error_message = '<h1>' . esc_attr__( 'Unable to activate Axeptio', 'axeptio-wordpress-plugin' ) . '</h1>';
$axeptio_error_message .= '<p>' . sprintf(
/* translators: %1$s: current php version min and %2$s version of php required */
esc_attr__( 'Your server is currently running PHP %1$s. The Axeptio plugin requires at least PHP %2$s. Please upgrade your PHP version to use this plugin.', 'axeptio-wordpress-plugin' ),
PHP_VERSION,
'7.4'
) . '</p>';
$axeptio_error_message .= sprintf( '<p><a class="button button-large" href="%1$s">%2$s</a></p>', esc_url( get_admin_url( null, 'plugins.php' ) ), __( 'Return to plugins pages', 'axeptio-wordpress-plugin' ) );
wp_die( ( $axeptio_error_message ) ); // PHPCS:Ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
$xpwp_is_local = in_array( wp_get_environment_type(), array( 'local', 'development' ), true );
// Require Composer autoloader if it exists.
if ( file_exists( XPWP_PATH . 'vendor/autoload.php' ) ) {
require_once XPWP_PATH . 'vendor/autoload.php';
require_once XPWP_PATH . 'includes/wpcs-autoload.php';
}
// Activation/Deactivation.
register_activation_hook( __FILE__, '\Axeptio\Plugin\activate' );
register_deactivation_hook( __FILE__, '\Axeptio\Plugin\deactivate' );
// Bootstrap.
Axeptio\Plugin\setup();