function ajax_about() { if ( ! current_user_can( 'manage_options' ) || ! check_ajax_referer( 'sd_qa_about', '_n', false ) ) { wp_send_json_error( 'Auth failed' ); } $o = get_option( self::OPT, array() ); $provider = isset( $o['ai_provider'] ) ? $o['ai_provider'] : 'gemini'; $okey = isset( $o['openai_key'] ) ? $o['openai_key'] : ''; $gkey = isset( $o['gemini_key'] ) ? $o['gemini_key'] : ''; if ( 'openai' === $provider && ! $okey ) { wp_send_json_error( 'Add your OpenAI API key in SaveDealy → Settings.' ); } if ( 'gemini' === $provider && ! $gkey ) { wp_send_json_error( 'Add your Gemini API key in SaveDealy → Settings (free at aistudio.google.com/apikey).' ); } $name = isset( $_POST['name'] ) ? sanitize_text_field( wp_unslash( $_POST['name'] ) ) : ''; $aff = isset( $_POST['aff'] ) ? esc_url_raw( wp_unslash( $_POST['aff'] ) ) : ''; $context = ''; if ( $aff ) { $resp = wp_remote_get( $aff, array( 'timeout' => 8, 'redirection' => 5, 'user-agent' => 'Mozilla/5.0', 'sslverify' => false ) ); if ( ! is_wp_error( $resp ) ) { $body = wp_remote_retrieve_body( $resp ); if ( preg_match( '/]+name=["\']description["\'][^>]+content=["\']([^"\']+)/i', $body, $mm ) ) { $context = $mm[1]; } elseif ( preg_match( '/
Showing deals and coupons located in Kentucky