orbit-cache-compatlisted
Install: claude install-skill adityaarsharma/orbit
# 🪐 orbit-cache-compat — Cache layer compatibility
WP plugins that misuse caching are responsible for half of the "site slow" support tickets. This skill catches incompatibilities before they hit the user.
---
## Quick start
```bash
bash ~/Claude/orbit/scripts/check-object-cache.sh ~/plugins/my-plugin
```
Plus a live test against an object-cache-enabled wp-env site:
```bash
# Spin up wp-env with Redis
bash scripts/create-test-site.sh --plugin . --port 8881 --object-cache redis
# Run gauntlet — DB-profile step now reflects cached vs uncached
bash scripts/gauntlet.sh --plugin . --mode full
```
---
## What this skill checks
### 1. Object cache awareness
```php
// ❌ Bypass object cache — slow on Redis/Memcached sites
$value = $wpdb->get_var( "SELECT meta_value FROM wp_options WHERE option_name='my_plugin_data'" );
// ✅ Use WP API — automatically uses object cache if available
$value = get_option( 'my_plugin_data' );
// ❌ Reading user meta directly
$value = $wpdb->get_var( $wpdb->prepare(
"SELECT meta_value FROM wp_usermeta WHERE user_id=%d AND meta_key=%s", $u, 'my_meta'
) );
// ✅ Use the API
$value = get_user_meta( $u, 'my_meta', true );
```
### 2. Cache invalidation on writes
```php
// ❌ Reading from transient, writing to DB directly — cache stale
function get_thing() {
$cached = get_transient( 'my_thing' );
if ( $cached !== false ) return $cached;
$val = $wpdb->get_var( "..." );
set_transient( 'my_thing', $val, HOUR_IN_SECONDS );
return $val;
}
fun