[HUMMINGBIRD] admin-ajax has increased load time

I recently started using Humingbird and I've started to see admin-ajax error which has increased the load time of my site.
I also see some other errors in console related to Access-Control-Allow-Origin from https://hb.wpmucdn.com.

  • James Morris

    Hello bc

    I was working on your site to try to alleviate some of the issues you are having, but unfortunately, while doing my work the server went down and didn't even respond to pings.

    Problem:
    You had invalid token < errors due to using <script> tags inside of the Scripts and Styles plugin.

    Solution:
    I created a mu-plugin that registered the scripts correctly in wp_head. However, before I could remove the invalid script calls from the Scripts and Styles plugin, the server went down.

    Code (idxbroker_scripts.php):

    <?php
    // Add scripts to wp_head()
    function idxbroker_head_script() { ?>
    	<script charset="UTF-8" type="text/javascript" id="idxwidgetsrc-24142" src="//beyondcondo.idxbroker.com/idx/customshowcasejs.php?widgetid=24142"></script>
        <script charset="UTF-8" type="text/javascript" id="idxwidgetsrc-34792" src="//beyondcondo.idxbroker.com/idx/quicksearchjs.php?widgetid=34792"></script>
    <?php }
    add_action( 'wp_head', 'idxbroker_head_script' );

    Problem:
    You had a lot of admin-ajax calls that were bogging the server down.

    Solution:
    I don't believe this is related to Hummingbird, but for troubleshooting purposes, I created a mu-plugin that disables the admin-ajax heartbeat in WordPress. This is only a temporary solution until the root cause can be found.

    Code (stop_wp_heartbeat.php):

    <?php
    add_action( 'init', 'stop_heartbeat', 1 );
    function stop_heartbeat() {
    wp_deregister_script('heartbeat');
    }

    Problem:
    The CORS defines in your .htaccess were incorrectly formatted and did not cover all needed cases.

    Solution:
    I commented out the original defines and added the following instead.

    Code:

    # New rules for proper match and format - James M. @ WPMU DEV
    <IfModule mod_headers.c>
      <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
        Header set Access-Control-Allow-Origin "*"
      </FilesMatch>
    </IfModule>

    Unfortunately, this is as far as I could get before the server went down. Would you please restart the container (server) and ping us back here when we can resume work on this issue for you?

    Best regards,

    James Morris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.