Changeset 2248282
- Timestamp:
- 02/21/2020 04:31:23 PM (6 years ago)
- File:
-
- 1 edited
-
e-transactions-wc/trunk/wc-etransactions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
e-transactions-wc/trunk/wc-etransactions.php
r2240486 r2248282 28 28 29 29 function wooCommerceActiveETwp(){ 30 $wooCommerceActiveET = (in_array('woocommerce/woocommerce.php',apply_filters('active_plugins', get_option('active_plugins')))); 31 if(is_multisite()){ 32 //Si multisite 33 $wooCommerceActiveET = (array_key_exists('woocommerce/woocommerce.php', 34 apply_filters('active_plugins', get_site_option('active_sitewide_plugins')))); 35 } 36 return $wooCommerceActiveET; 30 // Makes sure the plugin is defined before trying to use it 31 if ( !class_exists( 'WC_Payment_Gateway' ) ) { 32 return false; 33 } 34 return true; 37 35 } 36 // Ensure WooCommerce is active 38 37 39 // Ensure WooCommerce is active 40 if (!wooCommerceActiveETwp()) { 41 return; 42 } 38 43 39 if(defined('WC_ETRANSACTIONS_PLUGIN')){ 44 40 _e('Previous plugin already installed. deactivate the previous one first.', WC_ETRANSACTIONS_PLUGIN); … … 77 73 } 78 74 function wc_etransactions_initialization() { 75 if(!wooCommerceActiveETwp()){ 76 return ("Woocommerce not Active") ; 77 } 79 78 $class = 'WC_Etransactions_Abstract_Gateway'; 80 79 … … 127 126 function hmac_admin_notice(){ 128 127 129 $temp = new WC_Etransactions_Standard_Gateway(); 130 $plugin_data = get_plugin_data( __FILE__ ); 131 $plugin_name = $plugin_data['Name']; 132 if ( !$temp->checkCrypto() ) { 133 echo "<div class='notice notice-error is-dismissible'> 134 <p><strong>/!\ Attention ! plugin ".$plugin_name." : </strong>".__('HMAC key cannot be decrypted please re-enter or reinitialise it.', WC_ETRANSACTIONS_PLUGIN)."</p> 135 </div>"; 136 } 128 if(wooCommerceActiveETwp()){ 129 $temp = new WC_Etransactions_Standard_Gateway(); 130 $plugin_data = get_plugin_data( __FILE__ ); 131 $plugin_name = $plugin_data['Name']; 132 if ( !$temp->checkCrypto() ) { 133 echo "<div class='notice notice-error is-dismissible'> 134 <p><strong>/!\ Attention ! plugin ".$plugin_name." : </strong>".__('HMAC key cannot be decrypted please re-enter or reinitialise it.', WC_ETRANSACTIONS_PLUGIN)."</p> 135 </div>"; 136 } 137 }else{ 138 echo "<div class='notice notice-error is-dismissible'> 139 <p><strong>/!\ Attention ! plugin E-Transactions : </strong>".__('Woocommerce is not active !.', 'wc-etransactions')."</p> 140 </div>"; 141 142 } 137 143 } 138 144 add_action('admin_notices', 'hmac_admin_notice');
Note: See TracChangeset
for help on using the changeset viewer.