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
@@ 2697-2699 (lines=3) @@
2694
				$method = ''; // Leave blank so WP_Filesystem can populate it as necessary.
2695
				$fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem.
2696
2697
				if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) {
2698
					return true; // Stop the normal page form from displaying, credential request form will be shown.
2699
				}
2700
2701
				// Now we have some credentials, setup WP_Filesystem.
2702
				if ( ! WP_Filesystem( $creds ) ) {
@@ 2702-2707 (lines=6) @@
2699
				}
2700
2701
				// Now we have some credentials, setup WP_Filesystem.
2702
				if ( ! WP_Filesystem( $creds ) ) {
2703
					// Our credentials were no good, ask the user for them again.
2704
					request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields );
2705
2706
					return true;
2707
				}
2708
2709
				/* If we arrive here, we have the filesystem */
2710