For developers
Files
includes/modules/class-builder-os-svg-antispam.php(Builder_OS_SVG_Antispam): module registered inBuilder_OS::MODULES.includes/modules/svg-antispam/class-builder-os-svg-sanitizer.php(Builder_OS_SVG_Sanitizer): sanitizer and dimension calculation.includes/modules/svg-antispam/class-builder-os-svg.php(Builder_OS_SVG): upload, file type, metadata,image_downsizeand library.includes/modules/svg-antispam/class-builder-os-antispam.php(Builder_OS_Antispam): comments, accounts and turning comments off.includes/modules/svg-antispam/class-builder-os-antispam-admin.php(Builder_OS_Antispam_Admin): the Security sections (formerly Settings cards),admin-postactions and the Comments column.Builder_OS_Admin::MOVED_TABSandredirect_moved_tabs()(admin_init) redirect the old URLs.- No JavaScript of its own: the honeypot field (
Builder_OS_Antispam::HONEYPOT,bos_as_hp) and the signed token (TOKEN,bos_as_rt) go in the HTML ofclass-builder-os-antispam.php. The Cloudflare script is loaded only with Turnstile configured. admin/css/builder-os-svg-antispam.css: SVG thumbnails and sections.
Options
| Option | Contents |
|---|---|
builder_os_svg | enabled (bool) and roles (string[]). |
builder_os_antispam | enabled, comments, accounts, min_time, login_min_time, max_links, blocked_words, rate_limit, rate_window, turnstile_comments, turnstile_accounts and disable_comments. |
builder_os_antispam_stats | totals (comments, held, register, login, lostpassword), reasons, days (Y-m-d → blocks, 31 days) and log (last 20). |
Transients bos_asrl_* | Comment limit per IP. |
Comment meta _bos_antispam | Reason: honeypot, time, token, links, words or filter. |
Hooks
| Hook | Type | Use |
|---|---|---|
builder_os_svg_user_allowed | filter | ( bool $allowed, WP_User $user ): decides per user whether they can upload SVGs. |
builder_os_svg_max_bytes | filter | Maximum uncompressed SVG size (default, 10 MB). |
builder_os_svg_rejected | action | ( string $filename, WP_Error $error ): an SVG rejected on upload. |
builder_os_antispam_comment_status | filter | ( string $status, array $reasons, array $commentdata ): '', 'spam' or 'held'. |
builder_os_antispam_protect_login | filter | Return false to skip the login check; for example, if a theme has its own form that submits to wp-login.php without login_form. |
builder_os_antispam_blocked | action | ( $channel, $reason, $outcome ): each block or hold. |
builder_os_forms_client_ip | filter | (From Forms.) Real IP behind a proxy; also used by the comments’ per-IP limit. |
Reuse from Forms: Builder_OS_Forms::time_token() and verify_time_token() (time token), Builder_OS_Forms_Submit::js_hash() (browser token), client_ip() and turnstile_ok(), which is now public, with the Turnstile keys from builder_os_forms_settings.
PHP API:
Builder_OS_SVG_Sanitizer::sanitize( $svg )returns astringor aWP_Error.Builder_OS_SVG_Sanitizer::dimensions( $svg )returns[ancho, alto].Builder_OS_Antispam::verify( $context, $min )returns'','honeypot','time'or'token'.Builder_OS_Antispam::fields_html( $context )returns the honeypot and the token, for custom forms.
Form fields: bos_as_hp (honeypot), bos_as_rt (server token), bos_as_tk and bos_as_js (browser token).
Nginx/Apache: nothing needs to be configured. SVGs are served sanitized as image/svg+xml.