PHPackages                             zeek/wp-utils - 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. zeek/wp-utils

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

zeek/wp-utils
=============

A collection of functions that provide utility functionality for WordPress.

6.1.3(9mo ago)3754↓100%3[3 issues](https://github.com/CodingIT-dev/wp-utils/issues)proprietaryPHPPHP &gt;=7.0CI failing

Since May 3Pushed 9mo ago14 watchersCompare

[ Source](https://github.com/CodingIT-dev/wp-utils)[ Packagist](https://packagist.org/packages/zeek/wp-utils)[ RSS](/packages/zeek-wp-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (88)Used By (0)

WordPress Utils
===============

[](#wordpress-utils)

[![Build Status](https://camo.githubusercontent.com/1d6e61cf4062040a70ca317089593c05db2a9da9a139e8467032f7e2f1b79a9a/68747470733a2f2f7472617669732d63692e636f6d2f5a65656b496e7465726163746976652f77702d7574696c732e7376673f746f6b656e3d473756706742785a70705938394347697933506e266272616e63683d646576656c6f70)](https://travis-ci.com/ZeekInteractive/wp-utils)[![Codacy Badge](https://camo.githubusercontent.com/2850956e01aecaeddb6c9b725779b26efb0f1d26c9624424122fec4161f94ffc/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3063656133336363336562343435346162303562333162663837613732316438)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=ZeekInteractive/wp-utils&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/87b1d0d4606616f9995da4388e33e7b29e0a112c48f93ef6fddad7d030ec5c87/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3063656133336363336562343435346162303562333162663837613732316438)](https://www.codacy.com?utm_source=github.com&utm_medium=referral&utm_content=ZeekInteractive/wp-utils&utm_campaign=Badge_Coverage)

Utility functions that make life just a little bit easier.

Database
--------

[](#database)

### `db_transaction( $callable, $args = [] )`

[](#db_transaction-callable-args---)

Run the given callback within a database transaction, rolling back the transaction if an error occurs.

### `get_raw_option_value( $key )`

[](#get_raw_option_value-key-)

Performs a very direct, simple query to the WordPress Options table that bypasses normal WP caching.

### `get_id_from_slug( $slug, $post_type = 'post', $force = false )`

[](#get_id_from_slug-slug-post_type--post-force--false-)

Performs a lookup for a post given a slug.

### `get_meta_key_from_meta_value()`

[](#get_meta_key_from_meta_value)

Perform a reverse lookup for a meta key based on a meta value.

ACF
---

[](#acf)

### `get_acf_meta_value_by_acf_key()`

[](#get_acf_meta_value_by_acf_key)

Use this when you know an ACF field key and a post ID, but the field is within a group.

### `is_acf_loadable()` (Deprecated)

[](#is_acf_loadable-deprecated)

Check to see if ACF is loadable and if ACF\_LITE is true.

Users
-----

[](#users)

### `generate_unique_username( $username )`

[](#generate_unique_username-username-)

Appends a counter to the given username which is incremented until there is no user with that username.

Misc
----

[](#misc)

### `get_current_url()`

[](#get_current_url)

Returns the current URL.

### `get_current_url_clean()`

[](#get_current_url_clean)

Returns the current URL, but without query args.

### `get_user_display_name( $user_id )`

[](#get_user_display_name-user_id-)

Easily get the user display name by the user ID.

### `get_env_value( $key, $filter = null )`

[](#get_env_value-key-filter--null-)

Helper function to check for an environmental variable in a variety of places: $\_ENV (for setting via .env.php files), Constant (for setting via a define() call), Filter, utilizing a passed in filter

### `remove_filters_for_anonymous_class( $hook_name = '', $class_name = '', $method_name = '', $priority = 10 )`

[](#remove_filters_for_anonymous_class-hook_name---class_name---method_name---priority--10-)

Remove a filter/action from an anonymous class

### `add_inline_svg()`

[](#add_inline_svg)

Checks if SVG file exists before grabbing its contents

### `get_current_datetime()`

[](#get_current_datetime)

Gets a DateTime object set to WordPress's local timezone

### `get_site_timezone()`

[](#get_site_timezone)

Get a DateTimeZone object that is set to the site's local timezone.

### `init_term( $slug, $taxonomy )`

[](#init_term-slug-taxonomy-)

Checks for and returns a term by the slug. Initializes the term if it does not yet exist.

Behaviors / Filters
-------------------

[](#behaviors--filters)

These must be initiated by creating the `\Zeek\WP_Util\Behaviors()` class.

### `file_mod_allowed`

[](#file_mod_allowed)

By default, disable file modifications (plugin adding, deleting, theme file editing, etc). Override with an `env` constant: `FILE_MOD_ALLOWED`.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 81.5% 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 ~36 days

Recently: every ~187 days

Total

84

Last Release

271d ago

Major Versions

2.12 → 3.02019-03-27

3.7.1 → 4.0.02021-03-04

4.0.1 → 5.02021-03-15

5.0.6 → 6.0.02023-04-20

v2.7.1 → v6.1.12023-10-18

PHP version history (3 changes)0.1.0PHP &gt;=5.3

1.6.1PHP &gt;=5.6

v2.0PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![AaronHolbrook](https://avatars.githubusercontent.com/u/953022?v=4)](https://github.com/AaronHolbrook "AaronHolbrook (53 commits)")[![chetmac](https://avatars.githubusercontent.com/u/4803973?v=4)](https://github.com/chetmac "chetmac (7 commits)")[![jacobarriola](https://avatars.githubusercontent.com/u/1371573?v=4)](https://github.com/jacobarriola "jacobarriola (3 commits)")[![ivande](https://avatars.githubusercontent.com/u/3731417?v=4)](https://github.com/ivande "ivande (2 commits)")

---

Tags

package

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/zeek-wp-utils/health.svg)

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

###  Alternatives

[lexxyungcarter/chatmessenger

Simple one-to-one/group chat messaging tool for Laravel 5, 6, 7, 8, 9 &amp; 10 with Pusher Integration

10724.1k](/packages/lexxyungcarter-chatmessenger)[georgeboot/laravel-tiptap

Opinionated integration of Tiptap editor using the TALL stack

346.4k](/packages/georgeboot-laravel-tiptap)[bmichotte/dijkstra

php 7+ implementation of the Dijkstra algorithm

131.5k](/packages/bmichotte-dijkstra)

PHPackages © 2026

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