Support » Plugin: Stock Ticker » auto refresh not working

  • Hello, it seems the “auto refresh” feature is not working.
    All my stock tickers are OK, no timeout issue.
    However data do not refresh, I am obliged to fetch them manually, which is not really convenient.
    Is there any computation to be done to set “Refresh Timeout” (currently 300s) from the number of tickers (currently 50 to be fetched in loop), “Fetch Timeout” (5s) and “Cache Timeout” (180s)?
    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hello @wparold,

    Thank you for reporting this issue.

    Stock Ticker fetch updated data from Alpha Vantage on each website visit (if there is not current fetch process triggered by other visitor).

    It’s important to note that Alpha Vantage does not provide live data, but updated stock data delayed by 15 minutes.

    “Refresh Timeout” define when ticker will be refreshed on page without requirement to reload page (only if Auto Refresh option is enabled).

    “Fetch Timeout” define how long will plugin wait to get response from AlphaVantage API server for single quote.

    “Cache Timeout” define how long plugin will keep fetched data from Alpha Vantage API server in local WordPress database before attempt to get new data from API.

    In theory, this value should be set to number of All Stock Symbols × Fetch Timeout + 50% – in your case it’s at least 375 seconds (if you have visits on at least each 5 seconds). If you do not have visits to website, data will not be updated.

    I hope this will help you to configure plugin. If note, please provide link to your website where you have inserted Stock Ticker on front-end.

    Kind regards,
    Aleksandar

    Hello @urkekg, nice to read your reply.
    Understood for the recommanded settings of Cache Timeout=375s.

    I also checked my browser console and actually saw that there was a JS error in \wp-content\uploads\stock-ticker-refresh.js, it cries because stock_tickers_load is not defined. So I edited and initialized it with ‘ var stock_tickers_load = “”; ‘ placed on line 1 of the file, and it removed the error. I am not sure but it seems it actually triggered a refresh of my stock feed then.

    However, I figured out another error then :p
    I use tickers from foreign exchanges. The data that are fetched are not the good ones (I want the current/last price – delayed as you mention, no problem with that), but the open prices (which by definition do not refresh during a trading day). Maybe this error I see is only due to the fact we are in the weekend, I will check that out tomorrow to confirm.

    Best Regards
    wparold

    opps, just saw your last update landing right now
    “Fix: stock price was by mistake taken from last_open instead of last_close, reported by @cartmen123” => I guess this matches my last report 🙂

    • This reply was modified 1 year, 10 months ago by wparold.

    Hi @wparold,

    Cache timeout resolved stuck quotes in your case for sure, not that addition to wp-content\uploads\stock-ticker-refresh.js

    But, you discovered new bug, so I fixed it in 3.0.5.1 (recently I renamed variables and functions from stock_ticker_... to stockticker_... but forgot to do same for auto refresh JS generated on settings save) Thanks for that!

    And yes, last_open was there by mistake since alpha7 of ALphaVantage version of plugin, and until yesterday, no one reported that and I missed it.

    Cheers,
    Aleksandar

    auto refresh not working

    Hello!

    I have a same problem.
    All my stock tickers are OK, no timeout issue.
    However data do not refresh, I am obliged to fetch them manually, which is not really convenient.
    Is there any computation to be done to set “Auto Refresh” timeout (currently 300s) from the number of tickers (currently 2 to be fetched), “Fetch Timeout” (10s) and “Cache Timeout” (60s)?
    My hostings based on lightspeed webserver.
    May you add file to plugin for run from cron?
    Many thanks!

    Hi @efimkuznetsov,

    Please open new thread and provide link to your website so I can check.

    Also, please read my explanation above https://wordpress.org/support/topic/auto-refresh-not-working-2/#post-9934987 and note that “Auto Refresh” does not affect back-end data refresh, but only front-end refresh (if visitor open page and stay on page for 30 minutes, StockTicker will grab data from database after time you defined for Auto Refresh, and replace previous content in ticker with new content. If plugin did not fetched new stocks in background meanwhile, there will be no visible change on front end. “Auto Refresh” is replacement for F5 – Reload of page in browser).

    Cheers,
    Aleksandar

    Aleksandar, my Stock Ticker you can check here. Screenshots with my settings: 1 & 2
    Thank you for you attention!

    @efimkuznetsov I found that somehow updater routine stuck (like update from AlphaVantage is already in progress). I flushed StockTicker cache (by appending URL parameter ?stockticker_purge_cache=1 for single page load), and after that both symbols start to update properly.

    Please check is this now working properly tomorrow during day, so we know is that fixed or not.
    If prices do not refresh tomorrow, please enable WordPress debugging so we can get StockTicker log generated for further analysis.

    Cheers,
    Aleksandar

    Hi, Aleksandar!

    Excuse me for long delay with answer. Unfortunately nothing changed after flush cache.
    I enabled debug mode with next setting:
    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);
    define(‘SCRIPT_DEBUG’, true);

    debug.log have this records:
    ==
    [02-Apr-2018 07:24:13 UTC] PHP Notice: Undefined index: message in /home/gelius/public_html/wp-content/plugins/stock-ticker/stock-ticker.php on line 483
    [02-Apr-2018 07:24:13 UTC] PHP Notice: Undefined index: symbol in /home/gelius/public_html/wp-content/plugins/stock-ticker/stock-ticker.php on line 484
    [02-Apr-2018 07:24:13 UTC] PHP Notice: Undefined index: message in /home/gelius/public_html/wp-content/plugins/stock-ticker/stock-ticker.php on line 487
    [02-Apr-2018 07:24:13 UTC] PHP Notice: Undefined index: message in /home/gelius/public_html/wp-content/plugins/stock-ticker/stock-ticker.php on line 498
    ==

    Hi @efimkuznetsov,

    Those undefined indexes are fixed in upcoming release.

    On your website something stuck updater in processing mode. Can you please check is there stockticker.log file in wp-content, and send it to me so I can check log and see is there obvious trigger of the bug? You can use form https://urosevic.net/c/ to provide link to log file.

    Thanks,
    Aleksandar

    Good day,

    On your website something stuck updater in processing mode. Can you please check is there stockticker.log file in wp-content, and send it to me so I can check log and see is there obvious trigger of the bug? You can use form https://urosevic.net/c/ to provide link to log file.

    Unfortunately in wp-content folder exist only one log file – debug.log
    How I can fix it?

    Hi @efimkuznetsov,

    That is strange.

    If you create file test.php with code from this paste https://pastebin.com/ZZPxWvXY in WordPress root, after you load that script in browser, what you get on screen and do you get created wp-content/test.log file with any content?

    As those details are confident, you can provide answer to this question through my contact form mentioned above.

    Cheers,
    Aleksnadar

    Hi Aleksandar,

    It seems to work now, it’s strange. File was created after I clicked “Fetch Stock Data Now!”

    I sent you log file via https://urosevic.net/c/

    Many thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘auto refresh not working’ is closed to new replies.