Code Duplication    Length = 3-6 lines in 3 locations

class-tgm-plugin-activation.php 3 locations

@@ 730-733 (lines=4) @@
727
					return true;
728
				}
729
730
				if ( ! WP_Filesystem( $creds ) ) {
731
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem.
732
					return true;
733
				}
734
735
				/* If we arrive here, we have the filesystem. */
736
@@ 2745-2747 (lines=3) @@
2742
				$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2743
				$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2744
2745
				if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2746
					return true; // Stop the normal page form from displaying, credential request form will be shown.
2747
				}
2748
2749
				// Now we have some credentials, setup WP_Filesystem.
2750
				if ( ! WP_Filesystem( $creds ) ) {
@@ 2750-2755 (lines=6) @@
2747
				}
2748
2749
				// Now we have some credentials, setup WP_Filesystem.
2750
				if ( ! WP_Filesystem( $creds ) ) {
2751
					// Our credentials were no good, ask the user for them again.
2752
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2753
2754
					return true;
2755
				}
2756
2757
				/* If we arrive here, we have the filesystem */
2758