Skip to content

Instantly share code, notes, and snippets.

View bonny's full-sized avatar
🇺🇦
StandWithUkraine

Pär Thernström bonny

🇺🇦
StandWithUkraine
View GitHub Profile
@bonny
bonny / wordpress-org-forced-update-response.md
Last active January 17, 2026 13:51
WordPress.org Plugin Update API response with autoupdate=1 (forced security update) - Real example from WooCommerce 10.4.2→10.4.3

WordPress.org Plugin Update API - The autoupdate Field for Forced Security Updates

This research was conducted for Simple History, a WordPress activity log plugin. We wanted to understand exactly how WordPress handles forced security updates so we could display this information clearly to site administrators. This document shares our findings.


API endpoint: POST https://api.wordpress.org/plugins/update-check/1.1/ Date captured: January 14, 2026 Plugin: WooCommerce 10.4.2 → 10.4.3

@bonny
bonny / simple-history-options-logger.php
Last active April 11, 2025 07:54
WordPress plugin that logs when a options are modified. Create folder `/plugins/simple-history-options-logger` and add file inside folder. Then active plugin in WordPress admin.
<?php
/**
* Plugin Name: Simple History Options Logger
* Description: Logs changes to selected WordPress options in Simple History
* Version: 1.0.0
* Author: Simple History
* Text Domain: simple-history-options-logger
* Domain Path: /languages
* Requires at least: 5.0
* Requires PHP: 7.4
<?php
// phpcs:ignoreFile
namespace Simple_History\ExampleCodeSnippets;
/**
* Support thread:
* https://wordpress.org/support/topic/logging-options-table-activity/
*
* Log when any of the options in an array are updated.
@bonny
bonny / watson-xbar-plugin.sh
Last active January 20, 2022 16:57
xbar script for watson
#!/usr/bin/env bash
# Watson Brew Status
#
# by Antoine Corcy <[email protected]>
# updated by Pär Thernstrom <[email protected]>
# to support Watson custom location and configuration.
#
# <xbar.title>Watson Brew Status</xbar.title>
# <xbar.version>1.0</xbar.version>
@bonny
bonny / index.html
Created June 7, 2020 19:57
TextTV.nu iframe
<p>Iframe med "vanliga" texttv.nu</p>
<iframe
src="http://texttv.nu/"
title="TextTV.nu"
width="400"
height="540">
</iframe>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am bonny on github.
  • I am eskapism (https://keybase.io/eskapism) on keybase.
  • I have a public key ASAcBveAKwwwqxEhr3J7LhlB6sp2CiOVxdG6to9eWVgCWQo

To claim this, I am signing this object:

@bonny
bonny / simple-history-log-http-requests-time.php
Created May 6, 2016 15:29
Snippet for WordPress plugin Simple History Log that logs https request made and how long each request took
<?php
/**
* To use this you first need to install the free plugin Simple History
* https://wordpress.org/plugins/simple-history/
*/
// pre_http_request is fired close before the actual request
add_filter( 'pre_http_request', function( $retval, $r, $url ) {
@bonny
bonny / simple-history-to-slack-incoming-webhook-integration.php
Created February 5, 2016 12:40
Example how to post all logged events in WordPress recent events plugin Simple History to Slack
<?php
// Prio 100 so we run late and give other filters chance to run
add_filter( "simple_history/log_insert_context", "on_log_insert_context_slackit", 100, 2 );
function on_log_insert_context_slackit( $context, $data ) {
$slack_webhook_url = '<your incoming webhook url>';
$remote_addr = empty( $context["_server_remote_addr"] ) ? "" : $context["_server_remote_addr"];
name: inverse
layout: true
class: middle, inverse
---
## Detta är en presentation
Diggar man markdown är detta ett väldigt enkelt sätt att skapa presentationer på serru.
- Använder markdown