Code Duplication    Length = 16-16 lines in 2 locations

class.jetpack.php 1 location

@@ 607-622 (lines=16) @@
604
	 * Make sure any site icon added to core can get
605
	 * synced back to dotcom, so we can display it there.
606
	 */
607
	function jetpack_sync_core_icon() {
608
		if ( function_exists( 'get_site_icon_url' ) ) {
609
			$url = get_site_icon_url();
610
		} else {
611
			return;
612
		}
613
614
		require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
615
		// If there's a core icon, maybe update the option.  If not, fall back to Jetpack's.
616
		if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
617
			// This is the option that is synced with dotcom
618
			Jetpack_Options::update_option( 'site_icon_url', $url );
619
		} else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) {
620
			Jetpack_Options::delete_option( 'site_icon_url' );
621
		}
622
	}
623
624
	function jetpack_admin_ajax_tracks_callback() {
625
		// Check for nonce

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

@@ 546-561 (lines=16) @@
543
		return crc32( serialize( $values ) );
544
	}
545
546
	function jetpack_sync_core_icon() {
547
		if ( function_exists( 'get_site_icon_url' ) ) {
548
			$url = get_site_icon_url();
549
		} else {
550
			return;
551
		}
552
553
		require_once( JETPACK__PLUGIN_DIR . 'modules/site-icon/site-icon-functions.php' );
554
		// If there's a core icon, maybe update the option.  If not, fall back to Jetpack's.
555
		if ( ! empty( $url ) && $url !== jetpack_site_icon_url() ) {
556
			// This is the option that is synced with dotcom
557
			Jetpack_Options::update_option( 'site_icon_url', $url );
558
		} else if ( empty( $url ) && did_action( 'delete_option_site_icon' ) ) {
559
			Jetpack_Options::delete_option( 'site_icon_url' );
560
		}
561
	}
562
563
	function get_sync_queue() {
564
		return $this->sync_queue;