# AI App Onsite

**Contributors:** aiapponsite  
**Tags:** ai, gpt, ai-app, app-builder  
**Requires at least:** 4.7  
**Tested up to:** 6.7.1  
**Stable tag:** 1.2.4.3
**Requires PHP:** 7.0  
**License:** GPLv2 or later  
**License URI:** [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html)

Add AI-powered apps to any site in minutes. Forget OpenAI “GPTs” or Claude “Projects”. The power of AI is now in your hands (and on your website)!

---

## Description

AI App Onsite enables you to add AI-powered applications to any page on your WordPress site quickly and easily. With no coding required, you can create and customize AI apps with full control over fields, layout, styling, and functionality—all from within the WordPress backend.

### Features

- **Add App To Any Page On Your Site (And Promote To Your Audience):** Leverage all the power and capabilities of the latest AI foundation models and API options to create any kind of app. If you can imagine it you can build it.
- **Build Your App Inside WordPress (In 6 Steps):** You can build your AI app from start to finish using an easy 6 step process, right in the WordPress backend. No other server-side dependencies and everything runs on your site.
- **You Control Fields, Layout, Styling & Functionality:** Make the look and feel of your app match the style of your site, and customize the functionality for a powerful user experience tailored to your visitor needs.
- **Customize AI Prompts & Inputs:** AIappOnsite offers site owners full control over their app functionality including AI prompts and data, as well as AI model selection and parameter settings. If AI can do it, you can deliver it on your site.
- **Using Your API Key Means Lower Cost:** Get excellent value and low operational cost with a simple ‘bring your own key’ system. No paid credits or confusing tiers, just a simple flat rate subscription fee.

### Two Huge Benefits of Using AI App Onsite

- **Create Powerful Lead Magnets:** Having an AI app right on your site generates immediate value and feedback, sets you apart from your competitors and can even be a powerful magnet for links from industry news and media sites.
- **Dramatically Increase Conversions:** Turn more site visitors into engaged prospects and significantly increase customer data capture by providing real time feedback and answers to their specific client inputs and queries.

---

## Installation

1. Download the plugin files and upload them to the `/wp-content/plugins/ai-app-onsite` directory.
2. In the WordPress admin panel, go to **Plugins > Installed Plugins** and click **Activate** next to "AI App Onsite".
3. Configure your settings by navigating to **AI App Onsite** in the WordPress admin sidebar.

---

## Frequently Asked Questions

### How do I set up my first AI app using AI App Onsite?

After activating the plugin, go to the **AI App Onsite** menu in the WordPress dashboard and follow the six-step process to create your app.

### Can I customize the AI prompts and model settings?

Yes, AI App Onsite allows full customization of AI prompts, model parameters, and field settings to align with your specific use case and audience.

### Do I need an API key to use this plugin?

Yes, AI App Onsite requires you to bring your own API key, allowing for straightforward cost control and usage.

---

## Screenshots

1. **Plugin Settings Screen** – Configure basic settings for your app  
   ![Plugin Settings](AIappOnsite-PluginSettings.png)
2. **Model Settings Screen** – Select and configure the AI model for your app  
   ![Model Settings](AIappOnsite-ModelSettings.png)
3. **Field Selector** – Set up app fields and properties for visitor interactions  
   ![Field Selector](AIappOnsite-FieldSelector.png)
4. **Prompt Editor** – Enter and refine the AI prompt for your app  
   ![Prompt Editor](AIappOnsite-PromptEditor.png)

---

## Changelog

### 1.0.0
- Initial release.
### 1.1.0
- CSS issue & Auto open last tab

### 1.4.3 
- Fix - the app would not load correctly on some themes.
- Update - Improved compatibility with the latest WordPress version.
- Update - Updated the plugin to use the latest API endpoints for better performance and reliability.
- Fix - Enhanced the user interface for easier navigation and app creation.
- Fix - Improved error handling and user feedback during app interactions.
- Add - Added a new feature to allow users to save and create multiple app configurations for easier management.
- Update - Enhanced security measures to protect user data and API keys.
- Add - Added a new feature to allow users to preview their app with shadow and border-radius settings before publishing.
- Update - Field selector now supports more number of fields.

### 1.2.4.2
- **Default Value Handling**:  
  Ensured default values for `app_corner` and `app_height` are applied if missing in the app settings, preventing layout issues during app rendering.

- **Database Update Format Fix**:  
  Resolved an issue in the `$wpdb->update()` call where a missing `%s` in the format array caused incorrect or failed updates to `app_height` in the `app_settings` table.

- **Database Schema Auto-Fix on Upgrade**:  
  Added a safe check during plugin upgrade to ensure `app_corner` and `app_height` columns exist in the `app_properties` table. If missing, they are automatically added without requiring manual database migration.

### 1.2.4.3
- Resolved an issue where plugin activation failed due to $wpdb being undefined inside a schema update closure.



---

## Upgrade Notice

### 1.0.0
- First release of AI App Onsite, offering AI-powered app creation and customization within WordPress.

### 1.2.0
- First release of AI App Onsite, offering AI-powered app creation and customization within WordPress.

#### 1.2.3
- Premium features added, including advanced model settings and field customization options.

### 1.2.4
- Bug Fixes and performance improvements. Plugin Urgent Update: Resolved a critical issue regarding access key validation.

### 1.2.4.2 
- Fixed bugs affecting app preview rendering and live app behavior.
- Improved database handler consistency for better reliability.

### 1.2.4.3 
- Resolved an issue where plugin activation failed due to $wpdb being undefined inside a schema update closure.


---

## External Services

This plugin connects to the following third-party APIs:

### 1. [ipinfo.io](https://ipinfo.io)

- **Purpose:** To obtain the user's geographic information based on their IP address.
- **Data Sent:** IP address
- **Notes:** If the user's IP is unavailable or consent is not provided, a default location is used.
- [Terms of Service](https://ipinfo.io/terms), [Privacy Policy](https://ipinfo.io/privacy)

### 2. [OpenAI](https://openai.com)

- **Purpose:** To generate AI-based chat responses.
- **Data Sent:** User inputs from the chat form
- [Terms of Service](https://openai.com/policies/terms-of-use), [Privacy Policy](https://openai.com/policies/privacy-policy)
