<?php
namespace Elementor;
use Elementor\App\Modules\Onboarding\Onboarding_Entry;
use Elementor\Core\Kits\Manager;
use Elementor\Core\Upgrade\Manager as Upgrade_Manager;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Elementor maintenance.
*
* Elementor maintenance handler class is responsible for setting up Elementor
* activation and uninstallation hooks.
*
* @since 1.0.0
*/
class Maintenance {
/**
* Activate Elementor.
*
* Set Elementor activation hook.
*
* Fired by `register_activation_hook` when the plugin is activated.
*
* @param bool $network_wide
* @since 1.0.0
* @access public
* @static
*/
public static function activation( $network_wide ) {
wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
wp_schedule_event( time(), 'daily', 'elementor/tracker/send_event' );
flush_rewrite_rules();
if ( is_multisite() && $network_wide ) {
$site_ids = get_sites( [
'fields' => 'ids',
] );
static::create_default_kit( $site_ids );
foreach ( $site_ids as $site_id ) {
switch_to_blog( $site_id );
Onboarding_Entry::mark_activation();
restore_current_blog();
}
return;
}
static::create_default_kit();
static::insert_defaults_options();
Onboarding_Entry::mark_activation();
}
public static function insert_defaults_options() {
$history = Upgrade_Manager::get_installs_history();
if ( empty( $history ) ) {
$default_options = [
'elementor_font_display' => 'swap',
];
foreach ( $default_options as $option_name => $option_value ) {
if ( \Elementor\Utils::is_empty( get_option( $option_name ) ) ) {
add_option( $option_name, $option_value );
}
}
}
}
public static function deactivation() {
Api::get_deactivation_data();
}
/**
* Uninstall Elementor.
*
* Set Elementor uninstallation hook.
*
* Fired by `register_uninstall_hook` when the plugin is uninstalled.
*
* @since 1.0.0
* @access public
* @static
*/
public static function uninstall() {
wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
Api::get_uninstalled_data();
}
/**
* Init.
*
* Initialize Elementor Maintenance.
*
* @since 1.0.0
* @access public
* @static
*/
public static function init() {
register_activation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'activation' ] );
register_deactivation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'deactivation' ] );
register_uninstall_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'uninstall' ] );
add_action( 'wpmu_new_blog', function ( $site_id ) {
if ( ! is_plugin_active_for_network( ELEMENTOR_PLUGIN_BASE ) ) {
return;
}
static::create_default_kit( [ $site_id ] );
} );
}
/**
* @param array $site_ids
*/
private static function create_default_kit( array $site_ids = [] ) {
if ( ! empty( $site_ids ) ) {
foreach ( $site_ids as $site_id ) {
switch_to_blog( $site_id );
Manager::create_default_kit();
restore_current_blog();
}
return;
}
Manager::create_default_kit();
}
}
| nama | waktu | ukuran | owner | perm | aksi |
|---|---|---|---|---|---|
| .. | |||||
| admin-templates/ | 2026-11-25 08:10 | 10.11 KB | 76129f60960:kunden | dxwrx-rx-r | |
| base/ | 2026-11-25 08:10 | 153.85 KB | 76129f60960:kunden | dxwrx-rx-r | |
| controls/ | 2026-11-25 08:10 | 260.89 KB | 76129f60960:kunden | dxwrx-rx-r | |
| editor-templates/ | 2026-11-25 08:10 | 98.46 KB | 76129f60960:kunden | dxwrx-rx-r | |
| elements/ | 2026-11-25 08:10 | 117.77 KB | 76129f60960:kunden | dxwrx-rx-r | |
| interfaces/ | 2026-11-25 08:10 | 730 B | 76129f60960:kunden | dxwrx-rx-r | |
| libraries/ | 2026-11-25 08:10 | 24.14 KB | 76129f60960:kunden | dxwrx-rx-r | |
| managers/ | 2026-11-25 08:10 | 91.38 KB | 76129f60960:kunden | dxwrx-rx-r | |
| settings/ | 2026-11-25 08:10 | 54.34 KB | 76129f60960:kunden | dxwrx-rx-r | |
| template-library/ | 2026-11-25 08:10 | 154.16 KB | 76129f60960:kunden | dxwrx-rx-r | |
| widgets/ | 2026-11-25 08:10 | 510.64 KB | 76129f60960:kunden | dxwrx-rx-r | |
| api.php | 2026-11-25 08:10 | 8.82 KB | 76129f60960:kunden | -xw-x--x-- | |
| autoloader.php | 2026-11-25 08:10 | 9.79 KB | 76129f60960:kunden | -xw-x--x-- | |
| beta-testers.php | 2026-11-25 08:10 | 3.17 KB | 76129f60960:kunden | -xw-x--x-- | |
| compatibility.php | 2026-11-25 08:10 | 10.96 KB | 76129f60960:kunden | -xw-x--x-- | |
| conditions.php | 2026-11-25 08:10 | 2.7 KB | 76129f60960:kunden | -xw-x--x-- | |
| db.php | 2026-11-25 08:10 | 15.89 KB | 76129f60960:kunden | -xw-x--x-- | |
| editor-assets-api.php | 2026-11-25 08:10 | 4.5 KB | 76129f60960:kunden | -xw-x--x-- | |
| embed.php | 2026-11-25 08:10 | 9.57 KB | 76129f60960:kunden | -xw-x--x-- | |
| fonts.php | 2026-11-25 08:10 | 62.53 KB | 76129f60960:kunden | -xw-x--x-- | |
| frontend.php | 2026-11-25 08:10 | 40.02 KB | 76129f60960:kunden | -xw-x--x-- | |
| heartbeat.php | 2026-11-25 08:10 | 3.34 KB | 76129f60960:kunden | -xw-x--x-- | |
| maintenance-mode.php | 2026-11-25 08:10 | 11.16 KB | 76129f60960:kunden | -xw-x--x-- | |
| maintenance.php | 2026-11-25 08:10 | 2.99 KB | 76129f60960:kunden | -xw-x--x-- | |
| plugin.php | 2026-11-25 08:10 | 15.67 KB | 76129f60960:kunden | -xw-x--x-- | |
| preview.php | 2026-11-25 08:10 | 8.21 KB | 76129f60960:kunden | -xw-x--x-- | |
| rollback.php | 2026-11-25 08:10 | 4.16 KB | 76129f60960:kunden | -xw-x--x-- | |
| shapes.php | 2026-11-25 08:10 | 7.81 KB | 76129f60960:kunden | -xw-x--x-- | |
| stylesheet.php | 2026-11-25 08:10 | 8.91 KB | 76129f60960:kunden | -xw-x--x-- | |
| tracker.php | 2026-11-25 08:10 | 17 KB | 76129f60960:kunden | -xw-x--x-- | |
| user-data.php | 2026-11-25 08:10 | 3.67 KB | 76129f60960:kunden | -xw-x--x-- | |
| user.php | 2026-11-25 08:10 | 10.11 KB | 76129f60960:kunden | -xw-x--x-- | |
| utils.php | 2026-11-25 08:10 | 30.51 KB | 76129f60960:kunden | -xw-x--x-- | |