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 )
{
[...]