๐Ÿ”’ Admin Guide – Security & Database

Technical Administration Guide for Farmers Bounty v3.5.0

This guide covers the technical architecture, security features, database management, and administrative tools available in Farmers Bounty. Intended for WordPress administrators and developers.

๐Ÿ“‘ Table of Contents


๐Ÿ” Credential Store

Encrypted API Key Storage

Farmers Bounty v3.5.0 introduces the Farmers_Bounty_Credential_Store class for secure API key management:

Supported Keys:

  • Weather Underground API Key and Station ID
  • Perenual API Key
  • Claude AI (Anthropic) API Key
  • Tavily API Key
  • PlantNet API Key

Security Features:

  • Encryption at Rest: All API keys are encrypted before storage in the database
  • WordPress NONCE Integration: All credential operations use WordPress security nonces
  • Capability Checks: Only administrators can view or modify credentials
  • Masked Display: Keys are masked (e.g., sk-ant-...****) in the admin interface

Key Resolution Order:

The system resolves API keys in this priority order:

  1. wp-config.php Constants: Highest priority (e.g., FARMERS_BOUNTY_CLAUDE_API_KEY)
  2. Encrypted Credential Store: Stored in wp_options with encryption
  3. wp_options Fallback: Legacy plain-text storage (for backward compatibility)
๐ŸŽจ Pro Tip: For maximum security, define API keys as constants in wp-config.php. This prevents them from being stored in the database entirely.

๐Ÿ—„๏ธ Database Architecture

37 Tables Organized by Version

Farmers Bounty creates 37 database tables, organized by the version that introduced them:

Core Tables (v1.0):

TableDescription
wp_fb_plantsPlant library with API-sourced data
wp_fb_user_gardensUser garden instances and locations
wp_fb_user_plantsPlants in user’s garden with status
wp_fb_weather_cacheWeather data from PWS
wp_fb_calendar_eventsGarden calendar events
wp_fb_api_cacheAPI response cache

Extended Tables (v2.0):

  • wp_fb_seed_inventory โ€” Seed packet tracking
  • wp_fb_harvests โ€” Harvest records and yields
  • wp_fb_care_logs โ€” Plant care activity logs
  • wp_fb_garden_layouts โ€” Visual garden designs
  • wp_fb_succession_plans โ€” Succession planting schedules
  • wp_fb_purchase_lists โ€” Shopping lists
  • wp_fb_purchase_items โ€” Individual list items

Feature Tables (v3.0):

  • wp_fb_pollinator_sightings โ€” Pollinator observation logs
  • wp_fb_preservation_recipes โ€” Preservation recipes
  • wp_fb_preserved_goods โ€” Preserved food inventory
  • wp_fb_learnings โ€” Season learning entries
  • wp_fb_notifications โ€” User notifications
  • wp_fb_plant_diagnoses โ€” AI diagnosis records
  • wp_fb_plant_photos โ€” Plant photo gallery
  • wp_fb_layout_snapshots โ€” Garden layout snapshots

AI & Integration Tables (v4.0-v4.4):

  • wp_fb_conversations โ€” AI conversation threads
  • wp_fb_conversation_messages โ€” Individual conversation messages
  • wp_fb_gdd_tracking โ€” Growing degree day records
  • wp_fb_soil_tests โ€” Soil test results
  • wp_fb_companion_plants โ€” Companion planting relationships
  • wp_fb_water_logs โ€” Watering event records
  • wp_fb_water_zones โ€” Irrigation zone definitions
  • wp_fb_integrations โ€” Third-party integration settings
  • wp_fb_sync_log โ€” Desktop app sync history
  • wp_fb_knowledgebase โ€” Custom knowledge articles
  • wp_fb_plant_identifications โ€” PlantNet ID records
  • wp_fb_crop_rotation โ€” Crop rotation history
  • wp_fb_personas โ€” User persona selections
  • wp_fb_feature_flags โ€” Feature customization flags
  • wp_fb_analytics_cache โ€” Pre-computed analytics data
  • wp_fb_error_log โ€” Plugin error tracking
๐Ÿ’ก Database Management: Use Farmers Bounty โ†’ Database Setup to view all tables, check their status, and recreate any missing tables. The system automatically runs migrations when the plugin is updated.

๐Ÿ’ฌ Conversation Database

Shared Conversation Storage

The conversation database is shared between Farmers Bounty and the companion Gardener’s Bounty AI Assistant plugin:

wp_fb_conversations Table:

  • id: Unique conversation identifier
  • user_id: WordPress user who owns the conversation
  • title: Conversation title (auto-generated or user-defined)
  • created_at: When conversation started
  • updated_at: Last message timestamp
  • source: Which plugin created it (farmers-bounty or gardeners-bounty)

wp_fb_conversation_messages Table:

  • id: Unique message identifier
  • conversation_id: Parent conversation
  • role: “user” or “assistant”
  • content: Message text
  • metadata: JSON with sources, context used, token counts
  • created_at: Message timestamp

