latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

API notification handler efficiency

Home Forums Community Forum API notification handler efficiency

This topic contains 1 reply, has 2 voices. Last updated by  Cristián Lávaque 3 years, 9 months ago.

Topic Author Topic
Posted: Sunday Mar 31st, 2013 at 6:37 am #46193
Tom
Username: halasyt

Hi,
I have read the notification handler post (http://www.s2member.com/kb/building-an-api-notification-handler/) and it’s working well.

My question is that if I want to have several notification handlers, is it better to place all of them into 1 plugin file, or have a separate one for each?
I’m asking with regard to WP efficiency of course. I would say use 1 file, so WP only has to load 1 plugin and hook, but I want to make sure.

So in the end, it would look something like this:

<?php
add_action('init', 's2_notification_handlers'); 

function s2_notification_handlers() {
		if(!empty($_GET['s2_payment_notification'])) 
			{...
			exit; } 
		if(!empty($_GET['s2_EOT_notification'])) 
			{...
			exit; } 
		if(!empty($_GET['s2_registration_notification'])) 
			{...
			exit; } 			
}

List Of Topic Replies

Viewing 1 replies (of 1 total)
Author Replies
Author Replies
Posted: Monday Apr 1st, 2013 at 12:23 am #46247

Yes, a single file will be more efficient than several because less files need to be accessed.

Viewing 1 replies (of 1 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.