-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate manifest using WP_Serve_File #2
Comments
The problem with your solution is that it will fail if other plugins need to serve a manifest. The same can be said for the service worker. This is because you cannot have multiple manifests or service workers for the same page. The solution used for this plugin allows to merge the contents of that files in case they are already in use for other purposes. I don't see any way to achieve that with WP_Serve_File. |
If there's already a |
Yes, I understand that. However what if multiple plugins generate the files (manifest, service worker) dynamically? There would be a conflict. |
The problem is that you can't know what other plugins are doing, so even if you write the file on disk, you don't know if you're compatible with other plugins. In theory the best solution would be to have a WordPress API for this, but it isn't available for now. |
It's 2024 - many years have passed - and WordPress still doesn't have an official way for plugins to add some code to the service worker. This is another attempt of standardization https://github.com/GoogleChromeLabs/pwa-wp, but it hasn't been merged with Wordpress core yet... |
The current mechanism you're using is bound to fail in many WordPress configurations.
WP_Serve_File
supports several ways to generate the manifest file (it will always use the best option according to the permissions the WordPress configuration has).The text was updated successfully, but these errors were encountered: