Wpml compatibility audit

From Lonsdale201/wp-agent-skills · View interactive version

Wpml compatibility audit is an AI agent skill from the GitHub repository Lonsdale201/wp-agent-skills. Audit whether a WordPress plugin or classic theme is WPML-compatible end to end. Use when asked "is this plugin WPML compatible?", "why does this shortcode/string/page not translate?", or when code has wpml-config.xml, stored page/product/term IDs, get_permalink/home_url, shortcode attributes, get_o

How to use this skill

Skill file

WPML compatibility audit

Use this to produce a verdict on a plugin/theme's WPML compatibility. This is a

workflow skill: it tells you what to inspect and how to classify problems. Use

the narrower WPML skills for implementation details once a failing area is

identified.

Compatibility verdicts

Report one of these:

and background render paths work in the current language or deliberately

snapshot original data.

strings, stored IDs, shortcodes, emails/PDFs, or custom tables need fixes.

object ID, or rely on direct meta/option strings with no translation path.

missing; still report source-level risks.

Audit workflow

  1. Identify the multilingual surface:

wpml_is_st_loaded().

runtime-testable; the hook form still degrades to original text.

  1. Separate static gettext from dynamic strings:

WordPress i18n. Check text domain, load timing, .pot, .po/.mo, and

JS translations.

registered and translated on every output path.

  1. Inventory stored object IDs:

attachment, menu, or form IDs need runtime resolution with

wpml_object_id or a correct wpml-config.xml declaration.

wpml_permalink.

  1. Inspect shortcode/block behavior:

wpml-config.xml <shortcode-list> or rich <shortcodes> config when

WPML should expose them to translators.

normal block translation.

  1. Inspect queries:

and restore with null.

explicit language column, translated joins, or deliberate snapshot logic.

  1. Inspect WooCommerce paths:

IDs before display.

custom-field/custom-term-field declarations.

  1. Inspect async/non-page rendering:

the same language context as the frontend request.

while rendering language-sensitive output and restore afterward.

Dynamic string checklist

Find option reads/writes, settings textareas, admin-entered labels, and template

data that comes from the database.

WPML core exposes wpml_is_st_loaded() as defined( 'WPML_ST_VERSION' ).

The actual handlers are in the String Translation add-on: ST 3.5.3 registers

wpml_register_single_string in inc/functions.php and filters

wpml_translate_single_string with a 5-argument callback.

Correct pattern:

do_action( 'wpml_register_single_string', 'my-plugin', 'button_label', $value );

$label = apply_filters(
    'wpml_translate_single_string',
    $value,
    'my-plugin',
    'button_label',
    $language_code // optional; omit for current language
);

Rules:

wpml_translate_single_string.

rendered outside the original frontend request.

function_exists().

it needs String Translation.

Stored ID checklist

Flag every stored ID and decide whether it is a snapshot or a live reference:

original object/language.

the translated page ID.

Typical page-option pattern:

$page_id = (int) get_option( 'my_page_id' );
$page_id = (int) apply_filters( 'wpml_object_id', $page_id, 'page', true );
$url     = $page_id > 0 ? get_permalink( $page_id ) : '';

`wpml-config.xml` checklist

Check whether the plugin ships wpml-config.xml in the plugin root. If absent,

decide whether it needs one.

String Translation parses config through wpml_parse_config_file /

wpml_parse_custom_config. <admin-texts> entries are imported by ST and can

attach option_{$option} filters for translated option values and nested ID

translation. Without ST, <admin-texts> does not provide translated output.

Usually declare:

<custom-fields> / <custom-term-fields>.

relevant post type.

shortcode content/attributes.

Validate config values strictly: translate, display-as-translated, and

automatic are 0|1; custom-field action is exactly

translate|copy|copy-once|ignore.

Common findings

calls wpml_translate_single_string.

is used directly on translated pages.

was submitted.

core without String Translation, so option-string behavior is not testable.

language-sensitive.

wp_set_script_translations().

Report format

Return:

presence, plugin version, active competing multilingual plugins if relevant.

shortcode/block, Woo, and async rendering.

Cross-references

language switching.

References

Validated against WPML Multilingual CMS 4.9.5 and WPML String Translation 3.5.3

local source:

classes/language-switcher/class-wpml-ls-settings-strings.php

classes/url-handling/class-wpml-endpoints-support.php

wpml-string-translation/inc/functions.php

wpml-string-translation/inc/private-actions.php and

wpml-string-translation/inc/admin-texts/wpml-admin-texts.class.php

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.