PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-dev3
Elementor Website Builder – more than just a page builder v3.23.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
← All changes | modules/apps/admin-apps-page.php +20 -13 4.1.0-dev33.23.0-dev3 View file →
@@ -2,9 +2,8 @@
2 2 namespace Elementor\Modules\Apps;
3 3
4 4 use Elementor\Core\Isolation\Wordpress_Adapter;
5 5 use Elementor\Core\Isolation\Plugin_Status_Adapter;
6 -use Elementor\Includes\EditorAssetsAPI;
7 6
8 7 if ( ! defined( 'ABSPATH' ) ) {
9 8 exit; // Exit if accessed directly.
10 9 }
@@ -45,9 +44,9 @@
45 44 self::render_plugin_item( $plugin );
46 45 }
47 46 }
48 47
49 - private static function get_plugins(): array {
48 + private static function get_plugins() : array {
50 49 if ( ! self::$wordpress_adapter ) {
51 50 self::$wordpress_adapter = new Wordpress_Adapter();
52 51 }
53 52
@@ -60,15 +59,21 @@
60 59 return static::filter_apps( $apps );
61 60 }
62 61
63 62 private static function get_remote_apps() {
64 - $editor_assets_api = new EditorAssetsAPI( [
65 - EditorAssetsAPI::ASSETS_DATA_URL => static::APPS_URL,
66 - EditorAssetsAPI::ASSETS_DATA_TRANSIENT_KEY => '_elementor_apps_data',
67 - EditorAssetsAPI::ASSETS_DATA_KEY => 'apps',
68 - ] );
63 + $apps = wp_remote_get( static::APPS_URL );
69 64
70 - return $editor_assets_api->get_assets_data();
65 + if ( is_wp_error( $apps ) ) {
66 + return [];
67 + }
68 +
69 + $apps = json_decode( wp_remote_retrieve_body( $apps ), true );
70 +
71 + if ( empty( $apps['apps'] ) || ! is_array( $apps['apps'] ) ) {
72 + return [];
73 + }
74 +
75 + return $apps['apps'];
71 76 }
72 77
73 78 private static function filter_apps( $apps ) {
74 79 $filtered_apps = [];
@@ -108,14 +113,16 @@
108 113 } else {
109 114 $app['action_label'] = esc_html__( 'Cannot Activate', 'elementor' );
110 115 $app['action_url'] = '#';
111 116 }
112 - } elseif ( current_user_can( 'install_plugins' ) ) {
117 + } else {
118 + if ( current_user_can( 'install_plugins' ) ) {
113 119 $app['action_label'] = esc_html__( 'Install', 'elementor' );
114 120 $app['action_url'] = self::$plugin_status_adapter->get_install_plugin_url( $app['file_path'] );
115 - } else {
116 - $app['action_label'] = esc_html__( 'Cannot Install', 'elementor' );
117 - $app['action_url'] = '#';
121 + } else {
122 + $app['action_label'] = esc_html__( 'Cannot Install', 'elementor' );
123 + $app['action_url'] = '#';
124 + }
118 125 }
119 126
120 127 return $app;
121 128 }
@@ -155,9 +162,9 @@
155 162 }
156 163
157 164 private static function render_plugin_item( $plugin ) {
158 165 ?>
159 - <div class="e-a-item"<?php echo ! empty( $plugin['file_path'] ) ? ' data-plugin="' . esc_attr( $plugin['file_path'] ) . '"' : ''; ?>>
166 + <div class="e-a-item">
160 167 <div class="e-a-heading">
161 168 <img class="e-a-img" src="<?php echo esc_url( $plugin['image'] ); ?>" alt="<?php echo esc_attr( $plugin['name'] ); ?>">
162 169 <?php if ( ! empty( $plugin['badge'] ) ) : ?>
163 170 <span class="e-a-badge"><?php echo esc_html( $plugin['badge'] ); ?></span>