Releases: jazir555/Add-Settings-Links
v9
Add Settings Links V8
Another massive refactor with too many additions and changes to list right now, will go back and update this description later with a changelog
Add Settings Links V7
Moved function definitions into a better order, and SQL query corrections
Add Settings Links V6
Massive refactor with many new features and additions
Core Improvements
Dynamic Settings Detection
Introduced multiple strategies for detecting settings links for plugins:
Scanning admin menus for known patterns (add_menu_page, add_options_page, etc.).
Analyzing the options table for settings-related entries.
Inspecting registered hooks (admin_menu, admin_init, etc.) for settings callbacks.
Support for Multisite
Ensured the plugin works seamlessly across multisite installations:
Scoped transient keys to individual sites.
Provided settings link detection in both single-site and network admin contexts.
Caching Mechanism
Implemented transient caching for:
Admin menu slugs (ASL_MENU_SLUGS_TRANSIENT) with a 12-hour expiration.
Plugin data (ASL_CACHED_PLUGINS_TRANSIENT) with a 24-hour expiration.
Reduced redundant database queries and file scans to improve performance.
Manual Overrides
Added functionality for users to manually specify settings links for plugins with unconventional or multiple settings pages.
Provided an admin interface to input and manage manual overrides.
Admin Interface Enhancements
Dropdown for Multiple Settings Links:
Introduced an accessible dropdown menu in the plugins list for plugins with multiple detected settings links.
Admin Page for Plugin Settings:
Created a dedicated settings page under "Settings" for managing overrides and plugin-specific configurations.
Used forms with proper nonce verification for secure input handling.
User Feedback Mechanisms
Displayed admin notices for plugins missing recognized settings links.
Included descriptions and placeholders in admin fields to guide users.
Searchable Plugin List
Added a search input for filtering the plugins table in the manual overrides settings page.
Security Enhancements
Data Validation and Sanitization
Validated URLs using filter_var and regex to ensure valid admin URLs.
Sanitized and escaped all user inputs (sanitize_text_field, esc_attr, esc_url_raw) to prevent XSS vulnerabilities.
Nonce Verification
Enforced nonce checks for all form submissions to prevent CSRF attacks.
Settings Link Validation
Restricted settings links to known admin pages (admin.php, options-general.php) using filters and regex.
Debugging and Error Handling
Improved Debugging
Reflection-based method analysis.
Admin menu slug caching processes.
Plugin file analysis and transient caching.
Added context to logs (e.g., site ID for multisite environments).
Error Fallbacks
Safeguarded against missing files, reflection exceptions, and invalid plugin data with robust error handling.
Optimization
Performance
Optimized file and directory scanning to exclude unnecessary files (e.g., vendor directories).
Cached results of expensive operations like file analysis and plugin list retrieval.
Reduced Overhead
Limited database queries by efficiently caching plugin data and detected settings links.
i18n and Multilingual Support
Initial translation support
Added text domain support for all user-facing strings.
Localized settings-related terms in 4 languages. Other languages will be added in the future.
Bug Fixes
Fixed Reflection Handling
Addressed potential errors when analyzing plugin methods using reflection, ensuring compatibility with different plugin structures.
Resolved Duplicate Links
Checked for and avoided adding duplicate settings links in the plugin action menu.
Corrected Admin Menu Handling
Adjusted menu and submenu scanning logic to account for edge cases with unconventional admin menu structures.
Features Added
Comprehensive Settings Detection
Combined multiple strategies to detect settings pages with greater accuracy.
Aggregated Notices
Displayed an aggregated warning for plugins missing recognized settings links, guiding users to manually add overrides.
Customizable Synonyms
Allowed customization of recognized "settings-like" terms via filters for better detection in diverse languages.
Add Settings Links V4
Tons of bug fixes, made the regex slug detection much more robust, added multi-site support, significantly expanded the flexibility for detecting plugin links, improved the settings links management page