Code Duplication    Length = 24-24 lines in 2 locations

class.jetpack-sync.php 1 location

@@ 911-934 (lines=24) @@
908
		return $response;
909
	}
910
911
	public function reindex_status() {
912
		$response = array( 'status' => 'ERROR' );
913
914
		// Assume reindexing is done if it was not triggered in the first place
915
		if ( false === Jetpack_Options::get_option( 'sync_bulk_reindexing' ) ) {
916
			return array( 'status' => 'DONE' );
917
		}
918
919
		Jetpack::load_xml_rpc_client();
920
		$client = new Jetpack_IXR_Client( array(
921
			'user_id' => JETPACK_MASTER_USER,
922
		) );
923
924
		$client->query( 'jetpack.reindexStatus' );
925
926
		if ( !$client->isError() ) {
927
			$response = $client->getResponse();
928
			if ( 'DONE' == $response['status'] ) {
929
				Jetpack_Options::delete_option( 'sync_bulk_reindexing' );
930
			}
931
		}
932
933
		return $response;
934
	}
935
936
	public function reindex_ui() {
937
		$strings = json_encode( array(

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

@@ 41-64 (lines=24) @@
38
		return $response;
39
	}
40
41
	public function reindex_status() {
42
		$response = array( 'status' => 'ERROR' );
43
44
		// Assume reindexing is done if it was not triggered in the first place
45
		if ( false === Jetpack_Options::get_option( 'sync_bulk_reindexing' ) ) {
46
			return array( 'status' => 'DONE' );
47
		}
48
49
		Jetpack::load_xml_rpc_client();
50
		$client = new Jetpack_IXR_Client( array(
51
			'user_id' => JETPACK_MASTER_USER,
52
		) );
53
54
		$client->query( 'jetpack.reindexStatus' );
55
56
		if ( ! $client->isError() ) {
57
			$response = $client->getResponse();
58
			if ( 'DONE' == $response['status'] ) {
59
				Jetpack_Options::delete_option( 'sync_bulk_reindexing' );
60
			}
61
		}
62
63
		return $response;
64
	}
65
66
	static function reindex_ui() {
67
		$strings = json_encode( array(