<commit_before># WP Client Ajax Login

A simple plugin that allows login to wordpress through the client's browser via AJAX.

## How to install

### Composer

If you're using Composer to manage your codebase add this plugin to your dependencies running:

`composer require roots/soil 0.1.0`

Or manually add it to your composer.json:

```
"require": {
  "enricodeleo/wpClientAjaxLogin": "0.1.0"
}
```

### Legacy way

[[Download this repo as a zip file ]](https://github.com/enricodeleo/wpClientAjaxLogin/archive/0.1.0.zip)and extract it to your wp-content/plugins directory.

<commit_msg>updated readme with jquery example<commit_after># WP Client Ajax Login

A simple plugin that allows login to wordpress through the client's browser via AJAX.

## How to install

### Composer

If you're using Composer to manage your codebase add this plugin to your dependencies running:

`composer require roots/soil 0.1.0`

Or manually add it to your composer.json:

```
"require": {
  "enricodeleo/wpClientAjaxLogin": "0.1.0"
}
```

### Legacy way

[Download this repo as a zip file ](https://github.com/enricodeleo/wpClientAjaxLogin/archive/0.1.0.zip)and extract it to your wp-content/plugins directory.

# Example of ajax call

You can use vanilla Javascript, Angular, or whatever framework suit your needs. Here's an example with jQuery:

```
$.ajax({
    type: "POST",
    url: "http://tastaly.dev/wp/wp-admin/admin-ajax.php",
    data: {
        user: "username", //hard-coded for example purposes
        pwd: "password", //hard-coded for example purposes
        action: "clientAjaxLogin"
    },
    success: function(resp) {
        var respObj = JSON.parse( resp );
        if( respObj.success ) {
            window.location = respObj.success;
        } else {
            console.log( respObj.error );
        }
    }
});
```

Of course you can bind the ajax call to an event like submitting a form.
{'fraction_non_alphanumeric': 0.10889005786428195, 'fraction_numerical': 0.009468700683850605, 'mean_word_length': 3.3524027459954233, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2512146', 'n_tokens_mistral': 608, 'n_tokens_neox': 577, 'n_words': 209}