'', 'secret' => '', 'attribution_enabled' => true, 'enabled_forms' => array( 'gravity_forms' => array(), ), 'field_maps' => array(), 'config_valid' => false, ); } /** * Convenience accessor that merges stored settings over defaults. * * @return array */ function simplysigned_get_settings() { $stored = get_option( SIMPLYSIGNED_OPTION, array() ); if ( ! is_array( $stored ) ) { $stored = array(); } return wp_parse_args( $stored, simplysigned_default_settings() ); } /** * Boot the plugin once all plugins are loaded so we can detect Gravity Forms. */ function simplysigned_bootstrap() { // Admin settings page + notices. if ( is_admin() ) { $settings = new SimplySigned_Settings(); $settings->hooks(); } // Server-side attribution capture (front-end only). if ( ! is_admin() ) { $attribution = new SimplySigned_Attribution(); $attribution->hooks(); } // Gravity Forms handler, only wire up if GF is active. if ( class_exists( 'GFForms' ) ) { $gf_handler = new SimplySigned_Handler_Gravity_Forms(); $gf_handler->hooks(); } // Retry queue processor (runs in cron context, which is_admin() is false for). add_action( SIMPLYSIGNED_RETRY_HOOK, array( 'SimplySigned_Poster', 'process_retry_queue' ) ); } add_action( 'plugins_loaded', 'simplysigned_bootstrap' ); /** * Suggested text for the site's privacy policy (Settings -> Privacy). */ function simplysigned_privacy_policy_content() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } $content = '
' . esc_html__( 'When you submit a form on this site, the information you enter is sent to SimplySigned, a service this site uses to receive and manage client inquiries. Along with the form, SimplySigned receives your IP address, your browser user agent, the page you submitted from, the first page you visited on this site, the referring site, and any advertising click identifiers and campaign (UTM) parameters from the links you followed to get here.', 'simplysigned' ) . '
'; $content .= '' . esc_html__( 'To connect a form submission to the advertising that led to it, this site stores those click identifiers, campaign parameters, landing page and referrer in first-party cookies prefixed simplysigned_ for up to one year.', 'simplysigned' ) . '
'; $content .= '' . sprintf( /* translators: 1: SimplySigned privacy policy URL, 2: SimplySigned terms URL */ wp_kses( __( 'SimplySigned privacy policy: %1$s. Terms: %2$s.', 'simplysigned' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'https://simplysigned.co/privacy' ), esc_url( 'https://simplysigned.co/terms' ) ) . '
'; wp_add_privacy_policy_content( 'SimplySigned', wp_kses_post( $content ) ); } add_action( 'admin_init', 'simplysigned_privacy_policy_content' ); /** * Admin notice if Gravity Forms is not present (informational, non-fatal). */ function simplysigned_maybe_gf_notice() { if ( ! current_user_can( 'manage_options' ) ) { return; } if ( class_exists( 'GFForms' ) ) { return; } $screen = get_current_screen(); if ( ! $screen || 'toplevel_page_simplysigned' !== $screen->id ) { return; } echo ''; echo esc_html__( 'Gravity Forms is not active. SimplySigned will start capturing form submissions automatically once Gravity Forms is installed and active.', 'simplysigned' ); echo '