Skip to content

Commit

Permalink
beeing more php compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle committed Jan 14, 2014
1 parent adf7152 commit 0d8bbd3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 11 deletions.
14 changes: 7 additions & 7 deletions plugin.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: /.well-known/
Plugin URI: http://wordpress.org/extend/plugins/well-known/
Description: This plugin enables "Well-Known URIs" support for WordPress (RFC 5785: http://tools.ietf.org/html/rfc5785).
Version: 1.0.0
Version: 1.0.1
Author: pfefferle
Author URI: http://notizblog.org/
*/
Expand All @@ -14,14 +14,14 @@
* @author Matthias Pfefferle
*/
class WellKnownPlugin {

/**
* Add 'well-known' as a valid query variables.
*
* @param array $vars
* @return array
*/
public function query_vars($vars) {
public static function query_vars($vars) {
$vars[] = 'well-known';

return $vars;
Expand All @@ -32,7 +32,7 @@ public function query_vars($vars) {
*
* @param WP_Rewrite $wp_rewrite
*/
public function rewrite_rules($wp_rewrite) {
public static function rewrite_rules($wp_rewrite) {
$well_known_rules = array(
'.well-known/(.+)' => 'index.php?well-known='.$wp_rewrite->preg_index(1),
);
Expand All @@ -45,10 +45,10 @@ public function rewrite_rules($wp_rewrite) {
*
* @param WP $wp
*/
public function delegate_request($wp) {
public static function delegate_request($wp) {
if (array_key_exists('well-known', $wp->query_vars)) {
$id = $wp->query_vars['well-known'];

do_action("well-known", $wp->query_vars);
do_action("well_known_{$id}", $wp->query_vars);
}
Expand All @@ -58,6 +58,6 @@ public function delegate_request($wp) {
add_filter('query_vars', array('WellKnownPlugin', 'query_vars'));
add_action('parse_request', array('WellKnownPlugin', 'delegate_request'), 99);
add_action('generate_rewrite_rules', array('WellKnownPlugin', 'rewrite_rules'), 99);

register_activation_hook(__FILE__, 'flush_rewrite_rules');
register_deactivation_hook(__FILE__, 'flush_rewrite_rules');
28 changes: 24 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== /.well-known/ ===
Contributors: pfefferle
Donate link: http://www.14101978.de
Tags: OpenID, XRD, well-known, XML, Discovery
Tags: well-known, discovery
Requires at least: 3.5.1
Tested up to: 3.2
Stable tag: 1.0.0
Tested up to: 3.8
Stable tag: 1.0.1

This plugin enables "Well-Known URIs" support for WordPress

Expand Down Expand Up @@ -40,25 +40,45 @@ From the RFC:
sites' URI space.

== Changelog ==

= 0.6.2 =

* bug fix

= 0.6.0 =

* refactored the code

= 0.5.1 =

* fixed some php-warnings

= 0.5 =

* better action/filter

= 0.4 =

* some improvements for host-meta (jrd)

= 0.3 =

* adding well-known uris a bit more wordpress-like

= 0.2.1.1 =

* Ooops, copy&paste bug

= 0.2.1 =

* Forgot to flush the rewrite rules

= 0.2 =

* Better doku

= 0.1 =

* Initial release

== Installation ==
Expand All @@ -84,7 +104,7 @@ Print robots.txt:
header('Content-Type: text/plain; charset=' . get_option('blog_charset'), true);
echo "User-agent: *";
echo "Allow: /";

exit;
}`

Expand Down

0 comments on commit 0d8bbd3

Please sign in to comment.