These are the most useful functions from the CFGP_U
class for developing advanced solutions: working with REST keys, reading geo data, secure redirects, cache invalidation, bot detection, input sanitization, helper HTTP requests, and more. All examples are ready for copy/paste.
Tip: All methods are static (CFGP_U::method()
), so you can call them directly from themes, plugins, or custom snippets.
Security Notes
- Do not output
KEY()
and internal IDs in front-end HTML. - Use
CFGP_U::redirect()
for redirects instead of manualheader()
calls. - Trigger cache invalidation only when needed (e.g., after changing geo rules), not on every request.
- Do not apply geo rules to bots (
CFGP_U::is_bot()
) to avoid breaking SEO previews and crawls.
- Security Notes
- HTTP Codes Helper
- Get Current User (ID or Email)
- Quick Access to Geo Fields
- Location Checks (City/Region/Country/Postcode)
- Safe Redirect (Preserving Parameters)
- Cache Invalidation (Global + Popular Cache Plugins)
- Bot/Crawler Detection
- HTTP Requests with Caching (GET/POST)
- Request Sanitizers (GET/POST)
- URL/Host Helpers
- Fragment Caching (W3TC mfunc)
- Defender Cookie (Anti-Abuse Signal)
- Display Flag
- Check if REST is Enabled
- Miscellaneous Utilities