|
@@ 1008-1010 (lines=3) @@
|
| 1005 |
|
|
| 1006 |
|
if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) { |
| 1007 |
|
return trailingslashit( $to ); |
| 1008 |
|
} else { |
| 1009 |
|
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
| 1010 |
|
} |
| 1011 |
|
} elseif ( empty( $subdir_name ) ) { |
| 1012 |
|
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
| 1013 |
|
} |
|
@@ 1011-1013 (lines=3) @@
|
| 1008 |
|
} else { |
| 1009 |
|
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
| 1010 |
|
} |
| 1011 |
|
} elseif ( empty( $subdir_name ) ) { |
| 1012 |
|
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); |
| 1013 |
|
} |
| 1014 |
|
} |
| 1015 |
|
|
| 1016 |
|
return $source; |