Code Duplication    Length = 3-5 lines in 3 locations

admin/includes/class-tgm-plugin-activation.php 3 locations

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