{"id":81693,"date":"2018-02-15T05:40:26","date_gmt":"2018-02-15T05:40:26","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/post-author-ip\/"},"modified":"2021-06-10T08:19:22","modified_gmt":"2021-06-10T08:19:22","slug":"post-author-ip","status":"publish","type":"plugin","link":"https:\/\/szl.wordpress.org\/plugins\/post-author-ip\/","author":3606,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.4","stable_tag":"1.4","tested":"5.7.15","requires":"4.9","requires_php":"","requires_plugins":"","header_name":"Post Author IP","header_author":"Scott Reilly","header_description":"Records the IP address of the original post author when a post first gets created.","assets_banners_color":"3390b5","last_updated":"2021-06-10 08:19:22","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522","header_plugin_uri":"https:\/\/coffee2code.com\/wp-plugins\/post-author-ip\/","header_author_uri":"https:\/\/coffee2code.com\/","rating":0,"author_block_rating":0,"active_installs":90,"downloads":3432,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"coffee2code","date":"2018-02-15 05:40:04"},"1.1":{"tag":"1.1","author":"coffee2code","date":"2019-06-22 06:21:24"},"1.2":{"tag":"1.2","author":"coffee2code","date":"2020-01-07 00:13:21"},"1.2.1":{"tag":"1.2.1","author":"coffee2code","date":"2020-01-07 00:18:13"},"1.3":{"tag":"1.3","author":"coffee2code","date":"2020-08-07 07:04:56"},"1.4":{"tag":"1.4","author":"coffee2code","date":"2021-06-10 08:19:22"}},"upgrade_notice":{"1.4":"<p>Recommended update: added GDPR compliance for data export and erasure, modernized block editor implementation, restructured unit test files, noted compatibility through WP 5.7, and updated copyright date (2021).<\/p>","1.3":"<p>Recommended update: added support for all public post types, reduced column width, improved meta key handling, expanded unit testing, added TODO.md file, updated compatibility to be WP 4.9 through 5.4+, and more internally.<\/p>","1.2.1":"<p>Trivial update: noted compatibility through WP 5.3+, updated JS development dependencies, and updated copyright date (2020)<\/p>","1.2":"<p>Recommended feature update: added support for the new block editor (aka Gutenberg),<\/p>","1.1":"<p>Minor update: added &#039;c2c_post_author_ip_allowed&#039; filter, modified initialization handling, noted compatibility through WP 5.1+, updated copyright date (2019), and more.<\/p>","1.0":"<p>Initial public release.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1822507,"resolution":"128x128","location":"assets","locale":""}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":1822507,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.2.1","1.3","1.4"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":1822507,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":1822507,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":2223202,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"A screenshot of the admin post listing showing the added \"Author IP\" column. It demonstrates the mix of a post where the post author IP address was recorded, and posts where it wasn't (due to the plugin not being activated at the time).","2":"A screenshot of the Publish metabox for a post showing the post author's IP address (for versions of WordPress older than 5.0, or later if the new block editor aka Gutenberg is disabled)","3":"A screenshot of the block editor sidebar panel for a post showing the post author IP address (WP 5.0 and later)"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[8533,132,1493,3919,86],"plugin_category":[],"plugin_contributors":[78189],"plugin_business_model":[],"class_list":["post-81693","plugin","type-plugin","status-publish","hentry","plugin_tags-audit","plugin_tags-author","plugin_tags-ip","plugin_tags-ip-address","plugin_tags-post","plugin_contributors-coffee2code","plugin_committers-coffee2code"],"banners":{"banner":"https:\/\/ps.w.org\/post-author-ip\/assets\/banner-772x250.png?rev=1822507","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/post-author-ip\/assets\/icon-128x128.png?rev=1822507","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/post-author-ip\/assets\/screenshot-1.png?rev=1822507","caption":"A screenshot of the admin post listing showing the added \"Author IP\" column. It demonstrates the mix of a post where the post author IP address was recorded, and posts where it wasn't (due to the plugin not being activated at the time)."},{"src":"https:\/\/ps.w.org\/post-author-ip\/assets\/screenshot-2.png?rev=1822507","caption":"A screenshot of the Publish metabox for a post showing the post author's IP address (for versions of WordPress older than 5.0, or later if the new block editor aka Gutenberg is disabled)"},{"src":"https:\/\/ps.w.org\/post-author-ip\/assets\/screenshot-3.png?rev=2223202","caption":"A screenshot of the block editor sidebar panel for a post showing the post author IP address (WP 5.0 and later)"}],"raw_content":"<!--section=description-->\n<p>This plugin records the IP address of the original post author when a post first gets created.<\/p>\n\n<p>The admin listing of posts is amended with a new \"Author IP\" column that shows the IP address of the author who first saved the post.<\/p>\n\n<p>The plugin is unable to provide IP address information for posts that were created prior to the use of this plugin.<\/p>\n\n<p>Links: <a href=\"https:\/\/coffee2code.com\/wp-plugins\/post-author-ip\/\">Plugin Homepage<\/a> | <a href=\"https:\/\/wordpress.org\/plugins\/post-author-ip\/\">Plugin Directory Page<\/a> | <a href=\"https:\/\/github.com\/coffee2code\/post-author-ip\/\">GitHub<\/a> | <a href=\"https:\/\/coffee2code.com\">Author Homepage<\/a><\/p>\n\n<h3>Hooks<\/h3>\n\n<p>The plugin is further customizable via four filters. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).<\/p>\n\n<p><strong>c2c_show_post_author_ip_column (filter)<\/strong><\/p>\n\n<p>The 'c2c_show_post_author_ip_column' filter allows you to determine if the post author IP column should appear in the admin post listing table. Your hooking function can be sent 1 argument:<\/p>\n\n<p>Argument :<\/p>\n\n<ul>\n<li>$show_column (bool) Should the column be shown? Default true.<\/li>\n<\/ul>\n\n<p>Example:<\/p>\n\n<pre><code>\/**\n * Don't show the post author IP column except to admins.\n *\n * @param bool $show_column Should the column be shown? Default true.\n * @return bool\n *\/\nfunction post_author_ip_column_admin_only( $show ) {\n    if ( ! current_user_can( 'manage_options' ) ) {\n        $show = false;\n    }\n    return $show;\n}\nadd_filter( 'c2c_show_post_author_ip_column', 'post_author_ip_column_admin_only' );\n<\/code><\/pre>\n\n<p><strong>c2c_get_post_author_ip (filter)<\/strong><\/p>\n\n<p>The 'c2c_get_post_author_ip' filter allows you to customize the value stored as the post author IP address. Your hooking function can be sent 2 arguments:<\/p>\n\n<p>Arguments :<\/p>\n\n<ul>\n<li>$ip (string)   The post author IP address.<\/li>\n<li>$post_id (int) The post ID.<\/li>\n<\/ul>\n\n<p>Example:<\/p>\n\n<pre><code>\/**\n * Store all IP addresses from local subnet IP addresses as the same IP address.\n *\n * @param string $ip      The post author IP address.\n * @param int    $post_id The post ID.\n * @return string\n *\/\nfunction customize_post_author_ip( $ip, $post_id ) {\n    if ( 0 === strpos( $ip, '192.168.' ) ) {\n        $ip = '192.168.1.1';\n    }\n    return $ip;\n}\nadd_filter( 'c2c_get_post_author_ip', 'customize_post_author_ip', 10, 2 );\n<\/code><\/pre>\n\n<p><strong>c2c_get_current_user_ip (filter)<\/strong><\/p>\n\n<p>The 'c2c_get_current_user_ip' filter allows you to customize the current user's IP address, as used by the plugin. Your hooking function can be sent 1 argument:<\/p>\n\n<p>Argument :<\/p>\n\n<ul>\n<li>$ip (string)   The post author IP address.<\/li>\n<\/ul>\n\n<p>Example:<\/p>\n\n<pre><code>\/**\n * Overrides localhost IP address.\n *\n * @param string $ip      The post author IP address.\n * @param int    $post_id The post ID.\n * @return string\n *\/\nfunction customize_post_author_ip( $ip, $post_id ) {\n    if ( 0 === strpos( $ip, '192.168.' ) ) {\n        $ip = '192.168.1.1';\n    }\n    return $ip;\n}\nadd_filter( 'c2c_get_post_author_ip', 'customize_post_author_ip', 10, 2 );\n<\/code><\/pre>\n\n<p><strong>c2c_post_author_ip_allowed (filter)<\/strong><\/p>\n\n<p>The 'c2c_post_author_ip_allowed' filter allows you to determine on a per-post basis if the post author IP should be stored. Your hooking function can be sent 3 arguments:<\/p>\n\n<p>Arguments :<\/p>\n\n<ul>\n<li>$allowed (bool) Can post author IP be saved for post? Default true.<\/li>\n<li>$post_id (int)  The post ID.<\/li>\n<li>$ip (string)    The post author IP address.<\/li>\n<\/ul>\n\n<p>Example:<\/p>\n\n<pre><code>\/**\n * Don't bother storing localhost IP addresses.\n *\n * @param bool   $allowed Can post author IP be saved for post? Default true.\n * @param int    $post_id The post ID.\n * @param string $ip      The post author IP address.\n * @return string\n *\/\nfunction disable_localhost_post_author_ips( $allowed, $post_id, $ip ) {\n    if ( $allowed &amp;&amp; 0 === strpos( $ip, '192.168.' ) ) {\n        $allowed = false;\n    }\n    return $allowed;\n}\nadd_filter( 'c2c_post_author_ip_allowed', 'disable_localhost_post_author_ips', 10, 3 );\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Install via the built-in WordPress plugin installer. Or download and unzip <code>post-author-ip.zip<\/code> inside the plugins directory for your site (typically <code>wp-content\/plugins\/<\/code>)<\/li>\n<li>Activate the plugin through the 'Plugins' admin menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='if%20a%20post%20is%20originally%20drafted%20at%20one%20ip%20address%2C%20then%20later%20worked%20on%20at%20another%20ip%20address%2C%20which%20ip%20address%20gets%20recorded%3F'><h3>If a post is originally drafted at one IP address, then later worked on at another IP address, which IP address gets recorded?<\/h3><\/dt>\n<dd><p>The IP address in use at the time that the post is first saved (regardless of whether the post was saved as a draft, immediately published, or some other status) will be recorded.<\/p><\/dd>\n<dt id='are%20other%20ip%20addresses%20in%20use%20during%20the%20post%27s%20handling%20%28such%20as%20when%20it%20is%20edited%2C%20published%2C%20etc%29%20also%20tracked%3F'><h3>Are other IP addresses in use during the post's handling (such as when it is edited, published, etc) also tracked?<\/h3><\/dt>\n<dd><p>No, this plugin only records the IP address in use when the post was first saved.<\/p><\/dd>\n<dt id='how%20do%20i%20see%20%28or%20hide%29%20the%20%22author%20ip%22%20column%20in%20an%20admin%20listing%20of%20posts%3F'><h3>How do I see (or hide) the \"Author IP\" column in an admin listing of posts?<\/h3><\/dt>\n<dd><p>In the upper-right of the page is a \"Screen Options\" link that reveals a panel of options. In the \"Columns\" section, check (to show) or uncheck (to hide) the \"Author IP\" option.<\/p><\/dd>\n<dt id='is%20this%20plugin%20compatible%20with%20the%20new%20block%20editor%20%28aka%20gutenberg%29%3F'><h3>Is this plugin compatible with the new block editor (aka Gutenberg)?<\/h3><\/dt>\n<dd><p>Yes. This plugin is compatible with the block editor as well as the classic editor.<\/p><\/dd>\n<dt id='is%20this%20plugin%20gdpr-compliant%3F'><h3>Is this plugin GDPR-compliant?<\/h3><\/dt>\n<dd><p>Yes. The IP address stored for authors on the posts they created will be exported on data export requests and deleted for data erasure requests.<\/p><\/dd>\n<dt id='does%20this%20plugin%20include%20unit%20tests%3F'><h3>Does this plugin include unit tests?<\/h3><\/dt>\n<dd><p>Yes.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4 (2021-06-09)<\/h4>\n\n<p>Highlights:<\/p>\n\n<p>This recommended release adds GDPR compliance for data export and erasure, modernizes block editor implementation, restructures unit test files, and notes compatibility through WP 5.7.<\/p>\n\n<p>Details:<\/p>\n\n<ul>\n<li>New: Add GDPR compliance for data export and erasure\n\n<ul>\n<li>New: Add <code>register_privacy_erasers()<\/code> and <code>remove_ip_address_from_posts_by_email()<\/code> for handling data erasure requests<\/li>\n<li>New: Add <code>register_data_exporter()<\/code> and <code>export_user_data_by_email()<\/code> for handling data export requests<\/li>\n<li>New: Add <code>add_privacy_policy_content()<\/code> for outputting suggested privacy policy snippet<\/li>\n<li>New: Add FAQ entry denoting GDPR compliance<\/li>\n<\/ul><\/li>\n<li>Change: Modernize block editor implementation and update JS dependencies<\/li>\n<li>Change: Remove check for theme support of HTML5 since that isn't relevant to admin<\/li>\n<li>Change: Enable script translations<\/li>\n<li>Change: Note compatibility through WP 5.7+<\/li>\n<li>Change: Update copyright date (2021)<\/li>\n<li>Unit tests:\n\n<ul>\n<li>Change: Restructure unit test directories and files into <code>tests\/<\/code> top-level directory<\/li>\n<li>Change: Remove 'test-' prefix from unit test files<\/li>\n<li>Change: In bootstrap, store path to plugin file constant<\/li>\n<li>Change: Rename <code>phpunit.xml<\/code> to <code>phpunit.xml.dist<\/code> per best practices<\/li>\n<\/ul><\/li>\n<li>New: Add a few more possible TODO items<\/li>\n<\/ul>\n\n<h4>1.3 (2020-08-06)<\/h4>\n\n<p>Highlights:<\/p>\n\n<p>This recommended release adds support for all public post types, reduces column width, improves meta key handling, expands unit testing, adds a TODO.md file, updates compatibility to be WP 4.9 through 5.4+, and more internally.<\/p>\n\n<p>Details:<\/p>\n\n<ul>\n<li>New: Enable plugin functionality for all public post types by default\n\n<ul>\n<li>New: Add <code>get_post_types()<\/code> for retrieving post types<\/li>\n<li>New: Add filter <code>c2c_stealth_publish_post_types<\/code> to filter post types<\/li>\n<\/ul><\/li>\n<li>New: Add <code>is_protected_meta()<\/code> to protect the meta key from being exposed as a custom field<\/li>\n<li>New: Improve configurability and accessibility of meta key name\n\n<ul>\n<li>New: Add <code>get_meta_key_name()<\/code> as getter for meta_key name<\/li>\n<li>New: Add filter <code>c2c_post_author_ip_meta_key<\/code> for customizing meta key name<\/li>\n<\/ul><\/li>\n<li>New: Add <code>rest_pre_insert()<\/code> to add meta key as first-class object property prior to REST-initiated update<\/li>\n<li>New: Add HTML5 compliance by omitting <code>type<\/code> attribute for <code>style<\/code> tag when the theme supports 'html5'<\/li>\n<li>New: Add TODO.md for newly added potential TODO items<\/li>\n<li>Change: Reduce width of 'Author IP' column<\/li>\n<li>Change: Remove duplicate hook registration<\/li>\n<li>Change: Note compatibility through WP 5.4+<\/li>\n<li>Change: Drop compatibility for version of WP older than 4.9<\/li>\n<li>Change: Update JS dependencies<\/li>\n<li>Change: Tweak formatting of CSS styles<\/li>\n<li>Change: Update links to coffee2code.com to be HTTPS<\/li>\n<li>Unit tests:\n\n<ul>\n<li>New: Add tests for <code>add_admin_css()<\/code>, <code>admin_css()<\/code>, <code>add_post_column()<\/code>, <code>enqueue_block_editor_assets()<\/code>, <code>handle_column_data()<\/code><\/li>\n<li>New: Add tests for <code>include_column()<\/code>, <code>register_meta()<\/code>, <code>show_post_author_ip()<\/code>, <code>transition_post_status()<\/code><\/li>\n<li>New: Add test for default hooks<\/li>\n<li>Change: Use <code>get_meta_key_name()<\/code> to set default meta key used by tests<\/li>\n<li>Change: Remove unnecessary unregistering of hooks in <code>tearDown()<\/code><\/li>\n<li>Change: Use HTTPS for link to WP SVN repository in bin script for configuring unit tests<\/li>\n<\/ul><\/li>\n<\/ul>\n\n<h4>1.2.1 (2020-01-06)<\/h4>\n\n<ul>\n<li>New: Unit tests: Add test to verify plugin hooks <code>plugins_loaded<\/code> action to initialize itself<\/li>\n<li>Change: Note compatibility through WP 5.3+<\/li>\n<li>Change: Update JS dependencies<\/li>\n<li>Change: Update copyright date (2020)<\/li>\n<\/ul>\n\n<p><em>Full changelog is available in <a href=\"https:\/\/github.com\/coffee2code\/post-author-ip\/blob\/master\/CHANGELOG.md\">CHANGELOG.md<\/a>.<\/em><\/p>","raw_excerpt":"Records the IP address of the original post author when a post first gets created.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/81693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"author":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/users\/3606"}],"replies":[{"embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=81693"}],"wp:attachment":[{"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=81693"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=81693"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=81693"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=81693"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=81693"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/szl.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=81693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}