WP API Privacy
WP API Privacy
The default WordPress installation from wordpress.org automatically transmits extraneous information via various HTTP calls that occur in the admin. Some of this data may be cause for concern from a privacy perspective.
This plugin seeks to limit that information, attempting to further protect your privacy in the process. Simply install this plugin and activate it, and various aspects of WordPress that are questionable from a privacy perspective will be modified.
To find out about recent changes, please read the Changelog.
Modifications Made
Default outgoing HTTP requests to third-party services like the plugin and theme update mechanism at WordPress.org contains site and version information in the User-Agent header. For example, all requests contain your website name in the form of http://mysite.com, and a version string such as 6.6, giving third-parties detailed information about your site. Combining this information with your IP address (which all servers can determine from incoming requests), provides the recipient with potentially intrusive insight into every website using the WordPress platform.
Once active, the plugin strips can be configured to strip this information so requests do not contain information about the domain name that requested them or which version of WordPress it was using. Some API calls, such as the ones to the plugin listings, also contain a version parameter to filter the associated list of plugins - these are left in.
Plugin And Theme Data
When a default WordPress installation contains WordPress.org requests information about plugin and theme updates, it sends detailed information about every plugin and theme on your WordPress site, including all the plugin and theme headers available. This occurs even for private plugins or themes, or plugins and themes that are not hosted on WordPress.org.
After activation, any plugins or themes that update from third-party repositories (as indicated by the Update URI in the plugin header) will be filtered on all outbound requests.
Core Requests
When WordPress attempts to do a core software update, it sends along detailed information such as your site URL, how many users you have, how many blogs you have, your MySQL version, your PHP version, the type of server you have (i.e Mac, Linux, Windows, etc) and all the PHP extensions you have on your site. This information can also be selectively filtered to only provide what's absolutey essential to the WordPress API servers.
Installation
You can install the package either via a ZIP file, or by using composer. Please note, this plugin is still in active development - please don't install it on any production sites, but feel free to test it on development or less essential sites to help provide feedback.
ZIP File
Navigate to the "Releases" section in the sidebar, and click on the latest release. Inside the release you will see a ZIP file that looks like wp-api-privacy.zip. Simply download that file and then use the WordPress plugin installer in the admin panel to add it.
Composer
You can add the plugin to your website using Composer. First navigate to your main WordPress directory.
The execute the command:
composer require wp-privacy/wp-api-privacy
This will install the plugin to your wp-content/plugins directory. Once done, navigate to your plugins page in the WordPress admin panel and activate the plugin.
Future Updates
The plugin will automatically fetch updates via the WordPress admin from this Github repository using the WordPress update mechanism (you will be notified in the admin when an update is available).
Verification
After installing the plugin, you can also use the "HTTP Requests Manager" plugin to verify the user-agent field has been changed to "WordPress/Private", and that the plugin information is stripped of any plugins hosted off-site.
The following is a list of the most recent releases for this plugin.
-
1.2.3 - Updater Fix
- Fixed: Issue where update mechanism could impact other plugin updates
SHA256 hash:41969c6a52476dd928d92f771fed0de2cdf3ea5a6132dcded2900d108f63e135
-
1.2.2 - Language update + fixes
- Updated: Chinese/Taiwain language - Fixed: Issue with uninstall options wipe
SHA256 hash:27f516b2f153f640046b0198237b2922a4defb22ef8e757554d1deec87c5702f
-
1.2.1 - Minor Updates
- Added: Uninstall hook to clean out settings - Modified: Cache time for Github updates
SHA256 hash:492535460df0b2dd963f71ee976340f86a400d8c16b09358248fa61b83115b88
-
1.2.0 - Code Improvements
- Updated: improved privacy code for user-agent
SHA256 hash:22f24fd57c8b0450a04ec032e61693b2d4323ff626287d6f7d8873ad2b10a697
-
1.1.9 - Languages update
- Fixed: Issue with load_plugin_textdomain in WordPress 6.7 - Added: Turkish language translation (thanks Kerem Erkan)
SHA256 hash:24d6126d20bded2a7ab90b82c2df537e01dc97e520ebbda30d3516908a525f14
-
1.1.8 - Updated languages plus more
A few minor changes in this release: - Updated: German and Chinese languages (thanks) - Modified: method for stripping information from core update requests (thanks Matt Radford ) - Added: Persian (Farsi) language (thanks Mohammad Anbarestany)
SHA256 hash:90189cf2e11acd2a937cabcb70d8020fccd49f7ae7f2c560b5cec2abe24343c4
-
1.1.7 - Bug fixes
- fixed issue with tag comparison - added check for main branch only updates
SHA256 hash:c2872ffbe8e37866c3dfbac02ce85c5c60cab06858975e0069781d612094039f
-
1.1.6 - Settings page
- Added: New settings for the user-agent to add a unique hash instead of removing the URL completely - Added: a CHANGELOG.md to support Git Updater - Added: additional banner assets for Git Updater
SHA256 hash:bea6f39f813ffbad97ae93968a17358e1cd105ac43977474940b3982e3b21941
-
1.1.5 - Minor Update
- Added: German translations (thanks to Udo Meisen) - Added: New setting to control User-Agent for non wordpress.org calls - Added: Settings link in the plugins list - Previously added: Chinese translations (thanks to Alex Lion)
SHA256 hash:2c7c39c8d05603cc2de6c723dafcebf752a4b4f22716cbb9d9cf42b7a9a7bdae
-
1.1.4 - Github Updates
Working on improvements for the Github update mechanism
SHA256 hash:60b79bfb7aa58f83a95370a8b4e48b4284d4cee8be4102024a51636b69785021
-
1.1.3 - Errors + Admin Statistics
The following changes were made: - Fixed: critical error when visiting the network admin in multi-site - Added: basic statistics on admin panel options page
SHA256 hash:5ba05f3320f1eda77b1334080c06e4e2d37c062924262774b83eab2673b48a54
-
1.1.2 - Composer Updates
The composer.json was updated to list the project as a 'wordpress-plugin'. It can now be installed into wp-content/plugins using 'composer require wp-privacy/wp-api-privacy'
SHA256 hash:6c58299815f4909a3c7127161e9b5d827269d95b14e45cb1565edda7485552c7
-
1.1.0 - Settings page
- Added a new settings page with configurable settings - Added new POT file for translating strings
SHA256 hash:43a8d260c228b4baa3d25df3ed353686aa7675591f11a0974075a4e0262503e5
-
1.0.3 - Bugs fixes, force check
Fixed a bug related to theme mismatch (thanks [Craig Riley](https://github.com/craigrileyuk)). Added ability to force-look for an update via the the WordPress admin. Starting initial work on settings page and internationalization.
SHA256 hash:d10696e1b941b96dab44c26b280931e0ed5adf06dd879fd54a53575dabeeea37
-
1.0.2 - Plugin & Theme Filters, Core URL changes
This release fixes a bug where some plugins with Update URIs defined on wordpress.org wouldn't update anymore. It also adds additional privacy filtering on WordPress API core, theme, and plugin API calls.
SHA256 hash:fc4187632e07b93846028baccd3e5d0392346b082c64c0a94b9be1ad55c9ae61
-
1.0.1 - Removed off-site plugins from data sent to WP.org
Any plugins that indicate they are hosted off-site using the "Update URI" header in the plugin file will no longer report data to WordPress.org during update checks. There is no reason to pass this data on as the updates are not provided by WordPress.org
SHA256 hash:583bc19aa193bb7c279f9eb593c13977e1b2dc5dbc4f3943a5131bb38cb3be05
-
1.0.0 - First release
Removes home site URL from the user-agent header to all outgoing web requests that use the WordPress HTTP API.
SHA256 hash:f3a15d027f4101619291d6e2311deeb3ab1495034c3f94ae4b0f94e1052eb0bd
The following is a list of the most recent issues for this plugin.
-
Spanish translation
That's it!
-
Delete Setting Option on Uninstall
We did a security review of the plugin and found a minor issue, though not with a security implication for this plugin. The plugin doesn't currently delete the option storing the plugin's setting when the plugin is uninstalled as plugins are supposed to do. That can be [handled](https://developer.wordpress.org/plugins/plugin-basics/uninstall-methods/) with either a register_uninstall_hook or an uninstall.php file.
-
Update zh_TW Language Pack for 1.2.1
-
Default behaviour
Hey @duanestorey, just had a quick read through the code. Looking at [function modifyUserAgent()](https://github.com/wp-privacy/wp-api-privacy/blob/main/src/api-privacy.php#L107) am I right to understand that by default (with privacy options turned off) it _mimics_ WordPress' default behaviour? If so, I'm wondering about your reasoning behind this. Would not it be easier (maybe even expected) to leave $params unchanged by default, instead of maintaining the mimicking?
-
Working with Git Updater
Hey @duanestorey! I didn’t want to hijack another issue but I saw you had a question about Git Updater and branches. Yes, you can use Git Updater to seamlessly switch between repository branches. Lots of information at https://git-updater.com and you can always ping me 😉
-
Added tr_TR language
-
Fatal Error from the GitHub Updater script
Hello, I've run into an issue with the plugin, specifically the GitHub Updater; it placed my site into maintenance. After doing some digging, I came across a PHP Fatal Error in regard to this line: https://github.com/wp-privacy/wp-api-privacy/blob/935a96779315b930111903c16fcc0317c0226397/src/github-updater.php#L177C21-L177C118 ``` PHP Fatal error: Uncaught Error: Attempt to assign property "tag_name" on string ``` ```php if ( $release->tag_name = $latestVersion && $release->target_commitish == $this->githubBranch ) { ``` Changing it to the following seems to have fixed the issue: ```php if ( $release->tag_name == $latestVersion && $release->target_commitish == $this->githubBranch ) { ```
-
Investigate issue with Git Updater
There might be a potential conflict between the update mechanism of the plugin, and Git Updater.
-
Updated zh_TW language pack for 1.1.7
-
Persian Language
-
Update zh_TW language pack for 1.1.5 new strings
-
Maybe add plugin action link for settings screen
Has this been omitted on purpose or is it on the todo list? I can open a PR if the latter. To be clear, by action link I mean a link added through this: https://developer.wordpress.org/reference/hooks/plugin_action_links_plugin_file/
-
PHP Fatal Error when "network activated"
2024-11-09 10:26:53.317011 [NOTICE] [3470] [T0] [89.0.208.206:59913-H3:A6D493F0EF36D8B3-88#APVH_praetor.eu:443] [STDERR] PHP Fatal error: Uncaught Error: Call to undefined function wp_get_current_user() in /var/www/[...]/wp-includes/capabilities.php:911 Stack trace: #0 /var/www/[...]/wp-admin/network/settings.php(16): current_user_can() #1 /var/www/[...]/wp-content/plugins/wp-api-privacy/src/api-privacy.php(11): require_once('...') #2 /var/www/[...]/wp-content/plugins/wp-api-privacy/wp-api-privacy.php(30): require_once('...') #3 /var/www/[...]/wp-settings.php(471): include_once('...') #4 /var/www/[...]/wp-config.php(148): require_once('...') #5 /var/www/[...]/wp-load.php(55): require_once('...') #6 /var/www/[...]/wp-admin/admin.php(34): require_once('...') #7 /var/www/[...]/wp-admin/network/admin.php(13): require_once('...') #8 /var/www/[...]/wp-admin/network/index.php(11): require_once('...') #9 {main} thrown in /var/www/[...]/wp-includes/capabilities.php on line 911 The error only appears in Network Admin.
-
Improve I18N Issues
1. Make UI strings' I18N code meet the standard. 2. Update the zh_TW language pack for the new UI strings.
-
Some misspelled URI strings in the plugin's main file
This is a really cool project @duanestorey and thanks for sharing it with the community! Just a quick note that it appears there are some misspelled URI strings: https://github.com/wp-privacy/wp-api-privacy/blob/main/wp-api-privacy.php These lines are missing a `-` (dash) it seems: ``` Plugin URI: https://github.com/wpprivacy/wp-api-privacy Update URI: https://github.com/wpprivacy/wp-api-privacy ``` Also if possible I might suggest adding the following 2 lines to the plugin header as well: ``` GitHub Plugin URI: wp-privacy/wp-api-privacy Primary Branch: main ``` Even though you're not using Git Updater, these lines could allow other projects like Git Updater or my own RepoMan to more easily identify the plugin as being hosted on GitHub, and I don't think it would conflict with your own mechanism. Or if you have another idea about how GitHub-based plugins could identify themselves, I'm asking around...
-
Discussion - count of modifications
Thoughts on creating a simple 'setting' that could toggle on or off the counting of times the "modifyCurl" has run ? It might be interesting for people to see a count of how much data is sent to WP. Figuring out where to store those counts (transients, in memory/redis cache) could impact page render speed, but it might be interesting to be able to see this plugin 'in action'.
-
zh_TW language pack from qualified translator
1. My bio [here](https://profiles.wordpress.org/alexclassroom/#content-translations). 2. zh_TW screenshot ![alexlion me - 20241108 - 223724](https://github.com/user-attachments/assets/2af0b86b-417b-40dc-9b36-6fb37a70f04f)
-
Maybe use composer/installers to allow for custom install path when using composer
I tried to install wp-api-privacy in a WordPress setup that is managed by composer *in its whole* (a Bedrock installation) and has a single composer.json (at the root dir). This is not possible at the moment, but it would be possible if wp-api-privacy required composer/installers (I believe that’s how it works). https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md https://github.com/composer/installers Cheers!
-
Discussion - poisoning of data
Instead of simply removing or preventing the information from being sent, thoughts on a setting that could be toggled on or off that would cause the information to be "poisoned" - the data would be replaced with incorrect or random (Faker) data. By injecting decoy/random information into the transmitted data, the gathering of the data would be less useful or entirely unusable.
-
Fix use of $plugin instead of $theme
Inside the block for stripping theme data, the code uses `$plugin->UpdateURI` instead of `$theme->UpdateURI`
-
Plugin won’t update while WP API Privacy is active
A reddit user mentioned that the AIOS plugin won’t update when WP API Privacy is active. Here is the subbredit thread: https://www.reddit.com/r/Wordpress/comments/1glzjpy/today_i_learned_that_wordpress_sends_your_site/lvykukh/
Signing Authority
This plugin has designated a signing authority for all future ZIP file releases. That means in the near future, when you download a ZIP file, it will be verified cryptographically using information provided by the designated website, https://plugins.duanestorey.com.
If you are a plugin or theme author, this information is provided in the main Plugin of Theme file, using the Authority: header.
Hash Verification
ZIP files downloaded via this site have an associated SHA256 hash.
Mac
On Mac, you can use the sha256 command to calculate the hash of a downloaded ZIP file. Open terminal and execute:
sha256 [filename]
Where [filename] is the name of the ZIP file. If the hash matches the one on the website, the ZIP file is genuine.
Linux
On Linux, you can use the sha256sum command to calculate the hash of a downloaded ZIP file. From a shell, execute:
sha256sum [filename]
Where [filename] is the name of the ZIP file. If the hash matches the one on the website, the ZIP file is genuine.
Latest Release
The latest official release is below.
Updater Fix
Download 1.2.341969c6a52476dd928d92f771fed0de2cdf3ea5a6132dcded2900d108f63e135
Github Repository
This project is located on Github in the repository wp-privacy/wp-api-privacy.
Star Support Project