이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

Pods AJAX Views

설명

Pods AJAX Views offers an easy way to generate cached views from AJAX when they haven’t been cached yet. It will serve straight from cache and output on the page if the view has already been generated.

This plugin requires the Pods Framework version 2.4.1 or later to run.

Why AJAX Views?

If you are using pods_view to cache template output, you’re already on the right track to improving performance of your site through it’s powerful Partial Page Caching. However, what if you have a complicated view that may take a few seconds to generate? What if you have a few of those views on the same page?

On hosts like WPEngine, there’s a strict 30 second limit and then a 502 server error is sent to the visitor. Waiting a long time for a page to load, or especially being sent a server error like that just isn’t acceptable for visitors and they may choose to bail on your site.

Pods AJAX Views takes those complicated views and lets you off-load them into a separate asynchronous AJAX call that allows the rest of the page to be built and sent to the browser. When the AJAX request runs, the view is cached like normal, so subsequent calls to the Pods AJAX View code will produce the exact same result as a default pods_view would.

Usage

Use the same way as pods_view, it accepts the same arguments, except one additional argument $forced_regenerate at the end which can be set to true (default: false) that will force the view to be deleted from cache and reloaded.

pods_ajax_view( 'my-big-cached-template.php' );

AJAX requests are done through the same URL, so you still have access to the query and postdata like normal. We hook into template_redirect to stop Beware that AJAXed views are loaded from AJAX, not through the current page. They do not have access to the current WP_Query or Query variables, or the Post loop. If you want to pass anything into it, use the $data argument.

For information about pods_view, see these resources:

Available Constants

  • define( 'PODS_AJAX_VIEWS_STATS', true ) – Creates a table for Stats tracking and regeneration ability; Must be enabled before activating, if you enable it, just deactivate / activate again
  • define( 'PODS_AJAX_VIEWS_OVERRIDE', true ) – Overrides all pods_view() calls in the theme and turns them into AJAX views, even if they aren’t set to cache (it’ll load the non-cached version via AJAX)
  • define( 'PODS_AJAX_VIEWS_API_KEY', 'abcdefghijk' ) – This should be highly randomized, it’s the API key used to access the sitemap at yoursite.com/?pods_ajax_view_action=view_sitemap&pods_ajax_view_api_key=XXXX which must be accessed through the user (or anon) the regeneration will be run as because the URLs are specific to the user and have nonces on them; You can use this with a plugin like Warm Cache to keep your views fresh and always generated
  • define( 'PODS_AJAX_VIEWS_SITEMAP_LIMIT', -1 ) – You can override how many sitemap items will show, default is 250

Contributors

Check out our GitHub for a list of contributors, or search our GitHub issues to see everyone involved in adding features, fixing bugs, or reporting issues/testing.

github.com/pods-framework/pods-ajax-views/graphs/contributors

스크린샷

  • Manage page.
  • Regnerating views from manage page.

설치

  1. Unpack the entire contents of this plugin zip file into your wp-content/plugins/ folder locally
  2. Upload to your site
  3. Navigate to wp-admin/plugins.php on your site (your WP Admin plugin page)
  4. Activate this plugin

OR you can just install it with WordPress by going to Plugins >> Add New >> and type this plugin’s name

후기

이 플러그인에 대한 평가가 없습니다.

기여자 & 개발자

“Pods AJAX Views”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

자국어로 “Pods AJAX Views”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

1.2 – March 26th, 2020

  • Added: Now requiring PHP 5.4+
  • Added: Freemius support when running Pods 2.7.17

1.1 – March 2nd, 2020

  • Fixed: Resolved potential SQL errors by not showing admin page if PODS_AJAX_VIEWS_STATS is not defined as true
  • Fixed: Fix tracking_data PHP notices
  • Added: When WP_DEBUG is on, we now output an HTML comment when nonce fails
  • Updated compatibility with WP 5.4

1.0 – June 19th, 2014