Before I explain the problem, I have a bit of a specific workflow on this one website and I wonder if there are too many factors to properly diagnose the issue (I will try this plugin on simpler site as well).
The site is using Elementor, LearnDash, MemberPress, ACF Pro, and Timber at the moment (I usually just build with the last two plugins). I am developing locally using VVV and automating my builds with Gulp, which proxies the VVV address to localhost.
At first, this plugin didn’t work because it was trying to use “localhost” to “ping” Browsersync. When I changed it to the IP address Browsersync uses for external devices, it started working, but it reloads constantly, even without any changes to the WordPress database.
My thinking is maybe Elementor (or any of the other plugins) are updating constantly, perhaps looking for licenses or whatever, but they could be the root of the issue. I also cannot get the logs to output to a file even after using the code provided in the description and setting up debugging in my wp-config.php. Any tips would be greatly appreciated and I will try on a simpler server to try and isolate the issue. Great job on the plugin though!
]]>Great plugin idea. The only problem is if we want to run this on a dev server in the wild, but we’re developing locally it doesn’t work. The plugin has the server WordPress is using do the request to BrowserSync, and that won’t get the right host when using ‘localhost’.
The alternative would be to have a JavaScript function loaded client-side when using the WordPress admin dashboard, and you trigger that to do the request via ajax. That way localhost resolves properly to the computer that the user is using rather than the WordPress server.
Please receive this suggestion with enthusiasm and pride! Although I can’t use it for my projects, it’s still a great idea and will help people.
]]>Hi Sami,
I stumbled upon your plugin. I have it up and running on a local dev instance, and I’m loving it so far.
During my installation, I saw this error (below) flagged in the log. I fixed the typo and the error went away.
25-Dec-2019 01:55:36 UTC] Trigger-Browsersync: Calling: https://localhost:3000/__browser_sync__?method=reload
[25-Dec-2019 01:55:36 UTC] PHP Notice: Undefined variable: emssage in /Users/mark/Local Sites/avada/app/public/wp-content/plugins/trigger-browsersync/trigger-browsersync.php on line 275
If your plugin is on GitHub, I can fork a branch and submit a pull request (PR) fix.
Thanks & keep up the great work!
]]>I’ve got my browserSync localhost running on HTTPS. in the mu-plugin I’ve got the filter applied:
apply_filters( 'trigger_browsersync_protocol', 'https' );
I’m logged into WP in https://website.dev and the url is https://localhost:3000. Is there something I’m missing?
]]>Hi,
Can you elaborate more on how to install this plugin,
Where should I run the npm install (the node modules and browsersync), on the wordpress root or elsewhere?
If I already have browsersync on my theme folder can I still use this plugin?
Thanks.
]]>