PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.7.7
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.7.7
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / vendor / elementor / wp-one-package / src / Admin / Components / Onboarding.php

Onboarding.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.7.7, at vendor/elementor/wp-one-package/src/Admin/Components/Onboarding.php

65 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ElementorOne\Admin\Components;
4
5 use ElementorOne\Connect\Facade;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 /**
12 * Class Onboarding
13 * Handles onboarding page actions
14 */
15 class Onboarding {
16
17 /**
18 * Instance
19 * @var Onboarding|null
20 */
21 private static ?Onboarding $instance = null;
22
23 /**
24 * Get instance
25 * @return Onboarding|null
26 */
27 public static function instance(): ?Onboarding {
28 if ( ! self::$instance ) {
29 self::$instance = new self();
30 }
31 return self::$instance;
32 }
33
34 /**
35 * On connect
36 * @param Facade $facade
37 * @return void
38 */
39 public function on_connect( Facade $facade ): void {
40 wp_safe_redirect( $facade->utils()->get_admin_url() . '#/home/onboarding' );
41 exit;
42 }
43
44 /**
45 * On connect fail
46 * @param Facade $facade
47 * @return void
48 */
49 public function on_connect_fail( Facade $facade ): void {
50 wp_safe_redirect(
51 $facade->utils()->get_admin_url() . '#/home?connect-fail=1'
52 );
53 exit;
54 }
55
56 /**
57 * Onboarding constructor
58 * @return void
59 */
60 private function __construct() {
61 add_action( 'elementor_one/elementor_one_connected', [ $this, 'on_connect' ] );
62 add_action( 'elementor_one/elementor_one_connect_fail', [ $this, 'on_connect_fail' ], 10, 1 );
63 }
64 }
65