The Health Diagnosis Plugin is a WordPress plugin combined with a Vue.js frontend to detect plant diseases using artificial intelligence. This plugin leverages Naive UI, a Vue 3 Component Library, and TypeScript to deliver a seamless and interactive user experience. The backend is developed in PHP to integrate smoothly with WordPress, allowing the use of shortcodes to embed the plugin on any page of your website.
- AI-based plant disease detection
- Seamless integration with WordPress
- Modern Vue.js frontend
- User-friendly interface with Naive UI components
- Shortcode functionality for easy embedding in WordPress pages or posts
- Support for both Arabic and English languages
Admins have access to a dedicated tab "AI Detection" in the WordPress dashboard where they can:
- Manage plants and diseases.
- Manage AI models.
- View user process history.
To set up the project for development, follow these steps:
- Clone the repository:
git clone https://github.com/mfoud5391/health-diagnosis-plugin.git
- Navigate to the frontend directory:
cd frontend
- Install dependencies using pnpm (install pnpm globally if not available):
If pnpm is not found, install it globally using npm:
pnpm i
npm install -g pnpm
- Run the development server:
./run.sh
- In
app_vue.php
, uncomment the following line to enable the development server:<script type="module" src="http://localhost:3006/src/main.ts"></script>
- For excluding prediction files in your PHP code, comment out the lines as shown in the following example:
<!-- <script type="module" crossorigin src="<?php echo plugin_dir_url(__FILE__) . 'frontend/dist/assets/index-41f7c117.js' ?>"></script> --> <!-- <link rel="stylesheet" href="<?php echo plugin_dir_url(__FILE__) . 'frontend/dist/assets/index-a06995a4.css'; ?>"> -->
Enjoy live development with hot reloading.
To build the project for production:
- Navigate to the frontend directory:
cd frontend
- Run the build script:
./d.sh
- Go to
wp-health-diagnosis-plugin/hd-plugin/frontend/dist/index.html
and copy the main JS and CSS file names:<script type="module" crossorigin src="/assets/index-41f7c117.js"></script> <link rel="stylesheet" href="/assets/index-a06995a4.css">
- In
app_vue.php
, comment out the development server script line and replace it with the production files , show following example:<!-- <script type="module" src="http://localhost:3006/src/main.ts"></script> --> <script type="module" crossorigin src="<?php echo plugin_dir_url(__FILE__) . 'frontend/dist/assets/index-41f7c117.js' ?>"></script> <link rel="stylesheet" href="<?php echo plugin_dir_url(__FILE__) . 'frontend/dist/assets/index-a06995a4.css'; ?>
After building the project and setting up the plugin, you can find wp-health-diagnosis-plugin.zip
in the root folder. To install the plugin in WordPress:
- Go to the WordPress dashboard.
- Navigate to the Plugins section.
- Click on "Add New" and then "Upload Plugin."
- Choose the file
health-diagnosis-plugin.zip
and upload it. - Activate the plugin.
Congratulations! The plugin is now installed and activated.
Once the plugin is activated, you can access the user interface at:
- User:
http://yourwebsite.com/detectionai
- Admin: A new tab "AI Detection" will be available in the WordPress dashboard to manage plants, models, diseases, and user process history.
You can use the following shortcode to embed the detection feature on any page of your website:
[detectionai_shortcode]
For support, please raise an issue on the GitHub repository or contact the maintainer via email at mfoud444@gmail.com.