html-admin-page-addons.php
2 years ago
html-admin-page-builder.php
4 years ago
html-admin-page-entries-view.php
3 years ago
html-admin-page-export.php
3 years ago
html-admin-page-form-templates.php
3 years ago
html-admin-page-import.php
3 years ago
html-admin-page-tools-logs.php
4 years ago
html-admin-page-tools.php
5 years ago
html-admin-settings.php
7 years ago
html-deactivation-popup.php
3 years ago
html-notice-allow-usage.php
2 years ago
html-notice-custom.php
6 years ago
html-notice-php-deprecation.php
3 years ago
html-notice-review.php
2 years ago
html-notice-survey.php
4 years ago
html-notice-update.php
6 years ago
html-notice-updated.php
6 years ago
html-notice-updating.php
6 years ago
html-admin-page-addons.php
238 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Addons |
| 4 | * |
| 5 | * @var string $view |
| 6 | * @var object $addons |
| 7 | * |
| 8 | * @package EverestForms |
| 9 | */ |
| 10 | |
| 11 | defined( 'ABSPATH' ) || exit; |
| 12 | |
| 13 | ?> |
| 14 | <div class="wrap evf_addons_wrap"> |
| 15 | <h1 class="wp-heading-inline"><?php esc_html_e( 'Everest Forms Add-ons', 'everest-forms' ); ?></h1> |
| 16 | |
| 17 | <?php if ( apply_filters( 'everest_forms_refresh_addons', true ) ) : ?> |
| 18 | <a href="<?php echo esc_url( $refresh_url ); ?>" class="page-title-action"><?php esc_html_e( 'Refresh Add-ons', 'everest-forms' ); ?></a> |
| 19 | <?php endif; ?> |
| 20 | |
| 21 | <hr class="wp-header-end"> |
| 22 | <h2 class="screen-reader-text"><?php esc_html_e( 'Filter add-ons list', 'everest-forms' ); ?></h2> |
| 23 | |
| 24 | <?php if ( $sections ) : ?> |
| 25 | <div class="wp-filter"> |
| 26 | <ul class="filter-links"> |
| 27 | <?php foreach ( $sections as $section ) : ?> |
| 28 | <li class="<?php echo esc_attr( $section->slug ); ?>"> |
| 29 | <a href="<?php echo esc_url( admin_url( 'admin.php?page=evf-addons§ion=' . esc_attr( $section->slug ) ) ); ?>"<?php echo $current_section === $section->slug ? ' class="current" aria-current="page"' : ''; ?>><?php echo esc_html( $section->label ); ?></a> |
| 30 | </li> |
| 31 | <?php endforeach; ?> |
| 32 | </ul> |
| 33 | <form class="search-form search-plugins hidden" method="get"> |
| 34 | <input type="hidden" name="page" value="evf-addons"> |
| 35 | <?php $page_section = ( isset( $_GET['section'] ) && '_featured' !== sanitize_text_field( wp_unslash( $_GET['section'] ) ) ) ? sanitize_text_field( wp_unslash( $_GET['section'] ) ) : '_all'; // phpcs:ignore WordPress.Security.NonceVerification ?> |
| 36 | <input type="hidden" name="section" value="<?php echo esc_attr( $page_section ); ?>"> |
| 37 | <label> |
| 38 | <span class="screen-reader-text"><?php esc_html_e( 'Search Add-ons', 'everest-forms' ); ?></span> |
| 39 | <input type="search" name="s" value="" class="wp-filter-search hidden" placeholder="<?php esc_attr_e( 'Search Add-ons...', 'everest-forms' ); ?>" aria-describedby="live-search-desc" /> |
| 40 | </label> |
| 41 | <input type="submit" id="search-submit" class="button hide-if-js" value="<?php esc_attr_e( 'Search Add-ons', 'everest-forms' ); ?>"> |
| 42 | </form> |
| 43 | </div> |
| 44 | |
| 45 | <br class="clear"> |
| 46 | <p class="refresh"> |
| 47 | <?php |
| 48 | /* translators: %s: Refresh URI */ |
| 49 | printf( esc_html__( 'Make your forms even more robust with our premium addons. Missing any addons? Click the %1$sRefresh Add-ons%2$s button above.', 'everest-forms' ), '<a href="' . esc_url( $refresh_url ) . '">', '</a>' ); |
| 50 | ?> |
| 51 | </p> |
| 52 | |
| 53 | <?php if ( '_featured' !== $current_section && $addons ) : ?> |
| 54 | <form id="extension-filter" method="post"> |
| 55 | <div class="wp-list-table widefat extension-install"> |
| 56 | <h2 class="screen-reader-text"><?php esc_html_e( 'Add-ons list', 'everest-forms' ); ?></h2> |
| 57 | <div class="the-list"> |
| 58 | <?php |
| 59 | $plan = evf_get_license_plan(); |
| 60 | if ( false === $plan ) { |
| 61 | array_shift( $addons ); |
| 62 | ?> |
| 63 | <div class="plugin-card plugin-card-everest-forms-ai-contact-form"> |
| 64 | <a href="<?php echo esc_url( 'https://everestforms.net/features/convertkit/?utm_source=addons-page&utm_medium=banner&utm_campaign=evf-upgrade-to-pro&utm_content=ai-contact-form' ); ?>"> |
| 65 | <div class="plugin-card-top"> |
| 66 | <div class="name column-name"> |
| 67 | <h3 class="plugin-name"> |
| 68 | <?php echo esc_html( 'AI Contact Form' ); ?> |
| 69 | <img src="<?php echo esc_url( evf()->plugin_url() . '/assets/extensions-json/sections/images/ai.png' ); ?>" class="plugin-icon" alt=""/> |
| 70 | </h3> |
| 71 | </div> |
| 72 | <div class="desc column-description"> |
| 73 | <p class="plugin-desc"> <?php echo esc_html( 'Add AI capabilities like interactive chatbox, AI generated email notifications, and more to your forms.' ); ?></p> |
| 74 | </div> |
| 75 | </div> |
| 76 | </a> |
| 77 | <div class="plugin-card-bottom"> |
| 78 | <div class="status column-status"> |
| 79 | <strong><?php esc_html_e( 'Status:', 'everest-forms' ); ?></strong> |
| 80 | <?php |
| 81 | $addon_slug = 'ai-contact-form'; |
| 82 | if ( is_plugin_active( $addon_slug . '/' . $addon_slug . '.php' ) ) : |
| 83 | ?> |
| 84 | <span class="status-label status-active"><?php esc_html_e( 'Activated', 'everest-forms' ); ?></span> |
| 85 | <?php elseif ( file_exists( WP_PLUGIN_DIR . '/' . $addon_slug . '/' . $addon_slug . '.php' ) ) : ?> |
| 86 | <span class="status-label status-inactive"><?php esc_html_e( 'Inactive', 'everest-forms' ); ?></span> |
| 87 | <?php else : ?> |
| 88 | <span class="status-label status-install-now"><?php esc_html_e( 'Not Installed', 'everest-forms' ); ?></span> |
| 89 | <?php endif; ?> |
| 90 | </div> |
| 91 | <div class="action-buttons upgrade-plan"> |
| 92 | <?php |
| 93 | $repo_url = 'https://api.github.com/repos/wpeverest/ai-contact-form/releases/latest'; |
| 94 | $response = wp_safe_remote_get( $repo_url ); |
| 95 | $release = wp_remote_retrieve_body( $response ); |
| 96 | $release = json_decode( $release, true ); |
| 97 | $latest_tag = isset( $release['tag_name'] ) ? esc_attr( $release['tag_name'] ) : ''; |
| 98 | $download_url = "https://github.com/wpeverest/ai-contact-form/archive/{$latest_tag}.zip"; |
| 99 | ?> |
| 100 | <?php if ( is_plugin_active( $addon_slug . '/' . $addon_slug . '.php' ) ) : ?> |
| 101 | <?php |
| 102 | $plugin_file = plugin_basename( $addon_slug . '/' . $addon_slug . '.php' ); |
| 103 | $url = wp_nonce_url( |
| 104 | add_query_arg( |
| 105 | array( |
| 106 | 'page' => 'evf-addons', |
| 107 | 'action' => 'deactivate', |
| 108 | 'plugin' => $plugin_file, |
| 109 | ), |
| 110 | admin_url( 'admin.php' ) |
| 111 | ), |
| 112 | 'deactivate-plugin_' . $plugin_file |
| 113 | ); |
| 114 | ?> |
| 115 | <a class="button button-secondary deactivate-now" href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'Deactivate', 'everest-forms' ); ?></a> |
| 116 | <?php elseif ( file_exists( WP_PLUGIN_DIR . '/' . $addon_slug . '/' . $addon_slug . '.php' ) ) : ?> |
| 117 | <?php |
| 118 | $plugin_file = plugin_basename( $addon_slug . '/' . $addon_slug . '.php' ); |
| 119 | $url = wp_nonce_url( |
| 120 | add_query_arg( |
| 121 | array( |
| 122 | 'page' => 'evf-addons', |
| 123 | 'action' => 'activate', |
| 124 | 'plugin' => $plugin_file, |
| 125 | ), |
| 126 | admin_url( 'admin.php' ) |
| 127 | ), |
| 128 | 'activate-plugin_' . $plugin_file |
| 129 | ); |
| 130 | ?> |
| 131 | <a class="button button-primary activate-now" href="<?php echo esc_url( $url ); ?>"><?php esc_html_e( 'Activate', 'everest-forms' ); ?></a> |
| 132 | <?php else : ?> |
| 133 | <a href="<?php echo esc_url( $download_url ); ?>" class="button evf-download-ai"><?php esc_html_e( 'Download Addon', 'everest-forms' ); ?></a> |
| 134 | <?php endif; ?> |
| 135 | </div> |
| 136 | </div> |
| 137 | </div> |
| 138 | <?php } ?> |
| 139 | <?php |
| 140 | foreach ( $addons as $addon ) : |
| 141 | ?> |
| 142 | |
| 143 | <div class="plugin-card plugin-card-<?php echo esc_attr( $addon->slug ); ?>"> |
| 144 | <a href="<?php echo esc_url( $addon->link ); ?>"> |
| 145 | <div class="plugin-card-top"> |
| 146 | <div class="name column-name"> |
| 147 | <h3 class="plugin-name"> |
| 148 | <?php echo esc_html( $addon->title ); ?> |
| 149 | <img src="<?php echo esc_url( evf()->plugin_url() . '/assets/' . $addon->image ); ?>" class="plugin-icon" alt="" /> |
| 150 | </h3> |
| 151 | </div> |
| 152 | <div class="desc column-description"> |
| 153 | <p class="plugin-desc"><?php echo esc_html( $addon->excerpt ); ?></p> |
| 154 | </div> |
| 155 | </div> |
| 156 | </a> |
| 157 | <div class="plugin-card-bottom"> |
| 158 | <?php if ( in_array( str_replace( '-lifetime', '', $license_plan ), $addon->plan, true ) ) : ?> |
| 159 | <div class="status column-status"> |
| 160 | <strong><?php esc_html_e( 'Status:', 'everest-forms' ); ?></strong> |
| 161 | <?php if ( is_plugin_active( $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 162 | <span class="status-label status-active"><?php esc_html_e( 'Activated', 'everest-forms' ); ?></span> |
| 163 | <?php elseif ( file_exists( WP_PLUGIN_DIR . '/' . $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 164 | <span class="status-label status-inactive"><?php esc_html_e( 'Inactive', 'everest-forms' ); ?></span> |
| 165 | <?php else : ?> |
| 166 | <span class="status-label status-install-now"><?php esc_html_e( 'Not Installed', 'everest-forms' ); ?></span> |
| 167 | <?php endif; ?> |
| 168 | </div> |
| 169 | <div class="action-buttons"> |
| 170 | <?php if ( is_plugin_active( $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 171 | <?php |
| 172 | /* translators: %s: Add-on title */ |
| 173 | $aria_label = sprintf( esc_html__( 'Deactivate %s now', 'everest-forms' ), $addon->title ); |
| 174 | $plugin_file = plugin_basename( $addon->slug . '/' . $addon->slug . '.php' ); |
| 175 | $url = wp_nonce_url( |
| 176 | add_query_arg( |
| 177 | array( |
| 178 | 'page' => 'evf-addons', |
| 179 | 'action' => 'deactivate', |
| 180 | 'plugin' => $plugin_file, |
| 181 | ), |
| 182 | admin_url( 'admin.php' ) |
| 183 | ), |
| 184 | 'deactivate-plugin_' . $plugin_file |
| 185 | ); |
| 186 | ?> |
| 187 | <a class="button button-secondary deactivate-now" href="<?php echo esc_url( $url ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php esc_html_e( 'Deactivate', 'everest-forms' ); ?></a> |
| 188 | <?php elseif ( file_exists( WP_PLUGIN_DIR . '/' . $addon->slug . '/' . $addon->slug . '.php' ) ) : ?> |
| 189 | <?php |
| 190 | /* translators: %s: Add-on title */ |
| 191 | $aria_label = sprintf( esc_html__( 'Activate %s now', 'everest-forms' ), $addon->title ); |
| 192 | $plugin_file = plugin_basename( $addon->slug . '/' . $addon->slug . '.php' ); |
| 193 | $url = wp_nonce_url( |
| 194 | add_query_arg( |
| 195 | array( |
| 196 | 'page' => 'evf-addons', |
| 197 | 'action' => 'activate', |
| 198 | 'plugin' => $plugin_file, |
| 199 | ), |
| 200 | admin_url( 'admin.php' ) |
| 201 | ), |
| 202 | 'activate-plugin_' . $plugin_file |
| 203 | ); |
| 204 | ?> |
| 205 | <a class="button button-primary activate-now" href="<?php echo esc_url( $url ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php esc_html_e( 'Activate', 'everest-forms' ); ?></a> |
| 206 | <?php else : ?> |
| 207 | <?php |
| 208 | /* translators: %s: Add-on title */ |
| 209 | $aria_label = sprintf( esc_html__( 'Install %s now', 'everest-forms' ), $addon->title ); |
| 210 | ?> |
| 211 | <a href="#" class="button install-now" data-slug="<?php echo esc_attr( $addon->slug ); ?>" data-name="<?php echo esc_attr( $addon->name ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php esc_html_e( 'Install Addon', 'everest-forms' ); ?></a> |
| 212 | <?php endif; ?> |
| 213 | </div> |
| 214 | <?php else : ?> |
| 215 | <div class="action-buttons upgrade-plan"> |
| 216 | <a class="button upgrade-now" href="https://everestforms.net/pricing/?utm_source=addons-page&utm_medium=upgrade-button&utm_campaign=evf-upgrade-to-pro" target="_blank"><?php esc_html_e( 'Upgrade Plan', 'everest-forms' ); ?></a> |
| 217 | </div> |
| 218 | <?php endif; ?> |
| 219 | </div> |
| 220 | </div> |
| 221 | <?php endforeach; ?> |
| 222 | </div> |
| 223 | </div> |
| 224 | </form> |
| 225 | <?php endif; ?> |
| 226 | <?php else : ?> |
| 227 | <p> |
| 228 | <?php |
| 229 | /* translators: %s: Add-ons Link */ |
| 230 | printf( esc_html__( 'Our catalog of Everest Forms Add-ons/Extensions can be found on WPEverest.com here: <a href="%s">Everest Forms Extensions Catalog</a>', 'everest-forms' ), 'https://everestforms.net/' ); |
| 231 | ?> |
| 232 | </p> |
| 233 | <?php endif; ?> |
| 234 | </div> |
| 235 | <?php |
| 236 | wp_print_request_filesystem_credentials_modal(); |
| 237 | wp_print_admin_notice_templates(); |
| 238 |