PHPackages                             badcow/shortcodes - 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. badcow/shortcodes

ActiveLibrary

badcow/shortcodes
=================

1132.7k↓32%PHP

Since Apr 5Pushed 11y ago2 watchersCompare

[ Source](https://github.com/Badcow/Shortcodes)[ Packagist](https://packagist.org/packages/badcow/shortcodes)[ RSS](/packages/badcow-shortcodes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Badcow Shortcodes
=================

[](#badcow-shortcodes)

This is a port of WordPress' brilliant shortcode feature for use outside of WordPress. The code has remained largely unchanged.

The purpose of this project is to use the familiar WordPress shortcode syntax in any system.

Basic Usage
-----------

[](#basic-usage)

```
$shortcodes = new Badcow\Shortcodes\Shortcodes;
$shortcodes->addShortcode('hello', function ($attributes, $content, $tagName) {
    return $attributes['greeting'] . ', ' . $content;
});

echo $shortcodes->process('My shortcode does this: [hello greeting="Konnichiwa"]world![/hello]');

```

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

[](#installation)

Use [Composer](http://getcomposer.org/). That's what all the cool kids use.

```
"require" : { "badcow/shortcodes": "dev-master" }

```

Running Tests
-------------

[](#running-tests)

```
phpunit /path/to/shortcodes

```

Build Status
------------

[](#build-status)

[![Build Status](https://camo.githubusercontent.com/c106884a737e2b2537ffdbb5d5bac79406778258e41d68058920c507e8aa9b6b/68747470733a2f2f7472617669732d63692e6f72672f426164636f772f53686f7274636f6465732e706e67)](https://travis-ci.org/Badcow/Shortcodes)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community8

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dd5f6a3443d2ee5f0121397886a0141ba4f462d1a9686ba613de2815726b62f?d=identicon)[samuelwilliams](/maintainers/samuelwilliams)

---

Top Contributors

[![samuelwilliams](https://avatars.githubusercontent.com/u/806430?v=4)](https://github.com/samuelwilliams "samuelwilliams (12 commits)")

### Embed Badge

![Health badge](/badges/badcow-shortcodes/health.svg)

```
[![Health](https://phpackages.com/badges/badcow-shortcodes/health.svg)](https://phpackages.com/packages/badcow-shortcodes)
```

PHPackages © 2026

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