Forminator Dashboard Style missing CSS?
-
I just wanted to create a new form and my dashboard looks like this
https://gyazo.com/1d1858e2f7737452162a47cc38c3c075
And every other page from forminator … Any suggestions?
-
P.S – I stopped my cache plugin. Reload it, clean it and I still get this …
Hi @pleasure94
I hope you’re well today!
This definitely isn’t purely CSS issue but a conflict on site. Most likely it’s due to another plugin but it may be also caused by the theme (rarely) or some aspect of server configuration (less rarely).
In most cases, it’s another plugin breaking some of the Frominator scripts or blocking some of back-end (admin) HTTP requests.
It is necessary to perform full conflict test in this case:
1. take a full backup of the site
2. switch theme temporarily to Twenty Twenty-Three
3. disable all plugins except Forminator; clear server cache if there is anyAt this point you should see Forminator working just fine. If so:
4. start enabling plugins (and your original theme) one-by-one, after each one checking Forminator.
At some point the issue should get back and the last enabled plugin (or theme for that matter) would be the cause of the issue so let us know about it and we’ll take it from there to find solution.
Kind regards,
Adam… the problem is this plugin
Order Tip for WooCommerce- Version: 1.3.0
- Author: Adrian Emil Tudorache
- Last Updated: 2 months ago
Hi @pleasure94
Thank you for response!
Knowing about the plugin I could check it on my end and I can confirm the conflict.
I looked closer into it and the conflict is caused by that plugin due to the significant bug in it (it may also affect other plugins sooner or later).
It isn’t anything that we could or should fix in Forminator and it should be fixed by the Order Tip for WooCommerce developers.
—-
The specific bug is in the plugins /order-tip-woo/admin/controllers/config.php file, in two locations:
1. Line 32 is
add_action( 'admin_body_class', array( $this, 'admin_body_class' ) );That’s not a big deal but it should actually be
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );because “admin_body_class” is a filter hook, not an action hook in WordPress core.
2. Line 57 starts the custom “admin_body_class” function which is coded in a way that it only returns classes in certain cases. This is fine when developer want plugin to add custom classes on certain pages.
But additionally, if expected conditions are not matched, function should just return unmodified classes and this one does not do it. This is a bug. I’m not sure why but it’s quite common and I’ve seen it multiple times in various – especially older – plugins; I suppose there is some misunderstanding in how it works.
All in all, this needs to be fixed in the Order Tip for WooCommerce plugin. Feel free to report it to its developers.
——
That said, I do found a way to patch it for now, until it’s fixed. Below is the code that removes, sort of, overwrites that buggy code in the plugin (without need to modify the plugin itself) and makes it all work as it should be.
To apply patch to the site:
1. create an empty file with a .php extension (e.g. “woo-ordertip-plugin-adminclass-patch.php”)
2. copy and paste following code into that file
<?php add_action( 'admin_head', function(){ global $wp_filter; $tag = 'admin_body_class'; $hook_method = 'admin_body_class'; $hook_class = 'WOO_Order_Tip_Admin_Config'; if ( ! isset( $wp_filter[$tag] ) ) { return; } foreach ( $wp_filter[$tag]->callbacks as $key => $callback_array ) { foreach ( $callback_array as $c_key => $callback ) { if ( substr_compare( $c_key, $hook_method, strlen( $c_key ) - strlen( $hook_method ), strlen( $hook_method ) ) === 0 ) { if ( $callback['function'][0] instanceof $hook_class ){ unset( $wp_filter[$tag]->callbacks[$key][$c_key] ); } } } } }, 99 ); add_filter( 'admin_body_class', 'wooordertip_admin_body_class', 100, 1 ); function wooordertip_admin_body_class( $classes ) { if ( isset( $_GET['page'] ) && $_GET['page'] == 'wc-settings' && isset( $_GET['tab'] ) && $_GET['tab'] == 'order_tip' && isset( $_GET['section'] ) && $_GET['section'] == 'reports' ) { return $classes . ' order-tip-reports-settings'; } return $classes; }3. save the file and upload it to the “/wp-content/mu-plugins” folder of your site’s WordPress installation.
That’s it, it should work just out of the box (I tested it on my end). Once/if the Order Tip plugin releases update with a fix, that patch file can be removed form site.
Best regards,
Adam@wpmudev-support8 thanks for the response!
Hello @pleasure94 ,
We haven’t heard from you for several days now, so it looks like you no longer need our assistance.
Feel free to re-open this topic if needed.
Kind regards
Kasia
The topic ‘Forminator Dashboard Style missing CSS?’ is closed to new replies.