PHPackages                             wpify/asset - 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. wpify/asset

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

wpify/asset
===========

1.3.0(1y ago)022.3k↑36.1%[1 issues](https://github.com/wpify/asset/issues)1GPL-2.0-or-laterPHP

Since Sep 8Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (16)Used By (1)

WPify Asset
===========

[](#wpify-asset)

Abstraction over WordPress Asset.

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

[](#installation)

`composer require wpify/asset`

Usage
-----

[](#usage)

```
use Wpify\Asset\AssetFactory;
use Wpify\Asset\Asset;
use Wpify\Asset\AssetConfig;

$factory = new AssetFactory;

// Enqueues from the URL

$factory->factory( array( 'src' => 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js?ver=LK12' ) );
$factory->factory( array( 'src' => 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css' ) );

$args = array( 'dependencies' => array( 'jquery' ) );

// or

$factory->url( 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js?ver=LK12', $args );

// in admin

$factory->admin_url( 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js?ver=LK12', $args );

// on login screen

$factory->login_url( 'https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/js/bootstrap.bundle.min.js?ver=LK12', $args );

// Enqueues script or style built with `wp-scripts`

$factory->wp_script( plugin_dir_path( __FILE__ ) . 'build/plugin.js', $args );
$factory->admin_wp_script( plugin_dir_path( __FILE__ ) . 'build/plugin.js', $args );
$factory->login_wp_script( plugin_dir_path( __FILE__ ) . 'build/plugin.js', $args );

// Enqueues script or style from theme

$factory->theme( 'style.css', $args );
$factory->admin_theme( 'style.css', $args );
$factory->login_theme( 'style.css', $args );

// Enqueues script or style from parent theme

$factory->parent_theme( 'style.css', $args );
$factory->admin_parent_theme( 'style.css', $args );
$factory->login_parent_theme( 'style.css', $args );

// Create asset manually

$style_config = new AssetConfig( $args );
$style_config->set_src( plugins_url( 'style.css', __FILE__ ) )
             ->set_handle( 'custom-style' )
             ->set_is_admin( false )
             ->set_is_login( false )
             ->set_do_enqueue( '__return_true' )
             ->set_version( '1.0.0' )
             ->set_media( 'all' );
$style = new Asset( $style_config );

$script_config = new AssetConfig( $args );
$script_config->set_src( plugins_url( 'script.js', __FILE__ ) )
              ->set_handle( 'custom-script' )
              ->set_is_admin( false )
              ->set_is_login( false )
              ->set_do_enqueue( '__return_true' )
              ->set_dependencies( array( 'jquery' ) )
              ->set_version( '1.0.0' )
              ->set_in_footer( true ),
              ->set_variables( array( 'some_global_variable' => 'for the script is here!' ) )
              ->set_script_before( 'console.log( "Script before!" );' )
              ->set_script_after( 'console.log( "Script after!" );' )
              ->set_text_domain( 'my-plugin-text-domain' )
              ->set_translations_path( plugin_dir_path( __FILE__ ) . 'languages' );
$script = new Asset( $script_config );
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

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 ~75 days

Recently: every ~213 days

Total

15

Last Release

658d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/92d6ba0cde4324b12697fe98421d2430b68bff0a981225d42b103fb53dea16f5?d=identicon)[vasikgreif](/maintainers/vasikgreif)

---

Top Contributors

[![mejta](https://avatars.githubusercontent.com/u/498441?v=4)](https://github.com/mejta "mejta (23 commits)")

### Embed Badge

![Health badge](/badges/wpify-asset/health.svg)

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

###  Alternatives

[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k5.4k1](/packages/vinkius-labs-laravel-page-speed)

PHPackages © 2026

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