Getting started

Configuring the API key

The API key field on Wynko → Settings is always shown empty — never pre-filled, and the raw key never appears in the page source once saved. Enter it and save; Wynko verifies it live against Laposta before storing anything, so an invalid key is rejected with an inline error and nothing written, while a valid one shows how many campaigns were found and primes the cache.

Keeping the key out of the database

Define it as a constant in wp-config.php instead of storing it as a WordPress option:

define( 'WYNKO_API_KEY', 'your-laposta-api-key' );

A constant always wins over a stored value, and Wynko won’t write a database value that would shadow it. When a constant is in effect, the settings page shows the constant’s name instead of the key field.

If you’d rather not touch wp-config.php at all, an environment variable with the same name works exactly the same way — Wynko reads real server environment variables, so anything that puts WYNKO_API_KEY into the environment your site runs in (your host’s dashboard, a container’s env settings, or a .env file that your hosting stack loads into the environment) is picked up automatically, no code changes needed.

On multisite, give one site its own key by suffixing that site’s blog ID — every site in a network has one (find it under Sites → All Sites, or in the URL when editing a site), and it’s whatever number WordPress actually assigned that site, not a fixed value:

define( 'WYNKO_API_KEY', 'default-key' );       // used by any site without its own
define( 'WYNKO_API_KEY_3', 'site-three-key' );  // used only by the site whose blog ID is 3

A key defined this way is never written to the database and therefore isn’t removed on uninstall — remove the constant (or environment variable) yourself if you decommission the site. If a key was already saved through the settings page before the constant was added, that value stays in the database (inert while the constant is defined) so the field works again if the constant is later removed.

Wynko’s Status row shows Connected or Not connected for whichever key is in effect, and re-checks automatically whenever the key changes.