self::ID, 'name' => __( 'Shop and languages check', 'forensix-digital' ), 'description' => __( 'With WooCommerce, finds products without a description, image, price or SKU, placeholder text in products, and shop settings that need attention (terms page, privacy page, HTTPS, payment test mode, taxes). With Polylang or WPML, suggests the languages a page or post has no translation in. It only reads and never changes your shop or your pages.', 'forensix-digital' ), 'category' => 'content', 'edition' => Edition::FREE, 'dependencies' => array( SiteScanApp::ID ), 'features' => array( 'F-COMMERCE-01' => Edition::FREE, 'F-COMMERCE-03' => Edition::FREE, 'F-COMMERCE-05' => Edition::FREE, ), 'deactivation_effects' => array( __( 'Scans no longer check your products, shop settings or translations.', 'forensix-digital' ), __( 'Existing findings stay visible until the next scan. Your shop and pages 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' ) ); } /** * Adds the language tag check to a site scan. * * @param mixed $checks Page checks of the scan. * @return mixed */ public function add_checks( $checks ) { if ( is_array( $checks ) ) { $checks[] = new HreflangCheck(); } return $checks; } /** * Nothing to set up. */ public function activate(): void {} /** * Stops adding the checks 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 shop and translation checks 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; } $store = Plugin::container()->get( FindingStore::class ); $checks[] = new ShopCheck( SiteScanApp::ID, $store ); $checks[] = new TranslationCheck( SiteScanApp::ID, $store ); return $checks; } }