WP Admin pages loading slow

This topic is: not resolved

This topic contains 5 replies, has 3 voices, and was last updated by  Damon Morda 8 years, 6 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #5854

    Damon Morda
    Participant
    Post count: 4

    Hi,

    Love the plugin, but ran into a performance issue I was hoping someone could help me out with. Ever since I installed the plugin, the WordPress administration pages take several seconds to load. If I disable the plugin, they load instantly.

    I’ve narrowed the issue down to the following wp_svg_icons_plugin_updater() function in wp-svg-icons.php. As a temporary workaround, I’ve commented out the following line:

    add_action( ‘admin_init’ , ‘wp_svg_icons_plugin_updater’, 0 );

    I realize that’s going to prevent updates from occurring and is only a temporary workaround, but it did address the slowdown.

    Is there something that can be re-factored so that function is only executed on certain pages or can be more streamlined to prevent page loading delays?

    • This topic was modified 8 years, 8 months ago by  Damon Morda.
    #6042

    Damon Morda
    Participant
    Post count: 4

    Bump.

    #6226

    Matthias
    Participant
    Post count: 17

    Try the following:

    register_activation_hook(__FILE__, ‘wp_svg_icons_update_activation’);
    register_deactivation_hook(__FILE__, ‘wp_svg_icons_update_deactivation’);
    add_action(‘wp_svg_icons_hourly_event’, ‘wp_svg_icons_plugin_updater’);

    function wp_svg_icons_update_activation() {
    wp_schedule_event(time(), ‘hourly’, ‘wp_svg_icons_hourly_event’);
    }

    function wp_svg_icons_update_deactivation() {
    wp_clear_scheduled_hook(‘wp_svg_icons_hourly_event’);
    }

    • This reply was modified 8 years, 6 months ago by  Matthias. Reason: removed code tag due to formatting issue
    #6228

    Matthias
    Participant
    Post count: 17

    Please deactivate the plugin before the code changes for the hook to be triggered.
    You may also enter the wp_schedule_event function into the WP_SVG_Icons_Activator.activate() and the wp_clear_scheduled_hook into the WP_SVG_ICON_Deactivator.deactivate(). Then the only code line to change in the main file would be to replace the add_action trigger. I guess the wp_svg_icons_plugin_updater behaves slowly if the update server/shop responds late due to an overload.

    #6300

    Evan Herman
    Keymaster
    Post count: 568

    Hi,

    I will take a look into this issue and see what may be going on that would cause long page load times. Obviously that shouldn’t occur.

    Thanks,
    Evan

    #6318

    Damon Morda
    Participant
    Post count: 4

    Hi Evan/Matthias,

    Thanks for the suggestions / feedback. I might implement Matthias’ suggestion as a temporary solution and then keep an eye out for Evan’s update that fixes it without me manually making the plugin changes.

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

You must be logged in to reply to this topic.