admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('a11y_license_nonce'), 'position' => get_option('a11y_enhancer_position', 'bottom-right'), 'fontSize' => get_option('a11y_enhancer_widget_font_size', '20'), 'defaultLang' => 'en' )); error_log('A11y Enhancer: Assets enqueued successfully.'); } add_action('wp_enqueue_scripts', 'a11y_enhancer_enqueue_assets'); function a11y_enhancer_adjust_brightness($hex, $steps) { $hex = ltrim($hex, '#'); if ($hex === 'transparent') { return 'transparent'; } $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); $r = max(0, min(255, $r + $steps)); $g = max(0, min(255, $g + $steps)); $b = max(0, min(255, $b + $steps)); return sprintf('#%02x%02x%02x', $r, $g, $b); } function a11y_enhancer_add_widget() { if (is_admin()) { error_log('A11y Enhancer: Skipping widget rendering in admin.'); return; } $default_lang = 'en'; $current_lang = get_option('a11y_enhancer_current_lang', $default_lang); $flag_url_base = 'https://flagcdn.com/16x12/'; $flag_mappings = a11y_enhancer_get_flag_mappings(); // From translations.php $flag_code = isset($flag_mappings[$current_lang]) ? $flag_mappings[$current_lang] : $current_lang; $flag_url = $flag_url_base . $flag_code . '.png'; error_log('A11y Enhancer: Rendering widget HTML in wp_footer.'); ?> = $ten_days) { // Check if reminder is needed (4 days after initial notice) if ($reminder_shown || ($current_time - $install_date) >= ($ten_days + $four_days)) { update_option('a11y_enhancer_review_reminder_shown', true); $message = __('We noticed you’ve been using A11y Accessibility Enhancer for a while. Your feedback means a lot! Please consider leaving a review to help us improve and support others in making their sites accessible.', 'a11y-enhancer'); } else { $message = __('Thank you for using A11y Accessibility Enhancer! If you’re finding it helpful, we’d greatly appreciate a review on WordPress.org to share your experience and support our mission to enhance accessibility.', 'a11y-enhancer'); } ?>