$timestamp, 'gen' => (string) ( $meta['gen'] ?? '' ), 'model' => (string) ( $meta['model'] ?? '' ), 'v' => defined( 'AIPT_VERSION' ) ? AIPT_VERSION : '', ) ); if ( false === $json ) { return false; } update_post_meta( $productId, $key, wp_slash( $json ) ); update_post_meta( $productId, MetaKeys::ROLLUP, (string) $timestamp ); if ( ! self::wroteLiveValue( $productId, $key, $json ) || ! self::wroteLiveValue( $productId, MetaKeys::ROLLUP, (string) $timestamp ) ) { return false; } \AIPT\Core\Funnel\FunnelMilestones::record( 'first_generation' ); do_action( 'aipt_content_marked', $productId, $contentType, $meta ); return true; } public static function wroteLiveValue( int $postId, string $metaKey, $expected ): bool { return get_post_meta( $postId, $metaKey, true ) === $expected; } }