PHPackages                             wbf/assets - 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. wbf/assets

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

wbf/assets
==========

An helper component for assets manegment

09PHP

Since May 25Pushed 8y ago3 watchersCompare

[ Source](https://github.com/wagaweb/wbf_assets)[ Packagist](https://packagist.org/packages/wbf/assets)[ RSS](/packages/wbf-assets/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Assets Manager
==============

[](#assets-manager)

A simple Assets Manager tailored for Wordpress.

It as some interesting features:

- If a path is provided, the asset (js or css) will be enqueued only if the file exists, so you get no 404.
- If a path is provided, the Assets Manager will use `filemtime()` as asset version. This will prevent browser to serve a cached version of the asset if the file was modified.
- You can provide a callback for each asset to do additional checks before deciding whether enqueue the asset or not.

Usage
-----

[](#usage)

- Create an array of assets:

```
$libs = [
    "my-style" => [
        'uri' => "...",
        'type' => 'css',
    ],
    "my-js" => [
        'uri' => "...",
        'path' => "...",
        'type' => 'js',
        'enqueue' => false
    ]
];
```

- Instance a new object and enqueue

```
$a = new AssetsManager($libs);
$a->enqueue();
```

You can pass a number of arguments to AssetsManager constructor:

```
[
	'uri' => '', //A valid uri
	'path' => '', //A valid path
	'version' => false, //If FALSE, the filemtime will be used (if path is set)
	'deps' => [], //Dependencies
	'i10n' => [], //the Localication array for wp_localize_script
	'type' => '', //js or css
	'enqueue_callback' => false, //A valid callable that must be return true or false
	'in_footer' => false, //Used for scripts
	'enqueue' => true //If FALSE the script\css will only be registered
]
```

### Localization

[](#localization)

You can use `i10n` key to pass an array for `wp_localize_script()`. See [wp\_localize\_script()](https://codex.wordpress.org/Function_Reference/wp_localize_script) for further informations.

```
$libs = [
    'my-js' => [
    	'i10n' => [
    	    'name' => myValue
    	    'params' => [
    	        'foo' => 'bar',
    	        'baz' => true
    	    ]
    	]
	]
]
```

Is equivalent to

```
wp_localize_script( 'my-js', 'myValue', [
    'foo' => 'bar',
    'baz' => true
]);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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/ecab5a59cfdd434af4feb082bcb4c24e264ea99574713c876789c3ea8a088c65?d=identicon)[Waga Dev](/maintainers/Waga%20Dev)

---

Top Contributors

[![LostCore](https://avatars.githubusercontent.com/u/2674299?v=4)](https://github.com/LostCore "LostCore (19 commits)")

### Embed Badge

![Health badge](/badges/wbf-assets/health.svg)

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

###  Alternatives

[jawira/case-converter

Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.

1746.9M79](/packages/jawira-case-converter)[awcodes/drop-in-action

A form component for Filamentphp allowing actions inside of forms.

8656.0k](/packages/awcodes-drop-in-action)[hubertusanton/silverstripe-seo

SEO module for Silverstripe

4823.0k2](/packages/hubertusanton-silverstripe-seo)

PHPackages © 2026

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