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

ActiveWordpress-muplugin[Utility &amp; Helpers](/categories/utility)

frc/wp-assets
=============

Helper for assets.

01.3kPHPCI failing

Since Feb 14Pushed 3y ago6 watchersCompare

[ Source](https://github.com/frc/wp-assets)[ Packagist](https://packagist.org/packages/frc/wp-assets)[ RSS](/packages/frc-wp-assets/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

WP Assets
=========

[](#wp-assets)

This is a must-use plugin used via composer, plugin activation not required.

Usage
-----

[](#usage)

Call function `frc_asset($file)`. For example:

`wp_enqueue_style('styles', frc_asset('styles/main.css'));`

Available methods:

- `frc_asset($file)->uri()`
- `frc_asset($file)->path()`
- `frc_asset($file)->exists()`
- `frc_asset($file)->notExists()`
- `frc_asset($file)->contents()`

Casting `frc_asset($file)` to a string will return asset's URI.

Optional configuration using `add_theme_support` function.

```
add_theme_support('frc-assets', [
    'root' => 'asset', // Root folder name for distributed assets
    'file' => 'assets.json', // Assetmanifest's file name
    'path' => get_theme_file_path(''), // Full path to root folder
    'uri' => get_theme_file_uri(""), // Full URI to root folder
    'manifest' => '/', // Full path to manifest file
    'addHashToFilename' => false, // If using laravel mix you can opt to use the hash from query string in filename and get better caching from cdn's and nginx
]);
```

If using 'addHashToFilename' the manifest file should be in the following format with hash length of 20.

```
{
    "/scripts/main.js": "/scripts/main.js?id=a91004e635bd357e16e6"
}

```

And you should have the following in you nginx.conf this strips the added "hash.a91004e635bd357e16e6" from the filename when a request is made

```
location ~ "^(.+)(hash\.[0-9a-f]{20})\.(js|css|ttf|eot|woff2?|png|jpe?g|gif|svg|ico)$" {
    add_header Cache-Control "public";
    expires 10y;
    try_files $uri $1$3 =404;
    access_log off;
}

```

all of these work..
/GET /scripts/main.hash.a91004e635bd357e16e6.js =&gt; /scripts/main.js
/GET /scripts/main.a91004e635bd357e16e6.js =&gt; /scripts/main.a91004e635bd357e16e6.js
/GET /scripts/main.hash.js =&gt; /scripts/main.hash.js
/GET /scripts/main.js =&gt; /scripts/main.js

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 90.9% 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/f1e6b94e34fb8afb2d20c27189f9de8ff081f8a6949ee225d3a450327abb45f2?d=identicon)[janne](/maintainers/janne)

---

Top Contributors

[![jmerilainen](https://avatars.githubusercontent.com/u/5939342?v=4)](https://github.com/jmerilainen "jmerilainen (10 commits)")[![JanneAalto](https://avatars.githubusercontent.com/u/6008144?v=4)](https://github.com/JanneAalto "JanneAalto (1 commits)")

### Embed Badge

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

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

###  Alternatives

[sallar/jdatetime

Jalali (Shamsi) DateTime class written in PHP, Supports year higher than 2038

18541.4k4](/packages/sallar-jdatetime)[nfephp-org/posprint

Thermal POS printer library

7131.7k2](/packages/nfephp-org-posprint)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[amendozaaguiar/filament-route-statistics

Filament route statictics viewer

3225.0k1](/packages/amendozaaguiar-filament-route-statistics)[fof/drafts

Allow users to create post and discussion drafts

1771.1k5](/packages/fof-drafts)[inspiredminds/contao-wowjs

Integrates WOW.js for Contao content elements and form fields.

1813.0k](/packages/inspiredminds-contao-wowjs)

PHPackages © 2026

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