WP Manifestindependent plugin directory
manifest / ai / plant-disease-detector

Plant Disease Detector

🌿 AI-powered WordPress plugin for plant disease detection. Supports Google AI Studio, Ollama (local), and OpenRouter. Features multilingual reports (20+ languages), scan history, RTL support, and drag-and-drop image upload.

by Ahmad Wael Β· github.com/devwael/plant-disease-detector Β· website

β˜… 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/devwael/plant-disease-detector/archive/refs/heads/main.zip

Readme

Plant Disease Detector

A WordPress plugin that uses AI vision models to detect plant diseases from images. Simply upload a photo of your plant and get instant diagnosis with treatment recommendations.

🌿 Features

  • AI-Powered Analysis – Identify plant species and detect diseases using advanced vision AI models
  • Multiple AI Providers – Choose between Google AI Studio, Ollama (local), or OpenRouter
  • Multilingual Reports – Get analysis results in 20+ languages including Arabic, Spanish, French, Chinese, and more
  • Scan History – Logged-in users can view, manage, and delete their past scans
  • RTL Support – Full right-to-left language support for Arabic, Persian, and Urdu
  • Modern UI – Clean, responsive design with drag-and-drop, paste (Ctrl+V), and click-to-upload support
  • Privacy Focused – Scans are stored per-user as custom post types

πŸ“¦ Requirements

  • WordPress 5.0+
  • PHP 7.4+
  • An API key from one of the supported AI providers

βš™οΈ Installation

  1. Download or clone this repository into your /wp-content/plugins/ directory:

    cd /wp-content/plugins/
    git clone https://github.com/bbioon/plant-disease-detector.git
  2. Install Composer dependencies:

    cd plant-disease-detector
    composer install
  3. Activate the plugin in Plugins β†’ Installed Plugins

  4. Configure your AI provider in Settings β†’ Plant Detector

πŸ”§ Configuration

Navigate to Settings β†’ Plant Detector to configure:

AI Providers

Provider API Key Required Models
Google AI Studio Yes (Get Key) gemini-2.0-flash-exp, gemini-1.5-pro, gemini-1.5-flash
Ollama (Local) No llava, gemma3-vision, or any vision model
OpenRouter Yes (Get Key) google/gemma-2-9b-it:free and 100+ models

Report Language

Select from 20+ languages for AI-generated reports:

  • English, Arabic, Spanish, French, German, Italian, Portuguese
  • Russian, Chinese, Japanese, Korean, Hindi, Bengali
  • Turkish, Dutch, Polish, Vietnamese, Thai, Indonesian, Persian, Urdu, Swahili

πŸš€ Usage

Detector Shortcode

Add the plant disease detector form to any page or post:

[plant_disease_detector]

Users can:

  • Click to upload an image
  • Drag and drop an image
  • Paste an image from clipboard (Ctrl+V)

History Shortcode

Display the user's scan history (requires login):

[plant_disease_history]

Features:

  • Grid layout with pagination (12 items per page)
  • View scan details, descriptions, and treatments
  • Delete individual scans

πŸ“ Project Structure

plant-disease-detector/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ css/
β”‚   β”‚   β”œβ”€β”€ style.css         # Main detector styles
β”‚   β”‚   └── history.css       # History page styles
β”‚   └── js/
β”‚       β”œβ”€β”€ script.js         # Detector functionality
β”‚       └── history.js        # History page functionality
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Admin/
β”‚   β”‚   └── Settings.php      # Admin settings page
β”‚   β”œβ”€β”€ Ajax/
β”‚   β”‚   └── Handler.php       # AJAX request handler
β”‚   β”œβ”€β”€ Api/
β”‚   β”‚   β”œβ”€β”€ Client.php        # API client factory
β”‚   β”‚   β”œβ”€β”€ ProviderInterface.php
β”‚   β”‚   └── Providers/
β”‚   β”‚       β”œβ”€β”€ GoogleAIProvider.php
β”‚   β”‚       β”œβ”€β”€ OllamaProvider.php
β”‚   β”‚       └── OpenRouterProvider.php
β”‚   β”œβ”€β”€ Frontend/
β”‚   β”‚   β”œβ”€β”€ HistoryPage.php   # History shortcode
β”‚   β”‚   └── Shortcode.php     # Detector shortcode
β”‚   β”œβ”€β”€ History/
β”‚   β”‚   └── ScanRepository.php # Scan data access
β”‚   β”œβ”€β”€ PostTypes/
β”‚   β”‚   └── ScanPostType.php  # Custom post type
β”‚   └── Plugin.php            # Main plugin class
β”œβ”€β”€ vendor/                   # Composer dependencies
β”œβ”€β”€ composer.json
└── plant-disease-detector.php # Plugin entry point

πŸ”Œ Architecture

The plugin follows a modular, object-oriented architecture:

  • Provider Interface Pattern – Easily extend with new AI providers by implementing ProviderInterface
  • Repository Pattern – ScanRepository handles all database operations for scans
  • Singleton Bootstrap – Plugin class ensures single initialization
  • Custom Post Type – Scans stored as pdd_scan posts with meta for analysis data
  • PSR-4 Autoloading – Clean namespace structure via Composer

πŸ›‘οΈ Security

  • All AJAX requests protected with WordPress nonces
  • Input sanitization using WordPress sanitization functions
  • Output escaping with esc_html(), esc_attr(), and wp_kses_post()
  • Capability checks for admin settings (manage_options)
  • User-specific scan access control

🌐 Hooks & Extensibility

Filters

// Modify analysis result before saving
add_filter('pdd_analysis_result', function($result, $image_data) {
    // Customize result
    return $result;
}, 10, 2);

Actions

// After a scan is saved
add_action('pdd_scan_saved', function($post_id, $result) {
    // Custom logic
}, 10, 2);

πŸ“ License

This plugin is licensed under the GPL-2.0-or-later.

πŸ‘€ Author

Ahmad Wael
Website: www.bbioon.com


Made with 🌱 for plant lovers everywhere

Read the full README on GitHub →