PHPackages                             oberonlai/wp-router - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. oberonlai/wp-router

ActiveLibrary

oberonlai/wp-router
===================

Adding router for WordPress.

v1.0.0(4y ago)210MITPHPPHP &gt;=7.2

Since Jul 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/oberonlai/wp-router)[ Packagist](https://packagist.org/packages/oberonlai/wp-router)[ Docs](https://github.com/oberonlai/wp-router)[ RSS](/packages/oberonlai-wp-router/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

WP Router v1.0
==============

[](#wp-router-v10)

Easily add custom URL endpoints in WordPress. Map a url to a function. Modifed from [wordpress-dispatcher](https://github.com/tim-field/wordpress-dispatcher)

Requirements
------------

[](#requirements)

- PHP &gt;=7.2
- [Composer](https://getcomposer.org/)
- [WordPress](https://wordpress.org) &gt;=5.4

Installation
------------

[](#installation)

#### Install with composer

[](#install-with-composer)

Run the following in your terminal to install with [Composer](https://getcomposer.org/).

```
$ composer require oberonlai/wp-router

```

WP Router [PSR-4](https://www.php-fig.org/psr/psr-4/) autoloading and can be used with the Composer's autoloader. Below is a basic example of getting started, though your setup may be different depending on how you are using Composer.

```
require __DIR__ . '/vendor/autoload.php';

use ODS\Router;

Router::routes( array() );
```

See Composer's [basic usage](https://getcomposer.org/doc/01-basic-usage.md#autoloading) guide for details on working with Composer and autoloading.

Example
-------

[](#example)

```
use ODS\Router;

Router::routes(
	array (
		'testing-a-url' => function(){
		    echo 'Hello Ted';
		},

		'hello-([a-z]+)' => function($request, $name){
		    echo "Hello $name";
		}
	)
);
```

/testing-a-url &amp; /hello-dougle will now be accessable in your WordPress site.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1752d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1587136?v=4)[Oberon Lai](/maintainers/oberonlai)[@oberonlai](https://github.com/oberonlai)

---

Top Contributors

[![oberonlai](https://avatars.githubusercontent.com/u/1587136?v=4)](https://github.com/oberonlai "oberonlai (1 commits)")

### Embed Badge

![Health badge](/badges/oberonlai-wp-router/health.svg)

```
[![Health](https://phpackages.com/badges/oberonlai-wp-router/health.svg)](https://phpackages.com/packages/oberonlai-wp-router)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
