Broken WordPress 6.1 when using FreeBSD FTPD server

The latest WordPress update breaks the FTP server capabilities. )
So don't update to 6.1 yet, because it will break the update possibility of your installation.
And you cannot update anymore after it.

I've created an issue for it (Technically the exists method of the ftpext filesystem always returns true for the default FreeBSD ftpd server)
https://core.trac.wordpress.org/ticket/57063

The coming 6.1.1 version should have reverted this change, but when you already upgraded it's already too late of course ;-)

When you've already installed, to only way forward is to
copy the WordPress 6.0 wp-admin/includeas/class-wp-filesystem-ftpext.php file into the installation.

You can download this 6.0 file here (remove the .txt extension)

WooCommerce incorrect out of stock error on checkout

It took me a few hours, to debug the cause of an out of stock error for a Woocommerce site.

The product variation had stock available. When performing a checkout it cause an error that the product didn't have enough stock.

I finally figured out what causes this problem:

Woocommerce tries to reserve a product via the function
'reserve_stock_for_product' (woocommerce/src/Checkout/Helpers/ReserveStock.php)

This method joins several tables: wp_wc_reserved_stock and wp_post_meta.

In my case the tables had different storage engines. wc_reserved_stock had a INNODB storage engine. wp_post_meta was MyISAM.

This fails with this particular INSERT query. Because it cannot joins these tables in a single transaction.

So don't mix table engines!!

(Which happen when you migrate an old site to a new server with a different default storage enginge)

Adding Syntax Highlighting to WordPress

I Just added syntax highlighting to WordPress. As a development blog I must be able to show some descent code samples!

I tried the pugin wp-syntax http://wordpress.org/extend/plugins/wp-syntax/, but adding a <pre> element requires me to go to the code pane and editor the code there. (And make me type every special char like & as &)
With this syntax highlighting I'm not very happy because it places the highlighting above a black background.

Another highliger codesnippet-20 Is capable of editing in design time. I just need to place the code between:

Code text

You can even change the style setting in an options tab of Wordpres
To enable this, just:

There's just one problem... TinyMCE removes my spaces !! An using a style "white-space: pre" gives me to many newlines because the highlighting adds newlines....

Aaaaaaargh!!!

Well I will look at this later.

Btw. I also found a DokuWiki syntax plugin for WordPress... That sounds promising, I use dokuwiki for my internal wiki, and this wiki contains a lot of code snippets!