• Resolved RonG

    (@rong)


    Plugin throws the following errors, due to incorrectly attempting to access the filesystem directly:

    Could not create /var/www/example.com/wp-content/plugins/all-in-one-wp-migration/storage/index.php file. Please ensure the parent folder has read/write permissions.
    Could not create /var/www/example.com/www/wp-content/plugins/all-in-one-wp-migration/storage/index.html file. Please ensure the parent folder has read/write permissions.

    The parent folder has the correct read/write permissions when accessed correctly (via WP_Filesystem).

    Plugin is using fopen(), fread(), and fwrite(), none of which, should a properly written plugin be using. See: https://codex.ww.wp.xz.cn/Filesystem_API

Viewing 1 replies (of 1 total)
  • Plugin Author Yani

    (@yaniiliev)

    Hi!
    Thank you for reporting this. Unfortunately, this is currently not possible. I will try to explain why below.

    This plugin creates and processes large backup archives (.wpress files) that can be several gigabytes in size. Why Direct Filesystem Access is Necessary

    The plugin processes files in 512KB chunks to handle sites of any size without running out of memory. WordPress’s Filesystem API loads entire files into memory, which would crash when handling multi-GB backups.

    The plugin uses fseek() to jump to specific byte positions in files, allowing interrupted exports/imports to resume exactly where they left off. The Filesystem API doesn’t support seeking within files.

    Direct file operations are orders of magnitude faster for large files compared to the abstracted Filesystem API, which adds overhead that becomes significant with GB-sized files.

    WordPress’s Filesystem API is designed for simple file operations like updating plugin files or creating small configuration files. It’s not built for:
    – Streaming operations
    – Partial file reads/writes
    – Seeking within files
    – Handling files larger than available memory

    For a migration plugin that must handle production sites with gigabytes of data, using fopen(), fread(), and fwrite() isn’t poor coding practice but an architectural requirement.

    While the Filesystem API could handle creating simple index files, it would make the core backup/restore functionality impossible to implement.

Viewing 1 replies (of 1 total)

The topic ‘Does not properly use WP_Filesystem’ is closed to new replies.