Changeset 3003145
- Timestamp:
- 11/29/2023 09:04:13 AM (2 years ago)
- Location:
- outshifter-export/trunk
- Files:
-
- 2 edited
-
README.txt (modified) (1 diff)
-
index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
outshifter-export/trunk/README.txt
r2978112 r3003145 3 3 Tags: EcommerceManagement, Omnichannel, CrossChannel, Distribution, Headless, Inventorysynchronization, Sales 4 4 Requires at least: 5.0 5 Tested up to: 6. 26 Stable tag: 3. 45 Tested up to: 6.3 6 Stable tag: 3.5 7 7 Requires PHP: 7.0 8 8 License: GPLv3 -
outshifter-export/trunk/index.php
r2978112 r3003145 8 8 * Author: Reachu 9 9 * Author URI: https://reachu.io/ 10 * Version: 3. 410 * Version: 3.5 11 11 */ 12 12 … … 82 82 update_option('wc_reachu_password', ''); 83 83 update_option('firebaseUserId', ''); 84 if (class_exists('OSEWCPHJC_reachuSync') && method_exists('OSEWCPHJC_reachuSync', 'plugin_uninstall')) { 85 OSEWCPHJC_reachuSync::plugin_uninstall(); 86 } 84 87 } 85 88 ); 86 89 } 90 91 public static function remove_webhook() 92 { 93 self::log('Inicio - remove_webhook'); 94 95 $data_store = WC_Data_Store::load('webhook'); 96 $webhooks = $data_store->search_webhooks(); 97 98 foreach ($webhooks as $webhook_id) { 99 $webhook = wc_get_webhook($webhook_id); 100 $nombre_webhook_creado = "Outshifter order.created"; 101 $nombre_webhook_actualizado = "Outshifter order.updated"; 102 103 self::log('Nombre del Webhook: ' . $webhook->get_name()); 104 105 106 if ($webhook->get_name() === $nombre_webhook_creado || $webhook->get_name() === $nombre_webhook_actualizado) { 107 self::log('Webhook ' . $webhook->get_name() . ' eliminado.'); 108 $webhook->delete(true); 109 } 110 } 111 112 self::log('Fin - remove_webhook'); 113 } 114 115 public static function remove_api_keys() 116 { 117 self::log('Inicio - remove_api_keys'); 118 119 // Parte de la descripción que estamos buscando 120 $descripcion_buscada = "Reachu export"; 121 122 global $wpdb; 123 $tabla_api_keys = $wpdb->prefix . 'woocommerce_api_keys'; 124 $api_keys = $wpdb->get_results("SELECT key_id, description FROM {$tabla_api_keys}"); 125 126 foreach ($api_keys as $api_key) { 127 // Verificar si la descripción contiene la subcadena buscada 128 if (strpos($api_key->description, $descripcion_buscada) !== false) { 129 $wpdb->delete($tabla_api_keys, ['key_id' => $api_key->key_id], ['%d']); 130 self::log('Clave API con descripción conteniendo "' . $descripcion_buscada . '" eliminada.'); 131 } 132 } 133 134 self::log('Fin - remove_api_keys'); 135 136 } 137 138 public static function plugin_uninstall() { 139 self::remove_webhook(); 140 self::remove_api_keys(); 141 } 87 142 88 143 public static function overrule_webhook_disable_limit($number) … … 600 655 update_option('wc_reachu_password', ''); 601 656 update_option('firebaseUserId', ''); 657 658 self::plugin_uninstall(); 602 659 603 660 self::log('[logout_reachu] disconnect reachu success');
Note: See TracChangeset
for help on using the changeset viewer.