PHPackages                             awesome9/json - 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. awesome9/json

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

awesome9/json
=============

WordPress json manager.

2.0.0(1y ago)0118↓46.7%GPL-3.0-or-laterPHPPHP &gt;=5.6

Since May 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/AwesomeNine/JSON)[ Packagist](https://packagist.org/packages/awesome9/json)[ RSS](/packages/awesome9-json/feed)WikiDiscussions master Synced 1mo ago

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

JSON
====

[](#json)

[![Awesome9](https://camo.githubusercontent.com/3c0c2d9b4a52297ff7faaf49e147ee8e6e96e0f435b798a6215c2e50ebc6bde3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f417765736f6d652d392d627269676874677265656e)](https://awesome9.co)[![Latest Stable Version](https://camo.githubusercontent.com/bad31fed715258611b085da7ac7c385e5f94e7a5170cafb8107da258ba5c50f8/68747470733a2f2f706f7365722e707567782e6f72672f617765736f6d65392f6a736f6e2f762f737461626c65)](https://packagist.org/packages/awesome9/json)[![PHP from Packagist](https://camo.githubusercontent.com/2729edb4feeae3af7b2c6f7b97edadcaeb033c8e5869e9204f7962abbdc5b562/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f617765736f6d65392f6a736f6e2e737667)](https://packagist.org/packages/awesome9/json)[![Total Downloads](https://camo.githubusercontent.com/94d14782dfca81cea4810c59a58cbc2b27257b685816ce6ab6a05d53cd15c89b/68747470733a2f2f706f7365722e707567782e6f72672f617765736f6d65392f6a736f6e2f646f776e6c6f616473)](https://packagist.org/packages/awesome9/json)[![License](https://camo.githubusercontent.com/04bae50a4fedebe0449fba9994c63aaa9f69c0ee9d884e3bd35bd5de09363910/68747470733a2f2f706f7365722e707567782e6f72672f617765736f6d65392f6a736f6e2f6c6963656e7365)](https://packagist.org/packages/awesome9/json)

 [![](https://camo.githubusercontent.com/9030386bc4cebc2474fbeba5543849aa99ad76384410797fbd4330b096018fa7/68747470733a2f2f696d672e69636f6e73382e636f6d2f6e6f6c616e2f3235362f6a736f6e2e706e67)](https://camo.githubusercontent.com/9030386bc4cebc2474fbeba5543849aa99ad76384410797fbd4330b096018fa7/68747470733a2f2f696d672e69636f6e73382e636f6d2f6e6f6c616e2f3235362f6a736f6e2e706e67)

📃 About JSON
------------

[](#-about-json)

This package provides ease of managing data localization within WordPress. It enables developers to add, remove, and manipulate JSON objects that can be output in the footer of WordPress pages.

💾 Installation
--------------

[](#-installation)

```
composer require awesome9/json
```

🕹 Usage
-------

[](#-usage)

### Initialize the JSON Manager

[](#initialize-the-json-manager)

To start using the JSON manager, initialize the `JSON` class with a default object name. This object name will be used as the JavaScript variable where the JSON data will be accessible.

```
use Awesome9\JSON\JSON;

// Initialize JSON manager with a default object name
$json_manager = new JSON('awesome9');
$json_manager->hooks();
```

The `hooks()` method binds the necessary WordPress hooks to output the JSON data automatically in the footer.

### Adding Data

[](#adding-data)

Use the `add()` method to add key-value pairs to the JSON object. You can add data in two ways:

- As individual key-value pairs.
- As an array of key-value pairs.

```
// Adding individual data
$json_manager->add('company', 'awesome');
$json_manager->add('product', 'json_manager');

// Adding multiple key-value pairs using an array
$json_manager->add([
    'feature1' => 'easy to use',
    'feature2' => 'robust',
]);
```

### Removing Data

[](#removing-data)

To remove a specific key from the JSON object, use the `remove()` method:

```
$json_manager->remove('product'); // Removes the 'product' key
```

### Clearing All Data

[](#clearing-all-data)

If you need to remove all data stored in the JSON object, use `clear_all()`:

```
$json_manager->clear_all();
```

### Accessing Data in JavaScript

[](#accessing-data-in-javascript)

After setting up data with the JSON manager, you can access it on the frontend in JavaScript. The default object name (in this case, `awesome9`) will hold the data.

```
console.log(awesome9.company);     // Outputs: 'awesome'
console.log(awesome9.feature1);    // Outputs: 'easy to use'
```

📖 Changelog
-----------

[](#-changelog)

[See the changelog file](./CHANGELOG.md)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~542 days

Total

4

Last Release

559d ago

Major Versions

1.0.2 → 2.0.02024-11-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/a8c0c9008048fdaccaef33d3fe68b29084832757fba12dd0d9543269a071ce39?d=identicon)[meshakeeb](/maintainers/meshakeeb)

---

Top Contributors

[![meshakeeb](https://avatars.githubusercontent.com/u/1378876?v=4)](https://github.com/meshakeeb "meshakeeb (8 commits)")

### Embed Badge

![Health badge](/badges/awesome9-json/health.svg)

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

PHPackages © 2026

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