PluginProbe
Elementor Website Builder – more than just a page builder / 3.27.4
Elementor Website Builder – more than just a page builder v3.27.4
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
← All changes | core/common/modules/connect/admin.php +9 -37 4.1.0-dev33.27.4 View file →
@@ -4,10 +4,8 @@
4 4 use Elementor\Core\Admin\Menu\Admin_Menu_Manager;
5 5 use Elementor\Plugin;
6 6 use Elementor\Settings;
7 7 use Elementor\Utils;
8 -use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
9 -use Elementor\Core\Common\Modules\Connect\AdminMenuItems\Editor_One_Connect_Menu;
10 8
11 9 if ( ! defined( 'ABSPATH' ) ) {
12 10 exit; // Exit if accessed directly.
13 11 }
@@ -17,36 +15,16 @@
17 15 const PAGE_ID = 'elementor-connect';
18 16
19 17 public static $url = '';
20 18
21 - private function get_valid_redirect_to_from_request() {
22 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only reading a URL parameter.
23 - $raw = Utils::get_super_global_value( $_GET, 'redirect_to' );
24 -
25 - if ( ! $raw ) {
26 - return '';
27 - }
28 -
29 - $raw = esc_url_raw( $raw );
30 -
31 - $validated = wp_validate_redirect( $raw, '' );
32 - if ( ! $validated ) {
33 - return '';
34 - }
35 -
36 - $admin_host = wp_parse_url( admin_url(), PHP_URL_HOST );
37 - $dest_host = wp_parse_url( $validated, PHP_URL_HOST );
38 - if ( $dest_host && $admin_host && ! hash_equals( $admin_host, $dest_host ) ) {
39 - return '';
40 - }
41 -
42 - return $validated;
19 + /**
20 + * @since 2.3.0
21 + * @access public
22 + */
23 + public function register_admin_menu( Admin_Menu_Manager $admin_menu ) {
24 + $admin_menu->register( static::PAGE_ID, new Connect_Menu_Item() );
43 25 }
44 26
45 - public function register_editor_one_menu( Menu_Data_Provider $menu_data_provider ) {
46 - $menu_data_provider->register_menu( new Editor_One_Connect_Menu() );
47 - }
48 -
49 27 /**
50 28 * @since 2.3.0
51 29 * @access public
52 30 */
@@ -56,14 +34,8 @@
56 34 'back_link' => true,
57 35 ] );
58 36 }
59 37
60 - // Allow a per-request default landing URL when provided via a safe `redirect_to` parameter.
61 - $maybe_redirect_to = $this->get_valid_redirect_to_from_request();
62 - if ( $maybe_redirect_to ) {
63 - self::$url = $maybe_redirect_to;
64 - }
65 -
66 38 if ( isset( $_GET['action'], $_GET['app'] ) ) {
67 39 $manager = Plugin::$instance->common->get_component( 'connect' );
68 40
69 41 // phpcs:ignore WordPress.Security.NonceVerification.Recommended
@@ -111,13 +83,13 @@
111 83 */
112 84 public function __construct() {
113 85 self::$url = admin_url( 'admin.php?page=' . self::PAGE_ID );
114 86
115 - add_action( 'elementor/editor-one/menu/register', [ $this, 'register_editor_one_menu' ] );
87 + add_action( 'elementor/admin/menu/register', [ $this, 'register_admin_menu' ] );
116 88
117 - add_action( 'elementor/editor-one/menu/after_register_hidden_submenus', function ( array $hooks ) {
89 + add_action( 'elementor/admin/menu/after_register', function ( Admin_Menu_Manager $admin_menu, array $hooks ) {
118 90 if ( ! empty( $hooks[ static::PAGE_ID ] ) ) {
119 91 add_action( 'load-' . $hooks[ static::PAGE_ID ], [ $this, 'on_load_page' ] );
120 92 }
121 - } );
93 + }, 10, 2 );
122 94 }
123 95 }