We've been having an issue on our site for weeks, and I've been dealing with the developers of the Brightcove Connect plugin, assuming it was something in their plugin, but they are suggesting it's something in yours, so I'm hoping someone can shed light on it!
On a stripped down test site running WP 5.1.1, we only have these plugins installed:
- WooCommerce
- Brightcove Connect
- Toolset Types
and when editing a product in WooCommerce (or on any admin page using the classic editor instead of the block editor), a javascript error occurs, stopping the page from finishing loading.
It's definitely stemming from the after_media buttons being added by Brightcove or Toolset Types.
See the pic error.png.
Brightcove says nothing in their plugin attempts to load anything from that non-existent directory, so it must be another plugin. When I disable Toolset Types, the editor finishes loading. If I disable Brightcove, then the editor also works. But, together, these two plugins are causing the javascript error.
Since Brightcove is adding its button first, I wonder if they alter something in the global environment that gives Toolset Types issues when it tries to add its button?
I'm hoping you could look into this and let us know if it's coming from your plugin.
Thanks!
Here are the PHP notices generated by the BC plugin in PHP 7.2.14 when editing a Product (with only BrightCove Video Connect and WooCommerce active on Twenty Nineteen theme):
[09-Apr-2019 18:49:47 UTC] PHP Notice: Undefined index: id in /path/to/site/wp-content/plugins/brightcove-video-connect/includes/api/class-bc-cms-api.php on line 720
[09-Apr-2019 18:49:47 UTC] PHP Stack trace:
[09-Apr-2019 18:49:47 UTC] PHP 1. {main}() /path/to/site/wp-admin/post.php:0
[09-Apr-2019 18:49:47 UTC] PHP 2. include() /path/to/site/wp-admin/post.php:197
[09-Apr-2019 18:49:47 UTC] PHP 3. require_once() /path/to/site/wp-admin/edit-form-advanced.php:389
[09-Apr-2019 18:49:47 UTC] PHP 4. do_action() /path/to/site/wp-admin/admin-header.php:99
[09-Apr-2019 18:49:47 UTC] PHP 5. WP_Hook->do_action() /path/to/site/wp-includes/plugin.php:465
[09-Apr-2019 18:49:47 UTC] PHP 6. WP_Hook->apply_filters() /path/to/site/wp-includes/class-wp-hook.php:310
[09-Apr-2019 18:49:47 UTC] PHP 7. BC_Setup::admin_enqueue_scripts() /path/to/site/wp-includes/class-wp-hook.php:286
[09-Apr-2019 18:49:47 UTC] PHP 8. BC_Setup::preload_params() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:294
[09-Apr-2019 18:49:47 UTC] PHP 9. BC_CMS_API->fetch_folders() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:238
[09-Apr-2019 18:49:47 UTC] PHP Notice: Undefined index: name in /path/to/site/wp-content/plugins/brightcove-video-connect/includes/api/class-bc-cms-api.php on line 720
[09-Apr-2019 18:49:47 UTC] PHP Stack trace:
[09-Apr-2019 18:49:47 UTC] PHP 1. {main}() /path/to/site/wp-admin/post.php:0
[09-Apr-2019 18:49:47 UTC] PHP 2. include() /path/to/site/wp-admin/post.php:197
[09-Apr-2019 18:49:47 UTC] PHP 3. require_once() /path/to/site/wp-admin/edit-form-advanced.php:389
[09-Apr-2019 18:49:47 UTC] PHP 4. do_action() /path/to/site/wp-admin/admin-header.php:99
[09-Apr-2019 18:49:47 UTC] PHP 5. WP_Hook->do_action() /path/to/site/wp-includes/plugin.php:465
[09-Apr-2019 18:49:47 UTC] PHP 6. WP_Hook->apply_filters() /path/to/site/wp-includes/class-wp-hook.php:310
[09-Apr-2019 18:49:47 UTC] PHP 7. BC_Setup::admin_enqueue_scripts() /path/to/site/wp-includes/class-wp-hook.php:286
[09-Apr-2019 18:49:47 UTC] PHP 8. BC_Setup::preload_params() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:294
[09-Apr-2019 18:49:47 UTC] PHP 9. BC_CMS_API->fetch_folders() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:238
[09-Apr-2019 18:49:47 UTC] PHP Notice: Undefined index: id in /path/to/site/wp-content/plugins/brightcove-video-connect/includes/api/class-bc-cms-api.php on line 720
[09-Apr-2019 18:49:47 UTC] PHP Stack trace:
[09-Apr-2019 18:49:47 UTC] PHP 1. {main}() /path/to/site/wp-admin/post.php:0
[09-Apr-2019 18:49:47 UTC] PHP 2. include() /path/to/site/wp-admin/post.php:197
[09-Apr-2019 18:49:47 UTC] PHP 3. require_once() /path/to/site/wp-admin/edit-form-advanced.php:389
[09-Apr-2019 18:49:47 UTC] PHP 4. do_action() /path/to/site/wp-admin/admin-header.php:99
[09-Apr-2019 18:49:47 UTC] PHP 5. WP_Hook->do_action() /path/to/site/wp-includes/plugin.php:465
[09-Apr-2019 18:49:47 UTC] PHP 6. WP_Hook->apply_filters() /path/to/site/wp-includes/class-wp-hook.php:310
[09-Apr-2019 18:49:47 UTC] PHP 7. BC_Setup::admin_enqueue_scripts() /path/to/site/wp-includes/class-wp-hook.php:286
[09-Apr-2019 18:49:47 UTC] PHP 8. BC_Setup::preload_params() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:294
[09-Apr-2019 18:49:47 UTC] PHP 9. BC_CMS_API->fetch_folders() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:238
[09-Apr-2019 18:49:47 UTC] PHP Notice: Undefined index: name in /path/to/site/wp-content/plugins/brightcove-video-connect/includes/api/class-bc-cms-api.php on line 720
[09-Apr-2019 18:49:47 UTC] PHP Stack trace:
[09-Apr-2019 18:49:47 UTC] PHP 1. {main}() /path/to/site/wp-admin/post.php:0
[09-Apr-2019 18:49:47 UTC] PHP 2. include() /path/to/site/wp-admin/post.php:197
[09-Apr-2019 18:49:47 UTC] PHP 3. require_once() /path/to/site/wp-admin/edit-form-advanced.php:389
[09-Apr-2019 18:49:47 UTC] PHP 4. do_action() /path/to/site/wp-admin/admin-header.php:99
[09-Apr-2019 18:49:47 UTC] PHP 5. WP_Hook->do_action() /path/to/site/wp-includes/plugin.php:465
[09-Apr-2019 18:49:47 UTC] PHP 6. WP_Hook->apply_filters() /path/to/site/wp-includes/class-wp-hook.php:310
[09-Apr-2019 18:49:47 UTC] PHP 7. BC_Setup::admin_enqueue_scripts() /path/to/site/wp-includes/class-wp-hook.php:286
[09-Apr-2019 18:49:47 UTC] PHP 8. BC_Setup::preload_params() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:294
[09-Apr-2019 18:49:47 UTC] PHP 9. BC_CMS_API->fetch_folders() /path/to/site/wp-content/plugins/brightcove-video-connect/includes/class-bc-setup.php:238
Our team probably will not work on compatibility issues when the plugin produces these notices even without Toolset active.
Thanks for your response. I'll pass it on to the developers of the Brightcove plugin and see if they can fix their issues. I'll leave this ticket open and update it when I get more info.
I'll stand by for your update.
Hi,
I'm following up on this issue with Brightcove plugin. Their developers said they are unable to replicate the errors you showed in this thread.
I tried it myself and set up a new installation with WP 5.1.1 and PHP 7.2, installed brightcove and types, activated Twenty Nineteen theme, turned on all error logging, and while the issue is still there (ie when editing a product in WC, a js error crashes the page), there are no errors in the log.
What version of the Brightcove Video Connect and Types were you using?
I don't recall exactly which versions I was using at the time, but I just tried again and the notices are still appearing for me on the latest versions:
Brightcove 1.7.0
WooCommerce 3.6.1
WP 5.1.1
Some other details:
PHP 7.2.14
MySQL 5.7.25
HTTPS
Single site installation from a clean DB
Permalinks set to "Month and name"
Only Twenty Nineteen, WooCommerce and Brightcove active.
It could have something to do with the fact I don't have a Brightcove account and login, I'm not sure. I have created a Duplicator clone package you can share with their support team if you'd like: hidden link
If you're not familiar with Duplicator, here is the plugin page: https://wordpress.org/plugins/duplicator/
Edit any Product in wp-admin to see the notices generated.
Thanks, I appreciate your response!
Indeed, when I remove my credentials from the brightcove plugin on my test site, it does cause those php warnings. It might be unrelated though, since when I had my credentials in there (and no php warnings) I was still getting the original js error that kicked this whole thing off.
I'll forward the info to them and see what they find.
Do they offer any testing account credentials? If so, I can try applying those to stop the warnings and notices. Then if I can replicate the JavaScript error and page crash, I'll have enough to submit to my 2nd tier team for additional investigation. I'm not sure how the licensing works with this plugin so I don't want to assume I can use your active account on my testing domain...any thoughts?
I can ask tomorrow. I'm the developer and my client is the Brightcove account owner, and the access they gave me to their Brightcove account doesn't allow me to create new API keys.
I can give you wp-admin and ssh access to my testing server, which is probably identical to what you were testing with. Let me know if that would help. I put the Brightcove credentials back there and the php warnings are gone.
I don't know if the js error is red herring or not, since now that I put the credentials back, it is gone! The page still crashes and doesn't finish loading the editor, but there are now no php or js errors. On our main server, the js error is still there.
Lmk if you want access to the test server.
Thanks!
Okay I was able to create a free trial account on the brightcove site but it doesn't allow me to create an API key, so that doesn't help. What I need in order to be able to escalate this to the next tier support team is to be able to see the problem on my local environment without any PHP notices and warnings. So we could try one of these options:
- I log in to your staging wp-admin environment and make a clone of the site using the Duplicator plugin. Assuming the API key doesn't throw new errors for being on the wrong URL, this could be a solution.
- You log in to your staging server environment and create the clone yourself, then post a download link here. I'll install the clone and finish up my local tests.
- You give me the API key credentials in use now on the staging site. Assuming the API key doesn't throw new errors for being on the wrong URL, this might be workable.
- You investigate and see if there are testing API keys available.
Hi, I used Duplicator to create an archive and here is the link: hidden link
It is the client's keys for their actual account, so goes without saying (but I have to), that if the keys work, please don't alter anything via the brightcove plugin.
It only checks referrers when playing videos, so the keys should work on your site.
I'll also still ask Brightcove if there's a way to generate test keys. It usually takes them a day or two to respond.
If it works the same as my site, you should see no php or js errors, but just the blank tinymce editor on the edit Product screen.
The issue only ever happens on any screen with the classic editor. It used to cause issues when editing custom posts created via Toolset, but when I switched those to the block editor they were okay.
Okay I have provided a copy of the plugin to my 2nd tier support team so they can investigate further. I'll let you know what I find out.
Awesome, thanks! I appreciate your perseverance in this.
Hi, I was wondering if there was any update on this. Thanks.
Hi, I don't have anything new to report at this time. I can see that my 2nd tier support team has escalated the issue to our developers, but I don't have a final solution available yet. I'll keep you posted here as I receive additional information.