Files
WooList/woolist-phplist
Malin 1c382f2cf4 fix: send API params in POST body, remove double URL-encoding
Root causes identified from logs:
1. All params (login, password, cmd, email, etc.) were appended to the URL
   query string; phpList REST API v3 expects them in the POST body.
   wp_remote_post now sends body=>$params instead of an empty body.
2. subscriber_get_by_email and subscriber_add called rawurlencode() on the
   email before passing it to call(), which then ran http_build_query() on
   it again — double-encoding '@' to '%2540'. Both rawurlencode() calls
   removed; wp_remote_post handles POST body encoding correctly.

Additional improvements:
- endpoint_url() returns just the bare ?page=call&pi=restapi URL
- On API error, log full_response (entire JSON) not just the message field,
  so phpList's exact reply is always visible in WC Status Logs
- Non-JSON response now gives an explicit error message pointing to the
  endpoint URL / credentials rather than a generic JSON parse failure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 08:18:43 +01:00
..