'', 'enabled' => 1, 'fix_csp' => 0, // off by default: never touch a security policy uninvited 'identity_secret' => '', // optional; a wp-config.php constant wins over this 'exclude' => '', // comma-separated post/page IDs ); } function aisupp_get( $key = null ) { $stored = get_option( AISUPP_OPT, null ); if ( null === $stored ) { // Settings were saved under the old, shorter option name before the // prefix change. Move them across once so an existing site does not // wake up with an empty site key and a dead agent. $legacy = get_option( 'asf_settings', null ); if ( null !== $legacy ) { update_option( AISUPP_OPT, $legacy ); delete_option( 'asf_settings' ); $stored = $legacy; } } $o = wp_parse_args( (array) $stored, aisupp_defaults() ); return $key === null ? $o : $o[ $key ]; } /** Site keys are public identifiers, but still constrain what we will store. */ function aisupp_clean_key( $k ) { return substr( preg_replace( '/[^a-zA-Z0-9]/', '', (string) $k ), 0, 64 ); } /* ------------------------------------------------------------------------- * Front end: emit the one script tag * ---------------------------------------------------------------------- */ /** * Enqueue the agent, rather than printing a raw