Code Duplication    Length = 3-6 lines in 3 locations

class-tgm-plugin-activation.php 3 locations

@@ 744-747 (lines=4) @@
741
					return true;
742
				}
743
744
				if ( ! WP_Filesystem( $creds ) ) {
745
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
746
					return true;
747
				}
748
749
				/* If we arrive here, we have the filesystem. */
750
@@ 2702-2704 (lines=3) @@
2699
				$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2700
				$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2701
2702
				if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2703
					return true; // Stop the normal page form from displaying, credential request form will be shown.
2704
				}
2705
2706
				// Now we have some credentials, setup WP_Filesystem.
2707
				if ( ! WP_Filesystem( $creds ) ) {
@@ 2707-2712 (lines=6) @@
2704
				}
2705
2706
				// Now we have some credentials, setup WP_Filesystem.
2707
				if ( ! WP_Filesystem( $creds ) ) {
2708
					// Our credentials were no good, ask the user for them again.
2709
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2710
2711
					return true;
2712
				}
2713
2714
				/* If we arrive here, we have the filesystem */
2715