WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a small plugin to test database interactions in wordpress. I have a small function that inputs the arguments to the table.

If i call my function in a themefile it inputs my test values to my table, but if i call it from another plugin i get this error:

Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /.../wp-includes/functions.php on line 2504

I have no idea what this error means, can anyone shed some light on it?

edit: I use MAMP with PHP 5.4.4


function test_db_function($name, $message){
  global $wpdb;
  $table_name = $wpdb->prefix . "testDB";

  if( $name == '' || $message == '' || !isset($name) || !isset($message)) {
    //return 0;
    $rows_affected = $wpdb->insert( $table_name, array( 
      'time' => time(), 
      'name' => $name, 
      'text' => $message) );
share|improve this question

You did not provide that information, so I have to guess a little bit: You are using PHP 5.4 and zlib.output_compression is on on your server?

Then you just stumbled upon bug #18525. Possible solutions:

  • Disable zlib.output_compression.
  • Apply the patch provided there and report back on that ticket if it works.
  • Disable notices.

What you can do when you decide to release the plugin to the public is another issue …

share|improve this answer
Thank you for a quick response, realized i provided a little information. I use PHP 5.4.4 in MAMP. – andeersg Oct 26 '12 at 19:57
I see that bug happens on auto-updates of plugins. I get the notice when calling a function from my plugin, and the function is not performed. – andeersg Oct 26 '12 at 20:07
Same problem here - I found that adding ini_set('zlib.output_handler', ''); at the top of my plugin solved it. – adam Jun 4 '13 at 20:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.