with open("public_html/supercerebro/api/get-credentials.php", "r") as f:
    content = f.read()

old = """    if ($svc === 'wordpress' && !empty($creds)) {
        $credentials['wordpress'] = [
            'wp_url'  => $creds['wp_url']  ?? '',
            'wp_user' => $creds['wp_user'] ?? '',
        ];
    }"""

new = """    if ($svc === 'wordpress' && !empty($creds)) {
        $credentials['wordpress'] = [
            'wp_url'  => $creds['wp_url']  ?? '',
            'wp_user' => $creds['wp_user'] ?? '',
        ];
    }
    if ($svc === 'shopify' && !empty($creds)) {
        $credentials['shopify'] = [
            'shop_domain' => $creds['shop_domain'] ?? '',
        ];
    }"""

if old in content:
    content = content.replace(old, new, 1)
    with open("public_html/supercerebro/api/get-credentials.php", "w") as f:
        f.write(content)
    print("OK get-credentials.php: shopify added")
else:
    print("ERROR: wordpress anchor not found")
