Privacy > Policy Guide. */ public static function privacy_text() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } $text = '

' . esc_html__( 'shouldcheck', 'shouldcheck' ) . '

'; $text .= '

' . esc_html__( 'ShouldCheck reads plugin packages without running them. It stores its reviews, a list of site changes (plugins, themes and WordPress updates) and its settings in your site database. A review records the ID of the administrator who asked for it. It does not store visitor or customer data, and it does not store payment keys: it only notes whether keys were entered.', 'shouldcheck' ) . '

'; $text .= '

' . esc_html__( 'Only when an administrator asks to review a plugin from WordPress.org, your site contacts api.wordpress.org for the plugin listing and, if the administrator allowed it, downloads.wordpress.org for the published ZIP. These requests carry WordPress\'s usual user agent (your site address and WordPress version). ShouldCheck sends nothing to its authors and runs no tracking or analytics.', 'shouldcheck' ) . '

'; $text .= '

' . esc_html__( 'Deleting the plugin removes its data, unless the administrator chose to keep reviews, history and settings.', 'shouldcheck' ) . '

'; wp_add_privacy_policy_content( 'ShouldCheck', wp_kses_post( $text ) ); } /** * Run once after the plugin files change. * * Saved reviews and history keep their original option names, so an upgrade needs no * data migration. It only makes sure the schedule exists and the baseline is current. */ public static function maybe_upgrade() { $previous = get_option( self::OPT_VERSION ); if ( SHOULDCHECK_VERSION === $previous ) { return; } // A site that ShouldCheck has run on before keeps what it had: no first-run setup, and the review buttons stay. // Evidence is a recorded version, saved settings, or reviews and events from an older release. Its own // first-run snapshot is not evidence. After a delete that kept data, only saved settings count, because // kept reviews do not say whether the setup was finished. $saved = get_option( ShouldCheck_Settings::OPTION, array() ); $saved = is_array( $saved ) ? $saved : array(); $kept = false !== get_option( 'shouldcheck_kept_data', false ); $old_data = ! $kept && ( false !== get_option( 'shouldcheck_v3_reports', false ) || false !== get_option( 'shouldcheck_v2_events', false ) ); $existing = ( false !== $previous ) || ! empty( $saved ) || $old_data; if ( $existing ) { $changed = false; // An existing site keeps what it had. "intercept" is retired; Settings::all() reads a saved true as beside. if ( ! array_key_exists( 'intercept', $saved ) ) { $saved['intercept'] = false; $changed = true; } if ( ! array_key_exists( 'onboarded', $saved ) ) { $saved['onboarded'] = true; $saved['beside'] = empty( $saved['intercept'] ); $changed = true; } elseif ( ! array_key_exists( 'beside', $saved ) ) { $saved['beside'] = empty( $saved['intercept'] ); $changed = true; } if ( $changed ) { update_option( ShouldCheck_Settings::OPTION, $saved, false ); } } // Cached package scans were made by the previous scanner. Start fresh. ShouldCheck_Directory::clear_cache(); ShouldCheck_Collisions::clear_cache(); // The browser sandbox moved out of the plugin in 0.10.0. Its history is no longer used. delete_option( 'shouldcheck_v8_runtime_tests' ); ShouldCheck_Site::ensure_scheduled(); ShouldCheck_Site::reconcile(); update_option( self::OPT_VERSION, SHOULDCHECK_VERSION, false ); } /** * Activation. It does not redirect: the setup notice on the Plugins screens asks for the first-run choices. */ public static function activate() { ShouldCheck_Site::ensure_scheduled(); ShouldCheck_Site::reconcile(); update_option( self::OPT_VERSION, SHOULDCHECK_VERSION, false ); } /** * Deactivation: stop scheduled work. Saved data is kept. */ public static function deactivate() { wp_clear_scheduled_hook( ShouldCheck_Site::CRON_HOOK ); wp_clear_scheduled_hook( ShouldCheck_Site::CRON_DEFERRED ); wp_clear_scheduled_hook( ShouldCheck_Collisions::WARM_HOOK ); } }