PHPackages                             andrewmead/wordpress-proper - 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. andrewmead/wordpress-proper

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

andrewmead/wordpress-proper
===========================

A set of classes you may find useful for WordPress development

4.0.1(1y ago)23.0k1[2 issues](https://github.com/andrewjmead/wordpress-proper/issues)[1 PRs](https://github.com/andrewjmead/wordpress-proper/pulls)MITPHP

Since May 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/andrewjmead/wordpress-proper)[ Packagist](https://packagist.org/packages/andrewmead/wordpress-proper)[ RSS](/packages/andrewmead-wordpress-proper/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (7)Versions (7)Used By (0)

[![Build Status](https://camo.githubusercontent.com/20841580a095b6368a47b6a3f3610eb4f69aaa83a44af1761b2b5f6cc6eddbbf/68747470733a2f2f6170702e7472617669732d63692e636f6d2f616e647265776a6d6561642f776f726470726573732d70726f7065722e7376673f6272616e63683d6d61696e)](https://app.travis-ci.com/andrewjmead/wordpress-proper)

WordPress Proper
================

[](#wordpress-proper)

A dependency-free set of classes you may find useful for WordPress development.

Docs
----

[](#docs)

- [Getting Started](#getting-started)
- [Periodic](#periodic)
    - [::check($option\_name, $date\_interval): bool](#periodic)
- [Number](#number)
    - [::abbreviate($number, bool $round = false): string](#abbreviate)
- [Timezone](#timezone)
    - [::site\_timezone(): DateTimeZone](#site_timezone)
    - [::site\_offset(): string](#site_offset)
    - [::site\_offset\_in\_hours(): float](#site_offset_in_hours)
    - [::site\_offset\_in\_seconds(): float](#site_offset_in_seconds)
    - [::utc\_timezone(): DateTimeZone](#utc_timezone)
    - [::utc\_offset(): string](#utc_offset)
    - [::utc\_offset\_in\_hours(): float](#utc_offset_in_hours)
    - [::utc\_offset\_in\_seconds(): float](#utc_offset_in_seconds)

Getting Started
---------------

[](#getting-started)

WordPress Proper can be installed via composer:

```
composer require andrewmead/wordpress-proper

```

From there, you can pull in whatever module you happen to need:

```
use Proper\Number;

Number::abbreviate(654201); // 654.2K
```

Periodic
--------

[](#periodic)

**Periodic::check(string $option\_name, string|DateInterval $interval): bool**

`Periodic` gives you a way to periodically do something. It's powered by WordPress options and PHP's `DateInterval` class.

It's perfect when you need to do something, but only every once in a while. In the example below, `Periodic` is used to run some code once every 30 minutes.

```
