PHPackages                             objectivco/wordpress-simple-settings - 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. [Framework](/categories/framework)
4. /
5. objectivco/wordpress-simple-settings

ActiveLibrary[Framework](/categories/framework)

objectivco/wordpress-simple-settings
====================================

A minimalist framework for managing WordPress plugin or theme settings.

0.7.3(6y ago)478.1k10[1 PRs](https://github.com/Objectivco/wordpress-simple-settings/pulls)1GPL-3.0-or-laterPHPPHP &gt;=5.2.0

Since Feb 7Pushed 6y ago6 watchersCompare

[ Source](https://github.com/Objectivco/wordpress-simple-settings)[ Packagist](https://packagist.org/packages/objectivco/wordpress-simple-settings)[ Docs](https://github.com/Objectivco/wordpress-simple-settings)[ RSS](/packages/objectivco-wordpress-simple-settings/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (9)Used By (1)

WordPress Simple Settings
=========================

[](#wordpress-simple-settings)

A minimalist framework for managing WordPress plugin or theme settings.

What Is This
------------

[](#what-is-this)

This is a super simple framework for managing options in your WordPress plugin or theme. No cumbersome field section registration or other overhead is required. Just add some settings, update them, get them. Whatever.

It handles nonces, field names, and etc magically!

How Does It Work
----------------

[](#how-does-it-work)

WordPress Simple Settings is an abstract class which you extend in your own plugin class, theme class, or wherever you need it.

It takes a prefix, set by you and builds a settings object which is stored in a single option in the database.

This last bit should be a clue to what type of data you should store using this API: small amounts!

Just like the built-in Options API (which this framework uses!), you only want to use this for small bits of data. Don't try to store your customer database here!

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

[](#installation)

The best way is to use composer: `composer require objectivco/wordpress-simple-settings`

You can also clone the repository into your lib or inc directory and require `wordpress-simple-settings.php`. But composer is better.

You can get a quick idea of how to implement in our example plugin: `examples/awesome-plugin`.

The gist is, you'll instantiate your plugin class as extension of `WP_SimpleSettings`. You'll then set a prefix as a class variable called `$prefix`.

If you don't set `$prefix`, the framework will try to use your child class name. But this will only work in PHP 5.3+. So, really, just set a prefix ok?

Change Log
----------

[](#change-log)

### 0.7.2

[](#072)

- Pass NULL as old value if there isn't an old value.

### 0.7.1

[](#071)

- WordPress coding standards
- Don't save to db for reach setting on save\_settings(). Defer to the end.
- Add action {$this-&gt;prefix}*update\_setting*{$setting} that receives the old and new values during setting update.
- Ignore .idea folder

### 0.3.0

[](#030)

- Added $delimeter variable to allow switching array delimeter from semi-colon (default) to something else.

### 0.2.2

[](#022)

- Added delete\_setting.

### 0.2.1

[](#021)

- Fix location of {$this-&gt;prefix}\_settings\_saved action to prevent inappropriate firing.

### 0.2

[](#02)

- Improves storage and handling of array values.
- Adds do\_action("{$this-&gt;prefix}\_settings\_saved") hook for adding your own actions after plugin settings are saved.

### 0.1

[](#01)

- Initial version.

Usage
-----

[](#usage)

Here are the basic functions available to you within your plugin.

### add\_setting($option\_name, $value)

[](#add_settingoption_name-value)

This is essentially a wrapper for `update_setting` that respectfully does not make any changes if the option in question is already set.

You'll most frequently use this in your activation hook.

### delete\_setting($option\_name)

[](#delete_settingoption_name)

Removes setting.

### get\_setting($option\_name, $type)

[](#get_settingoption_name-type)

Retrieves a specific option. Returns string by default. If you specify `array` as `$type`, it will treat the value as a delimited string (default semi-colon) and return an array.

### update\_setting($option\_name, $new\_value)

[](#update_settingoption_name-new_value)

Updates a specific option.

### get\_field\_name($option\_name, $type)

[](#get_field_nameoption_name-type)

Gets an HTML field name. If you set `$type` to array, the field value will be treated as a delimited string (default semi-colon) and stored as an array.

### the\_nonce()

[](#the_nonce)

Call `$YourPluginInstance->the_nonce()` somewhere in your admin form to generate the nonce used to validate / save settings.

### save\_settings()

[](#save_settings)

There is no need to call this unless you want to override the default functionality. This function will be called on `admin_init` and automagically saves settings, if the right nonce and `$_REQUEST` is set.

### Settings Object

[](#settings-object)

One of my goals in building this framework was to have an easily accessible settings object that can be used directly when the getters / setters are inconvenient. This is done by simply using `$this->settings[$option_name]`.

Obviously this should be used in read-only applications. Setting values here will not update them in the database.

Feedback
--------

[](#feedback)

I'm in no way claiming to have the perfect, final answer to managing options in WordPress themes or plugins.

The goal of this minimalist approach is that you can simply build your plugin rather than contorting it to work with more demanding APIs.

If you have any ideas for how I can improve on what I have here, please let me know!

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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 ~144 days

Recently: every ~165 days

Total

8

Last Release

2422d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/85bbb15622b7f0e78a944ef64e996941480395283be13da5084344ed4b773d56?d=identicon)[clifgriffin](/maintainers/clifgriffin)

---

Top Contributors

[![clifgriffin](https://avatars.githubusercontent.com/u/682201?v=4)](https://github.com/clifgriffin "clifgriffin (28 commits)")[![barryhughes](https://avatars.githubusercontent.com/u/3594411?v=4)](https://github.com/barryhughes "barryhughes (1 commits)")[![grappler](https://avatars.githubusercontent.com/u/1785641?v=4)](https://github.com/grappler "grappler (1 commits)")

### Embed Badge

![Health badge](/badges/objectivco-wordpress-simple-settings/health.svg)

```
[![Health](https://phpackages.com/badges/objectivco-wordpress-simple-settings/health.svg)](https://phpackages.com/packages/objectivco-wordpress-simple-settings)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M836](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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