Skip to content

Instantly share code, notes, and snippets.

View keesiemeijer's full-sized avatar

Kees Meijer keesiemeijer

View GitHub Profile
@keesiemeijer
keesiemeijer / setup-phpunit.sh
Last active December 8, 2023 11:02
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, curl wget, rsync, git, subversion and composer.
#
# WordPress is installed in the `/tmp/wordpress` directory for use by PHPUnit.
# The WordPress test suite is installed in the `/tmp/wordpress-tests-lib` directory.
@keesiemeijer
keesiemeijer / wp-update
Last active November 17, 2023 07:08
A bash script to update everything WordPress (core, plugins, themes and comments).
#!/usr/bin/env bash
# =============================================================================
#
# *** WARNING: THIS SCRIPT IS NO LONGER MAINTAINED ***
#
# use https://github.com/keesiemeijer/wp-update instead
#
# =============================================================================
absint
access_denied_splash
activate_plugin
activate_plugins
add_action
add_blog_option
add_clean_index
add_comment_meta
add_comments_page
add_cssclass
about
absint
absolute
accents
access
accordion
account
action
actions
activate
@keesiemeijer
keesiemeijer / gist:3cfbdd39f09ba30aff915287d67af6e7
Last active March 20, 2018 15:42
WordPress function word frequency
869 wp
559 get
225 post
124 link
113 is
106 comment
99 update
99 add
97 the
89 ajax
@keesiemeijer
keesiemeijer / functions.php
Created September 2, 2017 14:13
Override related posts with the WordPress Related Posts by Taxonomy plugin
add_action( 'widget_display_callback', 'page_widget_output', 10, 3 );
function page_widget_output( $instance, $widget, $args ) {
$plugin = function_exists( 'km_rpbt_plugin' ) ? km_rpbt_plugin() : false;
// Check if the plugin is activated and this is the related posts widget.
if ( ! $plugin || ( 'Related Posts By Taxonomy' !== $args['widget_name'] ) ) {
return $instance;
}
@keesiemeijer
keesiemeijer / widget.php
Last active September 13, 2017 14:57
Widget with checkbox
<?php
add_action( 'widgets_init', 'register_my_scheduled_posts_widget' );
function register_my_scheduled_posts_widget() {
register_widget( 'My_Scheduled_Posts_Widget' );
}
class My_Scheduled_Posts_Widget extends WP_Widget {
@keesiemeijer
keesiemeijer / widget.php
Last active September 13, 2017 16:08
Wiget with dropdown and back compatibility
<?php
add_action( 'widgets_init', 'register_my_scheduled_posts_widget' );
function register_my_scheduled_posts_widget() {
register_widget( 'My_Scheduled_Posts_Widget' );
}
class My_Scheduled_Posts_Widget extends WP_Widget {
@keesiemeijer
keesiemeijer / youtube-remove-ads.js
Last active October 19, 2022 20:57
Youtube skip ads and remove overlay ads after 3 seconds
// ==UserScript==
// @name Youtube SkipAd
// @namespace keesiemeijer
// @version 0.1
// @description Automatically skips ads after 5 seconds
// @author keesiemeijer
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@keesiemeijer
keesiemeijer / wp-word-frequency.txt
Last active March 20, 2018 16:29
WordPress functions and hooks word frequency
1118 wp
714 get
389 post
242 comment
217 link
190 user
158 update
156 the
141 meta
139 admin