'app.disconnected', 'delivery_id' => $cerquito_id, 'sent_at' => time(), ) ); if ( is_string( $cerquito_body ) && is_string( $cerquito_host ) ) { $cerquito_ts = (string) time(); wp_remote_post( rtrim( (string) $cerquito_conn['api'], '/' ) . '/channel-webhook/woocommerce', array( 'timeout' => 5, 'redirection' => 0, 'data_format' => 'body', 'body' => $cerquito_body, 'headers' => array( 'Content-Type' => 'application/json', 'X-Cerquito-Store' => strtolower( $cerquito_host ), 'X-Cerquito-Topic' => 'app.disconnected', 'X-Cerquito-Delivery' => $cerquito_id, 'X-Cerquito-Timestamp' => $cerquito_ts, 'X-Cerquito-Signature' => 'sha256=' . hash_hmac( 'sha256', $cerquito_ts . '.' . $cerquito_body, (string) $cerquito_conn['secret'] ), ), ) ); } } delete_option( 'cerquito_wc_connection' ); delete_option( 'cerquito_wc_pending' ); delete_option( 'cerquito_wc_log' ); global $wpdb; $cerquito_like = $wpdb->esc_like( '_transient_cerquito_wc_' ) . '%'; $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $cerquito_like ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery $cerquito_like = $wpdb->esc_like( '_transient_timeout_cerquito_wc_' ) . '%'; $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $cerquito_like ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery if ( function_exists( 'wp_unschedule_hook' ) ) { wp_unschedule_hook( 'cerquito_wc_deliver' ); } if ( function_exists( 'as_unschedule_all_actions' ) ) { as_unschedule_all_actions( 'cerquito_wc_deliver' ); }