Code Duplication    Length = 3-6 lines in 3 locations

class-tgm-plugin-activation.php 3 locations

@@ 822-825 (lines=4) @@
819
					return true;
820
				}
821
822
				if ( ! WP_Filesystem( $creds ) ) {
823
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
824
					return true;
825
				}
826
827
				/* If we arrive here, we have the filesystem. */
828
@@ 2839-2841 (lines=3) @@
2836
				$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2837
				$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2838
2839
				if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2840
					return true; // Stop the normal page form from displaying, credential request form will be shown.
2841
				}
2842
2843
				// Now we have some credentials, setup WP_Filesystem.
2844
				if ( ! WP_Filesystem( $creds ) ) {
@@ 2844-2849 (lines=6) @@
2841
				}
2842
2843
				// Now we have some credentials, setup WP_Filesystem.
2844
				if ( ! WP_Filesystem( $creds ) ) {
2845
					// Our credentials were no good, ask the user for them again.
2846
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2847
2848
					return true;
2849
				}
2850
2851
				/* If we arrive here, we have the filesystem */
2852