Skip to content

Instantly share code, notes, and snippets.

View sybrew's full-sized avatar

Sybre Waaijer sybrew

View GitHub Profile
@sybrew
sybrew / index.php
Last active June 23, 2024 04:36
TSF snippet ZIP creator.
<?php
$request = strtok( substr_replace( $_SERVER['REQUEST_URI'], '', 0, strlen( dirname( $_SERVER['PHP_SELF'] ) ) ), '.' );
$r_parts = array_values( array_filter( explode( '/', $request ) ) );
if ( empty( $r_parts[0] ) ) {
http_response_code( 400 );
exit;
}
@sybrew
sybrew / search-canonical-push-for-ga.php
Last active April 25, 2019 17:53
Search Canonical Push for Google Analytics
<?php
/**
* Plugin Name: Search Canonical Push for Google Analytics
* Plugin URI: https://theseoframework.com/
* Description: This plugin adds a small script to Search archives that optimizes the Google Analytics script when using pretty Search links.
* Version: 1.0.1
* Author: Sybre Waaijer
* Author URI: https://theseoframework.com/
* License: GPLv3
*/