PHPackages                             barbashin-andrey/shortcode - 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. barbashin-andrey/shortcode

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

barbashin-andrey/shortcode
==========================

PHP shortcodes handler

v1.0.0(2y ago)06https://github.com/WordPress/WordPress/blob/master/wp-includes/shortcodes.php#L63PHP

Since Apr 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/barbashin-andrey/shortcode)[ Packagist](https://packagist.org/packages/barbashin-andrey/shortcode)[ RSS](/packages/barbashin-andrey-shortcode/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PHP shortcodes handler
======================

[](#php-shortcodes-handler)

Based on Wordpress sources for my personal purposes
---------------------------------------------------

[](#based-on-wordpress-sources-for-my-personal-purposes)

### Example

[](#example)

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

function sampleFunc($params) {
    $atts = $params["atts"];
    $args = $params["args"];

    $name = $atts["name"];
    $age = $args["age"];

    return "Name: $nameAge: $age";
}

$content = '
    Some other elements
    [sample name="Alex"]
    Some other elements
';

$handler = new ShortcodeHandler();
$handler->addShortcode('sample', 'sampleFunc', ['age' => 18]);

$content = $handler->handle($content);
print_r($content);

```

Result:

```
Some other elements
Name: AlexAge: 18
Some other elements

```

### Installation

[](#installation)

Via composer:

```
composer require barbashin-andrey/shortcode

```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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

802d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/151625050?v=4)[barbashin-andrey](/maintainers/barbashin-andrey)[@barbashin-andrey](https://github.com/barbashin-andrey)

---

Top Contributors

[![barbashin-andrey](https://avatars.githubusercontent.com/u/151625050?v=4)](https://github.com/barbashin-andrey "barbashin-andrey (4 commits)")

### Embed Badge

![Health badge](/badges/barbashin-andrey-shortcode/health.svg)

```
[![Health](https://phpackages.com/badges/barbashin-andrey-shortcode/health.svg)](https://phpackages.com/packages/barbashin-andrey-shortcode)
```

###  Alternatives

[dave-liddament/php-language-extensions

Attributes for extending the PHP language, using static analysis to enforce new language constructs

189552.1k4](/packages/dave-liddament-php-language-extensions)[geocoder-php/here-provider

Geocoder here adapter

131.2M3](/packages/geocoder-php-here-provider)[metrakit/faker-eddy-malou

Use Eddy Malou sentences for your dummy texts

172.7k](/packages/metrakit-faker-eddy-malou)

PHPackages © 2026

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