{"id":51885,"date":"2016-11-03T13:05:05","date_gmt":"2016-11-03T13:05:05","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/well-known-uris\/"},"modified":"2016-11-03T13:20:56","modified_gmt":"2016-11-03T13:20:56","slug":"well-known-uris","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/well-known-uris\/","author":8363549,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.3","stable_tag":"trunk","tested":"4.6.30","requires":"3.5.1","requires_php":"","requires_plugins":null,"header_name":"\/well-known-uris\/","header_author":"mrose17","header_description":"","assets_banners_color":"","last_updated":"2016-11-03 13:20:56","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.14101978.de","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/well-known-uris\/","header_author_uri":"https:\/\/github.com\/brave\/wordpress-well-known","rating":0,"author_block_rating":0,"active_installs":70,"downloads":2705,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[6645,54762,125849],"plugin_category":[],"plugin_contributors":[125850,77968],"plugin_business_model":[],"class_list":["post-51885","plugin","type-plugin","status-publish","hentry","plugin_tags-discovery","plugin_tags-well-known","plugin_tags-well-known-uris","plugin_contributors-mrose17","plugin_contributors-pfefferle","plugin_committers-mrose17"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/well-known-uris.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This plugin enables \"Well-Known URIs\" support for WordPress (RFC 5785: http:\/\/tools.ietf.org\/html\/rfc5785).<\/p>\n\n<p>From the RFC:<\/p>\n\n<blockquote>\n  <p>It is increasingly common for Web-based protocols to require the\n  discovery of policy or other information about a host (\"site-wide\n  metadata\") before making a request.  For example, the Robots\n  Exclusion Protocol <a href=\"http:\/\/www.robotstxt.org\/\">http:\/\/www.robotstxt.org\/<\/a> specifies a way for\n  automated processes to obtain permission to access resources;\n  likewise, the Platform for Privacy Preferences\n  tells user-agents how to discover privacy policy beforehand.<\/p>\n  \n  <p>While there are several ways to access per-resource metadata (e.g.,\n  HTTP headers, WebDAV's PROPFIND [RFC4918]), the perceived overhead\n  (either in terms of client-perceived latency and\/or deployment\n  difficulties) associated with them often precludes their use in these\n  scenarios.<\/p>\n  \n  <p>When this happens, it is common to designate a \"well-known location\"\n  for such data, so that it can be easily located.  However, this\n  approach has the drawback of risking collisions, both with other such\n  designated \"well-known locations\" and with pre-existing resources.<\/p>\n  \n  <p>To address this, this memo defines a path prefix in HTTP(S) URIs for\n  these \"well-known locations\", \"\/.well-known\/\".  Future specifications\n  that need to define a resource for such site-wide metadata can\n  register their use to avoid collisions and minimise impingement upon\n  sites' URI space.<\/p>\n<\/blockquote>\n\n<p>You will need 'manage_options' capability in order to use the Settings\npage for this plugin.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>well-known<\/code>-folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the <em>Plugins<\/em> menu in WordPress<\/li>\n<li><p>If you wish to define one or more Well-Known URIs that return static output,\ngo to <em>Settings &gt; Well-Known URIs<\/em> and define them, e.g.<\/p>\n\n<pre><code>Path: \/.well-known\/\nrobots.txt\n\nContent-Type:\ntext\/plain; charset=utf-8\n\nURI contents:\nUser-agent: *\nAllow: \/\n<\/code><\/pre><\/li>\n<li>If you want to configure a Well-Known URI that returns dynamic output,\nfirst, edit the plugin source to define a function invoked by\n   do_action for the action <code>\"well_known_uri_\" + $path<\/code>. That function\nwill be invoked when <code>\/.well-known\/${path}<\/code> is requested.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='how%20can%20i%20define%20a%20well-known%20uri%3F'><h3>How can I define a well-known uri?<\/h3><\/dt>\n<dd><p>Set a callback for an URI (e.g., \"\/.well-known\/robots.txt\"),\nidentified by <code>\"well_known_uri_\" + $path<\/code> (e.g., <code>\"well_known_uri_robots.txt\"<\/code>).<\/p>\n\n<pre><code>    add_action('well_known_uri_robots.txt', 'robots_txt');\n<\/code><\/pre>\n\n<p>In the callback, do whatever processing is appropriate, e.g.,<\/p>\n\n<pre><code>    function robots_txt($query) {\n          header('Content-Type: text\/plain; charset=' . get_option('blog_charset'), TRUE);\n          echo \"User-agent: *\";\n          echo \"Allow: \/\";\n\n          exit;\n        }\n<\/code><\/pre>\n\n<p>This code defines a URI that returns static output, as shown in Step 3 above.\n(For static output, you will want to use <em>Settings &gt; Well-Known URIs<\/em> page to\navoid writing any code.)<\/p><\/dd>\n<dt id='is%20there%20an%20implementation%20where%20i%20can%20write%20off%3F'><h3>Is there an implementation where I can write off?<\/h3><\/dt>\n<dd><p>Yes, you can find an example plugin, which defines a Well-Known URI,\nhere: http:\/\/wordpress.org\/extend\/plugins\/host-meta\/<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Fork from the original -- https:\/\/wordpress.org\/plugins\/well-known\/ --\nmany thanks to https:\/\/profiles.wordpress.org\/pfefferle\/ for the\nexcellent plugin!<\/li>\n<\/ul>","raw_excerpt":"&quot;Well-Known URIs&quot; for WordPress!","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/51885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=51885"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mrose17"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=51885"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=51885"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=51885"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=51885"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=51885"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=51885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}