โšก Query Optimizer

Farmers_Bounty_Query_Optimizer Class

The Query Optimizer manages token budgeting for Claude API context assembly:

How It Works:

  1. Token Budget: Calculates available context window based on model limits
  2. Priority Ranking: Ranks context fragments by relevance to the user’s question
  3. Fragment Assembly: Assembles the most relevant context within the token budget:
    • System prompt (always included)
    • Weather data (high priority for weather questions)
    • Plant database (high priority for plant questions)
    • Knowledgebase articles (matched by relevance)
    • Conversation history (most recent messages)
    • GDD and frost data (seasonal context)
    • Planting calendar (timing context)
  4. Overflow Handling: Gracefully truncates least important context when budget is exceeded
โš ๏ธ Token Economics: Efficient context management keeps API costs low. The optimizer typically uses 2,000-4,000 tokens of context per query, keeping costs under $0.01 per question.

๐ŸŒฑ Garden Data Service

Farmers_Bounty_Garden_Data_Service Class

Builds real-time context for AI responses by assembling data from multiple sources:

Context Components:

  • Weather Context: Current conditions, forecast, recent rainfall, temperature trends from PWS
  • Plant Context: User’s active plants, their status, locations, and care history
  • GDD Context: Current growing degree day accumulation and plant development predictions
  • Frost Context: Last frost date, first frost date, days in growing season
  • Calendar Context: Upcoming events, overdue tasks, planting windows
  • Seasonal Context: Current season, what to plant now, what to harvest

Data Freshness:

  • Weather data: Refreshed every 15 minutes from PWS
  • Plant data: Real-time from database
  • GDD data: Calculated daily from weather history
  • Calendar data: Real-time from events table

๐Ÿ“… Georgia Planting Calendar

Farmers_Bounty_Georgia_Planting_Calendar Class

Provides month-by-month planting data optimized for USDA Zone 7b/8a (Atlanta, Georgia):

Data Includes:

  • Monthly Planting Recommendations: What to plant each month
  • Indoor vs Outdoor: When to start indoors vs direct sow
  • Transplant Timing: When to move seedlings outside
  • Last Frost Date: March 15-April 1 (average for Atlanta)
  • First Frost Date: November 1-15 (average for Atlanta)
  • Season Extension: Recommendations for extending growing season

Integration:

The planting calendar is used by:

  • AI Assistant (provides timing context for planting questions)
  • Calendar auto-generation (creates planting events)
  • Dashboard widgets (shows “what to plant now”)
  • Succession planting calculator

๐Ÿ“š Knowledgebase System

Reference Data Directories

The knowledgebase is stored in the knowledgebase/ directory of the plugin:

DirectoryContents
knowledgebase/pests/Pest identification guides, treatment options, prevention strategies for Georgia
knowledgebase/diseases/Plant disease reference, symptoms, organic and conventional treatments
knowledgebase/soil/Soil management, amendments, testing guides, Georgia clay soil solutions
knowledgebase/reference-data/Atlanta climate data, Georgia native plants, companion planting charts, USDA zone data

Knowledge Loader Admin Tool

Access at Farmers Bounty โ†’ Knowledge Base โ†’ Load Data

  • Import reference data files into the searchable knowledgebase
  • Index content for fast retrieval
  • Update existing entries
  • View loaded data statistics

RAG-Powered Search

The knowledgebase supports Retrieval-Augmented Generation (RAG) search:

  • User queries are matched against knowledgebase content
  • Most relevant articles are included in AI context
  • Reduces AI hallucination by providing authoritative local data
  • Prioritizes Georgia-specific information

๐Ÿ›ก๏ธ Privacy & Compliance

Farmers_Bounty_Privacy_Compliance Class

GDPR Consent Notices:

  • Consent banner displayed on first use of AI features
  • Clear explanation of data usage
  • Opt-in/opt-out controls
  • Consent status stored per user

Data Handling:

ServiceData SentData Stored
Claude AI (Anthropic)Question text, garden context, conversation historyAnthropic does not store prompts for training
Tavily (Web Search)Search query text onlyStandard search logging
Weather UndergroundStation ID for data retrievalPublic weather data

Key Privacy Principles:

  • No third-party sharing: Garden data is never sold or shared with third parties
  • Minimal data transmission: Only necessary context is sent to AI services
  • Local storage: All garden data remains in your WordPress database
  • User control: Export or delete all your data at any time
  • Transparent sources: AI responses indicate which data sources were used

๐Ÿ” Diagnostics

Access at Farmers Bounty โ†’ Diagnostics

System Information:

  • WordPress, PHP, MySQL versions
  • Plugin version and active features
  • Server configuration details
  • Memory usage and limits

