Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Conflicting styles and search is slow
- This topic has 9 replies, 2 voices, and was last updated 6 years, 9 months ago by
Ernest Marcinko.
-
AuthorPosts
-
August 27, 2019 at 12:54 pm #23751
WackoMako08
ParticipantHi,
I have noticed that the search functionality has gotten really slow recently. Any idea why? I haven’t changed any settings and I trying to search as little as possible but still takes a good few seconds to load.
Also this plugin has a really bad problem with conflicting styles. Its interfering with other plugins regularly. The css for this plugin is being loaded on EVERY page! Which is terrible development practice. It uses admin_print_styles which should not be used and is advised by WordPress:
https://codex.wordpress.org/Plugin_API/Action_Reference/admin_print_styles
Any intention of updating to plugin to use correct hooks? Otherwise I need to find a different search plugin for out site.
August 27, 2019 at 2:32 pm #23762Ernest Marcinko
KeymasterHi,
The plugin CSS and JS is not loaded on all of the back-end pages, only the ones that affect the plugin itself, you can check that via the plugin source.
The front-end is much different, as there is absolutely no way of determining which page contains the plugin shortcode, as shortcodes are registered in a later flow as the wp_head() is executed – thus would make it impossible to enqueue the plugin styles. Almost all plugins that use shortcodes work the same way, as it is not possible to determine if the shortcode has been used, until it is actually used, and it would not work properly without styling nor scripts.
You have two options there:
– You can either use the selective asset loading feature, so you can manually add which pages you need the plugin assets (css + js files):
– ..or you can use the asynch CSS loader feature, which waits for the plugin output and loads the CSS files asynchronously after.
I strongly recommend using options #1.While admin_print_styles is not recommended, we use it for backwards compatibility and other reasons as well. If it’s used correctly, it does no harm whatsoever. We are planning to change that hook with it’s equivalent though.
All plugin styles are constructed in a very strict way to only affect elements within the search container, you can confirm that by checking the generated stylesheet files.
If the search speed has changed, that is most likely a server related issue/change, if you hadn’t changed anything in the configuration. You can try some of the best practices here, for the best possible search performance.
August 27, 2019 at 2:57 pm #23765WackoMako08
ParticipantHi Ernest,
Thank you for your response. I’ve attached an image below. You can see the inputs have these black boxes behind them. These are coming from .tooltip which is being loaded by the plugin. The plugin page is from WP Job Manager Emails. The css file is being loaded on a non-asp page somehow.
August 27, 2019 at 3:05 pm #23767Ernest Marcinko
KeymasterThank you very much, that is indeed interesting.
Can you please check if the post type name is not within this list: https://i.imgur.com/L1mviyz.png
If it’s there, then please try removing it. Then the plugin should correctly determine to not to load that stylesheet file there.I also checked those CSS rules, those should not be there anymore, as they were depricated. I will make sure to remove them in the upcoming release.
August 27, 2019 at 3:15 pm #23770WackoMako08
ParticipantThe post type name isn’t present within that list so not sure how it is included
August 27, 2019 at 3:17 pm #23772Ernest Marcinko
KeymasterSomething else must be involved as well then. Can you please add temporary back-end and FTP details? I will debug throught the source to see what exactly is happening. I tested a few different post type editor screenst, but the stylesheet is not loaded there, so I don’t know what the issue is yet.
August 27, 2019 at 3:31 pm #23773WackoMako08
ParticipantYou cannot access this content.
August 28, 2019 at 8:58 am #23795Ernest Marcinko
KeymasterYou cannot access this content.
August 28, 2019 at 10:10 am #23798WackoMako08
ParticipantYou cannot access this content.
August 28, 2019 at 11:54 am #23808Ernest Marcinko
KeymasterThank you very much, I have found the problem. There was a bug that caused the styling still load even though it shouldn’t. I made the fix, now it should be okay. I will make sure to include this in the upcoming release as well, so you don’t have to worry about it anymore.
-
AuthorPosts
- You must be logged in to reply to this topic.