• Resolved johnmontfx

    (@johnmontfx)


    I’m trying to figure out a way to create a more responsive admin-ajax.php interaction by reducing the plugins loaded for certain ajax requests. I’d like to have some flexibility for this, so my thought is to have an “admin-ajax-custom.php” file that I use for certain requests. I tried using filters and permalinks but this doesn’t seem to work, probably because it’s not really a post or page.

    Is there a way to target a specific file or request for plugin loading? For instance “https://mysite.com/wp-admin/admin-ajax-custom.php”? Just using that URL as an example.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Sterup

    (@foomagoo)

    As long as you are loading wordpress correctly you’d just set the permalink in a plugin filter to https://mysite.com/wp-admin/admin-ajax-custom.php. Selective admin plugin loading needs to be enabled on the plugin organizer settings page.

    Thread Starter johnmontfx

    (@johnmontfx)

    Thanks for the quick response, Jeff.

    Something must be going on because I’ve done exactly that. Selective admin plugin is enabled and the URL is correct on the Plugin Filter page. I’ve added a function to the custom ajax file to print out loaded plugins to the error log and they all appear to be loading.

    Right now admin-ajax-custom.php is an exact copy of the original, so that’s not the problem.

    Time to start enabling / disabling plugins and see if that’s what’s happening.

    Thanks again.

    Thread Starter johnmontfx

    (@johnmontfx)

    So following up on this, I have moved to a dev site and done the following:

    1. Disabled all plugins except for Akismet, PO, and Favorites (which is the one where the ajax call I’m testing is being used
    2. Enabled the TwentyFifteen Theme
    3. Removed all plugin filters except for one: https://dev.fxphd.com/wp/wp-admin/admin-ajax-fx.php
    4. The plugin filter allows ONLY PO and Favorites (not Akismet)
    5. Turned ON Fuzzy URL Matching, Selective Plugin Loading, Ignore URL Protocol, Selective Admin Plugin Loading. All other settings off.
    6. When I attempt to access admin-ajax-fx.php, akismet is still loading. I added some code in the admin-ajax-fx.php file to print out the active plugins in the php log.

      I also disabled Favorites and Akismet is still loading. I also tried a couple of other plugins in place of Akismet…but they are still loading.

      Any suggestions for further debugging?

      Thanks again for creating an awesome plugin. Helps so much on my site where on some pages I do need some heavy plugins active and I can leave them off on other pages.

    Thread Starter johnmontfx

    (@johnmontfx)

    I also did a fresh install of WordPress 5.1.1 and copied wp/admin-ajax.php to wp/admin-ajax-fx.php

    I only installed PO and I have the same issue. I confirmed the existence of the MU plugin as well…it was installed correctly.

    Here are some screenshots from my dev server for the settings:

    https://www.dropbox.com/s/bflg2vzqc3bpo87/Screen%20Shot%202019-04-05%20at%2013.12.14.png?dl=0
    https://www.dropbox.com/s/z81rkuxt14oz3dp/Screen%20Shot%202019-04-05%20at%2013.12.21.png?dl=0
    https://www.dropbox.com/s/i9dn76h1nc2a6vu/Screen%20Shot%202019-04-05%20at%2013.12.36.png?dl=0

    Thanks again!

    • This reply was modified 5 years ago by johnmontfx.
    Thread Starter johnmontfx

    (@johnmontfx)

    Just wanted to (politely) bump this thread as I had done some experimenting and found I couldn’t get PO to respect the permalink…

    Thank you again for your assistance and work on the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable for specific URL request?’ is closed to new replies.