Skip Navigation

[Resolved] Timeout from external ressources

This thread is resolved. Here is a description of the problem and solution.

Problem: Several pages of my site hang or crash, or simply will not load. My host says there is a problem with implementing external resources.

Solution: There seems to be a problem with some deeply nested Views and conditionals. It might be best here to create some custom shortcodes instead of nesting Views with shortcode arguments inside other Views with shortcode arguments and conditionals. Use the get_view_query_results API to get a View's results in PHP.

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views-api/#get_view_query_results
https://toolset.com/forums/topic/big-problem-with-view-2/#post-1227289

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by romanB-3 4 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#1578591

Hello,
I have a major bug on most of my pages since yesterday
For instance : hidden link
My host tells the site makes requests to external ressources, but I can't find where, how, when, why...
I assume this is related to Toolset since I tried to deactivate all plugins and restore default theme without success.
Thank you.

#1578741

The post seems to load okay if the Content Template is disconnected, so that indicates a problem in the Single Post Content Template. I duplicated the template and removed some content, and now it appears to load well here:
hidden link
The content I deleted was multi-level nested Views in conditionals, like this:

[wpv-conditional if="( '[wpv-view name='related-posts' motscles='[wpv-view name='related-posts-par-mot-cle-thematique']']' eq '0' )"]

I would try isolate one single View that is causing the problem. If there isn't one single View causing a problem, maybe create some custom shortcodes so there aren't so many levels of nesting quotation marks like this.

#1578773

Thank you.
If I understand well, I should build a shortcode that would replace

[wpv-conditional if="( '[wpv-view name='related-posts' motscles='[wpv-view name='related-posts-par-mot-cle-thematique']']' eq '0' )"]

with for instance a shortcode "nested-view" that would have 3 parameters :
- the main view name ;
- the "filter" view name.

[wpv-conditional if="( '[nested-views view-name='related-posts' view-filter='related-posts-par-mot-cle-thematique']' eq '0' )"]

In that case, I assume I may build this two ways :
1- Build the shortcode by calling views, but I suppose that would really solve the query weight ;
2- Build the shortcode by replacing the secondary view with a full-PHP query so I wouldn't need the intermediate views anymore ?
In that case, I'd really use some documentation about building view queries in PHP instead of building them in Toolset.
Thank you.

#1578861

You can use get_view_query_results to get the results of a View with PHP:
https://toolset.com/documentation/programmer-reference/views-api/#get_view_query_results

How to use this API with arguments that would normally be in shortcode arguments:
https://toolset.com/forums/topic/big-problem-with-view-2/#post-1227289

#1579691

My issue is resolved now. Thank you!