Skip to content

Instantly share code, notes, and snippets.

Torsten Landsiedel Zodiac1978

Block or report user

Report or block Zodiac1978

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
@Zodiac1978
Zodiac1978 / wpantivirus.php
Last active Feb 17, 2019
Safebrowsing API v4 check for WP Antivirus by Pluginkollektiv (NOT WORKING)
View wpantivirus.php
<?php
// API: https://developers.google.com/safe-browsing/v4/lookup-api
// Testlinks: https://testsafebrowsing.appspot.com/
/*
Possible inspirations:
https://stackoverflow.com/questions/42348760/google-safe-browsing-api-is-not-responding-sending-back-response-status
http://www.queryadmin.com/1512/google-safebrowsing-v4-php-example/
https://github.com/web2all/safebrowsingv4
@Zodiac1978
Zodiac1978 / kill-referrer-spam.php
Created Jan 28, 2019
Skip tracking for specific domains from the Community-contributed list of referrer spammers from Matomo.
View kill-referrer-spam.php
<?php
/**
* Plugin Name: Kill Referrer Spam for Statify
* Description: Skip tracking for domains from the Community-contributed list of referrer spammers from Matomo.
* 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
@Zodiac1978
Zodiac1978 / exclude-subs.php
Created Jan 2, 2019
Exclude ALL posts from sub categories
View exclude-subs.php
<?php
// https://wordpress.stackexchange.com/questions/64701/exclude-all-posts-from-sub-categories
function filter_out_children( $query ) {
if ( is_main_query() && is_category() && ! is_admin() ) {
$qo = $query->get_queried_object();
$tax_query = array(
'taxonomy' => 'category',
'field' => 'id',
@Zodiac1978
Zodiac1978 / add-cpt-to-search.php
Created Jan 2, 2019
Add All Custom Post Types to search
View add-cpt-to-search.php
<?php
/**
* Add All Custom Post Types to search
* Original code from here: https://remicorson.com/include-all-your-wordpress-custom-post-types-in-search/
*
* Returns the main $query.
*
* @access public
* @since 1.0
@Zodiac1978
Zodiac1978 / statify-useragent-tracking.php
Last active Oct 9, 2018
!!! WORK IN PROGRESS !!! – Adds a new column in the statify table for the User Agent.
View statify-useragent-tracking.php
<?php
/**
* Plugin Name: Statify UA Tracking
* Description: Adds a new column in the statify table for the User Agent string.
* 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.