Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c49e6e9
initial version
jorgefilipecosta Mar 25, 2026
a7ecdd9
minimal version
jorgefilipecosta Mar 25, 2026
43c9699
initial form
jorgefilipecosta Mar 25, 2026
95b7a46
design improvements
jorgefilipecosta Mar 25, 2026
1b8b76b
save working
jorgefilipecosta Mar 25, 2026
1b9a601
disable
jorgefilipecosta Mar 25, 2026
ec3a968
fix design disabled
jorgefilipecosta Mar 25, 2026
c19da93
remove the exable
jorgefilipecosta Mar 25, 2026
7e34264
improve design
jorgefilipecosta Mar 25, 2026
b8e2ea5
document
jorgefilipecosta Mar 25, 2026
6fcc081
lint fixes
jorgefilipecosta Mar 25, 2026
96c0d20
litn fixes
jorgefilipecosta Mar 25, 2026
b4030ad
lint fixes
jorgefilipecosta Mar 25, 2026
2e78630
remove old page
jorgefilipecosta Mar 25, 2026
b5fa75f
remove old page code
jorgefilipecosta Mar 25, 2026
eae70a1
remove unnecessary code
jorgefilipecosta Mar 25, 2026
b8a7ce0
extrat svg
jorgefilipecosta Mar 25, 2026
d2fb807
remove api fetch
jorgefilipecosta Mar 25, 2026
ed64c68
fix renrendering issue
jorgefilipecosta Mar 25, 2026
abbb4e0
remove unrequired code
jorgefilipecosta Mar 25, 2026
6d31b5b
general cehcks
jorgefilipecosta Mar 25, 2026
9eb30a7
design fix
jorgefilipecosta Mar 25, 2026
64752f0
enhacements
jorgefilipecosta Mar 25, 2026
1df3568
enhacements
jorgefilipecosta Mar 25, 2026
0be9c3e
pass experiments definitions from the server
jorgefilipecosta Mar 25, 2026
6262435
fix start command to build the routes
jorgefilipecosta Mar 25, 2026
41ef694
enhacements
jorgefilipecosta Mar 25, 2026
2806a9a
update tests
jorgefilipecosta Mar 25, 2026
7f2dbfb
lint fix
jorgefilipecosta Mar 25, 2026
e183939
fix lint issues
jorgefilipecosta Mar 25, 2026
46cca40
Fix end to end tests
jorgefilipecosta Mar 25, 2026
7f79f7d
add unit test
jorgefilipecosta Mar 25, 2026
7dcd765
exclude build files from plugin check
jorgefilipecosta Mar 25, 2026
ea3a40e
test fix
jorgefilipecosta Mar 25, 2026
a593c02
Address PR review feedback
jorgefilipecosta Mar 31, 2026
590ed34
fix webpack clean.keep to also preserve build.php and constants.php
jorgefilipecosta Mar 31, 2026
0204d9b
fix lint: use fully qualified class name in @param annotation
jorgefilipecosta Mar 31, 2026
cfdd7d5
two different folders
jorgefilipecosta Apr 6, 2026
3add76f
update .gitignore
jorgefilipecosta Apr 6, 2026
f5a6a4e
fix end to end
jorgefilipecosta Apr 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
/.wordpress-org
/docs
/node_modules
/routes
/src
/tests
/tools

# Files
.*
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/plugin-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ jobs:
plugin_header_unsupported_plugin_name
exclude-directories: |
.github
build
docs
tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Thumbs.db
# Build output
build/
build-module/
build-scripts/
build-types/

# Environment
Expand Down
4 changes: 3 additions & 1 deletion ai.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
/**
* Shortcut constant to the path of this file.
*/
define( 'WPAI_DIR', plugin_dir_path( __FILE__ ) );
if ( ! defined( 'WPAI_DIR' ) ) {
define( 'WPAI_DIR', plugin_dir_path( __FILE__ ) );
}

