Code Duplication    Length = 20-20 lines in 2 locations

class.jetpack-sync.php 1 location

@@ 890-909 (lines=20) @@
887
		return ( $this->_get_post_count_local() != $this->_get_post_count_cloud() );
888
	}
889
890
	public function reindex_trigger() {
891
		$response = array( 'status' => 'ERROR' );
892
893
		// Force a privacy check
894
		Jetpack::check_privacy( JETPACK__PLUGIN_FILE );
895
896
		Jetpack::load_xml_rpc_client();
897
		$client = new Jetpack_IXR_Client( array(
898
			'user_id' => JETPACK_MASTER_USER,
899
		) );
900
901
		$client->query( 'jetpack.reindexTrigger' );
902
903
		if ( !$client->isError() ) {
904
			$response = $client->getResponse();
905
			Jetpack_Options::update_option( 'sync_bulk_reindexing', true );
906
		}
907
908
		return $response;
909
	}
910
911
	public function reindex_status() {
912
		$response = array( 'status' => 'ERROR' );

sync/class.jetpack-sync-reindex.php 1 location

@@ 20-39 (lines=20) @@
17
		return ( self::_get_post_count_local() != self::_get_post_count_cloud() );
18
	}
19
20
	static function reindex_trigger() {
21
		$response = array( 'status' => 'ERROR' );
22
23
		// Force a privacy check
24
		Jetpack::check_privacy( JETPACK__PLUGIN_FILE );
25
26
		Jetpack::load_xml_rpc_client();
27
		$client = new Jetpack_IXR_Client( array(
28
			'user_id' => JETPACK_MASTER_USER,
29
		) );
30
31
		$client->query( 'jetpack.reindexTrigger' );
32
33
		if ( ! $client->isError() ) {
34
			$response = $client->getResponse();
35
			Jetpack_Options::update_option( 'sync_bulk_reindexing', true );
36
		}
37
38
		return $response;
39
	}
40
41
	public function reindex_status() {
42
		$response = array( 'status' => 'ERROR' );