=== Smart Click Tracker === Contributors: coresolstudio, creativehassan, mustaneerabdullah93 Donate link: https://paypal.me/coresol Tags: analytics, click tracking, event tracking, user behavior, statistics Requires at least: 5.0 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 1.1.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Track clicks on any element of your WordPress site and view detailed statistics with beautiful charts. == Description == Smart Click Tracker is a lightweight WordPress plugin that helps you track and analyze clicks on your website. Whether you want to monitor button clicks, link engagement, or any other element interactions, this plugin provides the tools you need to make data-driven decisions. = Key Features = * **Element Click Tracking** – Track clicks on any element using CSS selectors * **Advanced Analytics** – Visual charts for clicks over time, hourly distribution, and device breakdown * **Date Range Filtering** – Filter analytics data by custom date ranges and specific trackers * **Device Detection** – See how users interact across desktop, mobile, and tablet devices * **User Tracking Controls** – Choose to track logged-in users, anonymous users, or both * **Data Retention** – Automatic cleanup of old tracking data based on your retention settings * **IP Anonymization** – Built-in option to anonymize visitor IP addresses for privacy compliance * **Rate Limiting** – Prevents duplicate click tracking from the same user in quick succession * **Lightweight** – Minimal impact on page load times with asynchronous tracking = Use Cases = * **Conversion Optimization** – Identify which CTAs and buttons get the most clicks * **UX Research** – Understand how users interact with your site layout * **Content Strategy** – Measure engagement on specific content elements * **A/B Testing Support** – Compare click rates on different page elements = Privacy = Smart Click Tracker is designed with privacy in mind: * Optional IP address anonymization * Configurable data retention period * Minimal data collection (no cookies, no third-party services) * All data stored locally in your WordPress database == Installation == 1. Upload the `smart-click-tracker` folder to the `/wp-content/plugins/` directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Go to 'Click Tracker' in your admin menu to start creating trackers = Manual Installation = 1. Download the plugin ZIP file 2. Go to Plugins > Add New in your WordPress admin 3. Click the 'Upload Plugin' button 4. Upload the ZIP file and activate the plugin == Frequently Asked Questions == = Does this plugin slow down my website? = No, Smart Click Tracker is designed to be lightweight and efficient. The tracking script loads only when active trackers exist and click events are sent asynchronously without affecting user experience. = Is this plugin GDPR compliant? = The plugin includes IP anonymization and data retention controls to help with GDPR compliance. No cookies are set and no data is sent to third-party services. For full compliance, you should include information about this tracking in your privacy policy. = Can I track clicks on dynamic elements? = Yes, the plugin uses event delegation to track clicks on elements that are dynamically added to the page after initial load. = How does the device detection work? = The plugin analyzes the user agent string to determine whether a visitor is using a desktop computer, mobile phone, or tablet device. = Does this work with page builders? = Yes, Smart Click Tracker works with all major page builders including Elementor, Beaver Builder, Divi, and others. Simply use the CSS selector of the element you want to track. = What CSS selectors can I use? = You can use any valid CSS selector: * `.classname` – Elements with a specific class * `#id` – Element with a specific ID * `a[href*="example"]` – Links containing specific text in the URL * `.parent .child` – Nested element selectors * `.btn, .cta` – Multiple elements with a single tracker = How long is tracking data stored? = By default, data is retained for 90 days. You can change this in Click Tracker > Settings. A daily cron job automatically cleans up expired data. == Screenshots == 1. Dashboard overview showing all trackers with click counts and quick actions 2. Advanced analytics with clicks-over-time chart and date range filtering 3. Hourly distribution and device breakdown charts 4. Settings page with tracking and privacy options 5. Add/Edit tracker form with CSS selector input == Changelog == = 1.1.0 = * Security: Added capability check to uninstall routine * Security: Separated admin and public nonce actions to prevent cross-context reuse * Security: Fixed XSS vulnerability in admin JavaScript when rendering AJAX response data * Security: Fixed settings sanitization losing values when checkboxes are unchecked * Performance: Replaced N+1 per-tracker click count queries with single bulk query on dashboard * Performance: Added database indexes on created_at, (tracker_id, created_at), and user_id columns * Performance: Added automatic database upgrade routine for existing installations * Fix: IP validation now accepts private/reserved ranges for REMOTE_ADDR (local/staging compatibility) * Removed console.log statements from production JavaScript = 1.0.9 = * Fixed analytics page not rendering charts and filter controls * Fixed edit tracker page not loading existing tracker data * Removed duplicate hook registration in admin class constructor * Moved analytics data preparation to dedicated method for reliability * Code quality improvements and cleanup = 1.0.8 = * Implemented unique naming convention (smarcltr prefix) for WordPress Plugin Directory compliance * Fixed JavaScript click tracking functionality with comprehensive debugging * Fixed tracker statistics modal display issues * Removed all error_log statements for production-ready silent operation * Cleaned up legacy files and optimized plugin structure * Added proper Chart.js integration for analytics page * Enhanced security with rate limiting and input validation * Improved error handling throughout the plugin * Performance optimizations with multi-layer caching = 1.0.7 = * Improved analytics interface * Fixed issue with filter form layout = 1.0.5 = * Initial release == Upgrade Notice == = 1.1.0 = Security and performance release. Fixes XSS vulnerability, improves nonce handling, adds database indexes for faster analytics queries, and resolves settings sanitization issue. Strongly recommended. = 1.0.9 = Bug fix release. Fixes broken analytics charts, edit tracker functionality, and duplicate hook registration. Recommended for all users. = 1.0.8 = Major update with WordPress Plugin Directory compliance, fixed JavaScript tracking, enhanced security, and performance optimizations. Highly recommended upgrade. = 1.0.7 = This update improves the analytics interface and fixes an issue with the filter form layout. Upgrade recommended. = 1.0.5 = Initial release of Smart Click Tracker.