Skip to content

Instantly share code, notes, and snippets.

@voneff
voneff / .htaccess
Last active June 25, 2018 10:53 — forked from Zodiac1978/.htaccess
WordPress: safe enabling of gzip compression
# BEGIN Enable Browser Caching
#
# 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
@voneff
voneff / .htaccess
Created June 12, 2018 14:45
WordPress: Redirect all to HTTPS, set HSTS
# BEGIN Redirect to HTTPS and set HSTS
#
# Sources:
# https://stackoverflow.com/questions/40154500/hsts-301s-http-www-to-https-canonical-htaccess
#
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R=301]
RewriteCond %{HTTPS} off
@voneff
voneff / WP-SlimStat-privacy-policy.html
Created June 12, 2018 12:10
WordPress – WP-SlimStat: Snippet für Datenschutzerklärung
Diese Website nutzt <a href="http://wordpress.org/extend/plugins/wp-slimstat">WP-SlimStat</a>, einen Webanalysedienst. WP-SlimStats verwendet sogenannte “Cookies”, Textdateien, die auf Ihrem Computer gespeichert werden und die eine Analyse der Benutzung der Website durch Sie ermöglicht. Die IP-Adresse wird hierbei gekürzt, d.h. es werden Teile der IP-Adresse entfernt um eine eindeutige Zuordnung zu unterbinden. Wir benutzen diese Informationen, um die Nutzung unserer Webseites auszuwerten. Diese Informationen werden nicht an Dritte weitergegeben. Sie können die Installation der Cookies durch entsprechende Einstellung in Ihrer Browser-Software verhindern. Weitere Informationen erhalten Sie in den Datenschutzerklärungen von WP-SlimStat: <a href="https://www.wp-slimstat.com/terms-and-conditions/">wp-slimstat.com/terms-and-conditions/</a>; Opt-Out: <a href="https://textsalon.de/?slimstat-opt-out=true">textsalon.de/?slimstat-opt-out=true</a>
@voneff
voneff / .htaccess
Created February 28, 2018 13:07
WordPress: Disable PHP Execution in Certain WordPress Directories
# BEGIN Disable PHP Execution
#
# Source:
# http://www.wpbeginner.com/wp-tutorials/how-to-disable-php-execution-in-certain-wordpress-directories
#
<Files *.php>
deny from all
</Files>
@voneff
voneff / custom-functionality-plugin.php
Last active April 24, 2018 14:00
WordPress dashboard: Move the menu item for "iubenda cookie law solution" to "Settings"
/* Add this into your own custom functionality plugin or the functions.php of your child theme */
<?php
function voneff_move_iubenda_menu_item(){
/* removing the top level menu item */
remove_menu_page( 'iubenda-cookie-law-solution' );
/* adding menu item under Settings */
@voneff
voneff / .htaccess
Created March 21, 2018 20:19
WordPress plugin Cache Enabler: Bypass PHP execution
# BEGIN Cache Enabler
# Sources:
# https://fastwp.de/6687/
# https://www.keycdn.com/support/wordpress-cache-enabler-plugin/
#
# BEGIN Cache Enabler
<IfModule mod_rewrite.c>
RewriteEngine On
@voneff
voneff / style.css
Created March 18, 2018 09:54
Enable standard ligatures and other OpenType features
/* Enabling standard ligatures and other OpenType features */
/* Source: https://app.typographychecklist.com/ */
/* Source: http://typographyhandbook.com/#opentype-features */
body, p {
font-kerning: normal;
font-variant-ligatures: common-ligatures contextual;
-moz-font-feature-settings: "kern", "liga", "clig", "calt";
-ms-font-feature-settings: "kern", "liga", "clig", "calt";
-webkit-font-feature-settings: "kern", "liga", "clig", "calt";
@voneff
voneff / custom.html
Created May 4, 2017 12:01
Formidable Forms: Ordering input options by multiple columns, not rows
<div id="frm_field_[id]_container" class="frm_form_field form-field [required_class][error_class]">
<label class="frm_primary_label">[field_name]
<span class="frm_required">[required_label]</span>
</label>
<div class="frm_opt_container">
<div style="float:left;padding-right:80px;">[input opt=1][input opt=2][input opt=3][input opt=4][input opt=5][input opt=6]</div>
<div style="float:left;padding-right:80px;">[input opt=7][input opt=8][input opt=9][input opt=10][input opt=11][input opt=12]</div>
<div style="float:left;">[input opt=13][input opt=14][input opt=15][input opt=16][input opt=17][input opt=18]</div>
</div>
[if description]<div class="frm_description">[description]</div>[/if description]
@voneff
voneff / style.css
Created April 19, 2017 08:44
Text flow: hyphenation / Silbentrennung
/*
* Active hyphenation in all texts
*
* Sources:
* https://css-tricks.com/almanac/properties/h/hyphenate/#comment-1596240
* https://justmarkup.com/log/2015/07/dealing-with-long-words-in-css/
*/
.body {
overflow-wrap: break-word
@voneff
voneff / .htaccess
Last active March 23, 2016 15:54
WordPress: custom security measures
# BEGIN Security
#
# Sources:
# https://premium.wpmudev.org/blog/5-simple-htaccess-tips-to-tighten-your-sites-security/
# https://premium.wpmudev.org/blog/keeping-wordpress-secure-the-ultimate-guide/
# https://gist.github.com/voneff/0daab6372769e9ef3d75
#
# Protect htaccess From Unauthorized Access