I’m using a plugin called WPDataTables to display small tables of data; typically fewer than 10 rows with only 3-4 columns each.
The tables are displayed using shortcodes.
I’m running into severe lag, as the plugin uses cURL to fetch the data from Google Sheets hosted on the web, and each fetch seems to take about 1 second. This would be fine if there were only 1 table on each page. For my purposes, I typically have to load up to 10 tables on a single page, which means the load time is typically closer to 10 seconds. Essentially unusable.
Is there a way to load the shortcodes only when they’re visible and hide them in something like an accordion container until needed?
Effectively, opening the accordion would load the shortcode, which would take about a second, but eliminate the egregious cumulative 10-second wait.
Thanks