Completed
Push — master ( fff4cb...1e58f6 )
by frank
02:05
created

autoptimizeCLI   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A clear() 0 5 1
1
<?php
2
// Exit if accessed directly
3
if ( ! defined( 'ABSPATH' ) ) {
4
	exit;
5
}
6
7
class autoptimizeCLI extends WP_CLI_Command {
8
9
	/**
10
	 * Clears the cache.
11
	 *
12
	 * @subcommand clear
13
	 */
14
	public function clear( $args, $args_assoc ) {
15
		WP_CLI::line( esc_html__( 'Flushing the cache...', 'autoptimize' ) );
16
		autoptimizeCache::clearall();
17
		WP_CLI::success( esc_html__( 'Cache flushed.', 'autoptimize' ) );
18
	}
19
20
}
21
22
WP_CLI::add_command( 'autoptimize', 'autoptimizeCLI' );
23