Support » Plugin: WooCommerce Cloak Affiliate Links » Plugin Stopped Working After Update

  • Resolved witguides


    Hey Guys,

    Great plugin, been using for a long time and worked perfectly!

    After update a couple of weeks ago, cloaked links are not generating properly.

    Here are my issues:
    – Affiliate link works when pasted into browser.
    – Affiliate does not work through cloaked link in website.
    – Normal direct link works through cloaked link in website.
    – Affiliate links works through website when plugin deactivated.
    – I note the affiliate link changes when cloaked.
    – Old links work, newly generated links over past week do not.


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author datafeedr



    Which update are you referring to? An update to WordPress, WooCommerce or to our plugin?

    Your last comment about old links working makes me think that something changed with how WordPress or WooCommerce handle saving links…


    Hi Eric,

    I can’t be certain.

    I suspect it was the last WordPress update, as I updated both around the same time.



    Plugin Author datafeedr



    It seems the issue is with how WooCommerce encodes the URL before it is saved to the database.

    Here’s the URL I entered into an External product’s Product URL field (without http://www.):

    And here is the value stored in the database:

    I added this code to a custom plugin and it fixed the issue:

     * Fix encoded ampersands.
     * WooCommerce was saving & as &. This code
     * converts the encoded ampersands back to a regular ampersand.
    add_filter( 'wccal_filter_url', 'mycode_decode_ampersand', 20, 2 );
    function mycode_decode_ampersand( $external_link, $post_id ) {
    	$external_link = html_entity_decode( $external_link, ENT_QUOTES | ENT_HTML5 );
    	return $external_link;

    Here’s how to create a custom plugin:

    Hope this helps!


    Plugin Author datafeedr


    Ugh! This site keeps converting my characters. I’ll post one more time adding spaces to the characters.

    Basically, WooCommerce is converting & into & # 0 3 8 ; before saving to the database.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin Stopped Working After Update’ is closed to new replies.