• Resolved t.inoue

    (@tinoue)


    Hello F4 Post Tree development team,

    Thank you for developing this excellent plugin. I’ve encountered an issue after activating F4 Post Tree v2.0.3 and would like to report it for your consideration.

    Bug Report: F4 Post Tree – 404 Error on tree.json File

    Problem Description:
    After activating F4 Post Tree plugin (v2.0.3), the following console error occurs repeatedly in WordPress admin:

    GET http://[site-url]/wp-content/f4-tree/tree.json?_=1761816521079 404 (Not Found)

    Root Cause Analysis:
    The issue occurs because:

    1. The tree.json file is not created when the plugin is first activated
    2. The URL generation for F4_TREE_POLLING_FILE_URL has a bug in the code

    Technical Details:
    File Location: /modules/Tree/Hooks.php (lines 89-95)

    Current problematic code:
    if(!defined(‘F4_TREE_POLLING_FILE_URL’)) {
    define(
    ‘F4_TREE_POLLING_FILE_URL’,
    str_replace(ABSPATH, ‘/’, F4_TREE_POLLING_FILE_PATH)
    );
    }

    Issues:

    1. str_replace(ABSPATH, ‘/’, F4_TREE_POLLING_FILE_PATH) generates incorrect URLs
    2. No activation hook ensures the wp-content/f4-tree/ directory and tree.json file are created

    Environment Information:

    • WordPress Version: 6.8.3
    • PHP Version: 8.3.21
    • Server: Apache on Linux
    • Plugin Version: F4 Post Tree 2.0.3
    • Site Language: Japanese (ja)
    • Environment: Production
    • WordPress Path: Custom installation path (/wp/ subdirectory)

    Suggested Fix:

    1. Fix URL generation – Replace with proper wp-content URL mapping
    2. Add activation hook – Ensure directory/file creation on plugin activation
    3. Add file existence check – Verify file exists during plugin initialization

    Impact:

    • Tree polling functionality fails completely
    • JavaScript console errors
    • Real-time tree updates don’t work
    • Affects multi-user collaborative editing experience

    Expected Behavior:
    The tree.json file should be automatically created in wp-content/f4-tree/ directory with proper URL accessibility for the polling mechanism to work correctly.

    Thank you for your time and consideration. Please let me know if you need any additional information.

    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @tinoue

    Thanks for this detailed error report. We’ll have a look and will fix this issue in the next release

    Best regards

    Plugin Author FAKTOR VIER

    (@faktorvier)

    Hi @tinoue

    We’ve just analysed our code. It already makes sure, that the tree.json file exists, as soon as you open a page that displays the tree. So we don’s see the need to add additional file creation mechanisms, if the file is ensured on tree display. When file does not exists, then it is because 1. there’s a permission problem on the server and WP could not create the file or 2. it is manually removed after the tree is loaded.

    Thread Starter t.inoue

    (@tinoue)

    Thank you.
    There is no 2, so it might be 1.
    Due to changes in the required specifications, I have temporarily stopped using the plugin, so I will try it again when I have time.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.