[NSFW] F4 Post Tree – 404 Error on tree.json File
-
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:- The tree.json file is not created when the plugin is first activated
- 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:
- str_replace(ABSPATH, ‘/’, F4_TREE_POLLING_FILE_PATH) generates incorrect URLs
- 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:
- Fix URL generation – Replace with proper wp-content URL mapping
- Add activation hook – Ensure directory/file creation on plugin activation
- 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
You must be logged in to reply to this topic.