2017 © Pedro PelĂĄez
 

wordpress-plugin wp-no-admin-ajax

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

image

devgeniem/wp-no-admin-ajax

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  • Monday, July 17, 2017
  • by devgeniem
  • Repository
  • 10 Watchers
  • 15 Stars
  • 1,917 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 8 Versions
  • 6 % Grown

The README.md

geniem-github-banner, (*1)

WP Plugin: No-Admin-Ajax

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

A WordPress plugin that changes the WP AJAX routine and rewrites the ajax requests to custom url rather than /wp-admin/admin-ajax.php back-end., (*3)

Install

Recommended installation to WP project is through composer:, (*4)

$ composer require devgeniem/wp-no-admin-ajax

Use cases

  • Rewrite all admin-ajax.php queries into custom url so you can allow /wp-admin/ to only certain IP-addresses.
  • You can use this to confuse bots which might try to use vulnerabilities in admin-ajax.php.

Configuration

Variables

This plugin url is by default /no-admin-ajax/. You can use filters to change it or you can set the default value by yourself by using:, (*5)

// This turns the no admin ajax url to -> /ajax/
define('WP_NO_ADMIN_AJAX_URL','ajax');

Notice: Value set here can be filtered too, this just sets the starting point for the custom url., (*6)

Notice 2: After plugin installation and other changes be sure to refresh your permalinks by just going to Settings > Permalinks > and saving it without any modification., (*7)

Hooks & Filters

You can customize the url by using filter no-admin-ajax/keyword., (*8)

<?php

// This changes /no-admin-ajax/ -> /ajax/
add_filter( 'no-admin-ajax/keyword', 'my_custom_no_admin_ajax_url' );
function my_custom_no_admin_ajax_url( $ajax_url ) {
    return "ajax";
}

You can run commands before ajax calls by using no-admin-ajax/before or no-admin-ajax/before/{action}, (*9)

<?php
// Writes log entries after hearthbeat action for debugging
do_action( 'no-admin-ajax/before/heartbeat' , 'my_custom_no_admin_ajax_debug' );
function my_custom_no_admin_ajax_debug() {
    error_log( 'DEBUG | heartbeat action was run by: '.$_SERVER[“REMOTE_ADDR”] );
}

The Versions

17/07 2017

dev-master

9999999-dev

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

17/07 2017

1.0.3

1.0.3.0

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

17/07 2017

dev-villesiltala-patch-1

dev-villesiltala-patch-1

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

30/10 2016

1.0.2

1.0.2.0

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

30/10 2016

dev-onnimonni-patch-1

dev-onnimonni-patch-1

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

14/08 2016

1.0.1

1.0.1.0

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

14/08 2016

dev-add-define-config

dev-add-define-config

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires

 

04/05 2016

1.0.0

1.0.0.0

A WordPress plugin that lightens the WP AJAX routine and directs the requests to front-end rather than admin back-end.

  Sources   Download

MIT

The Requires