PluginProbe
Elementor Website Builder – more than just a page builder / 3.32.0-dev1
Elementor Website Builder – more than just a page builder v3.32.0-dev1
4.3.0-beta3 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 All 452 releases
elementor / core / admin / menu / cloud-hosting-plans-menu-item.php

cloud-hosting-plans-menu-item.php in Elementor Website Builder – more than just a page builder 3.32.0-dev1, at core/admin/menu/cloud-hosting-plans-menu-item.php

61 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Core\Admin\Menu;
4
5 use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 /**
12 * Cloud Hosting Plans Menu Item.
13 */
14 class Cloud_Hosting_Plans_Menu_Item implements Admin_Menu_Item_With_Page {
15 const URL = 'https://go.elementor.com/host-local-side-menu/';
16
17 public function is_visible() {
18 $env_type = wp_get_environment_type();
19
20 if ( in_array( $env_type, [ 'development', 'local', 'staging' ] ) ) {
21 return true;
22 }
23
24 $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '';
25 $host = isset( $_SERVER['HTTP_HOST'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '';
26
27 $is_dev = (
28 false !== strpos( $host, '.local' )
29 || false !== strpos( $host, 'localhost' )
30 || preg_match( '/^192\.168\./', $ip )
31 || '127.0.0.1' === $ip
32 );
33
34 return $is_dev;
35 }
36
37 public function get_parent_slug() {
38 return 'edit.php?post_type=elementor_library';
39 }
40
41 public function get_label() {
42 return esc_html__( 'Hosting Plans', 'elementor' );
43 }
44
45 public function get_capability() {
46 return 'manage_options';
47 }
48
49 public function get_page_title() {
50 return esc_html__( 'Hosting Plans', 'elementor' );
51 }
52
53 public function render() {
54 exit;
55 }
56
57 public static function get_url() {
58 return self::URL;
59 }
60 }
61