echoPayPalConnector::isConnected()?'<p class="sg-ok">Connected ('.esc_html('live'===$s['paypal_mode']?'Live':'Sandbox').').</p>':'<p class="sg-warn">Not connected yet. Follow the steps in the <a href="'.esc_url(SetupPage::url(1)).'">setup guide</a>.</p>';
echo'</select><p class="description">One currency for the whole site. It applies to goals you create from now on; existing goals keep their currency. Check the fixed fee below after changing it.</p></td></tr>';
echo'<tr><th scope="row">Moderation</th><td><label><input type="checkbox" name="moderate_messages" value="1"'.checked(!empty($s['moderate_messages']),true,false).'> Hold messages for my approval before they can be shown in alerts</label></td></tr>';
echo'<tr><th scope="row">Profanity filter</th><td><label><input type="checkbox" name="profanity_filter" value="1"'.checked(!empty($s['profanity_filter']),true,false).'> Filter bad language in messages and names</label><br>';
echo'<label><input type="checkbox" name="profanity_use_builtin" value="1"'.checked(!empty($s['profanity_use_builtin']),true,false).'> Use the built-in word list</label>';
echo'<p><label for="sg_words">Your own words to block (one per line)</label><br><textarea id="sg_words" name="profanity_words" rows="6" class="large-text code">'.esc_textarea((string)$s['profanity_words']).'</textarea></p></td></tr></table></div>';
echo'<label><input type="checkbox" name="funding_card" value="1"'.checked(!empty($s['funding_card']),true,false).'> Show "Debit or Credit Card" (donors without a PayPal account)</label><br>';
echo'<label><input type="checkbox" name="funding_paylater" value="1"'.checked(!empty($s['funding_paylater']),true,false).'> Show "Pay Later" (donors pay in instalments; you are still paid in full)</label>';
echo'<p class="description">The PayPal button is always shown. Which extra buttons appear can also depend on the donor\'s country.</p></td></tr></table></div>';
echo'<div class="sg-card"><h2>Advanced</h2><table class="form-table" role="presentation"><tr><th scope="row"><label for="sg_ip">Visitor IP address</label></th><td><select id="sg_ip" name="visitor_ip_header">';
echo'</select><p class="description">Donation forms limit how fast one visitor can start payments (to stop abuse). If your site is behind Cloudflare or another proxy, choose it here so each visitor is counted separately; otherwise everyone looks like the same visitor and a busy moment, like a raid, could block donations. Only choose a proxy option if <em>all</em> traffic to your site really goes through it.</p>';
echo'<p>When a donor chooses "cover the fees", the form adds the estimated PayPal fee so you receive the amount they intended. The defaults (<strong>3.49% + $0.49</strong>) are <strong>US domestic estimates</strong>. Fees for international (cross-border) payments and currency conversion are higher and are <strong>not</strong> included, so you may receive slightly less than expected in those cases. Check PayPal\'s current fee page for your country and adjust.</p>';
echo'<tr><td><strong>Visitor address used with the saved option</strong></td><td><code>'.esc_html(\StreamGoals\Core\ClientIp::resolve($server,$mode)).'</code></td></tr>';
echo'</tbody></table><p class="description">This is your own visit. If the connection address belongs to your proxy or CDN (not to you) and your proxy\'s header shows your real address, choose that proxy option above and save. Then the "used" row should show your real address.</p></details>';
$errors[]='Minimum donation must be at least '.Format::money(\StreamGoals\Core\Settings::HARD_MIN_MINOR,$cur).'. PayPal\'s fixed fee makes smaller donations lose money.';