Skip to content

Instantly share code, notes, and snippets.

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
diff --git a/gravityforms-html5-validation.php b/gravityforms-html5-validation.php
index 5e2c9e0..116714c 100644
--- a/gravityforms-html5-validation.php
+++ b/gravityforms-html5-validation.php
@@ -599,6 +599,12 @@ public function gform_field_content( $field_content, $field, $force_frontend_lab
break;
}
+ if ( $field->validation_message ) {
+ if ( $element = (( $result = $xpath->query( "//input" )) ? $result->item( 0 ) : null ) ) {
diff --git a/includes/api/api-template.php b/includes/api/api-template.php
index bfd0fd2..259885c 100644
--- a/includes/api/api-template.php
+++ b/includes/api/api-template.php
@@ -162,7 +162,7 @@ function get_field_object( $selector, $post_id = false, $format_value = true, $l
* @param $strict (boolean) if true, return a field only when a field key is found.
* @return $field (array)
*/
-function acf_maybe_get_field( $selector, $post_id = false, $strict = true ) {
+function acf_maybe_get_field( $selector, $post_id = false, $strict = false ) {