Skip to content

Instantly share code, notes, and snippets.

@dieppon
dieppon / wp-reroute-email-unauthorized-access.patch
Created April 7, 2025 10:00
Fixes 'Unauthorized access' on Bedrock WP installation.
diff --git a/settings.php b/settings.php
index 1b87a34..9308391 100755
--- a/settings.php
+++ b/settings.php
@@ -8,7 +8,7 @@
if($_SERVER['REQUEST_METHOD'] == 'POST' && !in_array($tab, ['test', 'log'])){
if(!$_POST['settings_nonce']
|| !wp_verify_nonce($_POST['settings_nonce'], 'wpreroute_save_settings')
- || $_POST['_wp_http_referer'] != '/wp-admin/admin.php?page=wp-reroute-email%2Fsettings.php') {
+ || basename( $_POST['_wp_http_referer'] ) != 'admin.php?page=wp-reroute-email%2Fsettings.php') {
@dieppon
dieppon / all-in-one-video-gallery-videojs-poster-cover.patch
Created February 3, 2025 11:07
All-in-One Video Gallery videojs poster fix
@dieppon
dieppon / update-to-wp6-7-_load_textdomain_just_in_time-was-called-incorrectly.patch
Created November 19, 2024 17:38
update-to-wp6-7-_load_textdomain_just_in_time-was-called-incorrectly/
diff --git a/classes/class-uagb-loader.php b/classes/class-uagb-loader.php
index 31a5464..8968479 100644
--- a/classes/class-uagb-loader.php
+++ b/classes/class-uagb-loader.php
@@ -373,7 +373,9 @@ if ( ! class_exists( 'UAGB_Loader' ) ) {
*/
$lang_dir = apply_filters( 'uagb_languages_directory', UAGB_ROOT . '/languages/' );
- load_plugin_textdomain( 'ultimate-addons-for-gutenberg', false, $lang_dir );
+ add_action( 'init', function () {
@dieppon
dieppon / spx
Created October 1, 2024 13:33
spx
#!/usr/bin/env bash
# https://github.com/NoiseByNorthwest/php-spx
#
# @author Djamil Legato http://github.com/w00fz/spx-osx
# @modified Victor Dieppa Garriga - https://github.com/NoiseByNorthwest/php-spx convertion
# @license MIT
# @version 1.0
app="$(basename "$0")"
command="$1"
@dieppon
dieppon / announcer-invisible-text-description.patch
Last active May 24, 2023 17:09
Adds an invisible descriptive text to the CTA button
diff --git a/includes/display.php b/includes/display.php
index 3d0e070..0ab7fa6 100644
--- a/includes/display.php
+++ b/includes/display.php
@@ -170,7 +170,7 @@ class ANCR_Display{
$attrs[ 'rel' ] = 'nofollow noreferrer';
}
- $html .= '<a ' . ANCR_Utilities::build_attrs( $attrs ) . '>' . wp_kses_post( $button[ 'text' ] ) . '</a>';
+ $html .= '<a ' . ANCR_Utilities::build_attrs( $attrs ) . '>' . wp_kses_post( $button[ 'text' ] ) . ($button[ 'title' ] ? '<span class="visually-hidden"> ' . $button[ 'title' ] . '</span>' : '') .'</a>';
@dieppon
dieppon / matrix.bas
Created April 6, 2023 08:44
Creates "The Matrix" rain effect in MSX BASIC
10 SCREEN 1:COLOR 12,1,1:KEY OFF:WIDTH32:A$=" THE MATRIX HAS YOU! "
20 B=BASE(6):C=16*15+0:VPOKE B+8,C:VPOKE B+9,C:VPOKE B+10,C:VPOKE B+11,C:GOSUB 100
30 LOCATE X1%,Y%:IF Y%<>11 THEN PRINT CHR$(RND(1)*221+33);:LOCATE X2%,Y%:PRINT" ";ELSE PRINTMID$(A$,X1%+1,1);
40 Y%=(Y%+1) MOD 23:IF y%=0 THEN GOSUB 100
50 GOTO 30
100 X%=0:X1%=INT(RND(1)*32):X2%=INT(RND(1)*32):RETURN
@dieppon
dieppon / announcer-important-hardcode-with-php.patch
Last active March 7, 2023 16:08
Removes !important rile from css created with php.
diff --git a/includes/utilities.php b/includes/utilities.php
index 1ac6715..cd410f9 100644
--- a/includes/utilities.php
+++ b/includes/utilities.php
@@ -18,11 +18,11 @@ class ANCR_Utilities{
}
if( !empty( $font_color ) ){
- $properties[ 'color' ] = $font_color . ' !important';
+ $properties[ 'color' ] = $font_color;
@dieppon
dieppon / you-tube-vimeo-url-parser.php
Last active September 13, 2022 11:45
Parse url from YouTube and Vimeo and return an array with: type, ID, thumbnail, url, embed url and embed iframe.
<?php
/**
* Parse url from YouTube and Vimeo and return an array with: type, ID, thumbnail, url, embed url and embed iframe.
*
* @param string $url
* @return array
*/
function parse_video_url($url) {
$output = array();
if (preg_match("#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\/)[^&\n]+(?=\?)|(?<=embed/)[^&\n]+|(?<=v=)[^&\n]+|(?<=youtu.be/)[^&\n]+#", $url, $matches)) {
diff --git a/assets/css/blocks.css b/assets/css/blocks.css
index 12f3d2b..beaeb12 100644
--- a/assets/css/blocks.css
+++ b/assets/css/blocks.css
@@ -1 +1 @@
-.clearfix:after,.clearfix:before{content:'';display:block;clear:both}#editor .editor-writing-flow{max-width:750px;margin:auto}#editor .editor-writing-flow>div>div>div>.editor-block-list__layout>.wp-block{max-width:unset;width:100%}#editor .components-range-control__number{width:65px}.editor-styles-wrapper .wp-block .wp-block{max-width:100%;width:100%}.slick-arrow:focus{background:transparent}.components-range-control .components-range-control__slider{margin-left:8px}.components-base-control__label .component-color-indicator{vertical-align:text-bottom}#editor .advgb-accordion-block .advgb-accordion-header p.mce-content-body,#editor .advgb-accordion-block .advgb-accordion-body p.mce-content-body{color:inherit}#editor .advgb-accordion-block{padding:15px 0}#editor .advgb-accordion-body{border-top:none !important}.advgb-accordion-header,.advgb-accordion-heade