Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Overthinking things since 1978

Torsten Landsiedel Zodiac1978

🤔
Overthinking things since 1978
View GitHub Profile
@Zodiac1978
Zodiac1978 / security-header.js
Created Aug 12, 2020
WORK IN PROGRESS: wpcheck module to scan for common security headers
View security-header.js
/**
* wpcheck module security-header.js
* Scan WordPress URL for common security headers
*/
/**
* Required modules
*/
@Zodiac1978
Zodiac1978 / blocklist-to-spam.php
Last active Jul 12, 2020
Comments blocked by the blocklist should be spam and not trash. Companion plugin for Antispam Bee.
View blocklist-to-spam.php
<?php
/**
* Plugin Name: Blocklist to spam
* Description: Comments blocked by the blocklist should be spam and not trash.
* 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
View terminal.sh
## Find ttl for IPv4 record ##
dig +nocmd +noall +answer +ttlid a example.org
## Find ttl for IPv6 record ##
dig +nocmd +noall +answer +ttlid aaaa example.org
@Zodiac1978
Zodiac1978 / functions.php
Created Jan 19, 2020
Remove events from a specified event category in "The Events Calendar" by Modern Tribe
View functions.php
<?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 / projekt26-2020.md
Last active Aug 6, 2020
Teilnehmerinnen und Teilnehmer sowie alle Beiträge zur #Projekt26 Challenge im Jahr 2020
@Zodiac1978
Zodiac1978 / repair-bytes.php
Last active Jul 15, 2019
Sometimes the server config return bytes (instead of MB), this little helper fixes the display in the site health plugin.
View repair-bytes.php
<?php
/**
* Returns always bytes for every config (M, K or G)
*
* @param [string] $size_str Input from config.
* @return [int] Return in bytes.
*/
function return_bytes( $size_str ) {
switch ( substr( $size_str, -1 ) ) {
@Zodiac1978
Zodiac1978 / check-intl.php
Created Jun 22, 2019
Adds an additional check to the Site Health plugin for the intl (internationalization) module
View check-intl.php
<?php
/**
* Filter PHP modules for testing
*
* @package Normalizer
*/
/**
* Plugin Name: Check for intl PHP module
* Description: Add intl module for testing in Site Health
@Zodiac1978
Zodiac1978 / request-update.php
Last active Apr 10, 2019
To trigger the auto update all you have to do is to create a small script in your WP root directory that bootstraps WP core and calls the function. Wait a few seconds, and your site should be updated. Check the Updates page in your Dashboard and confirm that you received the update email.
View request-update.php
<?php
// @link: https://wordpress.stackexchange.com/questions/183202/how-to-what-triggers-a-wordpress-auto-update
// @link: http://blog.birdhouse.org/2013/11/02/force-wordpress-auto-update/
require( dirname(__FILE__) . '/wp-load.php' );
wp_maybe_auto_update();
@Zodiac1978
Zodiac1978 / ux-problems.md
Last active Mar 25, 2019
Related Github issues and their status for my talk about UX and usability problems in the new WordPress block editor (aka Gutenberg) at WordCamp Osnabrück 2019
@Zodiac1978
Zodiac1978 / statify-mobile-track.php
Created Mar 22, 2019
Adds a new column in the statify table for mobile usage.
View statify-mobile-track.php
<?php
/**
* Plugin Name: Statify Mobile Tracking
* Description: Adds a new column in the statify table for mobile usage.
* Plugin URI: http://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
You can’t perform that action at this time.