```php ``` ### Key Updates in `joebot.php` - **Enqueue Function**: The `joebot_enqueue_scripts` function uses `wp_enqueue_style` and `wp_enqueue_script` to load `joebot-styles.css` and `joebot-scripts.js` from the plugin directory (`plugin_dir_url(__FILE__)` ensures correct file paths). - **Nonce for Security**: Added a nonce (`wp_create_nonce('joebot_nonce')`) to the `joebot_ajax` object and included `check_ajax_referer` in the AJAX handlers to enhance security. - **Default Motivational Text**: Added a fallback text (`Stay inspired and keep pushing forward!`) in the `joebot_get_motivational_text` function for consistency with the JavaScript fallback. - **Shortcode**: Kept the `[joebot]` shortcode, which outputs the chatbot HTML structure, making it compatible with Elementor’s Shortcode widget. ### Steps to Install on Your Elementor-Based Website 1. **Create Plugin Directory and Upload Files**: - Access your WordPress site via FTP (e.g., FileZilla) or a file manager plugin (e.g., WP File Manager). - Navigate to `wp-content/plugins/`. - Create a folder named `joebot`. - Upload the following files to `wp-content/plugins/joebot/`: - `joebot.php` (use the content above). - `joebot-scripts.js` (from the previous response with `bottom: 80px` and `left: -10px`). - `joebot-styles.css` (from the previous response with `bottom: 80px` and `left: -10px`). - Ensure file permissions are set to 644 for files and 755 for the directory. 2. **Activate the Plugin**: - Log in to your WordPress admin dashboard. - Go to **Plugins > Installed Plugins**. - Find **JoeBot Chatbot** in the list and click **Activate**. 3. **Add the Chatbot to Your Elementor Page**: - **Using the Shortcode** (Recommended for Elementor): - Edit the page where you want the chatbot to appear in Elementor (e.g., **Pages > All Pages > Edit with Elementor**). - Drag the **Shortcode** widget from the Elementor sidebar to the desired section. - In the Shortcode widget settings, enter `[joebot]`. - Save and publish the page. - **Alternative: Using Custom HTML** (if you prefer manual HTML): - Drag the **HTML** widget to the page. - Paste the HTML from the `joebot_shortcode` function (as shown in the previous response): ```html