*/ public static function diagnostics() { $page_id = (int) get_option( AHNS_Page::OPTION, 0 ); $page_ok = $page_id > 0 && 'publish' === get_post_status( $page_id ); $product = AHNS_Configurator::default_product_id(); $enabled = count( AHNS_Fonts::enabled_ids() ); $fonts_dir = AHNS_Fonts::custom_dir()['path']; return array( array( 'label' => __( 'Plugin version', 'ahime-neon-sign-configurator' ), 'ok' => true, 'detail' => AHNS_VERSION . ' · WooCommerce ' . ( defined( 'WC_VERSION' ) ? WC_VERSION : 'absent' ) . ', PHP ' . PHP_VERSION, ), array( 'label' => __( 'Fonts', 'ahime-neon-sign-configurator' ), 'ok' => $enabled > 0, 'detail' => sprintf( /* translators: %d: number of fonts. */ __( '%d font(s) offered to customers.', 'ahime-neon-sign-configurator' ), $enabled ), ), array( 'label' => __( 'Fonts folder', 'ahime-neon-sign-configurator' ), 'ok' => self::really_writable( $fonts_dir ), 'detail' => $fonts_dir, ), array( 'label' => __( 'Configurator page', 'ahime-neon-sign-configurator' ), 'ok' => $page_ok, 'detail' => $page_ok ? (string) get_permalink( $page_id ) : __( 'No page published.', 'ahime-neon-sign-configurator' ), ), array( 'label' => __( 'Billed product', 'ahime-neon-sign-configurator' ), 'ok' => $product > 0, 'detail' => $product > 0 ? sprintf( '#%d · %s', $product, get_the_title( $product ) ) : __( 'None: the configurator is running in demo mode.', 'ahime-neon-sign-configurator' ), ), array( 'label' => __( 'Workshop e-mail', 'ahime-neon-sign-configurator' ), 'ok' => '' !== AHNS_Order::production_email(), 'detail' => '' !== AHNS_Order::production_email() ? AHNS_Order::production_email() : __( 'Not set: nobody receives the manufacturing specification.', 'ahime-neon-sign-configurator' ), ), ); } public function render_page() { if ( ! current_user_can( 'manage_woocommerce' ) ) { return; } $checks = self::diagnostics(); $ko = count( array_filter( $checks, static fn( $c ) => ! $c['ok'] ) ); $actions = class_exists( 'AHNS_Onboarding' ) ? AHNS_Admin_UI::button( __( 'Run the wizard again', 'ahime-neon-sign-configurator' ), AHNS_Onboarding::url(), 'on-accent' ) : ''; AHNS_Admin_UI::open( __( 'Help & setup wizard', 'ahime-neon-sign-configurator' ), 0 === $ko ? __( 'Every check is green.', 'ahime-neon-sign-configurator' ) : sprintf( /* translators: %d: number of checks to fix. */ __( '%d item(s) need your attention.', 'ahime-neon-sign-configurator' ), $ko ), $actions ); // --- Mise en route ----------------------------------------------------- AHNS_Admin_UI::card_open( __( 'Getting started in four steps', 'ahime-neon-sign-configurator' ) ); $steps = array( array( __( 'Create the configurator page', 'ahime-neon-sign-configurator' ), __( 'Configurator screen: one button creates and publishes it for you.', 'ahime-neon-sign-configurator' ) ), array( __( 'Link the billed product', 'ahime-neon-sign-configurator' ), __( 'It is the one that carries the calculated price when the neon is added to the cart.', 'ahime-neon-sign-configurator' ) ), array( __( 'Choose fonts, colours and backings', 'ahime-neon-sign-configurator' ), __( 'The customer only sees what you offer - and the server refuses the rest.', 'ahime-neon-sign-configurator' ) ), array( __( 'Check your pricing', 'ahime-neon-sign-configurator' ), __( 'The simulator breaks the calculation down: tube, material, power supply, options.', 'ahime-neon-sign-configurator' ) ), ); echo '
%s %s
', wp_kses( AHNS_Admin_UI::button( __( 'Go to the dashboard', 'ahime-neon-sign-configurator' ), admin_url( 'admin.php?page=' . AHNS_Dashboard::PAGE_SLUG ), 'primary' ), AHNS_Admin_UI::allowed_html() ), wp_kses( AHNS_Admin_UI::button( __( 'Contact support', 'ahime-neon-sign-configurator' ), self::SUPPORT_URL, 'ghost', array( 'target' => '_blank', 'rel' => 'noopener' ) ), AHNS_Admin_UI::allowed_html() ) ); AHNS_Admin_UI::card_close(); // --- Conformité (chantier E) ------------------------------------------ // // CE QUE CETTE CARTE DIT, ET POURQUOI ELLE EXISTE. // // La fiche technique sort deja trois lignes « A FAIRE TRANCHER » — c'est // leur bonne reponse, et une valeur inventee sur un document de conformite // serait pire qu'un vide. // // Mais s'arreter la REPORTE LE PROBLEME sur quelqu'un qui ne sait pas // qu'il l'a : en installant cette extension, le marchand devient le // FABRICANT au sens de la reglementation. C'est lui qui signe, lui qui // conserve dix ans, lui qui repond a un controle — et il l'apprend // rarement en lisant une fiche produit. AHNS_Admin_UI::card_open( __( 'Compliance: what falls to you', 'ahime-neon-sign-configurator' ) ); echo '' . esc_html__( 'By selling under your own name you are the MANUFACTURER in the regulatory sense: you affix the CE marking, you sign the EU declaration of conformity, and you keep a technical file for ten years. This plugin gives you the production parts and the dimensions; it does not sign on your behalf.', 'ahime-neon-sign-configurator' ) . '
'; $conformite = array( array( __( 'Declare your components', 'ahime-neon-sign-configurator' ), __( 'Spools, drivers, timers: without identified part numbers, no declaration holds up.', 'ahime-neon-sign-configurator' ), ), array( __( 'Gather your suppliers’ datasheets', 'ahime-neon-sign-configurator' ), __( 'Including the photobiological risk group (EN 62471): it is read off their documentation, it cannot be inferred.', 'ahime-neon-sign-configurator' ), ), array( __( 'Write your risk assessment', 'ahime-neon-sign-configurator' ), __( 'Electrical, thermal, mechanical, photobiological: this is what an inspection asks for first.', 'ahime-neon-sign-configurator' ), ), array( __( 'Buy the standards at the right time', 'ahime-neon-sign-configurator' ), __( 'Nine standards, none of them free to download. There is no rush until you open the declaration; at that point, five are unavoidable.', 'ahime-neon-sign-configurator' ), ), array( __( 'Get the three open points settled', 'ahime-neon-sign-configurator' ), __( 'EPREL labelling, photobiological risk group, EU declaration: they come out of the datasheet marked “TO BE SETTLED”, and that is the right answer for them.', 'ahime-neon-sign-configurator' ), ), array( __( 'Don’t forget French law', 'ahime-neon-sign-configurator' ), __( 'Mayoral authorisation, night switch-off (1 a.m. to 6 a.m.), local outdoor advertising tax, two-year statutory warranty.', 'ahime-neon-sign-configurator' ), ), ); echo '' . esc_html__( 'This is not legal advice: it is what the source documents allow us to state, and what they do not. The three open points need a certification body, not a careful re-read.', 'ahime-neon-sign-configurator' ) . '
'; AHNS_Admin_UI::card_close(); // --- Diagnostic -------------------------------------------------------- AHNS_Admin_UI::card_open( __( 'Diagnostics', 'ahime-neon-sign-configurator' ) ); echo '' . esc_html__( 'Copy this table if you write to us: it holds everything needed to understand your setup.', 'ahime-neon-sign-configurator' ) . '
'; echo '| %s | %s | %s |