Show IP Address

外掛說明

Show IP Address provides a small set of shortcodes for displaying request information. It does not store visitor information or call a third-party IP lookup API.

The default shortcode output is loaded from this site’s own WordPress REST API. This avoids putting one visitor’s IP address into HTML that may be served to other visitors by a full-page cache. If a host or security plugin blocks the REST API, the shortcode displays an unavailable message rather than a potentially incorrect cached address.

By default, the plugin uses the address seen by the web server (REMOTE_ADDR). If a site is behind a proxy or CDN, this may be the proxy’s address. Forwarded headers are not trusted automatically because they can be forged unless the proxy is configured to set them securely. Hosting providers or site developers can add trusted proxy support with the show_ip_address_client_ip filter.

Shortcodes

  • [show_ip] — Display the visitor’s IP address.
  • [show_ip_hostname] — Display the reverse-DNS hostname when available. This performs a DNS lookup only when requested.
  • [show_ip_useragent] — Display the browser user-agent string when supplied.
  • [show_ip_referrer] — Display the referrer URL when supplied. Browsers and privacy settings may omit it.

All shortcodes accept mode="server" for server-rendered output, for example [show_ip mode="server"]. Use this only on pages excluded from full-page caching; otherwise a cache may show one visitor’s details to another.

Shortcodes render with the CSS class show-ip-address and a field modifier such as show-ip-address--ip. The plugin adds no global styles, so typography and colour inherit from the active theme. You can target these classes in your theme stylesheet if desired.

Compatibility

The plugin uses WordPress core APIs, PHP, and a same-site REST request. It has no third-party IP lookup API, custom database table, shell command, or host-specific server dependency. The optional hostname shortcode uses the host’s DNS resolver when requested. The dynamic shortcode requires JavaScript and access to the site’s WordPress REST API. If that request is blocked, the plugin reports that the information is unavailable.

PHP 7.4 is the minimum code compatibility level. PHP 7.4 is end-of-life; use a PHP version that still receives security updates from your hosting provider. WordPress.org recommends PHP 8.3 or newer.

Privacy

The plugin does not store the displayed visitor details. The visitor IP is returned to that same visitor by a public, read-only endpoint on the current site. Site owners remain responsible for their own privacy notices and server/CDN logging.

螢幕擷圖

使用者評論

2018 年 7 月 14 日
Even though this plugin is not updated for several years it works just perfect. We use it on our support pages so clients can see their own IP address when we need it.
2016 年 9 月 3 日 5 則留言
UPDATE: Developer fixed problem so I am changing my 1-star review to 5-stars as it is working great now. Thank you! —- Original Review —- Can not activate the plugin. When I try I get the following message: The plugin does not have a valid header.
2016 年 9 月 3 日
I thought I would create a simple plugin,that does what its meant to do, it's simple and it works. Working on a few issues to do with 'shell_exec()' but apart from that it works.
2016 年 9 月 3 日 2 則留言
As promised, the plugin has been revised/updated and returned to it's roots of being a plugin designed to show one's IP and doing it correctly and effectively. Glad to see we were able to get things sorted! Thank you so much for listening and working with feedback, author! Updated to 5 stars for doing what it's meant to do, simple and well! ORIGINAL REVIEW ( 1 Star ) Created support topic over 2 months ago. https://wordpress.org/support/topic/disabled-shell_exec Even went so far as to attempt to contact him via his personal site to ensure he was made aware of this problem and support topic via http://www.keith-griffiths.com/contact-me No reply at all. Creator boasts "Any suggested updates I'll consider in each build." but can't be bothered to provide support for an issue that has arisen specifically from this plugin. 1 star, because no lower rating is available, due to errors and nonexistent support.
閱讀全部 5 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Show IP Address〉的開發相關工作。

參與者

將〈Show IP Address〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄。

變更記錄

2.0.0

  • Retained the original four shortcodes and legacy get_the_user_ip() helper.
  • Added cache-safe, same-site dynamic output and clear fallback when the REST request is unavailable.
  • Uses REMOTE_ADDR by default and validates IP values; added a filter for trusted proxy integrations.
  • Removed unnecessary global CSS and host-specific server calls.
  • Added a simple dashboard widget that displays the current administrator’s connection IP.
  • Namespaced plugin functions and CSS classes to reduce conflicts with themes and other plugins.

1.8

  • Added hostname, user-agent, and referrer shortcodes.
  • Refactored the plugin to remove external dependencies.

1.7

  • Improved shortcode handling for forwarded IP headers and escaped output.