A comprehensive WordPress plugin that provides Gutenberg blocks for integrating Todoist functionality into your WordPress site.
- Todo List Block: Display tasks from specific Todoist projects
- Todo Stats Block: Show task statistics and progress
- Secure API Integration: Uses Todoist Personal Access Token for secure authentication
- Responsive Design: Mobile-friendly blocks that work on all devices
- Real-time Updates: Interactive features for task management
- Site Admin Completion: A site admin can check off the boxes in the list display to complete tasks in the Todoist app.
- Monthly Productivity Report: Downloads stats for a given month/year and freezes them in-place so that they're not dependent on the API.
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Node.js and npm (for development)
-
Clone or download the plugin to your WordPress plugins directory:
wp-content/plugins/todoistberg/ -
Install dependencies (for development):
cd wp-content/plugins/todoistberg/ npm install -
Build the assets:
npm run build
-
Activate the plugin in WordPress admin
-
Configure your Todoist API token:
- Go to Settings → Todoistberg
- Get your Personal Access Token from Todoist Developer Settings
- Enter the token and test the connection
Display tasks from a specific Todoist project:
- Add the "Todoist Task List" block to your page/post
- Configure the block settings:
- Project: Select which Todoist project to display tasks from
- Maximum Items: Set how many tasks to show (1-50)
- Show Completed Tasks: Toggle to include completed tasks
- Title: Optional custom title for the block
Allow administrators to add tasks to your Todoist projects:
- Add the "Todoist Task Form" block to your page/post
- Configure the block settings:
- Project: Select which Todoist project to add tasks to
- Button Text: Customize the submit button text
- Placeholder Text: Customize the input placeholder
Note: This block is only visible to administrators on the frontend for security purposes.
Display completed task statistics:
- Add the "Todoist Completion Statistics" block to your page/post
- Configure which statistics to show:
- Show Today: Display tasks completed today
- Show This Week: Display tasks completed this week
- Show This Month: Display tasks completed this month
The plugin integrates with the Todoist REST API v2. All API calls are made server-side for security.
GET /projects- Fetch user's projectsGET /tasks- Fetch tasks with filtering optionsPOST /tasks- Create new tasksPOST /tasks/:id/close- Complete tasksPOST /tasks/:id/reopen- Reopen tasks
- API tokens are stored securely in WordPress options
- All API calls include proper authentication headers
- Nonces are used for all AJAX requests
- Input sanitization and validation on all user inputs
todoistberg/
├── src/
│ ├── blocks/
│ │ ├── todo-list.js
│ │ ├── todo-form.js
│ │ └── todo-stats.js
│ ├── index.js
│ ├── frontend.js
│ └── style.scss
├── build/ # Generated assets
├── todoistberg.php # Main plugin file
├── package.json
└── README.md
npm run build- Build production assetsnpm run start- Start development mode with hot reloadingnpm run lint:js- Lint JavaScript filesnpm run lint:css- Lint CSS filesnpm run format- Format code with Prettier
- Create a new block component in
src/blocks/ - Register the block in
src/index.js - Add styles to
src/style.scss - Update the main plugin file if needed
The plugin uses SCSS for styling. Main variables are defined in src/style.scss:
$todoistberg-primary: #db4c3f;
$todoistberg-secondary: #f5f5f5;
$todoistberg-text: #333;
$todoistberg-border: #ddd;The plugin provides several WordPress hooks for customization:
// Modify task data before display
add_filter('todoistberg_task_data', function($task) {
// Modify task data
return $task;
});
// Customize API response handling
add_action('todoistberg_api_response', function($response, $endpoint) {
// Handle API response
}, 10, 2);-
"Please configure your Todoist API token"
- Go to Settings → Todoistberg
- Enter your Personal Access Token
- Test the connection
-
"Connection failed"
- Verify your token is correct
- Check your internet connection
- Ensure the token has proper permissions
-
Blocks not appearing
- Ensure the plugin is activated
- Check for JavaScript errors in browser console
- Verify assets are built (
npm run build)
-
Tasks not loading
- Check if the project ID is correct
- Verify the project exists in your Todoist account
- Check API rate limits
Enable WordPress debug mode to see detailed error messages:
// In wp-config.php
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This plugin is licensed under the GPL v2 or later.
For support, please:
- Check the troubleshooting section above
- Search existing issues on GitHub
- Create a new issue with detailed information
- Initial release
- Todo List, Todo Form, and Todo Stats blocks
- Todoist API integration
- Admin settings page
- Responsive design
- Frontend interactivity