wpexplorer/wpex-blogger

Navigation in admin panel is slow because of API call to wpexplorer.com

Closed this issue · 3 comments

It takes from 1 to 8 seconds to open wp-admin main page and some other pages.
I found this is because of slow API calls:

WP_SimplePie_File->__construct()
wp-includes/class-wp-simplepie-file.php:63
ReflectionClass->newInstanceArgs()
wp-includes/class-wp-simplepie-file.php:63
SimplePie_Registry->create()
wp-includes/SimplePie/Registry.php:183
SimplePie->fetch_data()
wp-includes/class-simplepie.php:1666
SimplePie->init()
wp-includes/class-simplepie.php:1416
fetch_feed()
wp-includes/feed.php:829
wp_widget_rss_output()
wp-includes/widgets.php:1515
wpex_dashboard_rss_box()
wp-content/themes/wpex-blogger-21/admin/dashboard-feed.php:16
do_meta_boxes()
wp-admin/includes/template.php:1389
wp_dashboard()
wp-admin/includes/dashboard.php:256

Basically it connects to https://www.wpexplorer.com/feed/ with GET request.

  • Here are the timings of this connection:
    HTTP API Transport: curl
    DNS resolution time: 0.0605
    Connection time: 7.0481
    Time to start transmission (TTFB): 7.1170
    Answer size: 4KB
    Response content type: application / rss + xml; charset = UTF-8
    IP Address: 104.22.3.182

So you can see that actually 104.22.3.182 server is responding slowly.

I have 2 questions here:

  • why actually this call happens and what is does?
  • can we disable it in the theme code or may be you fix your server performance?

@Alex-JTI -

Hey, this is AJ the theme author.

  1. The theme adds a little feed in the backend with our latest blog articles like this:

Screen Shot 2021-04-05 at 6 54 27 PM

It should be loading very fast, unless perhaps your server is restricting access to our site for some reason. I will update the code to make the time out smaller. Thanks for the heads up.

  1. You can disable the feeds by adding this to your child theme functions.php file:

define( 'WPEX_DISABLE_THEME_DASHBOARD_FEEDS', true );

You could even add it in your wp-config.php file if you wanted if you aren't using a child theme.

Thank you for the quick response.
I have checked with the server owner and we don't seem to have any blocks to any outgoing connections. Most probably your server response is low sometimes depending on the load.

Do I need to add define( 'WPEX_DISABLE_THEME_DASHBOARD_FEEDS', true ); to the end of 0:/wp-content/themes/wpex-blogger/functions.php or to the section where other constants defined inside a function public function constants() in class WPEX_Theme_Class?

@Alex-JTI - This code would be added in your child theme functions.php file (if you are using a child theme) if you are not using a child theme it wouldn't help placing it inside the theme's file, because if you ever edit that file you will lose your changes. So you would instead place it in your wp-config.php file which is located on your server in the root directory where WordPress is installed.

I also made this quick plugin if you wanted to just use that instead - https://a.cl.ly/RBuYdXkN