PluginProbe
Elementor Website Builder – more than just a page builder / 3.16.0-dev1
Elementor Website Builder – more than just a page builder v3.16.0-dev1
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 / modules / apps / admin-apps-page.php

admin-apps-page.php in Elementor Website Builder – more than just a page builder 3.16.0-dev1, at modules/apps/admin-apps-page.php

236 lines 9.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\Apps;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 class Admin_Apps_Page {
9
10 public static function render() {
11 ?>
12 <div class="wrap e-a-apps">
13
14 <div class="e-a-page-title">
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>
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>
18 </p>
19 </div>
20
21 <div class="e-a-list">
22 <?php self::render_plugins_list(); ?>
23 </div>
24 <div class="e-a-page-footer">
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>
26 </div>
27 </div>
28 <?php
29 }
30
31 private static function render_plugins_list() {
32 $plugins = self::get_plugins();
33
34 foreach ( $plugins as $plugin ) {
35 self::render_plugin_item( $plugin );
36 }
37 }
38
39 private static function get_plugins() : array {
40 $images_url = static::get_images_url();
41
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.svg',
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' => 'Premium',
92 'action_label' => 'Let\'s Go',
93 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-element-pack-pro/',
94 'image' => $images_url . 'element-pack.gif',
95 ],
96 [
97 'name' => 'Ultimate Addons',
98 'author' => 'Brainstorm Force',
99 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-ultimate-elementor/',
100 'description' => 'Ultimate Addons for Elementor is a powerful plugin with advanced widgets, templates, and features for designing stunning websites using Elementor.',
101 'badge' => '25% Off',
102 'offering' => 'Discount is automatically applied',
103 'action_label' => 'Let\'s Go',
104 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-ultimate-elementor/',
105 'image' => $images_url . 'uae.svg',
106 ],
107 ];
108
109 $wporg_plugins = [
110 [
111 'file_path' => 'aryo-activity-log/aryo-activity-log.php',
112 'name' => 'Activity Log',
113 'author' => 'Activity Log Team',
114 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-activity-log/',
115 'badge' => 'Free',
116 'description' => 'Track user activity easily. Discover who does what on your website and perform a comprehensive security audit for peace of mind.',
117 'learn_more_url' => 'https://go.elementor.com/wp-dash-apps-learn-more-activity-log/',
118 'action_label' => 'Install',
119 'action_url' => '#',
120 'image' => $images_url . 'activity-log.png',
121 'target' => '_self',
122 ],
123 [
124 'file_path' => 'pojo-accessibility/pojo-accessibility.php',
125 'name' => 'One Click Accessibility',
126 'author' => 'Accessibility Team',
127 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-wpaccessibility/',
128 'badge' => 'Free',
129 'description' => 'The fastest plugin to enhance WordPress website accessibility. Empower your website to be user-friendly for all visitors.',
130 'learn_more_url' => 'https://go.elementor.com/wp-dash-apps-learn-more-wpaccessibility/',
131 'action_label' => 'Install',
132 'action_url' => '#',
133 'image' => $images_url . 'one-click-accessibility.png',
134 'target' => '_self',
135 ],
136 ];
137
138 foreach ( $wporg_plugins as $wporg_plugin_data ) {
139 if ( static::is_plugin_activated( $wporg_plugin_data['file_path'] ) ) {
140 continue;
141 }
142
143 if ( static::is_plugin_installed( $wporg_plugin_data['file_path'] ) ) {
144 if ( current_user_can( 'activate_plugins' ) ) {
145 $wporg_plugin_data['action_label'] = 'Activate';
146 $wporg_plugin_data['action_url'] = static::get_activate_plugin_url( $wporg_plugin_data['file_path'] );
147 } else {
148 $wporg_plugin_data['action_label'] = 'Cannot Activate';
149 $wporg_plugin_data['action_url'] = '#';
150 }
151 } else {
152 if ( current_user_can( 'install_plugins' ) ) {
153 $wporg_plugin_data['action_label'] = 'Install';
154 $wporg_plugin_data['action_url'] = static::get_install_plugin_url( $wporg_plugin_data['file_path'] );
155 } else {
156 $wporg_plugin_data['action_label'] = 'Cannot Install';
157 $wporg_plugin_data['action_url'] = '#';
158 }
159 }
160
161 array_unshift( $plugins, $wporg_plugin_data );
162 }
163
164 if ( ! static::is_elementor_pro_installed() ) {
165 array_unshift( $plugins, [
166 'name' => 'Elementor Pro',
167 'author' => 'Elementor',
168 'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-elementor-pro/',
169 'badge' => 'Premium',
170 'description' => 'Unlock Elementor Pro and build any website with advanced design capabilities, marketing tools, WooCommerce features, Dynamic Content, and more.',
171 'action_label' => 'Let\'s Go',
172 'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-elementor-pro/',
173 'image' => $images_url . 'elementor.svg',
174 ] );
175 }
176
177 return $plugins;
178 }
179
180 private static function get_images_url() {
181 return ELEMENTOR_URL . 'modules/apps/images/';
182 }
183
184 private static function is_elementor_pro_installed() {
185 return defined( 'ELEMENTOR_PRO_VERSION' );
186 }
187
188 private static function is_plugin_installed( $file_path ) {
189 $installed_plugins = get_plugins();
190
191 return isset( $installed_plugins[ $file_path ] );
192 }
193
194 private static function is_plugin_activated( $file_path ) {
195 return is_plugin_active( $file_path );
196 }
197
198 private static function get_activate_plugin_url( $file_path ) {
199 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 );
200 }
201
202 private static function get_install_plugin_url( $file_path ) {
203 $slug = dirname( $file_path );
204
205 return wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
206 }
207
208 private static function render_plugin_item( $plugin ) {
209 ?>
210 <div class="e-a-item">
211 <div class="e-a-heading">
212 <img class="e-a-img" src="<?php echo esc_url( $plugin['image'] ); ?>" alt="<?php echo esc_attr( $plugin['name'] ); ?>">
213 <?php if ( ! empty( $plugin['badge'] ) ) : ?>
214 <span class="e-a-badge"><?php echo esc_html( $plugin['badge'] ); ?></span>
215 <?php endif; ?>
216 </div>
217 <h3 class="e-a-title"><?php echo esc_html( $plugin['name'] ); ?></h3>
218 <p class="e-a-author"><?php esc_html_e( 'By', 'elementor' ); ?> <a href="<?php echo esc_url( $plugin['author_url'] ); ?>" target="_blank"><?php echo esc_html( $plugin['author'] ); ?></a></p>
219 <div class="e-a-desc">
220 <p><?php echo esc_html( $plugin['description'] ); ?></p>
221 <?php if ( ! empty( $plugin['offering'] ) ) : ?>
222 <p class="e-a-offering"><?php echo esc_html( $plugin['offering'] ); ?></p>
223 <?php endif; ?>
224 </div>
225
226 <p class="e-a-actions">
227 <?php if ( ! empty( $plugin['learn_more_url'] ) ) : ?>
228 <a class="e-a-learn-more" href="<?php echo esc_url( $plugin['learn_more_url'] ); ?>" target="_blank"><?php echo esc_html__( 'Learn More', 'elementor' ); ?></a>
229 <?php endif; ?>
230 <a href="<?php echo esc_url( $plugin['action_url'] ); ?>" class="e-btn e-accent" target="<?php echo isset( $plugin['target'] ) ? esc_attr( $plugin['target'] ) : '_blank'; ?>"><?php echo esc_html( $plugin['action_label'] ); ?></a>
231 </p>
232 </div>
233 <?php
234 }
235 }
236