PHPackages                             joanrodas/plubo-routes - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. joanrodas/plubo-routes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

joanrodas/plubo-routes
======================

WordPress routes made simple.

v0.8.0(2mo ago)142.8k↓100%[1 PRs](https://github.com/joanrodas/plubo-routes/pulls)GPL-3.0+PHPPHP &gt;=7.4

Since Apr 7Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/joanrodas/plubo-routes)[ Packagist](https://packagist.org/packages/joanrodas/plubo-routes)[ Docs](https://github.com/joanrodas/plubo-routes)[ Fund](https://ko-fi.com/joanrodas)[ RSS](/packages/joanrodas-plubo-routes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (35)Used By (0)

 [![Plubo Routes](https://github.com/joanrodas/plubo-docs/raw/main/src/.vuepress/public/images/plubo-routes-banner.png?raw=true)](https://github.com/joanrodas/plubo-docs/blob/main/src/.vuepress/public/images/plubo-routes-banner.png?raw=true)

[![GitHub stars](https://camo.githubusercontent.com/ff959cf47a49678bc1109aa48e9734afdcc10d75368013dc0f680c667a3c7f16/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f616e726f6461732f706c75626f2d726f757465733f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/plubo-routes/stargazers)[![Code Climate maintainability](https://camo.githubusercontent.com/896c722f2dec7d74a67ef5970d24bec31565d9792d48e683758dfa6b970306c3/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792d70657263656e746167652f6a6f616e726f6461732f706c75626f2d726f757465733f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/896c722f2dec7d74a67ef5970d24bec31565d9792d48e683758dfa6b970306c3/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792d70657263656e746167652f6a6f616e726f6461732f706c75626f2d726f757465733f7374796c653d666f722d7468652d6261646765)

WordPress routes made simple.

✔️ No need to write rewrite rules and tags manually
✔️ Automatically flush rewrite rules when the routes change
✔️ Custom redirects and action routes
✔️ Easily extendable with hooks
✔️ Easy to use with Sage 10

Getting started
---------------

[](#getting-started)

`composer require joanrodas/plubo-routes`

> You can also install Plubo Routes as a standalone WordPress plugin, simply downloading the zip and placing it in the plugins folder.

[Read the Docs](https://www.plubo.dev/docs/routing/)

Adding new routes
-----------------

[](#adding-new-routes)

There are different types of routes:

- [Route (template)](https://www.plubo.dev/docs/routing/)
- [RedirectRoute](https://www.plubo.dev/docs/routing/redirect-routes.html)
- [ActionRoute](https://www.plubo.dev/docs/routing/action-routes.html)
- [PageRoute](https://www.plubo.dev/docs/routing/page-routes.html)

How to add a new route
----------------------

[](#how-to-add-a-new-route)

You can add new routes using the following filter:

```
PluboRoutes\RoutesProcessor::init();

add_filter( 'plubo/routes', array($this, 'add_routes') );
public function add_routes( $routes ) {
    //Your routes
    return $routes;
}
```

Basic routes
------------

[](#basic-routes)

Basic routes take 3 parameters:

ParameterType**Route Path**String**Template file name**String | Callable**Config**Array (optional)Examples:

```
use PluboRoutes\Route\Route;

add_filter( 'plubo/routes', array($this, 'add_routes') );
public function add_routes( $routes ) {
    $routes[] = new Route('clients/list', 'template_name');

    //SAGE 10 example
    $routes[] = new Route(
        'dashboard/{subpage:slug}',
        function($matches) {
            $subpage = 'dashboard/' . $matches['subpage'];
            return locate_template( app('sage.finder')->locate($subpage) );
        },
        [
            'name' => 'my-route'
        ]
    );
    return $routes;
}
```

Available syntax
----------------

[](#available-syntax)

You can use the format ***{variable\_name:type}*** with any of the available types:

- number (numbers only)
- word (a-Z only)
- slug (a valid WordPress slug)
- date (yyyy-mm-dd date)
- year (4 digits)
- month (01-12)
- day (01-31)
- digit (single digit 0-9)
- jwt (JWT token)
- ip (IPv4)

> You can also use custom regex patterns using the format ***{variable\_name:regex\_pattern}*** like ***{author:(\[a-z0-9-\]+)}***

Changing general template path
------------------------------

[](#changing-general-template-path)

By default, Plubo Routes will search the template inside your theme, but you can use a hook to chenge the default path.

If you use Sage 10, you could add something like this:

```
add_filter( 'plubo/template', function($template) {
    return app('sage.finder')->locate($template);
});
```

Custom Actions
--------------

[](#custom-actions)

Named routes provide a hook to execute your custom actions:

```
add_action('plubo/route_{route_name}', function($matches) {
    //Do something
});
```

Contributions
-------------

[](#contributions)

[![contributions welcome](https://camo.githubusercontent.com/0af13358db374a6151b58b9c4a052888205edd34b8d4f8f42a3e9f35b3a018bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/plubo-routes/issues)[![GitHub issues](https://camo.githubusercontent.com/3b8a98c0294cadd1934f21fc6721f3bdc028c6b40ef86fd912e3b6cbfb664929/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6a6f616e726f6461732f706c75626f2d726f757465733f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/plubo-routes/issues)[![GitHub license](https://camo.githubusercontent.com/d538de222e63c012bd4210fe33960aead683ea8efdefd516ba33082688abfa25/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f616e726f6461732f706c75626f2d726f757465733f7374796c653d666f722d7468652d6261646765)](https://github.com/joanrodas/plubo-routes/blob/main/LICENSE)

Feel free to contribute to the project, suggesting improvements, reporting bugs and coding.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.1% 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

Every ~46 days

Recently: every ~92 days

Total

32

Last Release

61d ago

PHP version history (2 changes)v0.1.0PHP &gt;=7.4

v0.5.6PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5029e0ad5278b4e3cdd5cebcc2ae0d2cb93698cd76f4afeb5fcc831ab1dfda10?d=identicon)[joanrodas](/maintainers/joanrodas)

---

Top Contributors

[![joanrodas](https://avatars.githubusercontent.com/u/47475754?v=4)](https://github.com/joanrodas "joanrodas (153 commits)")[![Albert-Sirvelia](https://avatars.githubusercontent.com/u/99665859?v=4)](https://github.com/Albert-Sirvelia "Albert-Sirvelia (2 commits)")[![renovate-bot](https://avatars.githubusercontent.com/u/25180681?v=4)](https://github.com/renovate-bot "renovate-bot (1 commits)")

---

Tags

composercomposer-packagepluginrewrite-rulesroutesroutingwordpresswordpress-php-librarywordpress-pluginpluginwordpressroutesroutingwp

### Embed Badge

![Health badge](/badges/joanrodas-plubo-routes/health.svg)

```
[![Health](https://phpackages.com/badges/joanrodas-plubo-routes/health.svg)](https://phpackages.com/packages/joanrodas-plubo-routes)
```

###  Alternatives

[ffraenz/private-composer-installer

A composer install helper for private packages

2331.7M5](/packages/ffraenz-private-composer-installer)[philippbaschke/acf-pro-installer

An install helper for Advanced Custom Fields PRO

283724.6k](/packages/philippbaschke-acf-pro-installer)[balbuf/composer-wp

Manage WordPress core, plugins, and themes with composer.

173.6k](/packages/balbuf-composer-wp)

PHPackages © 2026

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