Skip to content

Instantly share code, notes, and snippets.

diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php
# https://core.trac.wordpress.org/raw-attachment/ticket/44867/fullpatch-v9-44867-image-editor-save-modified-image-as-a-new-copy.patch (gist'ed since WP now requires auth to download raw file)
index 7f9ebf7f9f..9037bcb34d 100644
--- a/wp-admin/includes/image-edit.php
+++ b/wp-admin/includes/image-edit.php
@@ -310,6 +310,11 @@ function wp_image_editor( $post_id, $msg = false ) {
<label for="imgedit-target-thumbnail"><?php _e( 'Thumbnail' ); ?></label>
</span>
+ <span class="imgedit-label">
@drzraf
drzraf / strip-cookies.2.patch
Created April 30, 2026 20:04
WordPress #50522 patch
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
# https://core.trac.wordpress.org/raw-attachment/ticket/50522/strip-cookies.2.patch (gist'ed since WP now requires auth to download raw file)
index 2ebfb405c4..9d47e388b5 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -982,27 +982,25 @@ function wp_clear_auth_cookie() {
// Auth cookies.
setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
- setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
diff --git a/polylang.php b/polylang.php
index 030a4e0..5c1f2d5 100644
--- a/polylang.php
+++ b/polylang.php
@@ -67,7 +67,7 @@ if ( defined( 'POLYLANG_BASENAME' ) ) {
}
require __DIR__ . '/vendor/autoload.php';
-require __DIR__ . '/vendor/wpsyntex/polylang/polylang.php';
+// require __DIR__ . '/vendor/wpsyntex/polylang/polylang.php';
@drzraf
drzraf / sample node apparmor profile
Created September 17, 2025 15:32
limit data exfiltration from package dependencies malware: use apparmor
# Don't forget to set your
# @{project_dirs} = {foo,bar,...} # relative to $HOME
# inside some /etc/apparmor.d/tunables/home.d/*.conf file
abi <abi/4.0>,
include <tunables/global>
include <local/my-ssh>
profile node /usr/{local/,}bin/{node,deno} {
deny capability sys_admin,
@drzraf
drzraf / gist:4ff75a755907195cb286e4128b582d25
Created July 22, 2025 17:11
stop some WordPress plugins home-phoning all the time
sed -i '/public static function get_key_info/s/{$/{ return ["is_active"=>1];/' plugins/gravityforms/common.php
sed -i '/function acf_register_plugin_update/s/{$/{ return;/' plugins/advanced-custom-fields-pro/includes/Updater/init.php
// WPML, you're next
@drzraf
drzraf / cursor
Created July 11, 2025 04:17
cursor's editor apparmor profile
#/etc/apparmor.d/cursor
abi <abi/4.0>,
include <tunables/global>
# observed net accesses
# - api3.cursor.sh.cdn.cloudflare.net.
# - cursor.sh.cdn.cloudflare.net.
# - cursorapi.com.
# - cursor-cdn.com.
diff --git a/vendor/otgs/installer/includes/class-wp-installer-channels.php b/vendor/otgs/installer/includes/class-wp-installer-channels.php
index 57a225f..6f88811 100644
--- a/vendor/otgs/installer/includes/class-wp-installer-channels.php
+++ b/vendor/otgs/installer/includes/class-wp-installer-channels.php
@@ -234,6 +234,7 @@ class WP_Installer_Channels{
unset ( $downloads[ $type ][ $slug ]['channels'] );
$downloads[ $type ][ $slug ]['extra_channels'] = array();
+ $downloads[ $type ][ $slug ]['changelog'] = '';
if( isset( $download['channels'] ) ) {
@drzraf
drzraf / signal-desktop-linux-key-extract.php
Last active March 21, 2025 03:05
extract/decrypt signal-desktop (on mac/linux) sqlcipher database encrypted key
#!/usr/bin/php
<?php
/**
* extract/decrypt signal-desktop (on mac/linux) sqlcipher database encrypted key
* see https://github.com/signalapp/Signal-Desktop/issues/7005
* drzraf, 2025
*/
error_reporting(-1);
@drzraf
drzraf / pydio-decrypt.py
Created April 20, 2020 17:03
Decrypt a file encrypted using Pydio-cells
#!/usr/bin/python3
# Copyright (C) 2020, Raphaël . Droz + floss @ gmail DOT com
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# Decrypt a file encrypted using Pydio-cells, assuming are provided
# - export the encrypted master key as exported by the UI
@drzraf
drzraf / consent-field.patch
Created June 21, 2019 15:33
gravityforms-html5-validation consent field