PHPackages                             philipnewcomer/linkify-tracking - 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. philipnewcomer/linkify-tracking

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

philipnewcomer/linkify-tracking
===============================

Linkifies package tracking numbers for DHL, FedEx, UPS, and USPS

2.0.0(4y ago)648.1k↓82.4%2[6 issues](https://github.com/philipnewcomer/linkify-tracking/issues)GPL-3.0PHP

Since May 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/philipnewcomer/linkify-tracking)[ Packagist](https://packagist.org/packages/philipnewcomer/linkify-tracking)[ RSS](/packages/philipnewcomer-linkify-tracking/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

linkify-tracking
================

[](#linkify-tracking)

Linkifies package tracking numbers for DHL, FedEx, Royal Mail (UK), UPS, and USPS.

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

[](#installation)

```
composer require philipnewcomer/linkify-tracking

```

Usage
-----

[](#usage)

First instantiate an instance of the library:

```
$linkifyTracking = new PhilipNewcomer\LinkifyTracking\LinkifyTracking;
```

### Get the tracking URL for a single tracking number

[](#get-the-tracking-url-for-a-single-tracking-number)

```
$linkifyTracking->getLinkUrl('12345678901234567890');
```

Result:

```
https://tools.usps.com/go/TrackConfirmAction?tLabels=12345678901234567890

```

### Get the link data for a single tracking number

[](#get-the-link-data-for-a-single-tracking-number)

```
$linkifyTracking->getLinkData('12345678901234567890');
```

Result:

```
[
    'carrier' => 'USPS',
    'url' => 'https://tools.usps.com/go/TrackConfirmAction?tLabels=12345678901234567890'
]
```

### Convert all tracking numbers in the given content to HTML links

[](#convert-all-tracking-numbers-in-the-given-content-to-html-links)

```
$content = '
Here is a tracking number: 12345678901234567890
And another tracking number: 12345678901234567890
';
$linkifyTracking->linkify($content)
```

Result:

```
Here is a tracking number: 12345678901234567890
And another tracking number: 12345678901234567890
```

Configuration
-------------

[](#configuration)

Configuration arguments may be passed to the `LinkifyTracking` constructor.

The following arguments may be provided:

- `linkAttributes`: An array of attributes which should be added to the generated HTML links

Example:

```
$linkifyTracking = new PhilipNewcomer\LinkifyTracking\LinkifyTracking([
    'linkAttributes' => [
        'class' => 'tracking-link',
        'target' => '_blank'
    ]
]);
```

Credits
-------

[](#credits)

Tracking number regular expressions for DHL, FedEx, UPS, and USPS are taken from .

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~428 days

Total

4

Last Release

1676d ago

Major Versions

1.1.1 → 2.0.02021-12-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1446874?v=4)[Philip Newcomer](/maintainers/philipnewcomer)[@philipnewcomer](https://github.com/philipnewcomer)

---

Top Contributors

[![philipnewcomer](https://avatars.githubusercontent.com/u/1446874?v=4)](https://github.com/philipnewcomer "philipnewcomer (6 commits)")[![Nathanael-Shermett](https://avatars.githubusercontent.com/u/33186878?v=4)](https://github.com/Nathanael-Shermett "Nathanael-Shermett (5 commits)")[![jesusfbn](https://avatars.githubusercontent.com/u/15822179?v=4)](https://github.com/jesusfbn "jesusfbn (1 commits)")

### Embed Badge

![Health badge](/badges/philipnewcomer-linkify-tracking/health.svg)

```
[![Health](https://phpackages.com/badges/philipnewcomer-linkify-tracking/health.svg)](https://phpackages.com/packages/philipnewcomer-linkify-tracking)
```

###  Alternatives

[magepsycho/magento2-discountlimit

Magento 2 Discount Amount Limiter

1112.3k](/packages/magepsycho-magento2-discountlimit)[sas/shortcode

Use Wordpress like Shortcodes within the Text Editor of Shopware

156.4k](/packages/sas-shortcode)

PHPackages © 2026

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