Advertisement
Guest User

WP SEO import settings fix

a guest
Aug 1st, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.93 KB | None | 0 0
  1. @@ -167,7 +167,7 @@
  2.     if ( isset( $file[ 'file' ] ) && !is_wp_error( $file ) ) {
  3.         require_once ( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
  4.         $zip      = new PclZip( $file[ 'file' ] );
  5. -       $unzipped = $zip->extract( $p_path = WP_CONTENT_DIR . '/wpseo-import/' );
  6. +       $unzipped = $zip->extract( PCLZIP_OPT_PATH, $p_path = WP_CONTENT_DIR . '/wpseo-import/' );
  7.         if ( $unzipped[ 0 ][ 'stored_filename' ] == 'settings.ini' ) {
  8.             $options = parse_ini_file( WP_CONTENT_DIR . '/wpseo-import/settings.ini', true );
  9.             foreach ( $options as $name => $optgroup ) {
  10. @@ -177,7 +177,8 @@
  11.                     update_option( $name, json_decode( urldecode( $optgroup[ 'wpseo_taxonomy_meta' ] ), true ) );
  12.                 }
  13.             }
  14. -           @unlink( WP_CONTENT_DIR . '/wpseo-import/' );
  15. +           @unlink( $unzipped[ 0 ][ 'filename' ] );
  16. +           rmdir( $p_path );
  17.  
  18.             $content .= '<p><strong>' . __( 'Settings successfully imported.', 'wordpress-seo' ) . '</strong></p>';
  19.         } else {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement