| 开发者 |
ivijanstefan
creativform |
|---|---|
| 更新时间 | 2026年10月23日 02:02 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.0 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[cfgeo_city], must be enabled in Geo Controller settings. See the shortcode reference for supported attributes and return values.
Location-specific HTML can be affected by full-page caching when one cached response is shared between visitors. Follow the dynamic content and caching guidance and test every rule with a safe fallback.
Common Geolocation Use Cases
Geo Controller can be used to create location-aware WordPress experiences without building a separate geolocation system.
[cfgeo_map] to display a single-point Google Map for a detected or specified location. A valid Google Maps API key is required.
[cfgeo_map longitude="-74.0059" latitude="40.7128" zoom="15" title="My Company Name"]
My Company Name
No Name Street 35, New York, USA
We have what you need
[/cfgeo_map]
Geo tags can add configured geographic metadata to selected public content. Country flags are available through [cfgeo_flag], including custom country, size, class, ID, inline CSS, and include/exclude options.
Examples:
[cfgeo_flag]
[cfgeo_flag country="ca" size="32px"]
Read the Google Maps shortcode documentation before enabling map output. Google Maps is a separate external service with its own account, billing, terms, and privacy behavior.
Integrations and Developer Features
The plugin contains dedicated integration code for WooCommerce, Elementor, Contact Form 7, Gravity Forms, BuddyBoss Platform, WooPlatnica, and Yoast SEO. It also includes Cloudflare-aware IP handling and settings intended for common caching configurations. Compatibility still depends on the active theme, plugin versions, cache/CDN behavior, and site configuration.
Developers can use:
CFGP_U::api() for the current structured geodata arrayCFGP_U::api('country_code') for a single available fieldCFGP_API::lookup() for an explicit advanced lookupwindow.cfgeo when the plugin's JavaScript output is enableddo_shortcode() in templates that intentionally render shortcode content/wp-content/plugins/cf-geoplugin/.[cfgeo return="country" default="Unknown"].Yes. The plugin works without a paid license with a standard allowance of up to 500 API lookups per day. Active paid licenses provide unlimited lookups during the license period and enable features associated with the applicable license level. See the current plans.
Yes. Geo Controller was previously known as CF Geo Plugin. It is the continuation of the same WordPress plugin, with ongoing development, improved functionality, and maintained compatibility with supported existing shortcodes and integrations. Existing users do not need to install a separate plugin or migrate to a different product.
IP geolocation requires communication with the Geo Controller API. An IP address and technical request data are processed to return approximate location information. Optional Google Maps output communicates with Google when enabled. Review the Privacy Policy and document these services appropriately for your site.
IP geolocation estimates network location; it does not verify a person's physical position. Country results are generally more reliable than city or postcode results. VPNs, proxies, mobile carriers, corporate gateways, satellite connections, and incorrect trusted-proxy settings can change the detected IP or location. Provide fallback content and avoid using an IP result as the sole basis for high-impact decisions.
Use a controlled connection or reputable testing service that provides an exit point in the target location, then confirm the detected IP and fields on Geo Controller's Debug page. Clear relevant page and plugin caches between tests. Do not assume that one VPN endpoint represents every visitor in that location.
A full-page cache or CDN may be serving one visitor's rendered HTML to everyone. Exclude pages that require per-visitor output, use the plugin's supported dynamic/AJAX behavior where appropriate, and purge caches after changing rules. See dynamic content and caching.
The provider may not have that field for the detected IP, the daily allowance may have been reached, the request may have failed, or proxy/CDN settings may identify the wrong address. Check the Debug page, the displayed API response and error, SSL/proxy settings, trusted forwarding headers, and server logs. Use a default shortcode value for expected gaps.
Yes, when the template processes WordPress shortcodes. For example:
echo do_shortcode('[cfgeo return="country" default="Unknown"]');
Use WordPress do_shortcode() only where rendering administrator-controlled shortcode content is appropriate.
Use the current helper and validate keys defensively: $data = CFGP_U::api(); $country = is_array($data) ? ($data['country'] ?? '') : ''; $country_code = CFGP_U::api('country_code'); $response = CFGP_API::lookup('8.8.8.8', ['dns' => true]); $city = is_array($response) ? ($response['city'] ?? '') : ''; See the PHP integration documentation. Historic global variables from older CF Geo Plugin releases should not be used for new integrations.
Enable the plugin's JavaScript output, then read the generated window.cfgeo object after it is available:
if (window.cfgeo) { console.log(window.cfgeo.country); }
See the JavaScript integration documentation.
Yes, if JavaScript output is enabled. A form can contain fields such as:
[text city placeholder " City Name"]
[text country placeholder " Country Name"]
Your site script can then assign window.cfgeo.city and window.cfgeo.country after checking that the object and fields exist. Escape or validate values for the target context.
Any API call and location-dependent rendering has a cost. Geo Controller caches lookup data and supports dynamic loading options, but actual impact depends on hosting, network latency, cache configuration, enabled modules, and traffic. Measure the relevant pages and avoid unnecessary repeated lookups.
No plugin can guarantee compliance automatically. Geo Controller provides location-aware conditions that may support a site's implementation, but the site owner remains responsible for notices, consent, access rules, data processing, taxes, and applicable law. Obtain qualified advice where needed.
Start with the documentation. If the issue remains, use Contact & Support and include the plugin version, WordPress version, relevant settings, Debug output with secrets removed, and steps to reproduce.