| 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 the 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.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 |
[ |
| 130 |
'name' => 'Gravity Forms', |
| 131 |
'author' => 'Gravity Forms', |
| 132 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-gravityforms/', |
| 133 |
'description' => 'Millions trust Gravity Forms for versatile forms—boost email lists, create quizzes, accept payments, and more!', |
| 134 |
'badge' => '30% Off', |
| 135 |
'offering' => 'Discount is automatically applied', |
| 136 |
'action_label' => 'Let\'s Go', |
| 137 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-gravityforms/', |
| 138 |
'image' => $images_url . 'gravity-forms.svg', |
| 139 |
], |
| 140 |
[ |
| 141 |
'name' => 'TranslatePress', |
| 142 |
'author' => 'Reflection Media SRL', |
| 143 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-translatepress/', |
| 144 |
'description' => 'TranslatePress is the easiest way to translate your WordPress site and go multilingual. It\'s a proven way to grow multilingual traffic and reach more people.', |
| 145 |
'badge' => '15% Off', |
| 146 |
'offering' => 'Discount is automatically applied', |
| 147 |
'action_label' => 'Let\'s Go', |
| 148 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-translatepress/', |
| 149 |
'image' => $images_url . 'translate-press.png', |
| 150 |
], |
| 151 |
[ |
| 152 |
'name' => 'Profile Builder', |
| 153 |
'author' => 'Cozmoslabs', |
| 154 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-cozmoslabs-wordpress-profile-builder/', |
| 155 |
'description' => 'Create beautiful user registration forms, user profiles and member directories with the #1 user management tool for modern websites.', |
| 156 |
'badge' => '15% Off', |
| 157 |
'offering' => 'Discount is automatically applied', |
| 158 |
'action_label' => 'Let\'s Go', |
| 159 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-cozmoslabs-wordpress-profile-builder/', |
| 160 |
'image' => $images_url . 'profile-builder.svg', |
| 161 |
], |
| 162 |
[ |
| 163 |
'name' => 'Paid Member Subscriptions', |
| 164 |
'author' => 'Cozmoslabs', |
| 165 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-cozmoslabs-wordpress-paid-member-subscriptions/', |
| 166 |
'description' => 'Launch your membership site, online course or paid community, increase conversions and generate subscription revenue with one flexible and seamless solution.', |
| 167 |
'badge' => '15% Off', |
| 168 |
'offering' => 'Discount is automatically applied', |
| 169 |
'action_label' => 'Let\'s Go', |
| 170 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-cozmoslabs-wordpress-paid-member-subscriptions/', |
| 171 |
'image' => $images_url . 'paid-member-subscriptions.svg', |
| 172 |
], |
| 173 |
[ |
| 174 |
'name' => 'BetterDocs', |
| 175 |
'author' => 'WPDeveloper', |
| 176 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-wpdeveloper-betterdocs/', |
| 177 |
'description' => 'BetterDocs is the ultimate WordPress knowledge base tool to create powerful documentation, multiple or internal knowledge bases, FAQ sections, and more.', |
| 178 |
'badge' => '20% Off', |
| 179 |
'offering' => 'Use coupon code: Elementor20', |
| 180 |
'action_label' => 'Let\'s Go', |
| 181 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-wpdeveloper-betterdocs/', |
| 182 |
'image' => $images_url . 'better-docs.svg', |
| 183 |
], |
| 184 |
[ |
| 185 |
'name' => 'SchedulePress', |
| 186 |
'author' => 'WPDeveloper', |
| 187 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-wpdeveloper-wp-scheduled-posts/', |
| 188 |
'description' => 'SchedulePress is the advanced WordPress content management solution for effortlessly scheduling site content & sharing on multiple social media platforms.', |
| 189 |
'badge' => '20% Off', |
| 190 |
'offering' => 'Use coupon code: Elementor20', |
| 191 |
'action_label' => 'Let\'s Go', |
| 192 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-wpdeveloper-wp-scheduled-posts/', |
| 193 |
'image' => $images_url . 'schedule-press.svg', |
| 194 |
], |
| 195 |
[ |
| 196 |
'name' => 'BetterPayments', |
| 197 |
'author' => 'WPDeveloper', |
| 198 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-better-payment/', |
| 199 |
'description' => 'Better Payment is an advanced plugin to integrate payment gateways, like PayPal & Stripe, into your WordPress website to accept, manage & track payments.', |
| 200 |
'badge' => '20% Off', |
| 201 |
'offering' => 'Use coupon code: Elementor20', |
| 202 |
'action_label' => 'Let\'s Go', |
| 203 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-better-payment/', |
| 204 |
'image' => $images_url . 'better-payment.svg', |
| 205 |
], |
| 206 |
[ |
| 207 |
'name' => 'EmbedPress', |
| 208 |
'author' => 'WPDeveloper', |
| 209 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-embedpress/', |
| 210 |
'description' => 'EmbedPress is the ultimate WordPress plugin to easily embed multimedia content from 150+ sources and to boost website engagement & interaction.', |
| 211 |
'badge' => '20% Off', |
| 212 |
'offering' => 'Use coupon code: Elementor20', |
| 213 |
'action_label' => 'Let\'s Go', |
| 214 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-embedpress/', |
| 215 |
'image' => $images_url . 'embed-press.svg', |
| 216 |
], |
| 217 |
[ |
| 218 |
'name' => 'NotificationX', |
| 219 |
'author' => 'WPDeveloper', |
| 220 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-notificationx/', |
| 221 |
'description' => 'NotificationX is a leading WordPress FOMO & social proof marketing tool to create powerful notification alerts that boost site credibility and conversion.', |
| 222 |
'badge' => '20% Off', |
| 223 |
'offering' => 'Use coupon code: Elementor20', |
| 224 |
'action_label' => 'Let\'s Go', |
| 225 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-notificationx/', |
| 226 |
'image' => $images_url . 'notification-x.svg', |
| 227 |
], |
| 228 |
[ |
| 229 |
'name' => 'BetterLinks', |
| 230 |
'author' => 'WPDeveloper', |
| 231 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-betterlinks/', |
| 232 |
'description' => 'BetterLinks is the finest WordPress link management tool to easily create, shorten, manage, track, and analyze any website URLs and marketing campaigns.', |
| 233 |
'badge' => '20% Off', |
| 234 |
'offering' => 'Use coupon code: Elementor20', |
| 235 |
'action_label' => 'Let\'s Go', |
| 236 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-betterlinks/', |
| 237 |
'image' => $images_url . 'better-links.svg', |
| 238 |
], |
| 239 |
[ |
| 240 |
'name' => 'ShortPixel', |
| 241 |
'author' => 'ShortPixel', |
| 242 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-shortpixel/', |
| 243 |
'description' => 'Optimize images, PDFs and create WebP/AVIF version of all your website\'s images with an easy-to-use and lightweight plugin with great support.', |
| 244 |
'action_label' => 'Let\'s Go', |
| 245 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-shortpixel/', |
| 246 |
'image' => $images_url . 'shortpixel.png', |
| 247 |
], |
| 248 |
[ |
| 249 |
'name' => 'Solid WP', |
| 250 |
'author' => 'Stellar WP', |
| 251 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-solid-wp/', |
| 252 |
'description' => 'SolidWP provides best-in-case security, backups, and site maintenance plugins – the backbone of high-performing websites.', |
| 253 |
'action_label' => 'Let\'s Go', |
| 254 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-solid-wp/', |
| 255 |
'image' => $images_url . 'solidwp.png', |
| 256 |
], |
| 257 |
[ |
| 258 |
'name' => 'The Events Calendar', |
| 259 |
'author' => 'Stellar WP', |
| 260 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-the-events-calendar/', |
| 261 |
'description' => 'The Events Calendar is an essential plugin for seamless event management. Perfect for businesses, organizations & individuals hosting events of any scale.', |
| 262 |
'action_label' => 'Let\'s Go', |
| 263 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-the-events-calendar/', |
| 264 |
'image' => $images_url . 'tec.png', |
| 265 |
], |
| 266 |
[ |
| 267 |
'name' => 'GiveWP', |
| 268 |
'author' => 'Stellar WP', |
| 269 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-give-wp/', |
| 270 |
'description' => 'GiveWP is a WordPress plugin for nonprofit fundraising. Tailored for charities and organizations, simplifying online donations and boosting impact.', |
| 271 |
'action_label' => 'Let\'s Go', |
| 272 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-give-wp/', |
| 273 |
'image' => $images_url . 'give.svg', |
| 274 |
], |
| 275 |
[ |
| 276 |
'name' => 'LearnDash', |
| 277 |
'author' => 'Stellar WP', |
| 278 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-learndash/', |
| 279 |
'description' => 'LearnDash is a best-in-class LMS platform empowering educators, trainers, and businesses to create engaging online learning courses on WordPress.', |
| 280 |
'action_label' => 'Let\'s Go', |
| 281 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-learndash/', |
| 282 |
'image' => $images_url . 'learndash.svg', |
| 283 |
], |
| 284 |
[ |
| 285 |
'name' => 'Restrict Content Pro', |
| 286 |
'author' => 'Stellar WP', |
| 287 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-restrict-content-pro/', |
| 288 |
'description' => 'RCP is a WordPress plugin for effortless membership management and monetization, ideal for businesses & content creators seeking subscription-based models.', |
| 289 |
'action_label' => 'Let\'s Go', |
| 290 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-restrict-content-pro/', |
| 291 |
'image' => $images_url . 'rcp.svg', |
| 292 |
], |
| 293 |
[ |
| 294 |
'name' => 'Weglot', |
| 295 |
'author' => 'Weglot', |
| 296 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-weglot/', |
| 297 |
'description' => 'Weglot is one of the best WordPress multilingual plugins to translate and display your website in multiple languages.', |
| 298 |
'action_label' => 'Let\'s Go', |
| 299 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-weglot/', |
| 300 |
'image' => $images_url . 'weglot.svg', |
| 301 |
], |
| 302 |
[ |
| 303 |
'name' => 'Draw Attention', |
| 304 |
'author' => 'N Squared', |
| 305 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-draw-attention/', |
| 306 |
'description' => 'Easy to use drawing tool for creating interactive images (fully responsive image maps). Highlight sections of your images with clickable hotspots!', |
| 307 |
'action_label' => 'Let\'s Go', |
| 308 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-draw-attention/', |
| 309 |
'image' => $images_url . 'draw-attention.png', |
| 310 |
], |
| 311 |
[ |
| 312 |
'name' => 'Simply Schedule Appointments', |
| 313 |
'author' => 'N Squared', |
| 314 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-simply-schedule-appointments/', |
| 315 |
'description' => 'Meet the powerful WordPress booking plugin with built-in Elementor widgets, easy custom styling, unlimited booking calendars, and tons of integrations!', |
| 316 |
'action_label' => 'Let\'s Go', |
| 317 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-simply-schedule-appointments/', |
| 318 |
'image' => $images_url . 'ssa.png', |
| 319 |
], |
| 320 |
]; |
| 321 |
|
| 322 |
$wporg_plugins = [ |
| 323 |
[ |
| 324 |
'file_path' => 'aryo-activity-log/aryo-activity-log.php', |
| 325 |
'name' => 'Activity Log', |
| 326 |
'author' => 'Activity Log Team', |
| 327 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-activity-log/', |
| 328 |
'badge' => 'Free', |
| 329 |
'description' => 'Track user activity easily. Discover who does what on your website and perform a comprehensive security audit for peace of mind.', |
| 330 |
'learn_more_url' => 'https://go.elementor.com/wp-dash-apps-learn-more-activity-log/', |
| 331 |
'action_label' => 'Install', |
| 332 |
'action_url' => '#', |
| 333 |
'image' => $images_url . 'activity-log.png', |
| 334 |
'target' => '_self', |
| 335 |
], |
| 336 |
[ |
| 337 |
'file_path' => 'pojo-accessibility/pojo-accessibility.php', |
| 338 |
'name' => 'One Click Accessibility', |
| 339 |
'author' => 'Accessibility Team', |
| 340 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-wpaccessibility/', |
| 341 |
'badge' => 'Free', |
| 342 |
'description' => 'The fastest plugin to enhance WordPress website accessibility. Empower your website to be user-friendly for all visitors.', |
| 343 |
'learn_more_url' => 'https://go.elementor.com/wp-dash-apps-learn-more-wpaccessibility/', |
| 344 |
'action_label' => 'Install', |
| 345 |
'action_url' => '#', |
| 346 |
'image' => $images_url . 'one-click-accessibility.png', |
| 347 |
'target' => '_self', |
| 348 |
], |
| 349 |
]; |
| 350 |
|
| 351 |
foreach ( $wporg_plugins as $wporg_plugin_data ) { |
| 352 |
if ( static::is_plugin_activated( $wporg_plugin_data['file_path'] ) ) { |
| 353 |
continue; |
| 354 |
} |
| 355 |
|
| 356 |
if ( static::is_plugin_installed( $wporg_plugin_data['file_path'] ) ) { |
| 357 |
if ( current_user_can( 'activate_plugins' ) ) { |
| 358 |
$wporg_plugin_data['action_label'] = 'Activate'; |
| 359 |
$wporg_plugin_data['action_url'] = static::get_activate_plugin_url( $wporg_plugin_data['file_path'] ); |
| 360 |
} else { |
| 361 |
$wporg_plugin_data['action_label'] = 'Cannot Activate'; |
| 362 |
$wporg_plugin_data['action_url'] = '#'; |
| 363 |
} |
| 364 |
} else { |
| 365 |
if ( current_user_can( 'install_plugins' ) ) { |
| 366 |
$wporg_plugin_data['action_label'] = 'Install'; |
| 367 |
$wporg_plugin_data['action_url'] = static::get_install_plugin_url( $wporg_plugin_data['file_path'] ); |
| 368 |
} else { |
| 369 |
$wporg_plugin_data['action_label'] = 'Cannot Install'; |
| 370 |
$wporg_plugin_data['action_url'] = '#'; |
| 371 |
} |
| 372 |
} |
| 373 |
|
| 374 |
array_unshift( $plugins, $wporg_plugin_data ); |
| 375 |
} |
| 376 |
|
| 377 |
if ( ! static::is_elementor_pro_installed() ) { |
| 378 |
array_unshift( $plugins, [ |
| 379 |
'name' => 'Elementor Pro', |
| 380 |
'author' => 'Elementor', |
| 381 |
'author_url' => 'https://go.elementor.com/wp-dash-apps-author-uri-elementor-pro/', |
| 382 |
'badge' => 'Premium', |
| 383 |
'description' => 'Unlock Elementor Pro and build any website with advanced design capabilities, marketing tools, WooCommerce features, Dynamic Content, and more.', |
| 384 |
'action_label' => 'Let\'s Go', |
| 385 |
'action_url' => 'https://go.elementor.com/wp-dash-apps-go-to-elementor-pro/', |
| 386 |
'image' => $images_url . 'elementor.svg', |
| 387 |
] ); |
| 388 |
} |
| 389 |
|
| 390 |
return $plugins; |
| 391 |
} |
| 392 |
|
| 393 |
private static function get_images_url() { |
| 394 |
return ELEMENTOR_URL . 'modules/apps/images/'; |
| 395 |
} |
| 396 |
|
| 397 |
private static function is_elementor_pro_installed() { |
| 398 |
return defined( 'ELEMENTOR_PRO_VERSION' ); |
| 399 |
} |
| 400 |
|
| 401 |
private static function is_plugin_installed( $file_path ) { |
| 402 |
$installed_plugins = get_plugins(); |
| 403 |
|
| 404 |
return isset( $installed_plugins[ $file_path ] ); |
| 405 |
} |
| 406 |
|
| 407 |
private static function is_plugin_activated( $file_path ) { |
| 408 |
return is_plugin_active( $file_path ); |
| 409 |
} |
| 410 |
|
| 411 |
private static function get_activate_plugin_url( $file_path ) { |
| 412 |
return wp_nonce_url( 'plugins.php?action=activate&plugin=' . $file_path . '&plugin_status=all&paged=1&s', 'activate-plugin_' . $file_path ); |
| 413 |
} |
| 414 |
|
| 415 |
private static function get_install_plugin_url( $file_path ) { |
| 416 |
$slug = dirname( $file_path ); |
| 417 |
|
| 418 |
return wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug ); |
| 419 |
} |
| 420 |
|
| 421 |
private static function render_plugin_item( $plugin ) { |
| 422 |
?> |
| 423 |
<div class="e-a-item"> |
| 424 |
<div class="e-a-heading"> |
| 425 |
<img class="e-a-img" src="<?php echo esc_url( $plugin['image'] ); ?>" alt="<?php echo esc_attr( $plugin['name'] ); ?>"> |
| 426 |
<?php if ( ! empty( $plugin['badge'] ) ) : ?> |
| 427 |
<span class="e-a-badge"><?php echo esc_html( $plugin['badge'] ); ?></span> |
| 428 |
<?php endif; ?> |
| 429 |
</div> |
| 430 |
<h3 class="e-a-title"><?php echo esc_html( $plugin['name'] ); ?></h3> |
| 431 |
<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> |
| 432 |
<div class="e-a-desc"> |
| 433 |
<p><?php echo esc_html( $plugin['description'] ); ?></p> |
| 434 |
<?php if ( ! empty( $plugin['offering'] ) ) : ?> |
| 435 |
<p class="e-a-offering"><?php echo esc_html( $plugin['offering'] ); ?></p> |
| 436 |
<?php endif; ?> |
| 437 |
</div> |
| 438 |
|
| 439 |
<p class="e-a-actions"> |
| 440 |
<?php if ( ! empty( $plugin['learn_more_url'] ) ) : ?> |
| 441 |
<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> |
| 442 |
<?php endif; ?> |
| 443 |
<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> |
| 444 |
</p> |
| 445 |
</div> |
| 446 |
<?php |
| 447 |
} |
| 448 |
} |
| 449 |
|