| @@ -160,8 +160,10 @@ | ||
| 160 | 160 | */ |
| 161 | 161 | function eos_plugin_revisions_remove_versions( $N = false,$plugin_name = false ){ |
| 162 | 162 | $key = eos_plugin_revision_key(); |
| 163 | 163 | $all_dirs = eos_plugin_revisions_scandir( dirname( PLUGIN_REVISIONS_PLUGIN_DIR ) ); |
| 164 | + $prefix = 'pr-'.$key.'-'; | |
| 165 | + $suffix = '-ver-'.$plugin_name.'.zip'; | |
| 164 | 166 | global $wp_filesystem; |
| 165 | 167 | if( empty( $wp_filesystem ) ){ |
| 166 | 168 | require_once ABSPATH . 'wp-admin/includes/file.php'; |
| 167 | 169 | WP_Filesystem(); |
| @@ -167,9 +169,9 @@ | ||
| 167 | 169 | WP_Filesystem(); |
| 168 | 170 | } |
| 169 | 171 | if( $all_dirs && !empty( $all_dirs ) ){ |
| 170 | 172 | foreach( $all_dirs as $all_dir ){ |
| 171 | - if( substr( $all_dir,-strlen( $plugin_name ),strlen( $plugin_name ) ) !== $plugin_name ){ | |
| 173 | + if( 0 !== strpos( $all_dir,$prefix ) || substr( $all_dir,-strlen( $suffix ) ) !== $suffix ){ | |
| 172 | 174 | unset( $all_dirs[array_search( $all_dir,$all_dirs )] ); |
| 173 | 175 | } |
| 174 | 176 | } |
| 175 | 177 | $n = 0; |