1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Wcal_Admin_Notice {
public static function wcal_show_db_update_notice(){
if( isset( $_GET['ac_update'] ) && $_GET['ac_update'] == 'email_templates' ){
return;
}
global $wpdb;
$query_status = "SHOW FULL COLUMNS FROM " . $wpdb->prefix . "ac_email_templates_lite" . " WHERE Field = 'subject' OR Field = 'body'" ;
$results = $wpdb->get_results( $query_status );
foreach ( $results as $key => $value) {
if ( $value->Collation !== 'utf8mb4_unicode_ci' ) {
printf( __( '<div id="wcal_update" class="updated woocommerce-message" style="padding:15px;"><span>We need to update your email template database for some improvements. Please take a backup of your databases for your peice of mind</span><span class="submit"><a href="%s" class="button-primary" style="float:right;">Update</a></span></div>', 'woocommerce-abandoned-cart' ), 'admin.php?page=woocommerce_ac_page&action=listcart&ac_update=email_templates' );
break;
}
}
}
}