WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-Affiliate] plugin doesn't work anymore with WP 2.8 (8 posts)

  1. gawel44
    Member
    Posted 5 years ago #

    Hello,

    Since the version 2.8 of WP, the plugin WP-Affiliate (wordpress.org/extend/plugins/wp-affiliate/) doesn't work, i've try to desactivate, re-activated, etc.

    Do you have the same problem ?
    Do you know how to fix it ?

    The website of the plugin is down and it's the same for the creator.

    Thank's for your reply !

  2. arcab4
    Member
    Posted 5 years ago #

    just tagging on..having the same issue....anything new links created don't work..but looks like older links are still working....

  3. Alexandre
    Member
    Posted 5 years ago #

    I have found that the problem is with this line :

    wp_print_scripts( array( 'sack' ));

    When WP-Affiliate adds the SACK js lib to the page, a bunch of JS errors appear. Is there an incompatibility with SACK and 2.8, it does come with WP 2.8, should I use the .dev version instead?

    add_action('admin_print_scripts', 'wp_affiliate_js_admin_header' );
    
    function wp_affiliate_js_admin_header() // this is a PHP function
    {
      // use JavaScript SACK library for Ajax
      wp_print_scripts( array( 'sack' ));
    
      // Define custom JavaScript function
    ?>
    <script type="text/javascript">
    //<![CDATA[
    function wp_affiliate_ajax_add_link( link, text, category )
    {
       var mysack = new sack( "<?php bloginfo( 'wpurl' ); ?>/wp-admin/admin-ajax.php" );    
    
      mysack.execute = 1;
      mysack.method = 'POST';
      mysack.setVar( "action", "wp_affiliate_add_link" );
      mysack.setVar( "link", link.value );
      mysack.setVar( "text", text.value );
      mysack.setVar( "category", category );
      mysack.encVar( "cookie", document.cookie, false );
      mysack.onError = function() { alert('Ajax error in adding affiliate link' )};
      mysack.runAJAX();
    
      return true;
    
    } // end of JavaScript function
    //]]>
    </script>
    <?php
    } // end of PHP function myplugin_js_admin_header

    This outputs the following:

    <script type='text/javascript' src='http://bloguedegeek.net/wp-includes/js/tw-sack.js?ver=1.6.1'></script>
    <script type="text/javascript">
    //<![CDATA[
    function wp_affiliate_ajax_add_link( link, text, category )
    {
    [...]
  4. Alexandre
    Member
    Posted 5 years ago #

    Just found the solution!

    You have to re-save the permalink structure so that WP refreshes its cached list of permalinks.

    Just to to Settings > Permalinks and hit Save.

  5. lectronics
    Member
    Posted 4 years ago #

    I have this same problem, its stopped working now soon after I upgraded. Old links that were already saved are working but any new links show 404 error.

    I tried permalinks suggestion above, but doesnt work. I use custom structure:

    %postname%

  6. surfmedia
    Member
    Posted 4 years ago #

    it works, you just have to hit save and edit .htaccess 666 permision if it hasn't the write permissions.

    i have the same permalinks structure

  7. Brinkman
    Member
    Posted 4 years ago #

    Could you be a bit more specific? What file needs 666 permission?

  8. Brinkman
    Member
    Posted 4 years ago #

    Tried to do the "Just to to Settings > Permalinks and hit Save. " and I can't even find a 'Settings' link.

Topic Closed

This topic has been closed to new replies.

About this Topic