Code Duplication    Length = 44-44 lines in 2 locations

class.jetpack-sync.php 1 location

@@ 936-979 (lines=44) @@
933
		return $response;
934
	}
935
936
	public function reindex_ui() {
937
		$strings = json_encode( array(
938
			'WAITING' => array(
939
				'action' => __( 'Refresh Status', 'jetpack' ),
940
				'status' => __( 'Indexing request queued and waiting…', 'jetpack' ),
941
			),
942
			'INDEXING' => array(
943
				'action' => __( 'Refresh Status', 'jetpack' ),
944
				'status' => __( 'Indexing posts', 'jetpack' ),
945
			),
946
			'DONE' => array(
947
				'action' => __( 'Reindex Posts', 'jetpack' ),
948
				'status' => __( 'Posts indexed.', 'jetpack' ),
949
			),
950
			'ERROR' => array(
951
				'action' => __( 'Refresh Status', 'jetpack' ),
952
				'status' => __( 'Status unknown.', 'jetpack' ),
953
			),
954
			'ERROR:LARGE' => array(
955
				'action' => __( 'Refresh Status', 'jetpack' ),
956
				'status' => __( 'This site is too large, please contact Jetpack support to sync.', 'jetpack' ),
957
			),
958
		) );
959
960
		wp_enqueue_script(
961
			'jetpack_sync_reindex_control',
962
			plugins_url( '_inc/jquery.jetpack-sync.js', JETPACK__PLUGIN_FILE ),
963
			array( 'jquery' ),
964
			JETPACK__VERSION
965
		);
966
967
		$template = <<<EOT
968
			<p class="jetpack_sync_reindex_control" id="jetpack_sync_reindex_control" data-strings="%s">
969
				<input type="submit" class="jetpack_sync_reindex_control_action button" value="%s" disabled />
970
				<span class="jetpack_sync_reindex_control_status">&hellip;</span>
971
			</p>
972
EOT;
973
974
		return sprintf(
975
			$template,
976
			esc_attr( $strings ),
977
			esc_attr__( 'Refresh Status', 'jetpack' )
978
		);
979
	}
980
981
	private function _get_post_count_local() {
982
		global $wpdb;

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

@@ 66-109 (lines=44) @@
63
		return $response;
64
	}
65
66
	static function reindex_ui() {
67
		$strings = json_encode( array(
68
			'WAITING'     => array(
69
				'action' => __( 'Refresh Status', 'jetpack' ),
70
				'status' => __( 'Indexing request queued and waiting&hellip;', 'jetpack' ),
71
			),
72
			'INDEXING'    => array(
73
				'action' => __( 'Refresh Status', 'jetpack' ),
74
				'status' => __( 'Indexing posts', 'jetpack' ),
75
			),
76
			'DONE'        => array(
77
				'action' => __( 'Reindex Posts', 'jetpack' ),
78
				'status' => __( 'Posts indexed.', 'jetpack' ),
79
			),
80
			'ERROR'       => array(
81
				'action' => __( 'Refresh Status', 'jetpack' ),
82
				'status' => __( 'Status unknown.', 'jetpack' ),
83
			),
84
			'ERROR:LARGE' => array(
85
				'action' => __( 'Refresh Status', 'jetpack' ),
86
				'status' => __( 'This site is too large, please contact Jetpack support to sync.', 'jetpack' ),
87
			),
88
		) );
89
90
		wp_enqueue_script(
91
			'jetpack_sync_reindex_control',
92
			plugins_url( '_inc/jquery.jetpack-sync.js', JETPACK__PLUGIN_FILE ),
93
			array( 'jquery' ),
94
			JETPACK__VERSION
95
		);
96
97
		$template = <<<EOT
98
			<p class="jetpack_sync_reindex_control" id="jetpack_sync_reindex_control" data-strings="%s">
99
				<input type="submit" class="jetpack_sync_reindex_control_action button" value="%s" disabled />
100
				<span class="jetpack_sync_reindex_control_status">&hellip;</span>
101
			</p>
102
EOT;
103
104
		return sprintf(
105
			$template,
106
			esc_attr( $strings ),
107
			esc_attr__( 'Refresh Status', 'jetpack' )
108
		);
109
	}
110
111
	private function _get_post_count_local() {
112
		global $wpdb;