Health Checks:

  • Database: All 37 tables exist and are healthy
  • APIs: Connection status for all configured APIs
  • Permissions: File and folder permissions
  • Cron Jobs: Scheduled tasks running correctly
  • Cache: Cache system functioning
  • Credential Store: Encryption working correctly

Error Logs:

  • View recent plugin errors
  • Filter by severity (info, warning, error, critical)
  • Search and export logs
  • Clear old log entries

API Usage Monitoring:

  • Calls made per API per day/week/month
  • Estimated costs for Claude AI
  • Rate limit status
  • Failed request tracking
  • Average response times

๐Ÿ“ All Shortcodes Reference

ShortcodeDescription

Garden Assistant

Online
โœจ
Ask anything about gardening โ€” planting, pests, watering, harvest timing, and more

Quick Actions

Suggestions

What I Can Help With

  • ๐ŸŒฑ Planting advice
  • ๐Ÿ’ง Watering guidelines
  • ๐Ÿ› Pest management
  • โ˜€๏ธ Weather-based tips
  • ๐Ÿ”„ Crop rotation
  • ๐Ÿ“… Planting schedules
AI Chatbot with conversation management
You need Editor permissions to access the dashboard.
Main garden dashboard

Please log in to view your plants.

Plant management interface
You need Editor permissions to access the calendar.
Garden calendar view

Current Weather

Old Fourth Ward 33.7705ยฐN, 84.3700ยฐW
0 ยฐF
Clear
๐Ÿ’ง Humidity: --%
๐Ÿ’จ Wind: 0 mph
๐ŸŒง๏ธ Rainfall: 0.00"
Weather dashboard with PWS data
[fb_garden_designer]Visual garden layout designer
You need Editor permissions to access seed inventory.
Seed packet tracking
[fb_water_management]Water tracking and recommendations
You need Editor permissions to view analytics.
Garden performance analytics
[fb_plant_diagnosis]AI plant problem diagnosis
[fb_plant_id]PlantNet photo identification
[fb_native_plants]Native plant database browser
[fb_pollinators]Pollinator dashboard and tracker
[fb_preservation]Preservation guide and recipes
[fb_knowledge_base]Searchable knowledge base
[fb_glossary]Gardening terminology glossary
[fb_gdd_tracker]Growing degree day tracker
[fb_csv_export]Data export interface

๐Ÿ“‹ Changelog – v3.5.0 Highlights

Version 3.5.0 โ€” February 14, 2026

๐Ÿ†• New Features:

  • AI-Powered Chatbot: Full-featured AI gardening assistant with three-panel interface, powered by Claude AI
  • Conversation Management: Create, rename, delete, search, export, and import conversations
  • Encrypted Credential Store: Farmers_Bounty_Credential_Store class for secure API key storage with encryption at rest
  • Georgia Planting Calendar: Farmers_Bounty_Georgia_Planting_Calendar with month-by-month data for Zone 7b/8a
  • Query Optimizer: Farmers_Bounty_Query_Optimizer for intelligent token budgeting in AI context assembly
  • Garden Data Service: Farmers_Bounty_Garden_Data_Service for real-time context building (weather, plants, GDD, frost, calendar)
  • Conversation Database: Dedicated wp_fb_conversations and wp_fb_conversation_messages tables with import/export
  • Privacy Compliance: Farmers_Bounty_Privacy_Compliance class with GDPR consent management

๐Ÿ“š Enhanced Knowledgebase:

  • New knowledgebase/pests/ directory with Georgia-specific pest guides
  • New knowledgebase/diseases/ directory with plant disease reference
  • New knowledgebase/soil/ directory with soil management guides
  • Expanded knowledgebase/reference-data/ with regional planting data
  • Knowledge Loader admin tool for importing reference data
  • RAG-powered search for AI context retrieval

๐Ÿ”ง Improvements:

  • Enhanced

    Garden Assistant

    Online
    โœจ
    Ask anything about gardening โ€” planting, pests, watering, harvest timing, and more

    Quick Actions

    Suggestions

    What I Can Help With

    • ๐ŸŒฑ Planting advice
    • ๐Ÿ’ง Watering guidelines
    • ๐Ÿ› Pest management
    • โ˜€๏ธ Weather-based tips
    • ๐Ÿ”„ Crop rotation
    • ๐Ÿ“… Planting schedules
    shortcode with configurable attributes
  • Quick Actions buttons (Today’s Tasks, Weather Impact, Harvest Ready, Pest Check)
  • Suggestion chips for follow-up questions
  • Source indicators showing data provenance in AI responses
  • Shared conversation database with Gardener’s Bounty AI Assistant plugin
  • Improved diagnostics with credential store health checks

๐Ÿ”— Related Guides

  • Getting Started: Installation and initial setup
  • AI Assistant & Chatbot: Using the AI gardening assistant
  • Integrations & Settings: API key configuration
  • Tools & Features: Data management and diagnostics