# Idesoftbcn AI Product Customizer — Plugin structure

Internal developer reference for the WordPress.org plugin layout.

## Directory layout

```
idesoftbcn-ai-product-customizer/
├── idesoftbcn-ai-product-customizer.php   # Main plugin bootstrap
├── uninstall.php
├── readme.txt                  # WordPress.org readme (English only)
├── license.txt
│
├── includes/
│   ├── bootstrap.php           # Activation, WooCommerce dependency
│   ├── constants.php           # Paths, API URLs, version
│   ├── loader.php              # Hook registration
│   ├── plugin.php              # Core logic
│   └── template.php            # Public template loader
│
├── admin/                      # WordPress admin (back office)
│   ├── css/
│   │   ├── admin.css           # Product edit screen styles
│   │   └── admin-guide.css     # Admin guide page styles
│   ├── js/
│   │   └── admin-product-uploader.js
│   └── views/
│       └── admin-guide.php     # Admin guide page template
│
├── public/                     # Storefront (front office)
│   ├── css/
│   │   ├── designer.css        # Product customizer UI
│   │   └── cart.css            # Cart / checkout thumbnails
│   ├── js/
│   │   ├── designer.js         # Main designer script
│   │   ├── iapc-form-enctype.js
│   │   ├── iapc-cart-thumbnail.js
│   │   └── designer/           # Designer modules
│   └── templates/
│       ├── customizer-panels.php
│       ├── designer-wrap.php
│       └── ai-guided-modal.php
│
├── assets/                     # Static media (shared)
│   ├── graphics/               # SVG shapes for the designer
│   ├── stickers/               # Included sticker PNGs
│   ├── admin/images/           # Screenshots for admin guide
│   ├── logo.svg
│   └── (WP.org assets: banners, icons, screenshots — NOT in plugin ZIP; see ../w.org-directory-assets/)
```

## Path constants

Defined in `includes/constants.php`:

| Constant | Example use |
|----------|-------------|
| `IAPC_PLUGIN_DIR` / `IAPC_PLUGIN_URL` | Plugin root |
| `IAPC_ADMIN_DIR` / `IAPC_ADMIN_URL` | `admin/` assets and views |
| `IAPC_PUBLIC_DIR` / `IAPC_PUBLIC_URL` | `public/` assets and templates |

## Conventions

- **Admin hooks and enqueues** → files under `admin/`
- **Storefront hooks and enqueues** → files under `public/`
- **Shared PHP logic** → `includes/plugin.php` (may be split later)
- **Shared images** → `assets/` (not under `admin/` or `public/`)

## Translations

- **Plugin UI**: text domain `idesoftbcn-ai-product-customizer` (i18n-ready). Do **not** ship a `languages/` folder, `.po`, `.mo`, or `.pot` in the WordPress.org ZIP.
- **Local demos (optional)**: `.po` / `.mo` may live under `basura/translations/` outside the plugin package
- **WordPress.org readme**: `readme.txt` in **English only**
- **Community translations**: via [translate.wordpress.org](https://translate.wordpress.org/) after plugin approval

## WordPress.org SVN layout (after approval)

```
svn-repo/
├── trunk/          # Plugin code (this folder structure)
├── tags/1.0.1/     # Stable release snapshot
└── assets/         # banner-*.png, icon-*.png, screenshot-*.png (not inside trunk)
```

## Release ZIP

Exclude from the distribution ZIP (see `.distignore` at workspace root):

- `basura/` (dev tools)
- `.git/`
- `docs/` (optional — internal only)
