Conflicting styles and search is slow

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Conflicting styles and search is slow

This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 11 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #23751
    WackoMako08
    WackoMako08
    Participant

    Hi,

    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.

    #23762
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23765
    WackoMako08
    WackoMako08
    Participant

    Hi 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.

    Attachments:
    You must be logged in to view attached files.
    #23767
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23770
    WackoMako08
    WackoMako08
    Participant

    The post type name isn’t present within that list so not sure how it is included

    Attachments:
    You must be logged in to view attached files.
    #23772
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Something 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23773
    WackoMako08
    WackoMako08
    Participant
    You cannot access this content.
    #23795
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #23798
    WackoMako08
    WackoMako08
    Participant
    You cannot access this content.
    #23808
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.