WC_Dynamic_Gallery_Notices

"Copyright 2012 A3 Revolution Web Design" This software is distributed under the terms of GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007.

Defined (1)

The class is defined in the following location(s).

/includes/class-plugin-notices.php  
  1. class WC_Dynamic_Gallery_Notices 
  2. public function __construct() { 
  3. add_action( 'admin_init', array( $this, 'manual_update_database' ) ); 
  4. add_action( 'admin_init', array( $this, 'check_show_update_notice' ), 11 ); 
  5.  
  6. public function check_show_update_notice() { 
  7. $db_is_updated = get_option( 'a3_dynamic_gallery_db_updated', 'yes' ); 
  8. $a3_dynamic_gallery_db_version = get_option( 'a3_dynamic_gallery_db_version', '1.0.0' ); 
  9. if ( 'no' == $db_is_updated && version_compare( $a3_dynamic_gallery_db_version, WOO_DYNAMIC_GALLERY_DB_VERSION, '<' ) ) { 
  10. add_action( 'admin_notices', array( $this, 'update_notice' ) ); 
  11.  
  12. public function update_notice() { 
  13. ?> 
  14. <div id="message" class="error below-h2" style="margin-left:2px;"> 
  15. <p><?php _e( 'Thank you for updating to WooCommerce Dynamic Gallery Major Version 2.1.0 - we hope you enjoy it.', 'woo_dgallery' ); ?></p> 
  16. <p><?php _e( '<strong>IMPORTANT!</strong> This update must be run to complete the upgrade and get all the benefits of this new version.', 'woo_dgallery' ); ?></p> 
  17. <p><?php _e( "<strong>WARNING!</strong> This is a major upgrade - We strongly recommend that you do a database backup BEFORE you run the update. If you don't and something does go wrong, you may lose all of your product images. You have been warned.", 'woo_dgallery' ); ?></p> 
  18. <p class="submit"><a href="<?php echo esc_url( add_query_arg( 'do_update_db_a3_dynamic_gallery', 'true', admin_url( 'admin.php?page=woo-dynamic-gallery' ) ) ); ?>" class="a3-dg-update-now button-primary"><?php _e( 'RUN UPDATE', 'woo_dgallery' ); ?></a></p> 
  19. </div> 
  20. <?php 
  21.  
  22. public function updated_notice() { 
  23. ?> 
  24. <div id="message" class="updated below-h2" style="margin-left:2px;"> 
  25. <p><?php _e( 'WooCommerce Dynamic Gallery Data update complete. Thank you for updating to the latest version!', 'woo_dgallery' ); ?></p> 
  26. </div> 
  27. <?php 
  28.  
  29. public function manual_update_database() { 
  30. if ( isset( $_GET['do_update_db_a3_dynamic_gallery'] ) ) { 
  31. $this->update(); 
  32. add_action( 'admin_notices', array( $this, 'updated_notice' ) ); 
  33.  
  34. public function update() { 
  35. $db_is_updated = get_option( 'a3_dynamic_gallery_db_updated', 'yes' ); 
  36. $a3_dynamic_gallery_db_version = get_option( 'a3_dynamic_gallery_db_version', '1.0.0' ); 
  37. if ( 'no' == $db_is_updated && version_compare( $a3_dynamic_gallery_db_version, WOO_DYNAMIC_GALLERY_DB_VERSION, '<' ) ) { 
  38. include( WOO_DYNAMIC_GALLERY_FILE_PATH. '/includes/updates/update-db-manual.php' );