- Add OpenAI API Key field
-
Add OpenAI Endpoint field(Converted to constant: https://api.openai.com/v1/) - Implement OpenAI model fetching via API (Added proper class loading and error handling)
- Add OpenAI model dropdown with placeholder and loading states
- Add Deepseek API Key field (Added with description)
- Add Deepseek Endpoint field (Added with default value)
- Implement Deepseek model fetching via API (Using Deepseek_Service class)
- Add Deepseek model dropdown (Dynamically populated when API key provided)
- Add Gemini API Key field (Added with description)
- Add Gemini model dropdown with all required options:
- gemini-2.0-flash-exp
- gemini-1.5-flash
- gemini-1.5-flash-8b
- gemini-1.5-pro
- gemini-1.0-pro
- text-embedding-004
- Add Algolia Application ID field
- Add Algolia Search API Key field
- Add Algolia Admin API Key field
- Add Google Search API Key field
- Add Search Engine ID field
- Add checkbox for "All Pages"
- Add checkbox for "Homepage Only"
- Add checkbox for "Posts"
- Add checkbox for "Pages"
- Add checkbox for "Products"
- Add Debug Logging Switch
- Add "Enable Lead Collection" switch
- Add "Ask for Contact Info" timing selector:
- At the start of conversation
- Other timing options
- Add FluentCRM list dropdown
- Add FluentCRM tag dropdown
- Add Contact Status field
- Add Lead Collection Heading field
- Add Lead Collection Description field
- First restore basic form structure
- Implement field rendering methods
- Add API endpoints and credentials
- Implement model fetching functionality
- Add lead collection settings
- Test and validate each section
- Ensure proper sanitization of all fields
- Implement proper error handling
- Add inline documentation
- Test integration with FluentCRM
-
admin/class-admin-settings.php
- Add new fields
- Implement field rendering methods
- Add sanitization for new fields
- Implement AJAX handlers for model fetching
-
admin/views/settings-page.php
- Update form structure
- Add new sections
- Improve layout
-
admin/js/admin-settings.js
- Add dynamic model fetching
- Implement field visibility toggling
- Add validation
-
admin/css/admin-settings.css
- Update styles for new sections
- Improve responsive design
- Test each API integration separately
- Verify model fetching for each provider
- Test lead collection flow
- Verify FluentCRM integration
- Test all form validation
- Verify settings are saved correctly
- Test display locations functionality
- Verify debug logging
All changes should preserve existing functionality while adding missing features. Each feature should be implemented incrementally and tested thoroughly before moving to the next one.