Skip to content

Instantly share code, notes, and snippets.

Avatar
Always interested

Frank Bültge bueltge

Always interested
View GitHub Profile
@bueltge
bueltge / gist:6104254
Created Jul 29, 2013
A Look at the WordPress HTTP API: A Practical Example of wp_remote_get
View gist:6104254
<?php
/**
* Plugin Name: Twitter Demo
* Plugin URI: http://wp.tutsplus.com/tutorials/creative-coding/a-look-at-the-wordpress-http-api-a-practical-example-of-wp_remote_get/
* Description: Retrieves the number of followers and latest Tweet from your Twitter account.
* Version: 1.0.0
* Author: Tom McFarlin
* Author URI: http://tommcfarlin.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@bueltge
bueltge / wp-i18n-cheatsheet.md
Last active Dec 3, 2021
WordPress i18n Cheatsheet
View wp-i18n-cheatsheet.md

WordPress i18n CheatSheet

Whenever I write plugins or themes, there is one thing that needs a little extra attention and is quite frankly hard to get right: Translatable text. This list should helps me to find the right way fast.

Props to Alex Kirk, there list it inside a quiz.

You want to output the username in a sentence.

Assume that the $username has been escaped using esc_html().

@bueltge
bueltge / commentmeta-single.php
Created May 3, 2011
WordPress Example Plugin: Comment meta data test
View commentmeta-single.php
<?php
/*
Plugin Name: Comment meta data test
Version: 1.0
Plugin URI: http://wpengineer.com
Description: Comment meta data test
Author: Latz
Author URI: http://wpengineer.com
*/
@bueltge
bueltge / set-featured-image.php
Created Jun 14, 2012
Set featureed image automaticly on save post/page
View set-featured-image.php
View class_fb_backlink_checker.php
@bueltge
bueltge / readme.md
Last active Jun 29, 2021
Static PHP7 analyses with Phan and PHP 7 Migration Assistant Report (MAR), PHP 5 to PHP7 Migration Tools
View readme.md

Phan

Phan is a static analyzer for PHP. Phan prefers to avoid false-positives and attempts to prove incorrectness rather than correctness. github.com/phan/phan

Install via Composer

composer require --dev phan/phan

note: php-ast is necessary (sudo apt install php-ast)

Help

@bueltge
bueltge / gist:1595155
Created Jan 11, 2012
Add custom post type to AddQuicktag plugin for use the plugin on custom post types
View gist:1595155
<?php
/**
* Plugin Name: Use AddQuicktag on my CPT
* Plugin URI: http://bueltge.de/
* Description: Add custom post type 'my_custom_post_type' to AddQuicktag plugin
* Author: Frank Bültge
* Version: 0.0.1
* Licence: GPLv3
* Author URI: http://bueltge.de
*/
@bueltge
bueltge / wp-plugin-security-testing-cheatsheet.md
Created Aug 22, 2016
WordPress Plugin Security Testing Cheat Sheet
View wp-plugin-security-testing-cheatsheet.md

WordPress Plugin Security Testing Cheat Sheet

This cheat sheet was compiled by Dewhurst Security to record the knowledge gained when testing WordPress plugins for security issues for our clients. The security documentation provided by WordPress and found online for plugin security is sparse, outdated or unclear. This cheat sheet is intended for Penetration Testers who audit WordPress plugins or developers who wish to audit their own WordPress plugins.

This is a living document, feedback in the form of Issues or Pull Requests is very much welcomed.

Cross-Site Scripting (XSS)

@bueltge
bueltge / PortSwitch.php
Last active Mar 25, 2021
Port switch to get an workaround to use WordPress Multisite also without the default port 80.
View PortSwitch.php
<?php # -*- coding: utf-8 -*-
declare( strict_types = 1 );
/**
* Plugin Name: Port Switch
* Plugin URI: https://gist.github.com/bueltge/51013ab809f5f0f5e305c70c2d393fff
* Description: Port switch to get an workaround to use WordPress Multisite also without the default port 80.
* Version: dev
* Author: Frank Bültge
* Author URI: https://bueltge.de
* License: MIT
View cookie.html