| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Brizy |
| 4 |
* Description: A free drag & drop front-end page builder to help you create WordPress pages lightning fast. It's easy with Brizy. |
| 5 |
* Plugin URI: https://brizy.io/ |
| 6 |
* Author: Brizy.io |
| 7 |
* Author URI: https://brizy.io/ |
| 8 |
* Version: 2.8.19 |
| 9 |
* Text Domain: brizy |
| 10 |
* License: GPLv3 |
| 11 |
* Domain Path: /languages |
| 12 |
*/ |
| 13 |
/** |
| 14 |
* This will fix the url protocol for websites that are working behind a load balancer |
| 15 |
*/ |
| 16 |
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && stripos( $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https' ) !== false ) { |
| 17 |
$_SERVER['HTTPS'] = 'on'; |
| 18 |
} |
| 19 |
define( 'BRIZY_DEVELOPMENT', false ); |
| 20 |
define( 'BRIZY_LOG', false ); |
| 21 |
define( 'BRIZY_VERSION', '2.8.19' ); |
| 22 |
define( 'BRIZY_MINIMUM_PRO_VERSION', '2.4.15' ); |
| 23 |
define( 'BRIZY_MINIMUM_COMPILER_VERSION', '353-wp' ); |
| 24 |
define( 'BRIZY_RECOMPILE_TAG', 1781013436 ); |
| 25 |
define( 'BRIZY_EDITOR_VERSION', BRIZY_DEVELOPMENT ? 'dev' : '371-wp' ); |
| 26 |
define( 'BRIZY_SYNC_VERSION', '368' ); |
| 27 |
define( 'BRIZY_FILE', __FILE__ ); |
| 28 |
define( 'BRIZY_PLUGIN_BASE', plugin_basename( BRIZY_FILE ) ); |
| 29 |
define( 'BRIZY_PLUGIN_PATH', dirname( BRIZY_FILE ) ); |
| 30 |
define( 'BRIZY_PLUGIN_URL', rtrim( plugin_dir_url( BRIZY_FILE ), "/" ) ); |
| 31 |
define( 'BRIZY_MAX_REVISIONS_TO_KEEP', 30 ); |
| 32 |
include_once rtrim( BRIZY_PLUGIN_PATH, "/" ) . '/autoload.php'; |
| 33 |
include_once rtrim( BRIZY_PLUGIN_PATH, "/" ) . '/languages/main.php'; |
| 34 |
require_once( ABSPATH . '/wp-admin/includes/file.php' ); |
| 35 |
require_once( ABSPATH . '/wp-admin/includes/media.php' ); |
| 36 |
require_once( ABSPATH . '/wp-admin/includes/image.php' ); |
| 37 |
if ( BRIZY_DEVELOPMENT ) { |
| 38 |
$dotenv = new \Symfony\Component\Dotenv\Dotenv( 'APP_ENV' ); |
| 39 |
$dotenv->load( __DIR__ . '/.env' ); |
| 40 |
} |
| 41 |
add_action( 'plugins_loaded', 'brizy_load' ); |
| 42 |
add_action( 'init', 'brizy_load_text_domain' ); |
| 43 |
add_action( 'upgrader_process_complete', 'brizy_upgrade_completed', 10, 2 ); |
| 44 |
add_action( 'activated_plugin', 'Brizy_Admin_GettingStarted::redirectAfterActivation' ); |
| 45 |
register_activation_hook( BRIZY_FILE, 'brizy_install' ); |
| 46 |
register_deactivation_hook( BRIZY_FILE, 'brizy_clean' ); |
| 47 |
function brizy_load() { |
| 48 |
|
| 49 |
// registered before the editor bootstrap so that the meta keys stay |
| 50 |
// protected even if Brizy_Editor::get() throws and the plugin degrades |
| 51 |
Brizy_Editor_PostMetaProtection::_init(); |
| 52 |
|
| 53 |
try { |
| 54 |
$instance = Brizy_Editor::get(); |
| 55 |
} catch ( Exception $e ) { |
| 56 |
add_action( 'admin_notices', 'brizy_fail_notices' ); |
| 57 |
|
| 58 |
return; |
| 59 |
} |
| 60 |
if ( apply_filters( 'brizy_allow_plugin_included', true ) ) { |
| 61 |
do_action( 'brizy_plugin_included' ); |
| 62 |
} |
| 63 |
} |
| 64 |
|
| 65 |
function brizy_notices() { |
| 66 |
?> |
| 67 |
<div class="notice notice-error is-dismissible"> |
| 68 |
<p> |
| 69 |
<?php |
| 70 |
printf( __( '%1$s requires PHP version 5.6+, your currently running PHP %2$s. <b>%3$s IS NOT RUNNING.</b>', 'brizy' ), __bt( 'brizy', 'Brizy' ), PHP_VERSION, strtoupper( __bt( 'brizy', 'Brizy' ) ) ); |
| 71 |
?> |
| 72 |
</p> |
| 73 |
</div> |
| 74 |
<?php |
| 75 |
} |
| 76 |
|
| 77 |
function brizy_fail_notices() { |
| 78 |
?> |
| 79 |
<div class="notice notice-error is-dismissible"> |
| 80 |
<p> |
| 81 |
<?php |
| 82 |
printf( __( '%1$s failed to start. Please contact the support <a href="%s">here</a>.', 'brizy' ), __bt( 'brizy', 'Brizy' ), apply_filters( 'brizy_support_url', Brizy_Config::getSupportUrl() ), strtoupper( __bt( 'brizy', 'Brizy' ) ) ); |
| 83 |
?> |
| 84 |
</p> |
| 85 |
</div> |
| 86 |
<?php |
| 87 |
} |
| 88 |
|
| 89 |
function brizy_upgrade_completed( $upgrader_object, $options ) { |
| 90 |
if ( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) { |
| 91 |
foreach ( $options['plugins'] as $plugin ) { |
| 92 |
if ( $plugin == BRIZY_PLUGIN_BASE ) { |
| 93 |
add_option( 'brizy-regenerate-permalinks', 1 ); |
| 94 |
do_action( 'brizy-updated' ); |
| 95 |
} |
| 96 |
} |
| 97 |
} |
| 98 |
} |
| 99 |
|
| 100 |
function brizy_install() { |
| 101 |
Brizy_Logger::install(); |
| 102 |
add_option( 'brizy-regenerate-permalinks', 1 ); |
| 103 |
do_action( 'brizy-activated' ); |
| 104 |
set_transient( 'brizy_admin_notice', true, 7200 ); |
| 105 |
} |
| 106 |
|
| 107 |
function brizy_clean() { |
| 108 |
Brizy_Logger::clean(); |
| 109 |
add_option( 'brizy-regenerate-permalinks', 1 ); |
| 110 |
do_action( 'brizy-deactivated' ); |
| 111 |
} |
| 112 |
|
| 113 |
function brizy_load_text_domain() { |
| 114 |
load_plugin_textdomain( 'brizy', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); |
| 115 |
} |
| 116 |
|
| 117 |
new Brizy_Compatibilities_Init(); |
| 118 |
|