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 May 3, 2024 12:11
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 / .htaccess
Last active March 15, 2024 08:29
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 / repair-ajax-comments.php
Last active January 7, 2024 13:33
Repair AJAX comments for Antispam Bee in Streamtube theme (and maybe many more) - work in progress
<?php
/**
* Plugin Name: Repair AJAX comments for Antispam Bee
* Description: Add honeypot check and enable AJAX for Antispam Bee.
* 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 / functionality-plugin.php
Last active December 21, 2023 09:01
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
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / wp-config.php
Created November 28, 2023 15:48
Disable the fatal error handler from WordPress
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
@Zodiac1978
Zodiac1978 / show-php-version.php
Last active October 14, 2023 02:49
Show PHP version and if PHP is running in 32-bit or 64-bit mode in At-a-glance dashboard widget
<?php
/*
Plugin Name: Show PHP Version
Description: Shows the current PHP version in the "At a Glance" admin dashboard widget.
Version: 1.1
Requires at least: 3.8
Author: Torsten Landsiedel
Author URI: http://torstenlandsiedel.de
*/
@Zodiac1978
Zodiac1978 / functions.php
Created January 19, 2020 14:21
Remove events from a specified event category in "The Events Calendar" by Modern Tribe
<?php
/**
* The Events Calendar Remove Events from Month and List Views
*
* @param [object] $query Query of the events page.
* @return [object] Modified Query
*/
function tribe_exclude_events_category_month_list( $query ) {
if ( isset( $query->query_vars['eventDisplay'] ) && ! is_singular( 'tribe_events' ) ) {
@Zodiac1978
Zodiac1978 / plugin-preview.html
Created October 10, 2023 15:09
WordPress plugin preview for from Roy Tanck modified to support Enter key for submit
<!DOCTYPE html>
<html lang="en">
<head>
<title>WordPress plugin preview</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
@Zodiac1978
Zodiac1978 / disallow-gptbot.php
Created August 10, 2023 14:46
Add line in robots.txt to disallow GPTBot. (WordPress plugin)
<?php
/**
* Plugin Name: Disallow GPTBot
* Description: Add line in robots.txt to disallow GPTBot.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: http://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / double-translation-strings.php
Created August 25, 2023 20:43
Double every translation string for a given text domain for testing purpose.
<?php
/**
* Plugin Name: Double every translation
* Description: Double every translation string for testing purpose.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0