PHPackages                             pkarl/quick-query - 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. pkarl/quick-query

ActiveWordpress-plugin

pkarl/quick-query
=================

Quick-Query is a WordPress plugin that provides a jQuery-like interface for querying posts and other information.

1152[3 issues](https://github.com/pkarl/quick-query/issues)PHP

Since Nov 24Pushed 10y agoCompare

[ Source](https://github.com/pkarl/quick-query)[ Packagist](https://packagist.org/packages/pkarl/quick-query)[ RSS](/packages/pkarl-quick-query/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Quick Query (alpha)
===================

[](#quick-query-alpha)

[![Build Status](https://camo.githubusercontent.com/746f0f5cdaaa6894561b0628928fece93d55ce7e317b3c0aea3df13bc8131922/68747470733a2f2f7472617669732d63692e6f72672f706b61726c2f717569636b2d71756572792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pkarl/quick-query)

Quick Query is an interface for fetching data from WordPress that's intuitive and pleasant to use. It uses a jQuery-like syntax to chain together simple pieces of information and get you the right information in return.

### Project Update 8-15-2014

[](#project-update-8-15-2014)

Here are a few nuggets:

- As it happens, keeping the SVN version of this up to date on wordpress.org is a PITA, so until this gets to a real alpha, I'm not going to waste my energy there
- when that does happen, I'll make sure composer + wp.org both have access to QQ
- all posts are retrieved by default. I think Wordpress's not-so-smart defaults are something developers should be explicit about, so warm up your `ppp()`
- Tests are going very well, though I had a hell of a time with Wordpress + PHPUnit and that incomplete/horribly-documented factory class. I ended up creating objects for unit tests with a combination of factory stuff, built-in wordpress functions, and a smattering of wizardry
- Tags, taxonomy, and the like are easily the most complicated part of this. I'm nearly done with a draft that accommodates most all kinds of tax\_queries, but I need to test it in combination with other WP\_Query params and work on the `tax()` chaining interface
- The authors, parents &amp; children code should come very quickly after that

How it works &amp; Background
-----------------------------

[](#how-it-works--background)

Quick Query began as a scrap of syntactic sugar for dealing with [WP\_Query](http://codex.wordpress.org/Class_Reference/WP_Query). Over the course of a few projects, this sugary treat grew into necessity that simplified 80% of the time-consuming query code into a few pleasant lines.

Here's an comparison in a demanding scenario:

```
// The WP_Query way
$args = array(
	'post_type' => 'post',
	'tax_query' => array(
		'relation' => 'AND',
		array(
			'taxonomy' => 'movie_genre',
			'field' => 'slug',
			'terms' => array( 'action', 'comedy' )
		),
		array(
			'taxonomy' => 'actor',
			'field' => 'id',
			'terms' => array( 103, 115, 206 ),
			'operator' => 'NOT IN'
		)
	)
);
$query = new WP_Query( $args );

// The Quick Query way
$posts = $q->type('post')->tags( ['movie_genre' => ['action','comedy'], 'actor' => [103, 115, 206]], 'AND' );
```

The plan
--------

[](#the-plan)

I'm working on creating an honest-to-goodness open source version of it from the ground up. At the time of this writing, Quick Query is just a class wrapper with all of our code commented out.

I'll be working on this (along with anyone who enjoys the idea of mitigating the emotional damage WP\_Query causes) to incrementally re-add the functionality of `QQuery` along with tests and docs as we go.

TODO
====

[](#todo)

- Post Type

- `$qq->type('some-type')`

- Fetch Post by ID

- `$qq->get(42)`

- ACF sensory
- Fetch Post in set of IDs

- `$qq->in([2, 5, 42])`

- Sort order

- `$qq->sort('date', 'DESC')`

- Exclude ID(s)
- Return all posts

- `$qq->all()`

- Set posts per page

- `$qq->ppp(20)`

- Meta Fields options

- `$qq->meta('author')`

- Pagination &amp; Offset

- `$qq->ppp(3)->page(2)`

- Filter by post status

- `$qq->status('published')`
- `$qq->status(['published','draft'])`

- Terms, Taxonomies &amp; Categories

- `$qq->term('cats')`
- `$qq->tax('animals')`
- `$qq->tax(['animals'=>['cats', 'dogs'], ['pizza'=>['deep', 'NYC']], 'OR')`
- `$qq->category('fish')`

- Authors

- `$qq->author(1)`
- `$qq->author('Pete Karl II')`

- Parents &amp; Children

- `$qq->parent(22)`
- `$qq->parent('some-slug')`
- `$qq->children('some_post_type')`

Needs Tests
-----------

[](#needs-tests)

- ACF, see `tests/test_qq_acf.php`

Needs docs
----------

[](#needs-docs)

*(everything)*

Running Tests
=============

[](#running-tests)

I recommend using 10up's [VVV](https://github.com/Varying-Vagrant-Vagrants/VVV) to set up a wordpress environment.

From there, what I've done is cloned this repo, added it as a sync'd folder in VVV's Vagrant file, and then symlinked it to my wordpress repos.

> To sync any additional folder, add `config.vm.synced_folder "/path/to/your/folder/", "/srv/vagrant/mirror/"` to your Vagrantfile so you can edit code in your OS and run tests VM effortlessly

To run the tests, I `vagrant ssh` into the vbox, navigate to the plugin directory, and run `phpunit` (or, more frequently, `phpunit --debug`)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c9bc63b4019404431b20333a22ff06fb67fc382e00505a1d1ddec9c72a8b581?d=identicon)[steyblind](/maintainers/steyblind)

---

Top Contributors

[![jarednova](https://avatars.githubusercontent.com/u/1298086?v=4)](https://github.com/jarednova "jarednova (3 commits)")

### Embed Badge

![Health badge](/badges/pkarl-quick-query/health.svg)

```
[![Health](https://phpackages.com/badges/pkarl-quick-query/health.svg)](https://phpackages.com/packages/pkarl-quick-query)
```

PHPackages © 2026

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