Proper context for wp_remote_post()

You shouldn’t post directly to your plugin file – WordPress won’t be loaded, and you shouldn’t load it manually.

Use the AJAX API and an action hook to handle it (note it doesn’t need to be an actual AJAX request):

function wpse_180814_post_to_plugin( $name, $email ) {
    $result = wp_remote_post( 
        admin_url( 'admin-ajax.php' ), 
        array(
            'body' => array(
                'action' => 'wpse_180814_action',
                'name'   => $name,
                'email'  => $email,
            ),
        ) 
    );
}

function wpse_180814_action() {
    if ( isset( $_POST['name'], $_POST['email'] ) ) {
        global $wpdb;
        $wpdb->insert( 
            'table', 
            array ( 
                'name' => $_POST['name'], 
                'email' => $_POST['email'] 
            )
        );
    }
}

add_action( 'wp_ajax_nopriv_wpse_180814_action', 'wpse_180814_action' );
add_action( 'wp_ajax_wpse_180814_action', 'wpse_180814_action' );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)