• You are using esc_url() in get_card_methods_from_api() incorrectly. Default context for esc_url() is display, meaning ensure safe url escaping and display in HTML, e.g. by replacing & into &. Technically you could use URL encode, but URL you are constructing does not require any kind of encoding or escaping.
    • Please switch to wp_remote_get()/wp_remote_post()/wp_remote_request() as alternative to curl. wp_remote_XXX() can be traced, logged and debugged. This in combination with query monitor / debug bar will also highlight outstanding performance bug I’ve reported 8 months ago https://wordpress.org/support/topic/bug-in-get_card_method/.

The topic ‘Code quality’ is closed to new replies.