| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: Kadence Central |
| 4 |
* Plugin URI: https://kadencewp.com |
| 5 |
* Description: Maximize and amplify your admin with remote, multi-site management. One centralized dashboard to save time. |
| 6 |
* Author: Kadence |
| 7 |
* Version: 4.0.3 |
| 8 |
* Requires at least: 6.4 |
| 9 |
* Requires PHP: 7.0 |
| 10 |
* Author URI: https://kadencewp.com |
| 11 |
* Domain Path: /lang/ |
| 12 |
* iThemes Package: ithemes-sync |
| 13 |
*/ |
| 14 |
|
| 15 |
use SolidWP\Central\Central_Server\Central_Server_Notifier; |
| 16 |
|
| 17 |
if ( ! empty( $GLOBALS['ithemes_sync_path'] ) ) { |
| 18 |
/** @var string $active_plugin_path */ |
| 19 |
$active_plugin_path = preg_replace( '|^' . preg_quote( ABSPATH, '|' ) . '|', '', $GLOBALS['ithemes_sync_path'] ); |
| 20 |
/** @var string $this_plugin_path */ |
| 21 |
$this_plugin_path = preg_replace( '|^' . preg_quote( ABSPATH, '|' ) . '|', '', __DIR__ ); |
| 22 |
|
| 23 |
if ( $active_plugin_path != $this_plugin_path ) { |
| 24 |
|
| 25 |
add_action( |
| 26 |
'all_admin_notices', |
| 27 |
function () use ( $active_plugin_path, $this_plugin_path ) { |
| 28 |
echo '<div class="error"><p>'; |
| 29 |
printf( |
| 30 |
wp_kses( |
| 31 |
/* translators: 1: Active plugin path, 2: This plugin path */ |
| 32 |
__( |
| 33 |
'Only one Kadence Central plugin can be active at a time. The plugin at <code>%1$s</code> is running while the plugin at <code>%2$s</code> was skipped in order to prevent errors. Please deactivate the plugin that you do not wish to use.', |
| 34 |
'it-l10n-ithemes-sync' |
| 35 |
), |
| 36 |
[ |
| 37 |
'code' => [], |
| 38 |
] |
| 39 |
), |
| 40 |
esc_html( $active_plugin_path ), |
| 41 |
esc_html( $this_plugin_path ) |
| 42 |
); |
| 43 |
echo '</p></div>'; |
| 44 |
}, |
| 45 |
0 |
| 46 |
); |
| 47 |
} |
| 48 |
|
| 49 |
return; |
| 50 |
} |
| 51 |
|
| 52 |
$GLOBALS['ithemes_sync_path'] = __DIR__; |
| 53 |
|
| 54 |
require $GLOBALS['ithemes_sync_path'] . '/load.php'; |
| 55 |
|
| 56 |
/** |
| 57 |
* On activation, set a time, frequency and name of an action hook to be scheduled. |
| 58 |
* |
| 59 |
* @since 1.12.0 |
| 60 |
*/ |
| 61 |
function ithemes_sync_activation() { |
| 62 |
if ( ! wp_next_scheduled( 'ithemes_sync_daily_schedule' ) ) { |
| 63 |
wp_schedule_event( strtotime( 'Tomorrow 2AM' ), 'daily', 'ithemes_sync_daily_schedule' ); |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
register_activation_hook( __FILE__, 'ithemes_sync_activation' ); |
| 68 |
|
| 69 |
/** |
| 70 |
* On deactivation, remove all functions from the scheduled action hook. |
| 71 |
* |
| 72 |
* @since 1.12.0 |
| 73 |
*/ |
| 74 |
function ithemes_sync_deactivation() { |
| 75 |
wp_clear_scheduled_hook( 'ithemes_sync_daily_schedule' ); |
| 76 |
wp_clear_scheduled_hook( Central_Server_Notifier::SEND_QUEUED_NOTICES_ACTION ); |
| 77 |
} |
| 78 |
|
| 79 |
register_deactivation_hook( __FILE__, 'ithemes_sync_deactivation' ); |
| 80 |
|