Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

@@ 561-568 (lines=8) @@
558
				add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );
559
560
				$signed = $this->verify_xml_rpc_signature();
561
				if ( $signed && ! is_wp_error( $signed ) ) {
562
					// The actual API methods.
563
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) );
564
				} else {
565
					// The jetpack.authorize method should be available for unauthenticated users on a site with an
566
					// active Jetpack connection, so that additional users can link their account.
567
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
568
				}
569
			} else {
570
				// The bootstrap API methods.
571
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
@@ 569-577 (lines=9) @@
566
					// active Jetpack connection, so that additional users can link their account.
567
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
568
				}
569
			} else {
570
				// The bootstrap API methods.
571
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
572
				$signed = $this->verify_xml_rpc_signature();
573
				if ( $signed && ! is_wp_error( $signed ) ) {
574
					// the jetpack Provision method is available for blog-token-signed requests
575
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) );
576
				}
577
			}
578
579
			// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
580
			add_filter( 'pre_option_enable_xmlrpc', '__return_true' );