Skip to content

Instantly share code, notes, and snippets.

View Zodiac1978's full-sized avatar
🤔
Overthinking things since 1978

Torsten Landsiedel Zodiac1978

🤔
Overthinking things since 1978
View GitHub Profile
@Zodiac1978
Zodiac1978 / .htaccess
Last active September 12, 2026 01:48
Make your Website faster - a safe htaccess way
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/
@Zodiac1978
Zodiac1978 / toolbox.md
Last active August 26, 2026 09:15
List of useful online tools for website QA
<?php
// request-update.php
// https://blog.birdhouse.org/2013/11/02/force-wordpress-auto-update/
require dirname( __FILE__ ) . '/wp-load.php';
wp_maybe_auto_update();
@Zodiac1978
Zodiac1978 / adminbar-remover.php
Created July 12, 2026 18:25
Removes the adminbar on the frontend - a small plugin for a demo about creating plugins
<?php
/**
* Plugin Name: Adminbar Remover
* Description: Removes the adminbar on the frontend
* Plugin URI: https://wpmeetup-hamburg.de
* Version: 1.0.0
* Author: Torsten Landsiedel / WP Meetup Hamburg
* Author URI: https://torstenlandsiedel.de
* License: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / links.md
Last active June 24, 2025 16:12
Collection of websites/articles about the FAIR project (Federated and Independent Repositories)
@Zodiac1978
Zodiac1978 / functionality-plugin.php
Last active June 23, 2025 15:00
A functionality plugin template for custom code that could be used on different sites
<?php
/**
* Plugin Name: Functionality Plugin Template
* Description: Add custom tweaks and snippets in this custom plugin.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* License: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / .htaccess
Last active June 5, 2025 14:13
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
@Zodiac1978
Zodiac1978 / log_function_name.php
Last active April 23, 2025 06:16
Log the function name when doing_it_wrong is triggered (best used very early, for example in a mu-plugin)
/**
* Log the function name when doing_it_wrong is triggered
*
* @param string $function_name The function name that triggered the error
*/
function log_function_name( $function_name ) {
// Taken from https://x.com/jkohlbach/status/1912769898171998653
if ('_load textdomain_just_in_time' === $function_name ) {
error_log( wp_debug_backtrace_summary() );
}
@Zodiac1978
Zodiac1978 / fix-ionos-mail.php
Created November 13, 2024 16:30
Remove subdomain from the From address to allow mails on IONOS hosting. (See: https://torstenlandsiedel.de/2024/02/26/mailprobleme-bei-ionos-mit-subdomains/)
<?php
/**
* Plugin Name: Fix IONOS Mail
* Description: Remove subdomain from the From address to allow mails on IONOS hosting.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / functions.php
Created September 11, 2024 09:48
Add new heading style for an outline
<?php
/**
* Block Styles
*
* @link https://developer.wordpress.org/reference/functions/register_block_style/
*
* @package WordPress
* @subpackage HeaderOutline
* @since HeaderOutline 1.0
*/