Support » Plugins and Hacks » Tidy Up » [Plugin: Tidy Up] tidy hangs reading stderr

  • wp 3.0.1, osx 10.6.4, mamp 1.9.2 has Tidy Up hanging while reading stderr – related to a particular post being cleaned (sometimes opening the post in WP, switching between visual and html editor and saving helps, sometimes not – could it be related to the length of error report? it seems to be light correllation with that)

    tried everything, including compiling latest tidy from cvs, switching proc_open streams to binary, zero improvement…

    found solution by switching error output to file (needs write rights in plugin dir) using following changes in tidy_class.php:

    change the line that adds config to include also error output to file:

    $tidy_command .= ' -m -config '.dirname (__FILE__)."/$config.config -f ". dirname (__FILE__). "/err.txt";

    comment/remove lines that did the reading from stderr stream:

    // while ($ret = fread ($pipes[2], 1024))
    // 	$messages .= $ret;

    … and after them add a command to read the $messages from err.txt:

    $messages = file_get_contents (dirname (__FILE__)."/err.txt");

    (seems to be a problem with stderr stream or tidy code – Tidy Up might offer an option to use file if stream fails; I can provide database dump if anybody is interested in further investigation)

    http://wordpress.org/extend/plugins/tidy-up/

  • The topic ‘[Plugin: Tidy Up] tidy hangs reading stderr’ is closed to new replies.