Good Health- enhance the WordPress Site Health feature by providing more detailed diagnostics

GOOD HEALTH plugin is a WordPress plugin designed to enhance the WordPress Site Health feature by providing more detailed diagnostics, performance metrics, security checks, and integration with other potential plugins.



Here's a detailed breakdown of what this plugin does:

1. Enhances WordPress Site Health:

  • Custom Tab: It adds a new "Good Health" tab to the WordPress Site Health interface, providing a centralized dashboard for various health metrics.

2. Provides a Comprehensive Dashboard with Various "Cards":

The plugin's custom dashboard is organized into several "cards," each focusing on a specific aspect of website health:

  • Site Performance Card:
    • Displays placeholder metrics for Page Load Time and Server Response.
  • Security Status Card:
    • Shows SSL Status (whether SSL is active or inactive).
    • Indicates the number of pending plugin updates.
  • Malware Scan Card:
    • Displays the total number of errors found in the last malware scan.
    • Provides a button to "Start Malware Scan" and a link to "check details" (redirects to the wmd-scanner admin page).
    • Integration: It attempts to integrate with a hypothetical WP Malware Detector plugin (checking for malware/malware.php and the WMD_Scanner class) to fetch actual scan results.
  • SEO Audit Card:
    • Shows an "Overall Score" for SEO.
    • Provides a "Start Audit" button (redirects to the csa-seo-audit admin page).
    • Integration: It integrates with a hypothetical Comprehensive SEO Audit plugin (checking for comprehensive-seo-audit-plugin/comprehensive-seo-audit-plugin.php and the CSA_Audit class) to retrieve the SEO score.



  • Database Health Card:
    • Displays Database Size, number of Post Revisions, and number of Transients.
    • Offers an "Optimize Database" button to delete post revisions and optimize all database tables.
    • Includes a "WP Optimizer Pro" button (redirects to wp-optimizer-pro admin page).
  • User Security Card:
    • Shows the count of Admin Users.
    • Includes placeholders for "Weak Passwords" and "Inactive Users."
    • Provides a "Review Users" button (redirects to the WordPress Users page).
  • File Permissions Card:
    • Includes placeholders for "Insecure Files."
    • Displays the file permissions for wp-config.php.
    • Offers a "Scan Permissions" button (placeholder functionality).
  • Plugin Health Card:
    • Shows the number of Active Plugins.
    • Displays the number of Pending Updates for plugins.
    • Includes a placeholder for "Abandoned Plugins."
    • Provides a "Manage Plugins" button (redirects to the WordPress Plugins page).
  • Virus Scanner Card:
    • Includes placeholders for "Scanned Files" and "Suspicious Files."
    • Provides a "Run Virus Scan" button (redirects to a hypothetical virus-scanner admin page).
  • Backup Status Card:
    • Displays the "Last Backup" time and "Backup Size."
    • Provides a "Manage Backups" button (redirects to a hypothetical backup-creator-settings-page admin page).
    • Integration: It attempts to fetch backup information if the backup-creator/backup-creator.php plugin is active.
  • Cron Jobs Health Card:
    • Shows the number of Scheduled Jobs.
    • Includes a placeholder for "Overdue Tasks."
    • Provides a "View Cron Jobs" button (redirects to a hypothetical cron-management admin page).
  • Core Integrity Card:
    • Includes placeholders for "Modified Files" and "Missing Files" in the WordPress core.
    • Offers a "Verify Core Files" button (placeholder functionality).
  • Cache Status Card:
    • Identifies the "Caching Plugin" (attempts to detect CACHE BOOST, WP Super Cache, or W3 Total Cache).
    • Displays the number of "Cached Pages" (specifically for CACHE BOOST if active).
    • Includes a placeholder for "Cache Hit Rate."
    • Provides a "Manage Cache" button (redirects to a hypothetical cache-settings admin page).
  • Server Health Card:
    • Displays the PHP Version.
    • Shows the Memory Limit.
    • Indicates Disk Space.
    • Provides a "View Server Info" button (redirects to a hypothetical server-health admin page).
  • Image Optimization Status Card:
    • Includes placeholders for "Total Images," "Unoptimized Images," and "Potential Savings."
    • Offers "Review Images" (redirects to the Media Library) and "WP Optimizer Pro" (redirects to wp-optimizer-pro) buttons.
  • Broken Links & Redirects Card:
    • Includes placeholders for "Broken Internal Links" and "Broken External Links."
    • Shows "Total Redirects."
    • Provides "Scan for Broken Links" (placeholder functionality) and "Manage Redirects" buttons.
  • Advanced PHP Configuration Card:
    • Displays max_execution_time, upload_max_filesize, post_max_size, and max_input_vars.
    • Provides a "View PHP Info" button (redirects to a hypothetical phpinfoplugin admin page).
  • Security Headers Status Card:
    • Checks and displays the status of X-Content-Type-Options, X-Frame-Options, Strict-Transport-Security, and Content-Security-Policy headers.
    • Offers a "Check Headers" button (placeholder functionality).



3. AJAX-Powered Data Retrieval and Actions:

The plugin uses numerous AJAX actions (wp_ajax_good_health_*) to dynamically fetch and display data in the dashboard without full page reloads. It also triggers actions like database optimization and scans via AJAX.

4. Debugging and Logging:

  • Includes a good_health_debug_log function to log messages to the WordPress debug log if WP_DEBUG and WP_DEBUG_LOG are enabled. This is useful for troubleshooting plugin behavior and integrations.

5. Submenu Pages:

  • Registers a submenu item under "Site Health" for its "Good Health" dashboard.
  • Adds a placeholder submenu page for "Good Health Redirects Management" to be developed later.

6. Asset Management:

  • Enqueues its own CSS (good-health.css) and JavaScript (good-health.js) files specifically for the Site Health page and its own redirects page.
  • Localizes script data to pass AJAX URLs, nonces, and various administrative page URLs to the frontend JavaScript.

In summary, the Good Health plugin aims to be a comprehensive site health monitoring and management tool for WordPress administrators, aggregating various metrics and offering quick access to related tools and settings, with a focus on performance, security, and maintenance. It also demonstrates an architecture for integrating with other specialized plugins to pull in their diagnostic data.





Comentarii

Postări populare de pe acest blog

Mallware scanner plugin - securewordpress

WordPress sandbox installations on remote VPS servers

A conceptual WordPress plugin to display website statistics and provide advice, leveraging Google Site Kit.