View daan-date-last-modified.php
<?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 |
View caos-google-ads.php
<?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 |
View caos-google-optimize.php
<?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 |
View class-wp-proxy.php
<?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 | |
{ |
View functions.php
<?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); |
View edited-wp-config.php
// ** MySQL settings - You can get this info from your web host ** // | |
/** The name of the database for WordPress */ | |
define( 'DB_NAME', 'new_db_name' ); # CHANGE THIS! | |
/** MySQL database username */ | |
define( 'DB_USER', 'existing_db_username' ); | |
/** MySQL database password */ | |
define( 'DB_PASSWORD', 'existing_db_password' ); |
View find-replace.sql
UPDATE `table_name` | |
SET `column_name` = replace(column_name, 'olddomain.com', 'newdomain.com') |
View 301-redirect-with-exception.sh
RewriteEngine on | |
# Exception for Google Verification | |
RewriteCond %{REQUEST_URI} !^/google-verification-file.html | |
# Exception Let's Encrypt Challenge | |
RewriteCond %{REQUEST_URI} !^/.well-known/ | |
# 301 Redirect to New Domain incl. Request URI | |
RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L] |
View host-anything-locally.php
<?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/'; |
View Model\Custom.php
<?php | |
namespace Daan\CustomModule\Model; // Or Controller, or Plugin, or anything actually. | |
use Magento\Framework\Pricing\PriceCurrencyInterface as CurrencyInterface; | |
class Custom { | |
protected $currencyInterface; |
NewerOlder