Code Duplication    Length = 3-6 lines in 3 locations

class-tgm-plugin-activation.php 3 locations

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