import-history.php
1 year ago
other-plugin-importer.php
1 week ago
page.php
3 months ago
plugin-settings.php
3 months ago
tab-importers.php
3 months ago
tab-status.php
3 months ago
tab-version.php
3 months ago
tab-version.php
55 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Render version management page |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.50.0 |
| 8 | */ |
| 9 | |
| 10 | use AdvancedAds\Admin\Version_Control; |
| 11 | |
| 12 | $versions = get_transient( Version_Control::VERSIONS_TRANSIENT ); |
| 13 | ?> |
| 14 | <div class="wp-header-end hidden"></div> |
| 15 | <h3> |
| 16 | <?php esc_html_e( 'Rollback to Previous Version', 'advanced-ads' ); ?> |
| 17 | </h3> |
| 18 | <p> |
| 19 | <?php |
| 20 | printf( |
| 21 | /* translators: %s: current version */ |
| 22 | esc_html__( 'Experiencing an issue with Advanced Ads version %s? Rollback to a previous version before the issue appeared.', 'advanced-ads' ), |
| 23 | esc_attr( wp_advads()->get_version() ) |
| 24 | ) |
| 25 | ?> |
| 26 | </p> |
| 27 | <form method="post" action="" id="alternative-version" class="advads-form advads-form-horizontal mt-8"> |
| 28 | <?php wp_nonce_field( 'advads-version-control', 'version-control-nonce' ); ?> |
| 29 | |
| 30 | <div class="advads-field"> |
| 31 | <div class="advads-field-label"> |
| 32 | <?php esc_html_e( 'Available versions', 'advanced-ads' ); ?> |
| 33 | </div> |
| 34 | <div class="advads-field-input"> |
| 35 | <div class="flex gap-x-4"> |
| 36 | <select name="version" id="plugin-version"<?php echo ! $versions ? ' disabled' : ''; ?> class="!border"> |
| 37 | <?php if ( ! $versions ) : ?> |
| 38 | <option value="">--<?php esc_html_e( 'Fetching versions', 'advanced-ads' ); ?>--</option> |
| 39 | <?php else : ?> |
| 40 | <?php foreach ( $versions['order'] as $index => $version ) : ?> |
| 41 | <option value="<?php echo esc_attr( $version . '|' . $versions['versions'][ $version ] ); ?>"<?php selected( $index, 0 ); ?>><?php echo esc_html( $version ); ?></option> |
| 42 | <?php endforeach; ?> |
| 43 | <?php endif; ?> |
| 44 | </select> |
| 45 | |
| 46 | <button type="submit" id="install-version" class="button button-primary"<?php echo ! $versions ? ' disabled' : ''; ?>><?php esc_html_e( 'Reinstall', 'advanced-ads' ); ?></button> |
| 47 | |
| 48 | <span class="spinner"></span> |
| 49 | </div> |
| 50 | |
| 51 | <p class="text-sm italic text-red-600"><?php esc_html_e( 'Warning: It is advised that you backup your database before installing another version.', 'advanced-ads' ); ?></p> |
| 52 | </div> |
| 53 | </div> |
| 54 | </form> |
| 55 |