I’d like to announce the official release of the updated Preserve Code Formatting plugin (v2.5) for WordPress.
Preserve formatting of code for display by preventing its modification by WordPress and other plugins while retaining original whitespace and characters.
The plugin’s official homepage is located at :
coffee2code.com/wp-plugins/preserve-code-formatting.
This release features a fix for a long-running (and frustrating) bug where preserved code would occasionally appear garbled. This release also feature many behind-the-scenes plugin management code updates. The plugin extends support through WordPress v2.8+, but drops support for versions of WordPress older than v2.6.
Comments welcome on this post for this version of the plugin. Comments will be closed once this release has been superseded by another.
Update: Plugin updated to v2.5.1
Update 2: Plugin updated to v2.5.2
Update 3: Plugin updated to v2.5.3
Update 4: Plugin updated to v2.5.4
Read comments for details of the various updates.
Read more for a detailed ChangeLog of the release.
Detailed ChangeLog
These are the detailed changes, which may or may not make sense to you depending on your familiarity with the previous features and internals of the plugin.
- Fixed long-running bug that caused some preserved code to appear garbled
- Updated a lot of internal plugin management code
- Added ‘Settings’ link to plugin’s plugin listing entry
- Used plugins_url() instead of hardcoded path
- Brought admin markup in line with modern conventions
- Minor reformatting (spacing)
- Noted compatibility through WP2.8+
- Dropped support for pre-WP2.6
- Updated copyright date
- Updated screenshot
- Updated to v2.5
23 replies on “Preserve Code Formatting v2.5”
Plugin has been updated to v2.5.1
I’ve released a new update to the plugin that does the following:
* Fixed newly introduced bug that added unnecessary slashes to preserved code
* Fixed long-running bug where intended slashes in code got stripped on display (last remaining known bug)
Hi Scott.
I seem to be getting the following errors throughout my blog (both in published posts and in the dashboard/admin area):
Warning: gzuncompress() [function.gzuncompress]: data error in /home/david/public_html/geekery.etherknet.com/wp-content/plugins/preserve-code-formatting/preserve-code-formatting.php on line 371
It’s occurring in the preserve_postprocess function.
Any idea (before I investigate further) as to what’s causing this?
Cheers.
ps. Thanks for a very handy product! 🙂
David.
I encountered the same issue as well (though with less frequency). I managed to resolve it using code updates I’ve made available here. Mind testing that update to see if it eliminates those errors (and without introducing any new ones) and reporting back? Thanks!
Hi Scott,
The problem goes away with the code you pointed me to (2.5.2-beta).
I see you’ve changed from using gzuncompress to gzinflate. Function behaviour had changed, I gather?
Thanks very much.
Cheers.
David.
[…] coffee2code.com/archives/2009/07/30/preserve-code-formatting-v25 […]
Thanks for reporting back, David. I changed from using gzcompress/gzuncompress to gzdeflate/gzinflate. The gzuncompress error was vague and the docs seem to suggest the possibility of it having problems with certain sized data. The alternate implementation I went with seems to be better.
This plugin has been updated to v2.5.2
I’ve released a new update to the plugin that does the following:
* Fixed newly introduced bug that occasionally generated a gzuncompress() error (and prevented related code from displaying)
* Fix to retain attributes that had been provided for preserved tags
Hi Scott
I’ve upgraded to 2.5.2, and I’m currently experiencing the following error, now in gzinflate:
Warning: gzinflate() [function.gzinflate]: data error in /data01/isr/public_html/wp-content/plugins/preserve-code-formatting/preserve-code-formatting.php on line 372
I only experience this on a couple of posts – but the same posts each time.
Anything I can send you to help diagnose the problem further?
Thanks
ian
Do you mind e-mailing me the entire contents of one of the posts that consistently generates the error? Thanks.
Scott, great plugin 🙂
But I get the same error:
gehrcke.de/2009/06/cernvm-local-atlas-software-the-clean-solution/
I could not find your email address here… tell it to me and I will send you the whole blog post source!
Thank you,
Jan-Philip
oh oh… googling for
www.google.de/#hl=de&q=preserve-code-formatting%2Fpreserve-code-formatting.php+gzinflate&meta=&fp=fa7c0e7af2e9fba3
tells us that many many poeple suffer from this 🙂 But it also tells, that many people like your plugin 😉
Ian, Jan-Philip: Do you guys mind trying out a newer version of the plugin which should fix this? You can get it here (it’s v2.5.3-beta): svn.wp-plugins.org/preserve-code-formatting/trunk/preserve-code-formatting.php
Ian sent me the contents of a post that tripped the error and I believe I’ve worked around it. I’ll make an official release soon, but feedback is appreciated.
Scott,
the v2.5.3-beta fixes the error for me and does not seem to cause other problems. I don’t make heavy use of your plugin, so there is no guarantee, but for me everything is fine 🙂 !
Thank you for your work! Great 🙂
Jan-Philip
Hi Scott
Just tested 2.5.3-beta, and it works fine with all my posts.
Thank you very much for your help.
ian
The tentative 2.5.3 version worked for me as well. I’d upgraded the plugin to 2.5.2 from a much earlier version that was incompatible with the current WP version, 2.8.4. It threw the error described by others here. Any idea what’s going on?
I should add, that the settings page is blank when I click on the plug-in link.
Jan: Thanks for reporting back!
AlanK: Ah, thanks for finding the settings page bug. You can still get to the setting page under the admin “Settings” listing of settings pages, but in v2.5.3 that I’m about to release, the “Settings” link in the plugin’s listing will be fixed. You seem to be confirming that 2.5.3-beta is otherwise good for you?
Yes, since installing the beta version of your impending release, there has been no further incident. Thanks very much for attending to the issue. Most appreciated.
This plugin has been updated to v2.5.3
I’ve released a new update to the plugin that does the following:
* Fixed recently introduced bug affecting occasional code preservation by using a more robust alternative approach
* Fixed “Settings” link for plugin in plugin listing, which lead to blank settings page
* Changed help text for preservable tags settings input to be more explicit
Hi Scott,
First of all thanks for this plugin.
However, v2.5.3 does funny things to my post that 2.5.2 doesn’t.
I’ve left the blog on 2.5.3 so that you can check it out. The bit that doesn’t look right should read:
“#include “level1/level2/level3/level4/filename.h”
Please let me know if you can see the problem. If you want me to send you the complete blog source that’s not a problem.
John
John: Yup, you’re right. Seems like I backed out some thing in the 2.5.3 release that needed to remain. A new release will be soon forthcoming. Thanks for the report!
This plugin has been updated to v2.5.4
I’ve released a new update to the plugin that does the following:
* Fixed some borked code preservation by restoring some processing removed in previous release
Hi Scott,
All seems well now with that problem. Thanks
John