notice.php
52 lines
| 1 | <?php |
| 2 | |
| 3 | // calculate add-ons (non pro only) |
| 4 | $plugins = array(); |
| 5 | |
| 6 | if ( ! acf_get_setting( 'pro' ) ) { |
| 7 | if ( is_plugin_active( 'acf-repeater/acf-repeater.php' ) ) { |
| 8 | $plugins[] = __( 'Repeater', 'secure-custom-fields' ); |
| 9 | } |
| 10 | if ( is_plugin_active( 'acf-flexible-content/acf-flexible-content.php' ) ) { |
| 11 | $plugins[] = __( 'Flexible Content', 'secure-custom-fields' ); |
| 12 | } |
| 13 | if ( is_plugin_active( 'acf-gallery/acf-gallery.php' ) ) { |
| 14 | $plugins[] = __( 'Gallery', 'secure-custom-fields' ); |
| 15 | } |
| 16 | if ( is_plugin_active( 'acf-options-page/acf-options-page.php' ) ) { |
| 17 | $plugins[] = __( 'Options Page', 'secure-custom-fields' ); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | ?> |
| 22 | <div id="acf-upgrade-notice" class="notice notice-warning"> |
| 23 | <div class="notice-container"> |
| 24 | <div class="col-content"> |
| 25 | <img src="<?php echo esc_url( acf_get_url( 'assets/images/scf-logo.svg' ) ); ?>" /> |
| 26 | <h2><?php esc_html_e( 'Database Upgrade Required', 'secure-custom-fields' ); ?></h2> |
| 27 | <?php // translators: %1 plugin name, %2 version number ?> |
| 28 | <p><?php echo acf_esc_html( sprintf( __( 'Thank you for updating to %1$s v%2$s!', 'secure-custom-fields' ), acf_get_setting( 'name' ), acf_get_setting( 'version' ) ) ); ?><br /> |
| 29 | <?php esc_html_e( 'This version contains improvements to your database and requires an upgrade.', 'secure-custom-fields' ); ?></p> |
| 30 | <?php if ( ! empty( $plugins ) ) : ?> |
| 31 | <?php // translators: %s a list of plugin ?> |
| 32 | <p><?php echo acf_esc_html( sprintf( __( 'Please also check all premium add-ons (%s) are updated to the latest version.', 'secure-custom-fields' ), implode( ', ', $plugins ) ) ); ?></p> |
| 33 | <?php endif; ?> |
| 34 | </div> |
| 35 | <div class="col-actions"> |
| 36 | <a id="acf-upgrade-button" href="<?php echo esc_url( $button_url ); ?>" class="button-primary"><?php echo esc_html( $button_text ); ?></a> |
| 37 | </div> |
| 38 | |
| 39 | </div> |
| 40 | </div> |
| 41 | <?php if ( $confirm ) : ?> |
| 42 | <script type="text/javascript"> |
| 43 | (function($) { |
| 44 | |
| 45 | $("#acf-upgrade-button").on("click", function(){ |
| 46 | return confirm("<?php esc_attr_e( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'secure-custom-fields' ); ?>"); |
| 47 | }); |
| 48 | |
| 49 | })(jQuery); |
| 50 | </script> |
| 51 | <?php endif; ?> |
| 52 |