Download the PHP package andrewmead/wordpress-proper without Composer

On this page you can find all versions of the php package andrewmead/wordpress-proper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wordpress-proper

Build Status

WordPress Proper

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

Docs

Getting Started

WordPress Proper can be installed via composer:

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

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.

The first argument is name of the option you want to use to back a periodic task. This option will store the last time the periodic task was run.

The second argument is where you define the period you want to wait. This can be represented as a DateInterval or a valid string duration that the DateInterval constructor would accept.

Calls to check will always return a boolean value. The value will be true if it's time to run the task. The value will be false if the period of time hasn't passed since the task was last completed.

Number

Abbreviate

Number::abbreviate(int|float $number, bool $round = false): string

The abbreviate methods abbreviates large numbers such as 742898 into shorter strings such as 743K.

It provides abbreviations for:

  1. Thousands - Number::abbreviate(133300) returns the string 133.3K
  2. Millions - Number::abbreviate( 1300000 ) returns the string 1.3M
  3. Billions - Number::abbreviate( 999000000000 ) returns the string 999B
  4. Trillions - Number::abbreviate( 1000000000000 ) returns the string 1T

Numbers below one thousand are not abbreviated. That means Number::abbreviate(978) would return the string 978.

Numbers at or above one quadrillion are not abbreviated. That means Number::abbreviate(1000000000000000) would return the string 1,000,000,000,000,000.

Behind the scenes, abbreviate uses number_format_i18n from WordPress to internationalize abbreviations. This ensures that Number::abbreviate(1500) returns the string 1.5K for en_US and 1,5K for de_DE.

Timezone

A small set of functions that make it a bit easier to work with a WordPress site's timezone.

site_timezone

::site_timezone(): DateTimeZone

Get the WordPress site's timezone represent as a PHP DateTimeZone.

site_offset

::site_offset(): string

Get the offset for the WordPress site's timezone. This is represented as a string. Examples include "-04:00", "+08:45", and "-11:30".

site_offset_in_hours

::site_offset_in_hours(): float

Get the decimal offset for the WordPress site's timezone. This is represented as a float. Examples include -4, 8.75, and -11.5.

site_offset_in_seconds

::site_offset_in_seconds(): int

Get the offset for the WordPress site's timezone in seconds. This is represented as an int. Examples include -14400, 31500, and -41400.

utc_timezone

::utc_timezone(): DateTimeZone

Get a DateTimeZone instance that represents UTC. This will always return the same value, but serves as a handy counterpart to site_timezone

utc_offset

::utc_offset(): string

Get the offset for UTC. This will always return "+00:00". This will always return the same value, but serves as a handy counterpart to site_offset.

utc_offset_in_hours

::utc_offset_in_hours(): float

Get the decimal offset for UTC. This will always return 0. This will always return the same value, but serves as a handy counterpart to site_offset_in_hours.

utc_offset_in_seconds

::utc_offset_in_seconds(): int

Get the decimal offset for UTC. This will always return 0. This will always return the same value, but serves as a handy counterpart to site_offset_in_seconds.


All versions of wordpress-proper with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package andrewmead/wordpress-proper contains the following files

Loading the files please wait ....