Home › Forums › BulletProof Security Pro › Bloom eMail Opt-In and WP Easycart break Maintenance Mode Editor and BPS Backend
Tagged: Bloom eMail Opt-In, maintenance mode, WP Easycart
- This topic has 42 replies, 2 voices, and was last updated 9 years, 9 months ago by AITpro Admin.
-
AuthorPosts
-
SweetspotParticipant
Thanks a lot for pointing out what is wrong. I will try to put you peace of code in place. I think it would be nice if WPeasycart implement this changes to. Otherwise problems will occur again when plugin is updated?
Sent you a mail 30 min ago.
Best Regards /CSweetspotParticipantI used your code in WPEasycart plugin and it seems to work as expected now 🙂
I also had a look in Bloom´s plugin folder but it looked very different. I didn´t find a place where to put the code.Best/ C
AITpro AdminKeymasterI posted the solution in the WP EasyCart plugin support forum:  https://wordpress.org/support/topic/code-mode-needed so they will hopefully add the solution in the next version release.
If you would like for me to look at and test the Bloom email opt-in plugin and find the solution then since it is a premium plugin, send the zip file to me. After installation and testing is completed the Bloom zip file and all copies will be deleted.
SweetspotParticipantThat´s good. You really have outstanding support here.  I just sent you a mail at   info [at] ait-pro [dot] com
Best Regards / Claes
AITpro AdminKeymasterLot’s of tech support experience and training working for some of the largest corporations in the world. 😉  A product or service can be awesome, but if the support sucks then that negates/takes away from the product or service.  Good support is just as important as a good product or service.  😉
SweetspotParticipantYou are absolutely right about that! 🙂
AITpro AdminKeymasterI have found the problem and have a workaround solution for the Bloom eMail Opt-In plugin, but the Bloom folks need to come up with a permanent solution since doing this custom workaround solution would not be practical if this same problem is occurring on many/all other WordPress plugins.
The BPS plugin is calling a custom instance of TinyMCE using the wp_editor() function on the Maintenance Mode page:
<?php wp_editor( stripslashes( htmlspecialchars_decode( $MMoptions['bps_maint_text'], ENT_QUOTES ) ), 'bpscustomeditor' ); ?>
Source Code of the Maintenance Mode page showing the BPS plugin custom instance of TinyMCE:
mceInit: {'bpscustomeditor':{theme:"modern",skin:"lightgray",language:"en",formats:{
Bloom is hooking into ALL instances of TinyMCE instead of selectively hooking into ONLY WP default instances of TinyMCE. ie any other plugin that has created a custom instance of TinyMCE will most likely experience the same problem of Bloom hooking into that custom instance of the TinyMCE editor.
Source Code of the Maintenance Mode page showing Bloom hooking into the BPS plugin custom instance of TinyMCE:
external_plugins:{"bloom":"http:\/\/demo5.local\/wp-content\/plugins\/bloom\/js\/bloom-mce-buttons.js","anchor":"http:\/\/demo5.local\/wp-content\/plugins\/tinymce-advanced\/mce\/anchor\/plugin.min.js", ... ... ... tinyMCEPreInit.load_ext("http://demo5.local/wp-content/plugins/bloom/js", "en"); tinymce.PluginManager.load("bloom", "http://demo5.local/wp-content/plugins/bloom/js/bloom-mce-buttons.js"); tinyMCEPreInit.load_ext("http://demo5.local/wp-content/plugins/tinymce-advanced/mce/anchor", "en");
This problem is trickier and the question needs to be asked: should Bloom be hooking into other plugins custom instances of TinyMCE or not or should Bloom ONLY be hooking into WP Default instances of TinyMCE: Post page, Page page and other WP pages ONLY. My assumption is that Bloom will cause this same TinyMCE problem for other plugins and should ONLY be hooking into WP Default instances of TinyMCE. BUT the other side of that is that the Bloom code is intended to add a Bloom button to the WP Editor Toolbar so let’s say you wanted to add an opt-in to the BPS Maintenance Mode page. In theory if the Bloom button and code was not breaking the BPS custom instance of the TinyMCE editor then the Bloom button would be added successfully and you would be able to use it in BPS Maintenance Mode to add an opt-in form on your Maintenance Mode page.
In this particular case this is the most logical workaround solution: Since Bloom is breaking the BPS custom instance of TinyMCE on the BPS Maintenance Mode page and since you really do not need to have a Bloom button (it is a convenience and not a necessity) on the WP Editor toolbar (you can add the Bloom code/shortcode manually) then the best solution would be a custom solution for now. In the long term what really needs to happen is that the Bloom plugin needs some additional coding work to find out why it is causing the custom instance of TinyMCE to be broken. The Bloom folks can test with the BPS free version since the BPS free and Pro versions use the same Maintenance Mode feature and code.
Workaround Solution: Add a custom workaround conditional wrap that says to NOT hook into/load these filters on any BPS plugin pages.
Note: This is a custom solution and is specific to fixing the direct Bloom|BPS plugin issue/problem.
File: /bloom/bloom.php
Code Line: 322function add_mce_button_filters() { if ( ! preg_match( '/page=bulletproof-security/', esc_html($_SERVER['REQUEST_URI']), $matches) ) { add_filter( 'mce_external_plugins', array( $this, 'add_mce_button' ) ); add_filter( 'mce_buttons', array( $this, 'register_mce_button' ) ); } }
SweetspotParticipantThanks, You really work fast……. I will try to put your line of code into bloom.php for sure. I think it would be a good idea to inform elegant themes support forum about this. I can try to post there and see if we will have any respons/feedback from there. Ok for you?
Best Regards/C
AITpro AdminKeymasterYep definitely let them know about this since this problem will affect ALL other WordPress plugins and not only the BPS and BPS Pro plugins.  I tried dumbing down the Bloom code using the WordPress standard mce external plugins API code and the WP Editor Toolbar does display and TinyMCE is not broken, but the Bloom button does not display on the WP Editor toolbar and ALL other plugin’s buttons are removed from the toolbar.  My hunch is the true source of the problem is this jQuery code/file:  /bloom/js/bloom-mce-buttons.js since dumbing down the code should have worked.
AITpro AdminKeymasterOr another possibility is that since the Bloom code is using an array and $this then maybe they need to populate the arguments/add $arg variables => values in order to get and set all the TinyMCE arguments. Â Logical thought anyway. Â Or it could simply be that the Bloom class needs to make these functions public or create functions outside of the Bloom class. Â Just for a quickie test – tried making the functions public and that did not work, but I did not write the Bloom code so that may not be what is needed. Â Was just a quickie test.
SweetspotParticipantHi again. It feel good to see all your efforts ti solve this issue 🙂  Anyway, I posted a link to your earlier post #21548 and suggest them to read it. Hope they do! I´ll get back here wit more info as soon as can
AITpro AdminKeymasterYeah I imagine this is something the Bloom plugin folks will jump on ASAP since this problem affects ANY/ALL other WordPress plugins that use/create an instance of the WP Editor/TinyMCE and not just the BPS plugin.  😉
SweetspotParticipantHi!
Upon login to wp-admin this morning I found that Bloom was updated. I installed it and the problem with Maintenance Mode editor are now gone. I hope that´s a good solution. I´ll send you a mail about it.
Btw. Is it possible to implement transparent bg color in timer and/or maybe color picker for fonts in there? Same goes for Background images and so on.
AITpro AdminKeymasterI looked at the new Bloom version code that you emailed to me and my guess about the root problem being with the jQuery file/code was correct. Â The Bloom folks have created/added/removed/fixed the jQuery code.
http://forum.ait-pro.com/forums/topic/maintenance-mode-guide-read-me-first/
At this point in Maintenance Mode development you can create a custom MMode page with CSS code using the WP Editor Text tab, but you would have to edit the CSS code in this MMode Template file: Â /bulletproof-security/admin/htaccess/bps-maintenance.php to change the font color and background of the Countdown Timer. Â At some point we will add additional fancier options like color pickers to MMode.
#bpscountdowntimer { background-color:black; color: <?php echo $bps_maint_countdown_timer_color; ?>; font-size: 18px; font-weight: bold; padding: 4px; position:relative; top:0px; left:0px; }
SweetspotParticipantThanks for sorting this out. Bloom is running as expected. .-)
-
AuthorPosts
- You must be logged in to reply to this topic.