Skip to content

Instantly share code, notes, and snippets.

@retlehs
retlehs / woocommerce-shipping-detach-bundled-psr-log.patch
Created May 21, 2026 22:48
WooCommerce Shipping patch to avoid `psr/log` conflicts with Acorn
Detach bundled Psr\Log v1 from woocommerce-shipping.
The plugin's Jetpack autoloader registers its own Psr\Log v1 classes via
jetpack_autoload_classmap.php. When loaded before Acorn's vendor
autoload, the v1 LoggerInterface wins and Monolog v3 (shipped by Acorn)
fatals on the signature mismatch:
Declaration of Monolog\Logger::emergency(Stringable|string $message, ...)
must be compatible with Psr\Log\LoggerInterface::emergency($message, ...)
@retlehs
retlehs / block-styles.jsx
Created May 14, 2026 21:07
Multiple select for block styles
/**
* Multi-select block styles for Gutenberg, with live preview popovers.
*
* Gutenberg's built-in Block Styles panel is single-select: picking one
* "is-style-*" class swaps out any other. That makes it impossible to
* combine, say, a "size" style with a "decoration" style on the same
* block — see https://github.com/WordPress/gutenberg/issues/14598
* (open since 2019).
*
* This module replaces the core panel for the blocks listed in
@retlehs
retlehs / google-listings-and-ads-detach-bundled-monolog-and-psr-log.patch
Created May 5, 2026 17:08
Google for WooCommerce patch to avoid `psr/log` and `monolog/monolog` conflicts with Acorn
--- a/src/Autoloader.php
+++ b/src/Autoloader.php
@@ -39,6 +39,8 @@
return false;
}
+ self::detach_host_namespaces( $autoloader_result );
+
return $autoloader_result;
}
@retlehs
retlehs / 2026-04-29-closed-plugins.md
Last active April 29, 2026 22:48
WordPress.org plugins closed on 2026-04-29T16:02:25Z
@retlehs
retlehs / CC.md
Last active May 25, 2026 13:50
Backlinks for any domain via Common Crawl
@retlehs
retlehs / wp-docs-md-bookmarklet.md
Created August 7, 2025 17:57
WordPress.org Developer Docs to Markdown Bookmarklet

WordPress.org Developer Docs to Markdown Bookmarklet

Quick and dirty way to convert a WordPress developer documentation page into Markdown.

javascript:(function(){const turndownScript=document.createElement('script');turndownScript.src='https://unpkg.com/turndown/dist/turndown.js';turndownScript.onload=()=>{const turndownService=new TurndownService({gfm:true,headingStyle:'atx',codeBlockStyle:'fenced'});turndownService.addRule('table',{filter:'table',replacement:function(content,node){let markdownTable='\n';const rows=Array.from(node.querySelectorAll('tr'));const headerCells=Array.from(rows[0].querySelectorAll('th'));const columnCount=headerCells.length;let headerRow=headerCells.map(cell=>cell.textContent).join(' | ');let separatorRow=Array(columnCount).fill('---').join(' | ');markdownTable+=`| ${headerRow} |\n`;markdownTable+=`|${separatorRow}|\n`;for(let i=1;i<rows.length;i++){const cells=Array.from(rows[i].querySelectorAll('td'));const cellContent=cells.map(cell=>cell.textContent).join(' |
@retlehs
retlehs / woocommerce-shipping-ups-remove-psr-log.patch
Created July 18, 2025 18:41
WooCommerce patches to avoid `psr/log` conflicts with Acorn
diff --git a/vendor/composer/jetpack_autoload_classmap.php b/vendor/composer/jetpack_autoload_classmap.php
index 1855b18..d52edf3 100644
--- a/vendor/composer/jetpack_autoload_classmap.php
+++ b/vendor/composer/jetpack_autoload_classmap.php
@@ -194,50 +194,50 @@ return array(
'version' => '3.1.3',
'path' => $vendorDir . '/automattic/jetpack-autoloader/src/class-plugins-handler.php'
),
- 'Psr\\Log\\AbstractLogger' => array(
- 'version' => '1.1.4.0',
@retlehs
retlehs / sync-prod.sh
Last active January 19, 2026 23:53
WP-CLI aliases sync example
read -r -p "Would you really like to reset your development database and pull the latest from production? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
wp @development db reset --yes &&
wp @production db export - > sql-dump-production.sql &&
wp @development db import sql-dump-production.sql &&
wp @development search-replace https://example.com https://example.dev
fi
diff U3 a/wp/wp-includes/load.php b/wp/wp-includes/load.php
--- a/wp/wp-includes/load.php Tue Feb 02 19:38:52 2016
+++ b/wp/wp-includes/load.php Tue Feb 02 19:58:21 2016
@@ -285,7 +285,7 @@
*/
function wp_debug_mode() {
if ( WP_DEBUG ) {
- error_reporting( E_ALL );
+ error_reporting( E_ALL & ~E_DEPRECATED );