require_once WPAI_DIR . 'includes/bootstrap.php';
3 changes: 2 additions & 1 deletion docs/ARCHITECTURE_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ The plugin follows a modular, experiment-based architecture:
```
ai/
├── ai.php # Plugin bootstrap
├── build/ # Built assets
├── build/ # wp-build route assets
├── build-scripts/ # wp-scripts built assets
├── docs/ # Documentation
│ ├── experiments/ # Experiment specific documentation
│ ├── ARCHITECTURE_OVERVIEW.md # Architecture Overview
Expand Down
6 changes: 3 additions & 3 deletions docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ The plugin also includes the following action hooks:

### Asset Loading

The plugin provides a utility class for loading assets. This uses `wp-scripts` to build assets which are expected to live within the `src/` directory. They will then be built into the `build/` directory, where the asset loader will look for the files, pulling in the proper dependencies and versioning.
The plugin provides a utility class for loading assets. This uses `wp-scripts` to build assets which are expected to live within the `src/` directory. They will then be built into the `build-scripts/` directory, where the asset loader will look for the files, pulling in the proper dependencies and versioning.

```php
use WordPress\AI\Asset_Loader;
Expand All @@ -252,7 +252,7 @@ use WordPress\AI\Asset_Loader;
*
* First argument is the script handle.
* The second argument is the script file name.
* This script file name should be in the build/ directory.
* This script file name should be in the build-scripts/ directory.
* The source script files should be in the src/ directory. If needed,
* you can add the entry point to the webpack.config.js file.
*/
Expand All @@ -263,7 +263,7 @@ Asset_Loader::enqueue_script( 'my-experiment', 'experiments/my-experiment' );
*
* First argument is the style handle.
* The second argument is the style file name.
* This style file name should be in the build/ directory.
* This style file name should be in the build-scripts/ directory.
* The source style files should be in the src/ directory. If needed,
* you can add the entry point to the webpack.config.js file.
*/
Expand Down
18 changes: 1 addition & 17 deletions includes/Abstracts/Abstract_Feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,27 +216,11 @@ public function register_settings(): void {
// Child classes can override to register custom settings.
}

/**
* Renders feature-specific settings fields.
*
* Override this method in child classes to render custom settings UI
* that will appear within the feature's card on the settings page.
* This is called after the feature's main toggle control.
*
* @since 0.6.0
*
* @return void
*/
public function render_settings_fields(): void {
// Default implementation does nothing.
// Child classes can override to render custom settings UI.
}

/**
* Gets the option name for a custom feature setting field.
*
* Generates a properly namespaced option name for feature-specific settings.
* Use this when registering and rendering custom settings fields to ensure
* Use this when registering and storing custom settings fields to ensure
* consistent naming across the plugin.
*
* @since 0.6.0
Expand Down
8 changes: 4 additions & 4 deletions includes/Asset_Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class Asset_Loader {
* @param array<string, mixed>|null $asset_data Optional asset metadata (dependencies and version).
*/
public static function enqueue_script( string $handle, string $file_name, ?array $asset_data = null ): void {
$script_path = WPAI_PLUGIN_DIR . 'build/' . $file_name . '.js';
$script_url = WPAI_PLUGIN_URL . 'build/' . $file_name . '.js';
$script_path = WPAI_PLUGIN_DIR . 'build-scripts/' . $file_name . '.js';
$script_url = WPAI_PLUGIN_URL . 'build-scripts/' . $file_name . '.js';
$script_asset_path = substr( $script_path, 0, -3 ) . '.asset.php';

// If the file doesn't exist, don't try to enqueue it.
Expand Down Expand Up @@ -82,8 +82,8 @@ public static function enqueue_script( string $handle, string $file_name, ?array
* @param array<string, mixed>|null $asset_data Optional asset metadata (dependencies and version).
*/
public static function enqueue_style( string $handle, string $file_name, ?array $asset_data = null ): void {
$style_path = WPAI_PLUGIN_DIR . 'build/' . $file_name . '.css';
$style_url = WPAI_PLUGIN_URL . 'build/' . $file_name . '.css';
$style_path = WPAI_PLUGIN_DIR . 'build-scripts/' . $file_name . '.css';
$style_url = WPAI_PLUGIN_URL . 'build-scripts/' . $file_name . '.css';
$style_asset_path = substr( $style_path, 0, -4 ) . '.asset.php';
$handle = 'ai_' . $handle;

Expand Down
Loading
Loading