[wp-hackers] backend script that will do only authentication, without loading complete WordPress

Davit Barbakadze jayarjo at gmail.com
Mon Jan 31 12:46:12 UTC 2011


I wrote simple script, which checks for current users capabilities,
just to find out if it is possible, whether it's easy and whether it
has any sense. I should say that while it is possible, it's not
exactly easy, since I had to put some plugs here an there. But now
your mentioning of plugins modifying authentication process kinda
ruined it all :) Is this such a wide-spread practice? I would really
like this plugin to work with as much cases as possible.

Otherwise loading complete WordPress tends to be 3-5 times slower
(tested on clean install). Could potentially be a nice performance
boost. Of course if it doesn't ruin other things...

Here is the code: http://pastebin.com/TBUNSNzs.

Davit Barbakadze




On Mon, Jan 31, 2011 at 4:03 PM, Andrew Nacin <wp at andrewnacin.com> wrote:
> On Mon, Jan 31, 2011 at 2:15 AM, Davit Barbakadze <jayarjo at gmail.com> wrote:
>
>> We need to repeatedly send some info from client-side to WordPress
>> backend, but I guess loading complete WordPress to execute some very
>> simple operations would be an overkill. I knew there was a workaround
>> for load-script.php which minifies admin scripts, but looking at the
>> code now I see that it doesn't check for authentication, does it? In
>> our case that might be harmful. We need to check whether user is
>> logged in and is an admin. Is there an easy way to do that, without
>> loading complete WordPress?
>
>
> I don't see how loading WordPress is going to be overkill. You need to load
> WordPress to do what you're trying to do -- authentication requires quite a
> bit to be loaded, including plugins, particularly if they're altering the
> authentication process. Therefore this doesn't seem to have much practical
> value.
>
> There's no workaround in load-scripts/styles.php; as you've found, they
> simply don't do any authentication.
>
> Nacin
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list