aramkocharyan/crayon-syntax-highlighter — pull request #24 by chrisguitarguy (2012-09-28 07:33:38+00:00)
Title: Use the Upload Directory for Log Files

Instead of saving the log file in the plugin directory (where it likely gets obliterated by plugin updates?), save it in the user's upload directory.

This commit does that, but it brings up a few other issues. The one I encountered was the sample code breaking on the admin page. I get a notice that `wp_upload_dir`, the fuction I used to grab the upload directory, doesn't exist. Which is should: it's in `wp-includes/functions.php` which gets loaded way early. I suspect the issue is coming from doing ajax requests the wrong way (eg. using a custom PHP file and including `wp-load.php`). WordPress has a nice [API for AJAX] (http://codex.wordpress.org/AJAX_in_Plugins) that you should consider converting to.