Merge pull request #17741 from woocommerce/refactore/remove-clean-webhooks-logs-tool
Removed "Delete WebHook logs" tool
This commit is contained in:
commit
715eb1f167
|
@ -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' )
|
__( '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(
|
'reset_tracking' => array(
|
||||||
'name' => __( 'Reset usage tracking', 'woocommerce' ),
|
'name' => __( 'Reset usage tracking', 'woocommerce' ),
|
||||||
'button' => __( 'Reset', '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' );
|
WC_Cache_Helper::incr_cache_prefix( 'taxes' );
|
||||||
$message = __( 'Tax rates successfully deleted', 'woocommerce' );
|
$message = __( 'Tax rates successfully deleted', 'woocommerce' );
|
||||||
break;
|
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' :
|
case 'reset_tracking' :
|
||||||
delete_option( 'woocommerce_allow_tracking' );
|
delete_option( 'woocommerce_allow_tracking' );
|
||||||
WC_Admin_Notices::add_notice( 'tracking' );
|
WC_Admin_Notices::add_notice( 'tracking' );
|
||||||
|
|
Loading…
Reference in New Issue