true, 'strategy' => 'defer', ) ); wp_add_inline_script( self::HANDLE, 'window.printblobDeactivationFeedback = ' . wp_json_encode( self::data() ) . ';', 'before' ); } /** * What the box's script needs: where to send, which row's Deactivate opens the box, and the two values sent beside * the form. printblob.com refuses a reason not in its list. * * @return array{url:string, plugin:string, version:string, locale:string, wait:int, box:string} */ public static function data(): array { return array( 'url' => FACTS['feedback']['url'], 'plugin' => plugin_basename( FILE ), 'version' => VERSION, 'locale' => get_user_locale(), 'wait' => self::WAIT_MS, 'box' => self::BOX, ); } /** * Each reason's words, by its id in FACTS['feedback']['reasons']. * * @return array */ public static function labels(): array { return array( 'temporary' => __( 'It’s only for a moment: I’m fixing something', 'printblob' ), 'not-working' => __( 'It didn’t work on my site', 'printblob' ), 'hard-to-use' => __( 'It was hard to set up or use', 'printblob' ), 'back-or-sleeves' => __( 'I need back or sleeve printing', 'printblob' ), 'own-products' => __( 'I need my own products', 'printblob' ), '3d' => __( 'I need a 3D view', 'printblob' ), 'print-queue' => __( 'I need a print queue', 'printblob' ), 'other-plugin' => __( 'I found another plugin', 'printblob' ), 'other' => __( 'Something else', 'printblob' ), ); } public static function sent_text(): string { return __( 'Nothing is sent unless you press “Send and deactivate”. Then printblob.com receives the reason you chose, your note, your email address if you type one, the PrintBlob version and your WordPress language. Never your site’s address.', 'printblob' ); } /** * The box: a native dialog, closed until Deactivate is clicked. Below the reasons one place shows either a line * about the note or, for a reason PrintBlob Pro answers while it is not active, the Pro add-on: its features for that * reason, its prices and refund, and its checkout from this box. Every one of them is laid out in that place at once, * so choosing a reason moves nothing. * * @param bool $pro_active Whether PrintBlob Pro is active. */ private static function print_box( bool $pro_active ): void { $labels = self::labels(); $offers = $pro_active ? array() : array_filter( FACTS['feedback']['reasons'], static fn( array $reason ): bool => array() !== $reason['pro'] ); ?>

Pro::feature( $id )['point'] . '.', $reason['pro'] ) ) ); ?> .