You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
3
5
Be extremely concise in all interactions.
4
6
5
7
## Overview
6
8
7
-
WordPress plugin for embedding OPIO review feeds and sliders on client websites. Displays reviews from op.io aggregation service.
9
+
WordPress plugin ("Widget for OPIO Reviews") for embedding OPIO review feeds and sliders on client websites. Displays reviews from the op.io aggregation service. Current version: **1.1.15**.
10
+
11
+
## Build & Development
12
+
13
+
**No build system exists.** No package.json, composer.json, webpack, gulp, or linting configs. Assets (JS/CSS) are edited directly.
14
+
15
+
**Testing:** No automated tests. Manual testing only via WordPress admin preview.
16
+
17
+
**Deployment:** GitHub Actions (`.github/workflows/main.yml`) deploys to WordPress.org SVN on git tag push using `10up/action-wordpress-plugin-deploy`. Slug: `widget-for-opio-reviews`.
18
+
19
+
**Version bump checklist** — update all three locations when releasing:
20
+
1.`opio.php` — `Version:` in plugin header comment
21
+
2.`opio.php` — `OPIO_PLUGIN_VERSION` constant
22
+
3.`readme.txt` — `Stable tag:`
8
23
9
-
**Plugin Name:** Widget for OPIO Reviews
10
-
**Version:** 1.1.11
24
+
**Debug mode:** Set WP option `opio_debug_mode` to `'1'` to load unminified assets from `assets/src/` instead of `assets/`.
11
25
12
26
## Architecture
13
27
28
+
### Initialization Flow
29
+
30
+
```
31
+
opio.php → autoloader.php (PSR-4 for WP_Opio_Reviews\Includes)
- No local review rendering - just displays server HTML
19
-
- File: `includes/class-feed-shortcode.php`
41
+
1.**Feed** (`[opio_feed id='X']`) — Fetches pre-rendered HTML from `feed.op.io`, injects schema into `<head>` via output buffering. Handler: `class-feed-shortcode.php`.
42
+
43
+
2.**Slider** (`[opio_slider id='X']`) — Fetches JSON from `op.io/api/entities/reviews-slider`, renders locally via PHP templates. Three layout variants (horizontal, horizontal-carousel, vertical), each with public + admin-preview templates in `includes/`.
20
44
21
-
2.**Slider Widgets** (review carousels)
22
-
- Fetches JSON from `op.io/api/entities/reviews-slider`
Widget settings are stored as JSON in `post_content` of custom post types (`opio_feed`, `opio_slider`). Serializers validate and save form data; deserializers retrieve and process it (RGBA→hex conversion, `wp_kses` allowlist filtering).
Not yet supported: `rev.embeds[]` (social media embeds).
81
70
82
-
No automated tests. Manual testing via WordPress admin preview.
71
+
JS lightbox/gallery functions exist in both `opio-main.js` (feeds) and `opio-slider-main.js` (sliders) with separate implementations.
83
72
84
-
## Deployment
73
+
## Conventions
85
74
86
-
Plugin distributed via WordPress plugin directory or direct ZIP upload.
75
+
-**Namespace:**`WP_Opio_Reviews\Includes` with PSR-4 autoloading
76
+
-**File naming:**`class-{name}.php` maps to `Class_Name`
77
+
-**Methods/functions:**`snake_case`
78
+
-**Security:**`wp_verify_nonce()` for forms, `sanitize_text_field()` for input, `wp_kses()` with allowlist for output, `esc_url()`/`esc_html()` for escaping
0 commit comments