QTRAD_VERSION, 'items' => qtrad_migration_scan( true ), 'dismissed' => false ), false ); } /** * What a site that used qTranslate-X or qTranslate-XT should know after the switch. * * @param bool $apply Turn on the translation of custom fields, user profiles and options * where such data is found and the admin has not chosen yet. * @return string[] One plain-text line per finding. */ function qtrad_migration_scan( $apply = false ) { global $wpdb; $items = array(); $own = get_option( 'qtrad_settings', array() ); $own = is_array( $own ) ? $own : array(); $saved = $own; $modules = get_option( 'qtranslate_modules_state', array() ); $names = array( 'all-in-one-seo-pack' => 'All in One SEO Pack', 'events-made-easy' => 'Events Made Easy', 'google-site-kit' => 'Google Site Kit', 'gravity-forms' => 'Gravity Forms', 'jetpack' => 'Jetpack', 'slugs' => 'Slugs translation', 'wp-seo' => 'Yoast SEO', ); $active = array(); foreach ( is_array( $modules ) ? $modules : array() as $id => $state ) { if ( 1 === (int) $state && ! in_array( $id, array( 'slugs', 'acf', 'woo-commerce' ), true ) ) { // QTX_MODULE_STATE_ACTIVE. qTrad covers these itself. $active[] = isset( $names[ $id ] ) ? $names[ $id ] : (string) $id; } } if ( $active ) { /* translators: %s: comma-separated list of qTranslate-XT integration modules */ $items[] = sprintf( __( 'qTranslate-XT integration modules were active: %s. qTrad has no equivalent for these modules, so content they translated may show raw language markers.', 'qtrad' ), implode( ', ', $active ) ); } // One-time read-only scan; no core API counts meta by key pattern. // phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching $markers = array( '%' . $wpdb->esc_like( '[:' ) . '%' . $wpdb->esc_like( ']' ) . '%', '%' . $wpdb->esc_like( '