Code Duplication    Length = 16-17 lines in 2 locations

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

@@ 159-174 (lines=16) @@
156
	* Make sure any site icon added to core can get
157
	* synced back to dotcom, so we can display it there.
158
	*/
159
	static function jetpack_sync_core_icon() {
160
		if ( function_exists( 'get_site_icon_url' ) ) {
161
			$url = get_site_icon_url();
162
		} else {
163
			return;
164
		}
165
166
		require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
167
		// If there's a core icon, maybe update the option.  If not, fall back to Jetpack's.
168
		if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
169
			// This is the option that is synced with dotcom
170
			Jetpack_Options::update_option( 'site_icon_url', $url );
171
		} else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) {
172
			Jetpack_Options::delete_option( 'site_icon_url' );
173
		}
174
	}
175
176
}
177

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

@@ 492-508 (lines=17) @@
489
		return crc32( serialize( $values ) );
490
	}
491
492
	function jetpack_sync_core_icon() {
493
		error_log("syncing core icon");
494
		if ( function_exists( 'get_site_icon_url' ) ) {
495
			$url = get_site_icon_url();
496
		} else {
497
			return;
498
		}
499
500
		require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
501
		// If there's a core icon, maybe update the option.  If not, fall back to Jetpack's.
502
		if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
503
			// This is the option that is synced with dotcom
504
			Jetpack_Options::update_option( 'site_icon_url', $url );
505
		} else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) {
506
			Jetpack_Options::delete_option( 'site_icon_url' );
507
		}
508
	}
509
510
	function get_sync_queue() {
511
		return $this->sync_queue;