I am not the program author, but I’ll throw in my 2 cents …
If you are at all comfortable with PHP, it would not be too difficult to log senders, recipients, date and time sent, originating IP address, etc., by adding a few lines of code to the plugin.php
file. Just look for the wp_mail
function call and add some logging immediately after that. Here is some very simple code that would create a text file:
$f = @fopen(LOG_FILE, 'a+');
if ( $f ) {
@fputs($f, date("Y-m-d h:i") . " - IP: " . $_SERVER['REMOTE_ADDR'] .
" - SENDER: $sender RECIPIENT: $to ($name) IMAGE: $img");
@fclose( $f );
}
Note: Replace LOG_FILE
with the full path (path and file name) to a writeable location on your server. You can — and probably should — use WP’s internal directory constants here.
This would create a flat text file with a line for each ecard sent that would look something like this:
2013-01-20 02:12 - IP: 192.168.0.47 - SENDER: John Doe RECIPIENT: [email protected] (Jane Doe) IMAGE: /gallery/IMG_3410.JPG
If you wanted, you could even add $msg
at the end ( ...IMAGE: $img $msg");
) to include the text of the message the sender included.
WARNING: My simple code above comes with some caveats:
- It is not designed to be highly secure. It creates a plain-text file in a publicly-accessible location.
- It does not scale well. Whenever someone sends an ecard, this flat text file has to be appended to. Probably not a problem on a small site, but could be an issue on busier sites.
- The log file will continue to grow with each new entry, eventually leading to slower response time.
- There is no (good) way to sort, index or even view the log file from within WP.
- Probably some other things I’m not even thinking of at 2:15 am …
Use this at your own risk! But it’s a quick-and-easy / fast-and-dirty way to provide some basic logging functionality to this plugin…
Good luck!