Skip to content

Instantly share code, notes, and snippets.

@zottto
zottto / deactivate-automatic-plugin-updates.php
Last active August 29, 2015 14:18
WordPress: Deactivate automatic plugin updates
<?php
/**
* Plugin Name: Deactivate automatic plugin updates
* Description: Deactivates the possibility to automatically update a plugin.
* Plugin URI: http://www.wp-sicherheit.info/
* Version: 1.0
* Author: Marc Nilius
* Author URI: http://www.wp-sicherheit.info/
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@zottto
zottto / sessionStorage.js
Created August 16, 2012 11:33 — forked from tagawa/sessionStorage.js
sessionStorage polyfill
/*
* Based on: http://www.quirksmode.org/js/cookies.html
* and https://github.com/wojodesign/local-storage-js/blob/master/storage.js
* and https://gist.github.com/350433
* License: http://www.opensource.org/licenses/MIT
*/
(function(window) {
'use strict';
window.sessionStorage = window.sessionStorage || {
@zottto
zottto / wordpress-custom-plugin-template.php
Created November 27, 2015 08:43
Use this custom plugin template to add your own code snippets to WordPress. Copy this file into the plugin directory and activate it.
<?php
/**
* Plugin Name: Custom Plugin Template
* Description: Add custom tweaks and snippets in this custom plugin.
* Plugin URI: http://www.wp-sicherheit.info/
* Version: 1.0
* Author: Marc Nilius
* Author URI: http://www.wp-sicherheit.info/
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@zottto
zottto / .htaccess
Last active November 14, 2016 10:48
Passwortschutz für WP-Admin-Bereich
# Beispiel-Datei für WP-Passwortschutz
# https://www.wp-sicherheit.info
# Marc Nilius, info@wp-sicherheit.info
# Absicherung der wp-login.php
# Der Zugriff eines nicht-eingeloggten benutzers aucf /wp-admin
# leitet auch auf die wp-login.php weiter, so dass hiermit
# alles abgesichert ist
#
# Den Pfad zur .htpasswd entsprechend anpassen
@zottto
zottto / wordpress-snippet-remove-login-messages.php
Last active January 27, 2017 18:17
Ein Snippet, um die Login-Meldungen von WordPress zu vereinheitlichen. In einem Custom Plugin benutzen...
<?php
function wp_modify_login_error_incorrect_password($user) {
if ( is_wp_error( $user ) ) {
$error_string = $user->get_error_message();
if ($user->get_error_code() == 'incorrect_password') {
$user = new WP_Error('invalid_username', $error_string);
}
}
return $user;
}
@zottto
zottto / .htaccess
Created December 15, 2017 12:06
Default Apache configuration for WordPress performance optimizations
# Keep-Alive
<IfModule mod_headers.c>
Header set Connection Keep-Alive
</IfModule>
# Compress Transfer
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript application/json application/ld+json \
application/rss+xml application/vnd.ms-fontobject \
@zottto
zottto / .htaccess
Last active December 7, 2018 11:20
Mehr Sicherheit in WordPress durch .htaccess
# Beispiel-Codeschnipsel für die WordPress-htaccess-Datei
# https://www.wp-sicherheit.info
# Marc Nilius, info@wp-sicherheit.info
# Mit Material von Zodiac1978, siehe auch https://gist.github.com/Zodiac1978/d25a8f3aebba7cd1c01c
#
# Diese Codeschnipsel gehören in die .htaccess-Datei im Hauptverzeichnis von WordPress
# Jeder einzelne Bestandteil kann einzeln kopiert und genutzt werden.
# Bitte die Verwendungshinweise (Kommentare) an jedem Schnipsel beachten