benbalter/wordpress-to-jekyll-exporter

Uploaded files are removed on export

Opened this issue · 0 comments

v-p-b commented

Describe the bug

The plugin just deleted all contents of the wp-content/uploads directory...

Steps to reproduce the behavior

I'm using WordPress as packaged in Debian Bullseye. I suspect symlinks are part of the problem, here are the relevant ones:

/var/www/myblog -> /usr/share/wordpress

/usr/share/wordpress/wp-content/uploads -> /var/lib/wordpress/wp-content/uploads

I used the plugin downloaded from wordpress.com (version 2.3.6), installed by uploading the .zip.

Deletion occurs when I initiate an export. The generated .zip doesn't contain any media. The temporary directory created by the plugin contains a symlink to uploads (the tmp directory is not removed by the plugin either). I think the files are removed during cleanup(), because the delete operation follows the symlink.

$ ls -la /tmp/wp-jekyll-e5e17674045d5c460e7cf3aa4f137f01/wp-content/
total 2
drwxr-xr-x 2 www-data www-data 1024 Sep  2 08:23 .
drwxr-xr-x 3 www-data www-data 1024 Sep  2 08:23 ..
lrwxrwxrwx 1 www-data www-data   37 Sep  2 08:23 uploads -> /var/lib/wordpress/wp-content/uploads

Expected behavior

The plugin doesn't delete files.

Screenshots

N/A

Additional context

N/A