Skip to content

Instantly share code, notes, and snippets.

Focusing on Analytics, CI and Wordpress Related Projects At The Moment

Vincent Koc koconder

Focusing on Analytics, CI and Wordpress Related Projects At The Moment
Block or report user

Report or block koconder

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
koconder / Wordpress_WPCONFIG_Custom.php
Last active Jan 14, 2019
Disable XML-RPC Pingbacks on Wordpress for Wp-Config
View Wordpress_WPCONFIG_Custom.php
// Disable xmlrpc method to prevent Wordpress from participating in DDoS attacks
// More info at:
// remove x-pingback HTTP header
add_filter('wp_headers', function($headers) {
return $headers;
// disable pingbacks
koconder / Update_Wordpress_Hostname.sql
Last active Jan 14, 2019
Wordpress Site Migration SQL Command - Commands to Find and Replace Meta, Site Options and Site Content for Hostnames
View Update_Wordpress_Hostname.sql
UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, '','');
UPDATE wp_posts SET post_content = replace(post_content, '', '');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'','');
koconder / Affiliate Cookie
Last active Jan 14, 2019
Dead simple affiliate query string to 30 day cookie in Apache HTACCESS Config
View Affiliate Cookie
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
koconder /
Created Jun 23, 2014
ga.js Google Analytics - Organic Sources snippet
//Taken from
//And de-compressed
var Ld = "daum:q eniro:search_word naver:query pchome:q google:q yahoo:p yahoo:q msn:q bing:q aol:query aol:q lycos:q lycos:query ask:q cnn:query virgilio:qs baidu:wd baidu:word alice:qs yandex:text najdi:q seznam:q rakuten:qt biglobe:q search.smt.docomo:MT onet:qt onet:q kvasir:q terra:query rambler:query conduit:q babylon:q search-results:q avg:q comcast:q incredimail:q startsiden:q sogou:query globo:q ukr:q auone:q".split(" "),
Sd = function (a) {
if (a.get(kb) && !a.get(Mc)) {
var b;
b = !F(a.get(ic)) || !F(a.get(nc)) || !F(a.get(S)) || !F(a.get(lc));
for (var c = {}, d = 0; d < Md[w]; d++) {
var e = Md[d];
c[e] = a.get(e)
koconder / export.php
Last active Jan 14, 2019
PHP Rules for CSV exports for UTF-8 and old browsers. Dynamic Exporting with rules to support each type of format which is extendable to call a parser on inputs.
View export.php
//Do Download Headers if we have nothing else to show
if($uri_page[$no] == 'export'){
if($uri_page[$no+1] == 'csv'){
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
View disable-updates.php
// Don't disable on dev
if ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) {
// Disable core update checking
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
remove_action( 'admin_init', '_maybe_update_core' );
remove_action( 'wp_version_check', 'wp_version_check' );
View wordpress.vcl
backend default {
.host = "";
.port = "8080";
acl purge {
sub vcl_recv {
koconder /
Created Oct 3, 2013
Update all Timthumb Files across Cpanel Users
#! /bin/bash
# Detects and updates timthumb.php to latest version for all cPanel users.
latest=`lynx -source |grep "define ('VERSION'" $file |cut -f4 -d"'"`
if [ -z "$latest" ]; then
echo "could not get latest timthumb release, aborting!"
exit 1
for user in `awk -F':' '{ if ($3 > 499) print $0 }' /etc/passwd | grep home | cut -d':' -f1`; do
koconder /
Created Sep 9, 2013
Install Composer Globally on Cent OS
curl -sS | php
mv composer.phar /usr/bin/composer
You can’t perform that action at this time.