$content is empty while using DOMDocument

If the pages that are giving errors have no content, you can deal with it by adding a check at the start of the function:

function image_manipulation( $content ) {
  if(empty($content)) return $content;
  //rest of the code
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)