PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0-dev3
Elementor Website Builder – more than just a page builder v4.1.0-dev3
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 / core / isolation / plugin-status-adapter.php

plugin-status-adapter.php in Elementor Website Builder – more than just a page builder 4.1.0-dev3, at core/isolation/plugin-status-adapter.php

44 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core\Isolation;
3
4 class Plugin_Status_Adapter implements Plugin_Status_Adapter_Interface {
5
6 public Wordpress_Adapter_Interface $wordpress_adapter;
7
8 public function __construct( Wordpress_Adapter_Interface $wordpress_adapter ) {
9 $this->wordpress_adapter = $wordpress_adapter;
10 }
11
12 public function is_plugin_installed( $plugin_path ): bool {
13 $installed_plugins = $this->wordpress_adapter->get_plugins();
14
15 return isset( $installed_plugins[ $plugin_path ] );
16 }
17
18 public function get_install_plugin_url( $plugin_path ): string {
19 $slug = dirname( $plugin_path );
20 $admin_base_url = $this->wordpress_adapter->self_admin_url( 'update.php' );
21
22 $admin_url = add_query_arg( [
23 'action' => 'install-plugin',
24 'plugin' => $slug,
25 ], $admin_base_url );
26
27 return $this->wordpress_adapter->wp_nonce_url( $admin_url, 'install-plugin_' . $slug );
28 }
29
30 public function get_activate_plugin_url( $plugin_path ): string {
31 $admin_base_url = $this->wordpress_adapter->self_admin_url( 'plugins.php' );
32
33 $admin_url = add_query_arg( [
34 'action' => 'activate',
35 'plugin' => $plugin_path,
36 'plugin_status' => 'all',
37 'paged' => 1,
38 's' => '',
39 ], $admin_base_url );
40
41 return $this->wordpress_adapter->wp_nonce_url( $admin_url, 'activate-plugin_' . $plugin_path );
42 }
43 }
44