Code Duplication    Length = 8-9 lines in 2 locations

class.jetpack.php 2 locations

@@ 546-553 (lines=8) @@
543
				add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) );
544
545
				$signed = $this->verify_xml_rpc_signature();
546
				if ( $signed && ! is_wp_error( $signed ) ) {
547
					// The actual API methods.
548
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) );
549
				} else {
550
					// The jetpack.authorize method should be available for unauthenticated users on a site with an
551
					// active Jetpack connection, so that additional users can link their account.
552
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
553
				}
554
			} else {
555
				// The bootstrap API methods.
556
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
@@ 554-562 (lines=9) @@
551
					// active Jetpack connection, so that additional users can link their account.
552
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) );
553
				}
554
			} else {
555
				// The bootstrap API methods.
556
				add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) );
557
				$signed = $this->verify_xml_rpc_signature();
558
				if ( $signed && ! is_wp_error( $signed ) ) {
559
					// the jetpack Provision method is available for blog-token-signed requests
560
					add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) );
561
				}
562
			}
563
564
			// Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on.
565
			add_filter( 'pre_option_enable_xmlrpc', '__return_true' );