pmpro_ipnExit

Output ipnlog and exit;.

Description

pmpro_ipnExit(); 

Usage

  1. if ( !function_exists( 'pmpro_ipnExit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/services/ipnhandler.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_ipnExit(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/services/ipnhandler.php  
  1. function pmpro_ipnExit() { 
  2. global $logstr; 
  3.  
  4. //for log 
  5. if ( $logstr ) { 
  6. $logstr = "Logged On: " . date_i18n( "m/d/Y H:i:s" ) . "\n" . $logstr . "\n-------------\n"; 
  7.  
  8. echo $logstr; 
  9.  
  10. //log in file or email? 
  11. if ( defined( 'PMPRO_IPN_DEBUG' ) && PMPRO_IPN_DEBUG === "log" ) { 
  12. //file 
  13. $loghandle = fopen( dirname( __FILE__ ) . "/../logs/ipn.txt", "a+" ); 
  14. fwrite( $loghandle, $logstr ); 
  15. fclose( $loghandle ); 
  16. } elseif ( defined( 'PMPRO_IPN_DEBUG' ) ) { 
  17. //email 
  18. if ( strpos( PMPRO_IPN_DEBUG, "@" ) ) { 
  19. $log_email = PMPRO_IPN_DEBUG; 
  20. } //constant defines a specific email address 
  21. else { 
  22. $log_email = get_option( "admin_email" ); 
  23.  
  24. wp_mail( $log_email, get_option( "blogname" ) . " IPN Log", nl2br( $logstr ) );  
  25.  
  26. exit;