• Resolved mdalziel1982

    (@mdalziel1982)


    Hi,

    When grabbing the settings from the wp-option “amcharts_option” you are passing in a default param of “amcharts_get_defaults()”. That function is being evaluated even if the option is being returned properly.

    Right now the call to get the options is:
    $settings = get_option( 'amcharts_options', amcharts_get_defaults() );

    If you switch it to:

    $settings = get_option( 'amcharts_options' );
    if ($settings === false) {
        $settings = amcharts_get_defaults();
    }

    it will only run the amcharts_get_defaults function when necessary.

    On my dev environments the get_defaults ends up timing out trying to pull the resource list from the amcharts website, so constantly running that function causes the admin to be frustratingly slow.

    Thanks

    https://wordpress.org/plugins/amcharts-charts-and-maps/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author martynasma

    (@martynasma)

    Indeed. It seems that when using remote resources, it always requests the list from amcharts.com which is totally unnecessary.

    I’ll look for a solution, be it yours or something else.

    Will keep you posted.

    Thanks!

    Plugin Author martynasma

    (@martynasma)

    We just released an update. It will now not request resource list every time.

    Thanks for bringing this to our attention!

    Thread Starter mdalziel1982

    (@mdalziel1982)

    Looks good. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issues with getting the amcharts_options using get_option’ is closed to new replies.