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
Update AGENTS.md and CLAUDE.md to reflect Pro plugin structure and Freemius integration
- Change plugin description from "free WordPress plugin" to "WordPress plugin" with freemium model
- Remove "no includes/pro/ directory" note; add Pro features location and @fs_premium_only marker
- Update build commands: add build:pro, clarify build:assets usage, document selective asset building flags
- Add build-assets.js usage instructions with --css, --js, --rtl, --no-rtl flags and file/directory targeting
Copy file name to clipboardExpand all lines: AGENTS.md
+31-18Lines changed: 31 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,11 @@ This file provides guidance to Codex (Codex.ai/code) when working with code in t
4
4
5
5
## Plugin Overview
6
6
7
-
WebberZone Knowledge Base (v3.0.0) is a free WordPress plugin (namespace `WebberZone\Knowledge_Base`) that creates a multi-product knowledge base system. This is the standalone free version — there is no `includes/pro/` directory here. The companion premium plugin (knowledgebase-pro) is a separate repository that extends this codebase with pro features.
7
+
WebberZone Knowledge Base Pro (v3.0.0) is a WordPress plugin (namespace `WebberZone\Knowledge_Base`) that creates a multi-product knowledge base system. It uses a freemium model via Freemius integration — free core features with premium features in `/includes/pro/`.
8
8
9
9
-**Plugin entry**: `knowledgebase.php` (defines constants, loads Freemius via `load-freemius.php`, registers autoloader, and directly requires `includes/options-api.php` and `includes/functions.php`)
10
10
-**PHP**: 7.4+ | **WordPress**: 6.7+
11
11
-**Custom post type**: `wz_knowledgebase` | **Taxonomies**: `wzkb_category`, `wzkb_product`, `wzkb_tag`
@@ -30,24 +29,35 @@ WP_MULTISITE=1 vendor/bin/phpunit # Run multisite unit tests
30
29
### JavaScript / Blocks
31
30
32
31
```bash
33
-
npm run build # Build all blocks (runs build:free + build:pro)
32
+
npm run build # Build all blocks (free + pro)
34
33
npm run build:free # Build all free blocks
35
-
npm run build:assets # Minify CSS/JS and generate RTL
36
-
npm run start # Watch mode for free blocks
34
+
npm run build:pro # Build all pro blocks
35
+
npm run build:assets # Minify CSS/JS and generate RTL (= node build-assets.js)
36
+
npm run start # Watch mode for all blocks
37
37
npm run lint:js # Lint JavaScript
38
38
npm run lint:css # Lint CSS
39
39
npm run format # Auto-format JS and CSS
40
40
```
41
41
42
-
Individual block builds: `npm run build:[kb|articles|sections|products|search|breadcrumb|related|alerts]`
42
+
Individual block builds: `npm run build:[kb|articles|sections|products|search|breadcrumb|related|alerts|rating]`
43
43
44
-
Note: `package.json` also contains `build:pro` and `build:rating` scripts that reference `includes/pro/` — these are irrelevant in this repository and will fail if run here.
44
+
> **After editing any non-block JS or CSS** (files in `includes/admin/js/`, `includes/admin/css/`, `includes/admin/settings/js/`, `includes/frontend/css/`, `includes/pro/frontend/css/`, etc.) always run `node build-assets.js` to regenerate the `.min.js`, `.min.css`, and `-rtl` variants. Never hand-edit the minified or RTL files directly.
45
+
>
46
+
> **Selective asset building**: Pass flags to process only specific asset types:
**Hook Registry** (`includes/util/class-hook-registry.php`): Custom wrapper around WordPress actions/filters with duplicate prevention and closure support. All components register hooks through this instead of calling `add_action()`/`add_filter()` directly.
67
76
68
-
**Settings**: Global `$wzkb_settings` populated at plugin load. Read via `wzkb_get_option( $key )` or `wzkb_get_settings()`. Settings page in `includes/admin/class-settings.php`. Stored as a single serialized array under option key `wzkb_settings`. All settings filters use the prefix `wzkb_` (e.g. `wzkb_get_option_{$key}`).
77
+
**Settings**: Global `$wzkb_settings` populated at plugin load. Read via `wzkb_get_option( $key )` or `wzkb_get_settings()`. Settings page in `includes/admin/class-settings.php`.
69
78
70
-
**Caching** (`includes/util/class-cache.php`): Term meta-based caching (not transients) with expiry timestamps. AJAX endpoint for admin cache clearing.
79
+
**Caching** (`includes/util/class-cache.php`): Term meta-based caching (not transients) with expiry timestamps. AJAX endpoint for admin cache clearing. Use atomic operations when modifying cached data.
71
80
72
-
**Free/Pro coexistence**: The plugin includes deactivation logic in `knowledgebase.php` — activating either the free or pro plugin automatically deactivates the other and shows an admin notice.
81
+
**Free vs Pro**: Pro features conditionally instantiated in `Main::init()`. The `/includes/pro/` directory is marked `@fs_premium_only` in the plugin header. Do not add premium-only logic outside `/includes/pro/`.
-`wzkb_get_kb_url()`, `wzkb_get_product_sections_list()`, `wzkb_get_term_hierarchy_path()` — URL and taxonomy helpers
97
108
109
+
Settings are stored as a single serialized array under option key `wzkb_settings`. All settings filters use the prefix `wzkb_` (e.g. `wzkb_get_option_{$key}`).
110
+
98
111
### REST API
99
112
100
113
Endpoints under `/wzkb/v1/`: `/sections` (product sections), `/knowledgebase` (list), `/knowledgebase/{id}` (single). Responses are object-cached under group `wzkb_rest` (300 s TTL); cache is invalidated on post save/delete and term changes.
Copy file name to clipboardExpand all lines: CLAUDE.md
+31-18Lines changed: 31 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Plugin Overview
6
6
7
-
WebberZone Knowledge Base (v3.0.0) is a free WordPress plugin (namespace `WebberZone\Knowledge_Base`) that creates a multi-product knowledge base system. This is the standalone free version — there is no `includes/pro/` directory here. The companion premium plugin (knowledgebase-pro) is a separate repository that extends this codebase with pro features.
7
+
WebberZone Knowledge Base Pro (v3.0.0) is a WordPress plugin (namespace `WebberZone\Knowledge_Base`) that creates a multi-product knowledge base system. It uses a freemium model via Freemius integration — free core features with premium features in `/includes/pro/`.
8
8
9
9
-**Plugin entry**: `knowledgebase.php` (defines constants, loads Freemius via `load-freemius.php`, registers autoloader, and directly requires `includes/options-api.php` and `includes/functions.php`)
10
10
-**PHP**: 7.4+ | **WordPress**: 6.7+
11
11
-**Custom post type**: `wz_knowledgebase` | **Taxonomies**: `wzkb_category`, `wzkb_product`, `wzkb_tag`
@@ -30,24 +29,35 @@ WP_MULTISITE=1 vendor/bin/phpunit # Run multisite unit tests
30
29
### JavaScript / Blocks
31
30
32
31
```bash
33
-
npm run build # Build all blocks (runs build:free + build:pro)
32
+
npm run build # Build all blocks (free + pro)
34
33
npm run build:free # Build all free blocks
35
-
npm run build:assets # Minify CSS/JS and generate RTL
36
-
npm run start # Watch mode for free blocks
34
+
npm run build:pro # Build all pro blocks
35
+
npm run build:assets # Minify CSS/JS and generate RTL (= node build-assets.js)
36
+
npm run start # Watch mode for all blocks
37
37
npm run lint:js # Lint JavaScript
38
38
npm run lint:css # Lint CSS
39
39
npm run format # Auto-format JS and CSS
40
40
```
41
41
42
-
Individual block builds: `npm run build:[kb|articles|sections|products|search|breadcrumb|related|alerts]`
42
+
Individual block builds: `npm run build:[kb|articles|sections|products|search|breadcrumb|related|alerts|rating]`
43
43
44
-
Note: `package.json` also contains `build:pro` and `build:rating` scripts that reference `includes/pro/` — these are irrelevant in this repository and will fail if run here.
44
+
> **After editing any non-block JS or CSS** (files in `includes/admin/js/`, `includes/admin/css/`, `includes/admin/settings/js/`, `includes/frontend/css/`, `includes/pro/frontend/css/`, etc.) always run `node build-assets.js` to regenerate the `.min.js`, `.min.css`, and `-rtl` variants. Never hand-edit the minified or RTL files directly.
45
+
>
46
+
> **Selective asset building**: Pass flags to process only specific asset types:
**Hook Registry** (`includes/util/class-hook-registry.php`): Custom wrapper around WordPress actions/filters with duplicate prevention and closure support. All components register hooks through this instead of calling `add_action()`/`add_filter()` directly.
67
76
68
-
**Settings**: Global `$wzkb_settings` populated at plugin load. Read via `wzkb_get_option( $key )` or `wzkb_get_settings()`. Settings page in `includes/admin/class-settings.php`. Stored as a single serialized array under option key `wzkb_settings`. All settings filters use the prefix `wzkb_` (e.g. `wzkb_get_option_{$key}`).
77
+
**Settings**: Global `$wzkb_settings` populated at plugin load. Read via `wzkb_get_option( $key )` or `wzkb_get_settings()`. Settings page in `includes/admin/class-settings.php`.
69
78
70
-
**Caching** (`includes/util/class-cache.php`): Term meta-based caching (not transients) with expiry timestamps. AJAX endpoint for admin cache clearing.
79
+
**Caching** (`includes/util/class-cache.php`): Term meta-based caching (not transients) with expiry timestamps. AJAX endpoint for admin cache clearing. Use atomic operations when modifying cached data.
71
80
72
-
**Free/Pro coexistence**: The plugin includes deactivation logic in `knowledgebase.php` — activating either the free or pro plugin automatically deactivates the other and shows an admin notice.
81
+
**Free vs Pro**: Pro features conditionally instantiated in `Main::init()`. The `/includes/pro/` directory is marked `@fs_premium_only` in the plugin header. Do not add premium-only logic outside `/includes/pro/`.
-`wzkb_get_kb_url()`, `wzkb_get_product_sections_list()`, `wzkb_get_term_hierarchy_path()` — URL and taxonomy helpers
97
108
109
+
Settings are stored as a single serialized array under option key `wzkb_settings`. All settings filters use the prefix `wzkb_` (e.g. `wzkb_get_option_{$key}`).
110
+
98
111
### REST API
99
112
100
113
Endpoints under `/wzkb/v1/`: `/sections` (product sections), `/knowledgebase` (list), `/knowledgebase/{id}` (single). Responses are object-cached under group `wzkb_rest` (300 s TTL); cache is invalidated on post save/delete and term changes.
0 commit comments