PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.0-dev9
Elementor Website Builder – more than just a page builder v3.4.0-dev9
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / maintenance.php

maintenance.php in Elementor Website Builder – more than just a page builder 3.4.0-dev9, at includes/maintenance.php

75 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 use Elementor\Core\Kits\Manager;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Elementor maintenance.
12 *
13 * Elementor maintenance handler class is responsible for setting up Elementor
14 * activation and uninstallation hooks.
15 *
16 * @since 1.0.0
17 */
18 class Maintenance {
19
20 /**
21 * Activate Elementor.
22 *
23 * Set Elementor activation hook.
24 *
25 * Fired by `register_activation_hook` when the plugin is activated.
26 *
27 * @since 1.0.0
28 * @access public
29 * @static
30 */
31 public static function activation( $network_wide ) {
32 wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
33
34 wp_schedule_event( time(), 'daily', 'elementor/tracker/send_event' );
35 flush_rewrite_rules();
36
37 Manager::create_default_kit();
38
39 if ( is_multisite() && $network_wide ) {
40 return;
41 }
42
43 set_transient( 'elementor_activation_redirect', true, MINUTE_IN_SECONDS );
44 }
45
46 /**
47 * Uninstall Elementor.
48 *
49 * Set Elementor uninstallation hook.
50 *
51 * Fired by `register_uninstall_hook` when the plugin is uninstalled.
52 *
53 * @since 1.0.0
54 * @access public
55 * @static
56 */
57 public static function uninstall() {
58 wp_clear_scheduled_hook( 'elementor/tracker/send_event' );
59 }
60
61 /**
62 * Init.
63 *
64 * Initialize Elementor Maintenance.
65 *
66 * @since 1.0.0
67 * @access public
68 * @static
69 */
70 public static function init() {
71 register_activation_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'activation' ] );
72 register_uninstall_hook( ELEMENTOR_PLUGIN_BASE, [ __CLASS__, 'uninstall' ] );
73 }
74 }
75