render_overlay_demo_page();
}
// Add other submenu callback functions as needed...
public function system_review_page_callback()
{
include AD_BLOCK_GUARD_PLUGIN_DIR . 'templates/admin/system-review-page.php';
}
public function help_page_callback()
{
include AD_BLOCK_GUARD_PLUGIN_DIR . 'templates/admin/help-page.php';
}
// Function to render the Overlay Demo Page
private function render_overlay_demo_page()
{
// Check user capabilities
if (!current_user_can('manage_options')) {
return;
}
// Check if the system is enabled
$system_enabled = carbon_get_theme_option('ad_block_guard_enable');
// Check the status of the detection methods
$remote_detection_enabled = carbon_get_theme_option('ad_block_guard_remote_detection');
$network_detection_enabled = carbon_get_theme_option('ad_block_guard_network_detection');
$fast_detection_enabled = carbon_get_theme_option('ad_block_guard_fast_detection');
// Display warnings if necessary
$this->render_warning_table(!$system_enabled, __('WARNING: You have the system disabled in "General Settings".', 'ad-block-guard'));
$this->render_warning_table(!$remote_detection_enabled && !$network_detection_enabled && !$fast_detection_enabled, __('ERROR: All detection methods are disabled. The system will NOT work with all methods disabled.', 'ad-block-guard'));
// Get the serialized data from the wp_options table
$usergroup_settings = get_option('_ad_block_guard_usergroup_settings', []);
// Process overlays into enabled and disabled arrays
list($enabled_overlays, $disabled_overlays) = $this->process_overlays($usergroup_settings);
echo '