Merge pull request #17741 from woocommerce/refactore/remove-clean-webhooks-logs-tool

Removed "Delete WebHook logs" tool
This commit is contained in:
Mike Jolley 2017-11-17 11:42:34 +00:00 committed by GitHub
commit 715eb1f167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 15 deletions

View File

@ -174,15 +174,6 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
__( 'This option will delete ALL of your tax rates, use with caution. This action cannot be reversed.', 'woocommerce' )
),
),
'delete_webhook_logs' => array(
'name' => __( 'Delete WebHook logs', 'woocommerce' ),
'button' => __( 'Delete logs', 'woocommerce' ),
'desc' => sprintf(
'<strong class="red">%1$s</strong> %2$s',
__( 'Note:', 'woocommerce' ),
__( 'This tool removes WebHook logs. This will not delete the WebHooks themselves.', 'woocommerce' )
),
),
'reset_tracking' => array(
'name' => __( 'Reset usage tracking', 'woocommerce' ),
'button' => __( 'Reset', 'woocommerce' ),
@ -447,12 +438,6 @@ class WC_REST_System_Status_Tools_Controller extends WC_REST_Controller {
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
$message = __( 'Tax rates successfully deleted', 'woocommerce' );
break;
case 'delete_webhook_logs' :
$result = absint( $wpdb->query( "DELETE FROM {$wpdb->comments} WHERE comment_type='webhook_delivery';" ) );
$wpdb->query( "DELETE commentmeta FROM {$wpdb->commentmeta} commentmeta LEFT JOIN {$wpdb->comments} comments ON comments.comment_ID = commentmeta.comment_id WHERE comments.comment_ID IS NULL;" );
$message = sprintf( __( '%d logs deleted', 'woocommerce' ), $result );
break;
case 'reset_tracking' :
delete_option( 'woocommerce_allow_tracking' );
WC_Admin_Notices::add_notice( 'tracking' );