PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.2
Elementor Website Builder – more than just a page builder v3.16.2
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 +170 -97 4.0.93.16.2 View file →
@@ -1,11 +1,7 @@
1 1 <?php
2 2 namespace Elementor\Modules\Apps;
3 3
4 -use Elementor\Core\Isolation\Wordpress_Adapter;
5 -use Elementor\Core\Isolation\Plugin_Status_Adapter;
6 -use Elementor\Includes\EditorAssetsAPI;
7 -
8 4 if ( ! defined( 'ABSPATH' ) ) {
9 5 exit; // Exit if accessed directly.
10 6 }
11 7
@@ -10,21 +6,15 @@
10 6 }
11 7
12 8 class Admin_Apps_Page {
13 9
14 - const APPS_URL = 'https://assets.elementor.com/apps/v1/apps.json';
15 -
16 - private static ?Wordpress_Adapter $wordpress_adapter = null;
17 -
18 - private static ?Plugin_Status_Adapter $plugin_status_adapter = null;
19 -
20 10 public static function render() {
21 11 ?>
22 12 <div class="wrap e-a-apps">
23 13
24 14 <div class="e-a-page-title">
25 - <h2><?php echo esc_html__( 'Popular Add-ons, New Possibilities.', 'elementor' ); ?></h2>
26 - <p><?php echo esc_html__( 'Boost your web-creation process with add-ons, plugins, and more tools specially selected to unleash your creativity, increase productivity, and enhance your Elementor-powered website.', 'elementor' ); ?>*<br>
15 + <h2><?php echo esc_html__( 'Popular Apps, New Possibilities.', 'elementor' ); ?></h2>
16 + <p><?php echo esc_html__( 'Boost your web-creation process with add-ons, plugins, and more tools specially selected to unleash your creativity, increase productivity, and enhance your Elementor-powered website.', 'elementor' ); ?><br>
27 17 <a href="https://go.elementor.com/wp-dash-apps-about-apps-page/" target="_blank"><?php echo esc_html__( 'Learn more about this page.', 'elementor' ); ?></a>
28 18 </p>
29 19 </div>
30 20
@@ -31,9 +21,9 @@
31 21 <div class="e-a-list">
32 22 <?php self::render_plugins_list(); ?>
33 23 </div>
34 24 <div class="e-a-page-footer">
35 - <p>*<?php echo esc_html__( 'Please note that certain tools and services on this page are developed by third-party companies and are not part of Elementor\'s suite of products or support. Before using them, we recommend independently evaluating them. Additionally, when clicking on their action buttons, you may be redirected to an external website.', 'elementor' ); ?></p>
25 + <p><?php echo esc_html__( 'Please note that certain services on this page are developed by third-party companies. When you click on their action button, you may be redirected to an external website.', 'elementor' ); ?></p>
36 26 </div>
37 27 </div>
38 28 <?php
39 29 }
@@ -45,119 +35,202 @@
45 35 self::render_plugin_item( $plugin );
46 36 }
47 37 }
48 38
49 - private static function get_plugins(): array {
50 - if ( ! self::$wordpress_adapter ) {
51 - self::$wordpress_adapter = new Wordpress_Adapter();
52 - }
39 + private static function get_plugins() : array {
40 + $images_url = static::get_images_url();
53 41
54 - if ( ! self::$plugin_status_adapter ) {
55 - self::$plugin_status_adapter = new Plugin_Status_Adapter( self::$wordpress_adapter );
56 - }
42 + $plugins = [
43 + [
44 + 'name' => 'Elementor AI',
45 + 'author' => 'Elementor',
46 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-elementor-ai/',
47 + 'badge' => 'Premium',
48 + 'description' => 'Boost creativity with Elementor AI. Craft & enhance copy, create custom CSS & Code, and generate images to elevate your website.',
49 + 'action_label' => 'Let\'s Go',
50 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-elementor-ai/',
51 + 'image' => $images_url . 'elementor.svg',
52 + ],
53 + [
54 + 'name' => 'JetPlugins Add-ons',
55 + 'author' => 'Crocoblock',
56 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-crocoblock/',
57 + 'badge' => '10% Off',
58 + 'description' => 'Unlock dynamic widgets, e-commerce features, and a powerful filtering system for enhanced website capabilities.',
59 + 'offering' => 'Use coupon code: onlyforelementor',
60 + 'action_label' => 'Let\'s Go',
61 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-crocoblock/',
62 + 'image' => $images_url . 'crocoblock.png',
63 + ],
64 + [
65 + 'name' => 'Unlimited Elements',
66 + 'author' => 'Unlimited Group',
67 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-unlimited-elements/',
68 + 'badge' => '20% Off',
69 + 'description' => 'An all-in-one plugin that instantly gives you the most advanced tools to make better Elementor websites faster.',
70 + 'offering' => 'Use coupon code: elementor20',
71 + 'action_label' => 'Let\'s Go',
72 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-unlimited-elements/',
73 + 'image' => $images_url . 'unlimited-elements.gif',
74 + ],
75 + [
76 + 'name' => 'Essential Addons',
77 + 'author' => 'WPDeveloper',
78 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-wpdeveloper/',
79 + 'badge' => '20% Off',
80 + 'description' => 'Essential Addons is the ultimate library for Elementor, with 1 Million+ users and 100+ widgets & extensions to enhance web-building & design experiences.',
81 + 'offering' => 'Use coupon code: elementor20',
82 + 'action_label' => 'Let\'s Go',
83 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-wpdeveloper/',
84 + 'image' => $images_url . 'essential-addons.svg',
85 + ],
86 + [
87 + 'name' => 'Element Pack Pro',
88 + 'author' => 'BdThemes Ltd',
89 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-element-pack-pro/',
90 + 'description' => 'Revolutionize your web design experience with 250+ powerful features, tailored for designers of all skill levels. Create websites without breaking a sweat!',
91 + 'badge' => '10% Off',
92 + 'offering' => 'Discount is automatically applied',
93 + 'action_label' => 'Let\'s Go',
94 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-element-pack-pro/',
95 + 'image' => $images_url . 'element-pack.gif',
96 + ],
97 + [
98 + 'name' => 'Ultimate Addons',
99 + 'author' => 'Brainstorm Force',
100 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-ultimate-elementor/',
101 + 'description' => 'Ultimate Addons for Elementor is a powerful plugin with advanced widgets, templates, and features for designing stunning websites using Elementor.',
102 + 'badge' => '25% Off',
103 + 'offering' => 'Discount is automatically applied',
104 + 'action_label' => 'Let\'s Go',
105 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-ultimate-elementor/',
106 + 'image' => $images_url . 'uae.svg',
107 + ],
108 + [
109 + 'name' => 'Fiverr Logo Maker',
110 + 'author' => 'Fiverr',
111 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-fiverr/',
112 + 'description' => 'Craft your brand\'s identity on Fiverr Logo Maker. Upload logo, choose typography & colors for versatile variations. Elevate your brand effortlessly.',
113 + 'badge' => 'Premium',
114 + 'action_label' => 'Let\'s Go',
115 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-fiverr/',
116 + 'image' => $images_url . 'fiverr.svg',
117 + ],
118 + [
119 + 'name' => 'Hover Custom Domains',
120 + 'author' => 'Tucows',
121 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-hover/',
122 + 'description' => 'Elevate your website with a custom domain for maximum online impact. Enjoy exclusive Elementor user discounts through our Hover partnership.',
123 + 'badge' => '10% Off',
124 + 'offering' => 'Discount is automatically applied',
125 + 'action_label' => 'Let\'s Go',
126 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-hover/',
127 + 'image' => $images_url . 'hover.svg',
128 + ],
129 + ];
57 130
58 - $apps = static::get_remote_apps();
131 + $wporg_plugins = [
132 + [
133 + 'file_path' => 'aryo-activity-log/aryo-activity-log.php',
134 + 'name' => 'Activity Log',
135 + 'author' => 'Activity Log Team',
136 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-activity-log/',
137 + 'badge' => 'Free',
138 + 'description' => 'Track user activity easily. Discover who does what on your website and perform a comprehensive security audit for peace of mind.',
139 + 'learn_more_url' => 'https://go.elementor.com/wp-dash-apps-learn-more-activity-log/',
140 + 'action_label' => 'Install',
141 + 'action_url' => '#',
142 + 'image' => $images_url . 'activity-log.png',
143 + 'target' => '_self',
144 + ],
145 + [
146 + 'file_path' => 'pojo-accessibility/pojo-accessibility.php',
147 + 'name' => 'One Click Accessibility',
148 + 'author' => 'Accessibility Team',
149 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-wpaccessibility/',
150 + 'badge' => 'Free',
151 + 'description' => 'The fastest plugin to enhance WordPress website accessibility. Empower your website to be user-friendly for all visitors.',
152 + 'learn_more_url' => 'https://go.elementor.com/wp-dash-apps-learn-more-wpaccessibility/',
153 + 'action_label' => 'Install',
154 + 'action_url' => '#',
155 + 'image' => $images_url . 'one-click-accessibility.png',
156 + 'target' => '_self',
157 + ],
158 + ];
59 159
60 - return static::filter_apps( $apps );
61 - }
62 -
63 - 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 - ] );
69 -
70 - return $editor_assets_api->get_assets_data();
71 - }
72 -
73 - private static function filter_apps( $apps ) {
74 - $filtered_apps = [];
75 -
76 - foreach ( $apps as $app ) {
77 - if ( static::is_wporg_app( $app ) ) {
78 - $app = static::filter_wporg_app( $app );
160 + foreach ( $wporg_plugins as $wporg_plugin_data ) {
161 + if ( static::is_plugin_activated( $wporg_plugin_data['file_path'] ) ) {
162 + continue;
79 163 }
80 164
81 - if ( static::is_ecom_app( $app ) ) {
82 - $app = static::filter_ecom_app( $app );
165 + if ( static::is_plugin_installed( $wporg_plugin_data['file_path'] ) ) {
166 + if ( current_user_can( 'activate_plugins' ) ) {
167 + $wporg_plugin_data['action_label'] = 'Activate';
168 + $wporg_plugin_data['action_url'] = static::get_activate_plugin_url( $wporg_plugin_data['file_path'] );
169 + } else {
170 + $wporg_plugin_data['action_label'] = 'Cannot Activate';
171 + $wporg_plugin_data['action_url'] = '#';
172 + }
173 + } else {
174 + if ( current_user_can( 'install_plugins' ) ) {
175 + $wporg_plugin_data['action_label'] = 'Install';
176 + $wporg_plugin_data['action_url'] = static::get_install_plugin_url( $wporg_plugin_data['file_path'] );
177 + } else {
178 + $wporg_plugin_data['action_label'] = 'Cannot Install';
179 + $wporg_plugin_data['action_url'] = '#';
180 + }
83 181 }
84 182
85 - if ( empty( $app ) ) {
86 - continue;
87 - }
183 + array_unshift( $plugins, $wporg_plugin_data );
184 + }
88 185
89 - $filtered_apps[] = $app;
186 + if ( ! static::is_elementor_pro_installed() ) {
187 + array_unshift( $plugins, [
188 + 'name' => 'Elementor Pro',
189 + 'author' => 'Elementor',
190 + 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-elementor-pro/',
191 + 'badge' => 'Premium',
192 + 'description' => 'Unlock Elementor Pro and build any website with advanced design capabilities, marketing tools, WooCommerce features, Dynamic Content, and more.',
193 + 'action_label' => 'Let\'s Go',
194 + 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-elementor-pro/',
195 + 'image' => $images_url . 'elementor.svg',
196 + ] );
90 197 }
91 198
92 - return $filtered_apps;
199 + return $plugins;
93 200 }
94 201
95 - private static function is_wporg_app( $app ) {
96 - return isset( $app['type'] ) && 'wporg' === $app['type'];
202 + private static function get_images_url() {
203 + return ELEMENTOR_URL . 'modules/apps/images/';
97 204 }
98 205
99 - private static function filter_wporg_app( $app ) {
100 - if ( self::$wordpress_adapter->is_plugin_active( $app['file_path'] ) ) {
101 - return null;
102 - }
206 + private static function is_elementor_pro_installed() {
207 + return defined( 'ELEMENTOR_PRO_VERSION' );
208 + }
103 209
104 - if ( self::$plugin_status_adapter->is_plugin_installed( $app['file_path'] ) ) {
105 - if ( current_user_can( 'activate_plugins' ) ) {
106 - $app['action_label'] = esc_html__( 'Activate', 'elementor' );
107 - $app['action_url'] = self::$plugin_status_adapter->get_activate_plugin_url( $app['file_path'] );
108 - } else {
109 - $app['action_label'] = esc_html__( 'Cannot Activate', 'elementor' );
110 - $app['action_url'] = '#';
111 - }
112 - } elseif ( current_user_can( 'install_plugins' ) ) {
113 - $app['action_label'] = esc_html__( 'Install', 'elementor' );
114 - $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'] = '#';
118 - }
210 + private static function is_plugin_installed( $file_path ) {
211 + $installed_plugins = get_plugins();
119 212
120 - return $app;
213 + return isset( $installed_plugins[ $file_path ] );
121 214 }
122 215
123 - private static function is_ecom_app( $app ) {
124 - return isset( $app['type'] ) && 'ecom' === $app['type'];
216 + private static function is_plugin_activated( $file_path ) {
217 + return is_plugin_active( $file_path );
125 218 }
126 219
127 - private static function filter_ecom_app( $app ) {
128 - if ( self::$wordpress_adapter->is_plugin_active( $app['file_path'] ) ) {
129 - return null;
130 - }
131 -
132 - if ( ! self::$plugin_status_adapter->is_plugin_installed( $app['file_path'] ) ) {
133 - return $app;
134 - }
135 -
136 - if ( current_user_can( 'activate_plugins' ) ) {
137 - $app['action_label'] = esc_html__( 'Activate', 'elementor' );
138 - $app['action_url'] = self::$plugin_status_adapter->get_activate_plugin_url( $app['file_path'] );
139 - } else {
140 - $app['action_label'] = esc_html__( 'Cannot Activate', 'elementor' );
141 - $app['action_url'] = '#';
142 - }
143 -
144 - $app['target'] = '_self';
145 -
146 - return $app;
220 + private static function get_activate_plugin_url( $file_path ) {
221 + return wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $file_path . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $file_path );
147 222 }
148 223
149 - private static function get_images_url() {
150 - return ELEMENTOR_URL . 'modules/apps/images/';
151 - }
224 + private static function get_install_plugin_url( $file_path ) {
225 + $slug = dirname( $file_path );
152 226
153 - private static function is_elementor_pro_installed() {
154 - return defined( 'ELEMENTOR_PRO_VERSION' );
227 + return wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
155 228 }
156 229
157 230 private static function render_plugin_item( $plugin ) {
158 231 ?>
159 - <div class="e-a-item"<?php echo ! empty( $plugin['file_path'] ) ? ' data-plugin="' . esc_attr( $plugin['file_path'] ) . '"' : ''; ?>>
232 + <div class="e-a-item">
160 233 <div class="e-a-heading">
161 234 <img class="e-a-img" src="<?php echo esc_url( $plugin['image'] ); ?>" alt="<?php echo esc_attr( $plugin['name'] ); ?>">
162 235 <?php if ( ! empty( $plugin['badge'] ) ) : ?>
163 236 <span class="e-a-badge"><?php echo esc_html( $plugin['badge'] ); ?></span>