You have to modify how both NGGALLERY_ABSPATH and NGGALLERY_URLPATH are defined in order to solve this error. These are defined in nggallery.php around line 209 and 210.
The following definitions work for me..
define(‘NGGALLERY_ABSPATH’, dirname(__FILE__) . ‘/’ );
define(‘NGGALLERY_URLPATH’, WP_PLUGIN_URL . ‘/nextgen-gallery/’ );
I believe the problem is actually down to the function plugin_basename() not returning the expected response
You can check if the title you’re filtering belongs to the current post by comparing it to the global $post->post_title variable.
Here is an example filter
function my_title_filter($title)
{
global $post;
if( $title == $post->post_title ){
$title = 'My New Filtered Title';
}
return $title;
}