Skip to content

nadimtuhin/wp-noticeboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WP Noticeboard Plugin

A comprehensive WordPress noticeboard plugin for internal portals with advanced analytics tracking and extensive hook system for third-party integrations.

Author

Features

🎯 Core Functionality

  • Notice Management: Full CRUD operations with rich text editor
  • Role-Based Permissions: WordPress capability system integration
  • Categories: Color-coded notice categories (General, Policy, Event, Urgent)
  • Priority Levels: High, Medium, Low with visual indicators
  • Scheduling: Start/end date management
  • Status Control: Draft, Published, Archived states

πŸ“Š Analytics System

  • User Tracking: Track logged-in WordPress users with timestamps
  • Anonymous Tracking: Simple counter for non-logged visitors
  • View Analytics: Detailed view reports and statistics
  • Export Functionality: CSV export of analytics data
  • Read Status: Track read/unread status per user

🎨 Frontend Features

  • Responsive Design: Mobile-first approach
  • Shortcodes: [noticeboard] and [notice id="123"]
  • Widgets: Sidebar widget for latest notices
  • Dashboard Widget: Admin dashboard integration
  • Accessibility: Screen reader friendly and keyboard navigable

πŸ”§ Technical Features

  • WP AJAX: Native WordPress AJAX implementation
  • Hook System: 38+ action and filter hooks for extensibility
  • Security: Nonce verification, capability checks, data sanitization
  • Performance: Optimized queries and Intersection Observer for view tracking
  • Standards Compliant: WordPress coding standards

Installation

  1. Download the plugin files
  2. Upload to /wp-content/plugins/wp-noticeboard/
  3. Activate the plugin through the 'Plugins' menu in WordPress
  4. Configure settings and permissions as needed

Usage

Shortcodes

Display Noticeboard

[noticeboard limit="10" category="general" priority="high"]

Attributes:

  • limit: Number of notices to display (default: 10)
  • category: Filter by category slug
  • priority: Filter by priority (high, medium, low)
  • show_category: Show category badge (true/false)
  • show_priority: Show priority indicator (true/false)
  • show_date: Show creation date (true/false)
  • show_author: Show author name (true/false)
  • excerpt_length: Number of words for excerpt (default: 150)

Single Notice

[notice id="123" show_category="true" track_view="true"]

Widgets

Add the "Noticeboard Widget" to any sidebar to display latest notices with customizable options.

Hooks & Extensibility

The plugin provides extensive hook system for developers:

Action Hooks

  • wp_noticeboard_init - Plugin initialization
  • wp_noticeboard_notice_created - After notice creation
  • wp_noticeboard_notice_updated - After notice update
  • wp_noticeboard_notice_deleted - After notice deletion
  • wp_noticeboard_view_tracked - After view tracking
  • And 20+ more hooks...

Filter Hooks

  • wp_noticeboard_notice_data - Modify notice data
  • wp_noticeboard_display_content - Modify display content
  • wp_noticeboard_analytics_data - Modify analytics data
  • wp_noticeboard_user_capabilities - Modify user permissions
  • And 12+ more filters...

Example Integration

// Send Slack notification for high priority notices
add_action('wp_noticeboard_notice_created', function($notice_id, $data) {
    if ($data['priority'] === 'high') {
        // Send to Slack webhook
        wp_remote_post('https://hooks.slack.com/webhook', array(
            'body' => json_encode(array(
                'text' => 'New urgent notice: ' . $data['title']
            ))
        ));
    }
}, 10, 2);

// Add engagement score to analytics
add_filter('wp_noticeboard_analytics_data', function($data, $notice_id) {
    $data['engagement_score'] = calculate_engagement_score($notice_id);
    return $data;
}, 10, 2);

User Capabilities

  • manage_notices - Full notice management (Admin, Editor)
  • create_notices - Create new notices (Admin, Editor, Author)
  • edit_notices - Edit existing notices (Admin, Editor)
  • delete_notices - Delete notices (Admin only)
  • view_analytics - View analytics data (Admin, Editor)
  • export_analytics - Export analytics (Admin only)

Database Schema

Tables Created

  • wp_noticeboard_notices - Main notices storage
  • wp_noticeboard_categories - Notice categories
  • wp_noticeboard_views - User view tracking
  • wp_noticeboard_anonymous_views - Anonymous view counters

Requirements

  • WordPress 5.0+
  • PHP 7.4+
  • MySQL 5.6+

Security Features

  • Nonce verification for all AJAX requests
  • Capability checks for all operations
  • Data sanitization and validation
  • SQL injection prevention
  • XSS protection for notice content

Performance

  • Database indexing on frequently queried fields
  • Intersection Observer for efficient view tracking
  • Optimized queries with proper caching
  • Minimal performance impact

Development

File Structure

wp-noticeboard/
β”œβ”€β”€ wp-noticeboard.php          # Main plugin file
β”œβ”€β”€ README.md                   # This file
β”œβ”€β”€ IMPLEMENTATION_PLAN.md      # Development plan
β”œβ”€β”€ HOOKS_DOCUMENTATION.md      # Complete hook reference
β”œβ”€β”€ includes/                   # Core classes
β”œβ”€β”€ admin/                      # Admin interface
β”œβ”€β”€ public/                     # Frontend functionality
β”œβ”€β”€ assets/                     # CSS/JS files
└── templates/                  # Display templates

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Documentation

Changelog

Version 1.0.0

  • Initial release
  • Complete notice management system
  • Analytics tracking for logged-in and anonymous users
  • Extensive hook system for extensibility
  • WordPress AJAX implementation
  • Responsive design
  • Role-based permissions
  • Export functionality

License

GPL v2 or later - https://www.gnu.org/licenses/gpl-2.0.html

Support

For support, email nadimtuhin@gmail.com or create an issue on GitHub.


Note: This plugin is designed for internal portal use and includes comprehensive analytics tracking. Ensure compliance with your organization's privacy policies when tracking user interactions.

About

WordPress noticeboard plugin for internal portals with comprehensive analytics tracking and extensive hook system for third-party integrations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors