<?php namespace Elementor; 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. * * @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 ) { static::create_default_kit( get_sites( [ 'fields' => 'ids', ] ) ); return; } static::create_default_kit(); static::insert_defaults_options(); set_transient( 'elementor_activation_redirect', true, MINUTE_IN_SECONDS ); } 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 ); } } } } /** * 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' ); } /** * Init. * * Initialize Elementor Maintenance. * * @since 1.0.0 * @access public * @static */ public static function init() { register_activation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'activation' ] ); 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(); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
admin-templates | Folder | 0755 |
|
|
base | Folder | 0755 |
|
|
container | Folder | 0755 |
|
|
controls | Folder | 0755 |
|
|
editor-templates | Folder | 0755 |
|
|
elements | Folder | 0755 |
|
|
interfaces | Folder | 0755 |
|
|
libraries | Folder | 0755 |
|
|
managers | Folder | 0755 |
|
|
settings | Folder | 0755 |
|
|
template-library | Folder | 0755 |
|
|
widgets | Folder | 0755 |
|
|
api.php | File | 7.1 KB | 0644 |
|
autoloader.php | File | 9.4 KB | 0644 |
|
beta-testers.php | File | 2.99 KB | 0644 |
|
compatibility.php | File | 10.97 KB | 0644 |
|
conditions.php | File | 2.7 KB | 0644 |
|
db.php | File | 14.73 KB | 0644 |
|
editor-assets-api.php | File | 1.76 KB | 0644 |
|
embed.php | File | 8.44 KB | 0644 |
|
fonts.php | File | 62.53 KB | 0644 |
|
frontend.php | File | 39.39 KB | 0644 |
|
heartbeat.php | File | 2.57 KB | 0644 |
|
maintenance-mode.php | File | 11.13 KB | 0644 |
|
maintenance.php | File | 2.59 KB | 0644 |
|
plugin.php | File | 16.47 KB | 0644 |
|
preview.php | File | 7.59 KB | 0644 |
|
rollback.php | File | 3.63 KB | 0644 |
|
shapes.php | File | 6.41 KB | 0644 |
|
stylesheet.php | File | 8.91 KB | 0644 |
|
tracker.php | File | 15.68 KB | 0644 |
|
user.php | File | 9.88 KB | 0644 |
|
utils.php | File | 22.99 KB | 0644 |
|