PHPackages                             varunsridharan/wp-endpoint - 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. [API Development](/categories/api)
4. /
5. varunsridharan/wp-endpoint

ActiveLibrary[API Development](/categories/api)

varunsridharan/wp-endpoint
==========================

Simple Lib To Handle Creation of Custom Endpoints Or Rewrites in WordPress

1.5(5y ago)6453[1 PRs](https://github.com/varunsridharan/wp-endpoint/pulls)GPL-3.0-or-laterPHP

Since Dec 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/varunsridharan/wp-endpoint)[ Packagist](https://packagist.org/packages/varunsridharan/wp-endpoint)[ Fund](https://paypal.me/varunsridharan23)[ Fund](https://www.buymeacoffee.com/varunsridharan)[ RSS](/packages/varunsridharan-wp-endpoint/feed)WikiDiscussions main Synced today

READMEChangelog (6)DependenciesVersions (8)Used By (0)

WP Endpoint
===========

[](#wp-endpoint)

Simple Lib To Handle Creation of Custom Endpoints Or Rewrites in WordPress

[![Latest Stable Version](https://camo.githubusercontent.com/19133f26a9f2daca166ca4390454c30d8bd05cbdce228d1b8e11d8576c11f3ee/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d656e64706f696e742f76657273696f6e)](https://packagist.org/packages/varunsridharan/wp-endpoint)[![Total Downloads](https://camo.githubusercontent.com/b5540a15f895825455c2761aa5f1e208fa9200363e0decae806f177657482846/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d656e64706f696e742f646f776e6c6f616473)](https://packagist.org/packages/varunsridharan/wp-endpoint)[![Latest Unstable Version](https://camo.githubusercontent.com/ecaff97e65109f269a1ce96b09e4c56c7997fe67cc3b58d816caa755940231a7/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d656e64706f696e742f762f756e737461626c65)](//packagist.org/packages/varunsridharan/wp-endpoint)[![License](https://camo.githubusercontent.com/ec1c56cabb36451e60d0bf8f4eaba2f0f22f5a1625226869a9e69493ca70d389/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d656e64706f696e742f6c6963656e7365)](https://packagist.org/packages/varunsridharan/wp-endpoint)[![composer.lock available](https://camo.githubusercontent.com/74133025e0e8cbfdabe951d84658a7455a74ea99d487a9e6b65ba28f7463e56c/68747470733a2f2f706f7365722e707567782e6f72672f766172756e73726964686172616e2f77702d656e64706f696e742f636f6d706f7365726c6f636b)](https://packagist.org/packages/varunsridharan/wp-endpoint)

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

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **WP\_EndPoint library**, simply:

```
$ composer require Varunsridharan/WP_Endpoint

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
$ composer require Varunsridharan/WP_Endpoint --prefer-source

```

You can also **clone the complete repository** with Git:

```
$ git clone https://github.com/varunsridharan/wp-endpoint.git

```

Or **install it manually**:

[Download WP\_Endpoint.php](https://raw.githubusercontent.com/varunsridharan/wp-endpoint/master/class-endpoint.php):

```
$ wget https://raw.githubusercontent.com/varunsridharan/wp-endpoint/master/class-endpoint.php

```

Usage
-----

[](#usage)

```
$vs_wp_endpoint = new \Varunsridharan\WordPress\Endpoint('customprefix');
```

### Add End Point \[ `add_endpoint( $endpoint, $endpoint_type, $callback)` \]

[](#add-end-point--add_endpoint-endpoint-endpoint_type-callback-)

```
/**
 * Adds Custom Endpoints To Endpoints Array.
 *
 * @param string       $endpoint
 * @param int          $endpoint_type
 * @param array|string $callback
 *                     if callback is a string and no function with the name then it will be triggered as action
 *
 * @example add_endpoint('hello/',EP_PAGES,'my_page_calback')
 * @example add_endpoint('world/',EP_PAGES,array(&$this,'page_callback'))
 *
 * @return $this
 */

 // With Action Trigger
 $vs_wp_endpoint->add_endpoint('myendpoint',EP_ROOT,'myendpoint_action');

 // With Function Callback
 $vs_wp_endpoint->add_endpoint('myendpoint2',EP_ROOT,'myendpoint_callback');

 // With Class Callback
 $vs_wp_endpoint->add_endpoint('myendpoint3',EP_ROOT,array('VS_CALLBACK_HANDLER','render'));

add_action('myendpoint_action','render_endpoint_page');

function render_endpoint_page($wp){
	var_dump($wp->query_vars);
}

function myendpoint_callback($wp){
	var_dump($wp->query_vars);
}

class VS_CALLBACK_HANDLER{
	public static function render($wp){
		echo 'Hi';
	}
}
```

---

### Add Rewrite Rules \[ `add_rewrite_rule( $path, $after )` \]

[](#add-rewrite-rules--add_rewrite_rule-path-after--)

```
/**
 * Adds Custom Rewrite Rules.
 *
 * @param string $path
 * @param string $after
 *
 * @return $this
 */

// Below Will Be Converted into **http://example.com/mypath/22/xxx/
$vs_wp_endpoint->add_rewrite_rule('mypath/{user_id}/{user_name}','top');

// Below Will Be Converted into **http://example.com/welcome/EICAUTPPWICAASJEJNCA/
$vs_wp_endpoint->add_rewrite_rule('welcome/{verify_id}','top');
```

---

📝 Changelog
-----------

[](#-changelog)

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[Checkout CHANGELOG.md](https://github.com/varunsridharan/wp-endpoint/blob/main/CHANGELOG.md)

🤝 Contributing
--------------

[](#-contributing)

If you would like to help, please take a look at the list of [issues](https://github.com/varunsridharan/wp-endpoint/issues/).

📜 License &amp; Conduct
-----------------------

[](#--license--conduct)

- [**GNU General Public License v3.0**](https://github.com/varunsridharan/wp-endpoint/blob/main/LICENSE) © [Varun Sridharan](website)
- [Code of Conduct](https://github.com/varunsridharan/.github/blob/main/CODE_OF_CONDUCT.md)

📣 Feedback
----------

[](#-feedback)

- ⭐ This repository if this project helped you! 😉
- Create An [🔧 Issue](https://github.com/varunsridharan/wp-endpoint/issues/) if you need help / found a bug

💰 Sponsor
---------

[](#-sponsor)

[I](https://sva.onl/twitter/) fell in love with open-source in 2013 and there has been no looking back since! You can read more about me [here](https://sva.onl/website/). If you, or your company, use any of my projects or like what I’m doing, kindly consider backing me. I'm in this for the long run.

- ☕ How about we get to know each other over coffee? Buy me a cup for just [**$9.99**](https://sva.onl/buymeacoffee)
- ☕️☕️ How about buying me just 2 cups of coffee each month? You can do that for as little as [**$9.99**](https://sva.onl/buymeacoffee)
- 🔰 We love bettering open-source projects. Support 1-hour of open-source maintenance for [**$24.99 one-time?**](https://sva.onl/paypal)
- 🚀 Love open-source tools? Me too! How about supporting one hour of open-source development for just [**$49.99 one-time ?**](https://sva.onl/paypal)

Connect &amp; Say 👋
-------------------

[](#connect--say-)

- **Follow** me on [👨‍💻 Github](https://sva.onl/github/) and stay updated on free and open-source software
- **Follow** me on [🐦 Twitter](https://sva.onl/twitter/) to get updates on my latest open source projects
- **Message** me on [📠 Telegram](https://sva.onl/telegram/)
- **Follow** my pet on [Instagram](https://www.instagram.com/sofythelabrador/) for some *dog-tastic* updates!

---

*Built With ♥ By [Varun Sridharan](https://sva.onl/twitter) [ ![](https://camo.githubusercontent.com/ac180da7a81f72a639abce09c4827e7bacfdd3b82586b657387a7f84430c7b7f/68747470733a2f2f63646e2e73766172756e2e6465762f666c61672d696e6469612e6a7067)](https://en.wikipedia.org/wiki/India)*

 [![](https://camo.githubusercontent.com/51991d58f40dac784a0c08b9c5c16c66c59ef5bdf083e3d49e4f617ef98e03ee/68747470733a2f2f63646e2e73766172756e2e6465762f636f64656973706f657472792e706e67)](https://camo.githubusercontent.com/51991d58f40dac784a0c08b9c5c16c66c59ef5bdf083e3d49e4f617ef98e03ee/68747470733a2f2f63646e2e73766172756e2e6465762f636f64656973706f657472792e706e67)

---

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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

Every ~169 days

Recently: every ~211 days

Total

6

Last Release

1857d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/522dc9d037e4b0517ee9b76cd63d75a6331b0e578afa9b27fee84b02863ace80?d=identicon)[varunsridharan](/maintainers/varunsridharan)

---

Top Contributors

[![varunsridharan](https://avatars.githubusercontent.com/u/1884287?v=4)](https://github.com/varunsridharan "varunsridharan (26 commits)")

---

Tags

composerphprewritesvsp-libswordpresswordpress-developmentwordpress-development-kitwordpress-endpointwordpress-librarywordpress-php-librarywordpress-pluginwordpress-plugin-addonwordpress-plugin-developmentwordpress-plugin-librarywordpress-pluginswordpress-routerwp-endpointwp-libraryphpwordpresswordpress pluginwordpress-librarywordpress-developmentwordpress-pluginswordpress plugin developmentrewriteswordpress-plugin-librarywordpress-php-libraryvsp-libswordpress-routerwordpress-plugin-addonwordpress-endpointwordpress-development-kitwp-endpoint

### Embed Badge

![Health badge](/badges/varunsridharan-wp-endpoint/health.svg)

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

###  Alternatives

[varunsridharan/wp-dependencies

Provides Function To Check if a plugin is active/inactive &amp; function to compare versions.

1032.5k1](/packages/varunsridharan-wp-dependencies)[madeitbelgium/wordpress-php-sdk

WordPress Laravel PHP SDK

4422.9k1](/packages/madeitbelgium-wordpress-php-sdk)[renakdup/simple-dic

Simple DI Container with autowiring for your WordPress application with NO dependencies.

101.8k1](/packages/renakdup-simple-dic)

PHPackages © 2026

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