( function( $ ){
    $( document ).ready( function(){

      $( '.author-portfolio-btn-get-started' ).on( 'click', function( e ) {
          e.preventDefault();
          $( this ).html( 'Processing.. Please wait' ).addClass( 'updating-message' );

          $.post( author_portfolio_ajax_object.ajax_url, {
              'action' : 'install_act_plugin',
              'nonce'  : author_portfolio_ajax_object.nonce // Passed the nonce here
          }, function( response ){
              if ( response.success ) {
                  location.href = 'themes.php?page=advanced-import';
              } else {
                  // Handle Error properly
                  alert( response.data.message );
                  $( '.author-portfolio-btn-get-started' ).html( 'Try Again' ).removeClass( 'updating-message' );
              }
          } );
      } );
    } );

}( jQuery ) );