self::ID, 'name' => __( 'Content check', 'forensix-digital' ), 'description' => __( 'Finds leftover placeholder text, the sample page and post WordPress adds to a new site, the default tagline, empty paragraphs and posts nobody has updated for a long time, text repeated on several pages, dates that have passed, videos that no longer exist, and an old year in the copyright notice. With Business details turned on, it also finds phone and email links that differ from your saved details.', 'forensix-digital' ), 'category' => 'content', 'edition' => Edition::FREE, 'dependencies' => array( SiteScanApp::ID ), 'features' => array( 'F-CONTENT-01' => Edition::FREE, 'F-CONTENT-02' => Edition::FREE, 'F-CONTENT-03' => Edition::FREE, 'F-CONTENT-04' => Edition::FREE, 'F-CONTENT-05' => Edition::FREE, 'F-CONTENT-06' => Edition::FREE, ), 'deactivation_effects' => array( __( 'Scans no longer check your texts.', 'forensix-digital' ), __( 'Existing findings stay visible until the next scan. Your pages and posts are not changed.', 'forensix-digital' ), ), 'factory' => static fn(): self => new self(), ) ); } /** * Hooks the app while it is active. */ public function register(): void { add_filter( 'forensix_scan_stored_checks', array( $this, 'add_stored_checks' ) ); add_filter( 'forensix_scan_checks', array( $this, 'add_checks' ) ); } /** * Nothing to set up. */ public function activate(): void {} /** * Stops adding the check to scans. */ public function deactivate(): void { remove_filter( 'forensix_scan_stored_checks', array( $this, 'add_stored_checks' ) ); remove_filter( 'forensix_scan_checks', array( $this, 'add_checks' ) ); } /** * Nothing stored besides findings, which belong to the core. */ public function delete_data(): void {} /** * Adds the page check for the copyright year to a site scan. * * @param mixed $checks Page checks of the scan. * @return mixed */ public function add_checks( $checks ) { if ( ! is_array( $checks ) ) { return $checks; } $checks[] = new CopyrightCheck( (int) wp_date( 'Y' ) ); $checks[] = new EmbedCheck( (bool) Plugin::container()->get( Settings::class )->get( SiteScanApp::ID, 'check_external', true ) ); return $checks; } /** * Adds the content check to a site scan. * * @param mixed $checks Stored-content checks of the scan. * @return mixed */ public function add_stored_checks( $checks ) { if ( ! is_array( $checks ) ) { return $checks; } $checks[] = new ContentCheck( SiteScanApp::ID, Plugin::container()->get( FindingStore::class ) ); return $checks; } }