pax_global_header 0000666 0000000 0000000 00000000064 12552272565 0014525 g ustar 00root root 0000000 0000000 52 comment=dd8fee805fd09cc8ba1ece7f8f9ca5d95d654da8
wordpress-xrds-simple-1.2/ 0000775 0000000 0000000 00000000000 12552272565 0015664 5 ustar 00root root 0000000 0000000 wordpress-xrds-simple-1.2/LICENSE 0000664 0000000 0000000 00000002047 12552272565 0016674 0 ustar 00root root 0000000 0000000 Copyright (c) 2008 Stephen Paul Weber.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
wordpress-xrds-simple-1.2/readme.txt 0000664 0000000 0000000 00000003343 12552272565 0017665 0 ustar 00root root 0000000 0000000 === XRDS-Simple ===
Contributors: singpolyma, wnorris, pfefferle
Tags: xrds, xrds-simple, discovery
Requires at least: 2.1
Tested up to: 4.3
Stable tag: 1.2
Provides framework for other plugins to advertise services via XRDS.
== Description ==
[XRDS-Simple][] is a profile of XRDS, a service discovery protocol which used
in the [OpenID][] authentication specification as well as [OAuth][]. This
plugin provides a generic framework to allow other plugins to contribute their
own service endpoints to be included in the XRDS service document for the
domain.
[XRDS-Simple]: https://de.wikipedia.org/wiki/XRDS#XRDS_Simple
[OpenID]: http://openid.net/
[OAuth]: http://oauth.net/
== Installation ==
This plugin follows the [standard WordPress installation method][]:
1. Upload the `xrds-simple` folder to the `/wp-content/plugins/` directory
1. Activate the plugin through the 'Plugins' menu in WordPress
[standard WordPress installation method]: http://codex.wordpress.org/Managing_Plugins#Installing_Plugins
== Frequently Asked Questions ==
= How do I contribute services to the XRDS document =
Implement the filter 'xrds_simple', and see the public functions at the top of
the file.
== Changelog ==
Project maintined on github at
[diso/wordpress-xrds-simple](https://github.com/diso/wordpress-xrds-simple).
= version 1.2 (Jul 17, 2015)=
- allow 'xri://$xrds*simple' Type to be filtered out
- check if $_SERVER['HTTP_ACCEPT'] exist to avoid notice that break the xrds file
= version 1.1 (Nov 16, 2012)=
- fix various PHP and WordPress errors and warnings
- add ability to fetch plain text XRDS document (mainly for debugging. see [example](http://willnorris.com/?xrds=1&format=text))
= version 1.0 (Oct 7, 2008) =
- initial public release
wordpress-xrds-simple-1.2/xrds-simple.php 0000664 0000000 0000000 00000020760 12552272565 0020651 0 ustar 00root root 0000000 0000000 $type, 'expires' => $expires, 'services' => array());
return $xrds;
}
/**
* Convenience function for adding a new service endpoint to the XRDS structure.
*
* @param array $xrds current XRDS-Simple structure
* @param string $id ID of the XRD to add the new service to. If no XRD exists with the specified ID,
* a new one will be created.
* @param string $name human readable name of the service
* @param array $content content to be included in the service definition. Format:
*
* array(
* 'NodeName (ie, Type)' => array(
* array('attribute' => 'value', 'content' => 'content string'),
* ...
* ),
* ...
* )
*
* @param int $priority service priorty
* @return array updated XRDS-Simple structure
* @since 1.0
*/
function xrds_add_service($xrds, $xrd_id, $name, $content, $priority=10) {
if (!array_key_exists($xrd_id, $xrds) || !is_array($xrds[$xrd_id])) {
$xrds = xrds_add_xrd($xrds, $xrd_id);
}
$xrds[$xrd_id]['services'][$name] = array('priority' => $priority, 'content' => $content);
return $xrds;
}
/**
* Convenience function for adding a new service with minimal options.
* Services will always be added to the 'main' XRD with the default priority.
* No additional parameters such as httpMethod on URIs can be passed. If those
* are necessary, use xrds_add_service().
*
* @param array $xrds current XRDS-Simple structure
* @param string $name human readable name of the service
* @param mixed $type one type (string) or array of multiple types
* @param mixed $uri one URI (string) or array of multiple URIs
* @return array updated XRDS-Simple structure
* @since 1.0
*/
function xrds_add_simple_service($xrds, $name, $type, $uri) {
if (!is_array($type)) $type = array($type);
if (!is_array($uri)) $uri = array($uri);
$service = array('Type' => array(), 'URI' => array());
foreach ($type as $t) {
$service['Type'][] = array('content' => $t);
}
foreach ($uri as $u) {
$service['URI'][] = array('content' => $u);
}
return xrds_add_service($xrds, 'main', $name, $service);
}
// Private Functions
add_action('wp_head', 'xrds_meta');
add_action('parse_request', 'xrds_parse_request');
add_action('admin_menu', 'xrds_admin_menu');
add_filter('xrds_simple', 'xrds_atompub_service');
/**
* Print HTML meta tags, advertising the location of the XRDS document.
*/
function xrds_meta() {
echo ''."\n";
echo ''."\n";
}
/**
* Build the XRDS-Simple document.
*
* @return string XRDS-Simple document
*/
function xrds_write() {
$xrds = array(
'main' => array(
'type' => array('xri://$xrds*simple'),
),
);
$xrds = apply_filters('xrds_simple', $xrds);
//make sure main is last
if($xrds['main']) {
$o = $xrds['main'];
unset($xrds['main']);
$xrds['main'] = $o;
}
$xml = ''."\n";
$xml .= '
'; echo htmlentities(xrds_write()); echo ''; echo '
No registered filters.
'; } echo '