The WordPress user agent is set in the class WP_Http
as
'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
You can set it to a (secret) fixed value per filter:
add_filter( 'http_headers_useragent', 'wpse_59788_user_agent' );
function wpse_59788_user_agent()
{
// to remove this filter immediately uncomment the following line
// remove_filter( current_filter(), __FUNCTION__ );
return 'alfgjlkgjlkgjsldkjhrkjh';
}
To change the user agent for a plugin upgrade only try something like this (not tested):
add_filter( 'upgrader_pre_install', 'wpse_59788_register' );
function wpse_59788_register( $dummy )
{
add_filter( 'http_headers_useragent', 'wpse_59788_user_agent' );
return $dummy;
}
And uncomment the self deactivation line in the first function.
Related Posts:
- Plugin Form Submission Best Practice
- WP 3.3 How to Add Menu Items to the Admin Bar?
- Unit tests – Dealing with dependencies
- Should I create a theme or a plugin?
- How should you hook a session_start() when authoring a plugin?
- Which to use to execute code during the saving of a plugin settings page?
- How to get vim to autocomplete WordPress API functions?
- Overwriting Core WordPress Functions with Plugins
- How do I make specific plugin functionality apply to different sites in a network?
- How do I handle multiple Submit buttons in plugin’s option page?
- What is a settings group actually for?
- add_meta_box() to Category Edit Screen?
- The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache
- How does gettext works for translating readme file of plugin?
- How to properly load text domain of custom mu plugin
- How to add multiple copies of a widget from “available widgets”
- How to add quick edit and bulk edit fields to users admin section
- How do I approach removing menu items on the fly based on settings in my plugin?
- Can I use core’s “or Link to Existing Content” feature in my plugin?
- Plugin with specific admin menu icon
- What does $_registered_pages do?
- How do I change the initial quantity of a product in woocommerce?
- Redirect traffic to plugin
- How to Download and install plugin database remotely
- Should I always prefer esc_attr_e & esc_html_e instead of _e?
- How to insert data to a database table when the field is not yet created?
- using new WP_Query in save_post function alters $post
- Preview Changes button missing on custom post type page since updating to 3.4
- Show special field when correct shipping is chosen
- Custom Taxonomy to dropdown box on adminside wordpress
- WP_Editor – Saving Value into Plugin Option – Stripping HTML
- On cliking add new post redirect user to a custom page first
- How To Consistently Enforce Rewrite Rule in Plugin Development
- Warning: Cannot modify header information – How to resolve this issue? [closed]
- $paged always 0 on plugin’s custom page
- Create a new post using rest api and save featured image using an external image url
- wp.template() returns tags in Ajax response
- How to restrict access to image folder depending on whether product is purchased or not?
- Caching the_content calls
- Is there a way in which I can compare product id with the order id to display content on front end before placing the order? [closed]
- Video Security just like facebook [closed]
- How to hide or rename “X” and “x-child” references in website source?
- Link Pop-up in custom plugin
- How to handle shortcodes through plugin
- Run a function when new image is uploaded in media library
- Setting up Version Control for WordPress plugin development
- Ajax submit result opens in admin-ajax.php
- WordPress debug messages not displaying
- get author of published post
- Error passing post_content to function
- PHP File_exist() not working – Checking if File Exist in WordPress Theme Directory
- How to access all array values from do_action_ref_array()?
- Add a check box in Menu Settings
- How to register my code as a plugin
- Is there any way to fire heartbeat API from for website visitors?
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Cannot stop wpautop from messing up my plug-in output
- How can I prevent ‘500 internal server error’ because of a long install process?
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Update product prices from remote file
- Displaying custom content from a plugin within the active theme
- Using wp_mail to send email?
- Which wp plugin can use Create, Edit and Delete Email address from WordPress Dashboard
- product-attribute-slug-is-too-long-28-characters-max
- Custom plugin & calling REST api of wordpress instance the plugins is running on
- Add variables from rewrite rules to query var
- Limit get_next_post to posts from the same author
- Show list of categories that has posts with different taxonomies
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- Any way, hook to add content right before the “read more” link?
- How do I specify where to save the debug.log?
- How do I ensure I can loop through every enqueued script and CSS?
- What is the source of the $post_id in a hook argument?
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Plugins Settings page not updating
- TinyMCE 4.7.11 – Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)
- Code for cron to delete posts that contain specific expression (e.g. “unable to fetch” every 30 minutes
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- Use content filter on the post that is password-protected
- WordPress filter custom posts by multi terms of of a taxonomy
- foreach argument to get specific file types getting too many returns
- How to fetch the post content from the wordpress editor before it can be saved(published)?
- pull data from wordpress database
- How does one set cookies in WordPress without getting the ‘headers not sent’ error? within WP
- Filter the_content() to add custom figure tags
- Glyphicons Dont Show in WordPress Plugin Only
- Return all roles, including custom roles
- Change the search results header from plugin
- Mapping multiple URLs to same page
- Installing plugins on installation/activation
- Add query string variables to all hyperlinks URL matching a specified domain
- Virtual Page with Registration form
- Is there such a thing as a WordPress console?
- Loading jQuery library from WordPress admin
- WooCommerce adds a newline symbol (\n) between email recipients
- Upload to a specific media folder created by FileBird Lite
- Allow HTML in product attributes and variation for WooCommerce
- How do I modify the error code array used by “shake_error_codes” filter?
- How do I add multiple custom menu Woo-commerce my account page?