This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @formatter:off | |
* Plugin Name: Google Ads for CAOS | |
* Plugin URI: https://daan.dev/google-adwords-caos/ | |
* Description: Track Google Ads conversions with CAOS. | |
* Version: 1.0.0 | |
* Author: Daan van den Bergh | |
* Author URI: https://daan.dev | |
* License: GPL2v2 or later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Social Share Buttons template for Wordpress | |
* By Daan van den Bergh | |
*/ | |
$postUrl = 'http' . ( isset( $_SERVER['HTTPS'] ) ? 's' : '' ) . '://' . "{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; ?> | |
<section class="sharing-box content-margin content-background clearfix"> | |
<h5 class="sharing-box-name">Don't be selfish. Share the knowledge!</h5> | |
<div class="share-button-wrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( | |
'caos_gtag_additional_config', | |
function () { | |
?> | |
gtag('config', '<?php echo 'AW-453289819'; ?>'); | |
<?php | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server_name nas.yourdomain.com 192.168.xxx.xxx; | |
location /sabnzbd { | |
proxy_pass https://localhost:9080/sabnzbd; | |
} | |
location /sonarr { | |
proxy_pass http://localhost:8989/sonarr; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$octets = explode('.', $ip); | |
/** | |
* Instead of using Regex and str_replace, we're slicing the array parts | |
* and rebuilding the ip (implode) to make sure no duplicate values are | |
* replaced. | |
* | |
* E.g. using str_replace or preg_replace; 192.168.1.1 would result in 092.068.0.0. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Script to update any js-file | |
// Credits go to: Matthew Horne | |
// Remote file to download | |
$remoteFile = 'https://www.google-analytics.com/analytics.js'; | |
$localFile = '/path/to/your/webroot/analytics.js'; | |
// Check if directory exists, otherwise create it. | |
$uploadDir = '/path/to/your/webroot/'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Date Last Modified for WordPress Posts | |
* Plugin URI: https://daan.dev/wordpress/date-last-updated-modified/ | |
* Description: Display 'Last Updated' date along with 'Date Published' in WordPress. | |
* Version: 1.0.0 | |
* Author: Daan van den Bergh | |
* Author URI: https://daan.dev | |
* License: GPL2v2 or later | |
* Text Domain: daan-date-last-modified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @formatter:off | |
* Plugin Name: Google Optimize for CAOS | |
* Plugin URI: https://daan.dev/google-optimize-caos/ | |
* Description: Add Google Optimize for CAOS in gtag.js | |
* Version: 1.0.0 | |
* Author: Daan van den Bergh | |
* Author URI: https://daan.dev | |
* License: GPL2v2 or later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author : Daan van den Bergh | |
* @url : https://daan.dev/how-to/bypass-ad-blockers-caos/ | |
* @copyright: (c) 2019 Daan van den Bergh | |
* @license : GPL2v2 or later | |
*/ | |
class Analytics_Proxy extends WP_REST_Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The start of my Child Theme's functions.php | |
function sparkling_remove_google_fonts() { | |
wp_dequeue_style('sparkling-fonts'); | |
wp_deregister_style('sparkling-fonts'); | |
} | |
add_action('wp_enqueue_scripts', 'sparkling_remove_google_fonts', 100); |
NewerOlder