Library Manager
Stores books in a custom database table, exposes a secure REST API, and provides a React-based admin interface.
by Antigravity · github.com/emon0196/wordpress-library-manager-plugin
★ 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/emon0196/wordpress-library-manager-plugin/archive/refs/heads/main.zipWordPress Library Manager
A comprehensive WordPress plugin for managing a library of books. Features a custom database table, a secure REST API, and a React-based Admin Dashboard.
Features
- Custom Database Table: Optimized storage for book records.
- REST API: Full CRUD operations with secure authentication (Nonce & Capabilities).
- React Admin Dashboard: Modern Single Page Application (SPA) for managing books.
- Filtering & Pagination: Efficient data handling.
- Status Management: Visual indicators for book availability.
Installation
- Download the plugin ZIP file from GitHub.
- Go to your WordPress Admin -> Plugins -> Add New -> Upload Plugin.
- Upload
wordpress-library-manager.zipand Activate. - Upon activation, the database table
wp_library_bookswill be created automatically.
Usage
Navigate to Library Manager -> Dashboard in the admin menu.
- Add Book: Click "Add New Book", fill in the details (Title, Author, Year, Status) and save.
- Edit Book: Click the "Edit" button on any book row.
- Delete Book: Click the "Delete" button (requires confirmation).
- Filter: Use the status dropdown to filter the list.
REST API Documentation
Base URL: /wp-json/library/v1
Get Books
- Endpoint:
GET /books - Params:
page,per_page,status,author,year - Response: List of books object.
Get Single Book
- Endpoint:
GET /books/{id} - Response: Single book object.
Create Book
- Endpoint:
POST /books - Headers:
X-WP-Nonce: <nonce> - Body:
{ "title": "...", "author": "...", ... } - Response: Created book object.
Update Book
- Endpoint:
PUT /books/{id} - Headers:
X-WP-Nonce: <nonce> - Body: Fields into update.
Delete Book
- Endpoint:
DELETE /books/{id} - Headers:
X-WP-Nonce: <nonce> - Status: 204 No Content.
Development
- Clone the repository.
- Run
npm installto install dependencies. - Run
npm startfor development (hot reloading). - Run
npm run buildfor production build.
License
GPL-2.0-or-later