Skip to content

Instantly share code, notes, and snippets.

{
"title": "People and Blogs",
"script": "console.log ('Hi, fellow blogger!');",
"tabs": {
"interviews": {
"name": "P&B Interviews",
"description": "Feed of the latest P&B interviews",
"screenname": "pbnewsproduct",
"catname": "pbseries"
},
{
"title": "WP Dev News",
"description": "All the news that's fit to error_log()",
"image": "https://make.wordpress.org/design/files/2016/09/WordPress-logotype-wmark.png",
"script": "console.log ('Hello, WP dev!')",
"style": [
".divProductLogo {width: 125px;}",
".divProductTagline {color: blue}"
],
"tabs": {
{
"title": "news.scripting.com",
"description": "It's even worse than it appears.",
"image": "https://imgs.scripting.com/2023/12/24/slugger.png",
"script": "console.log ('Hello World')",
"style": [
".divProductTagline {font-style: italic}",
".divProductTagline {color: blue}"
],
"tabs": {
var urlTemplate = "https://drummer.land/chuck@grimmett.co/MakeWordPress.opml";
const request = require ("request");
function httpRespond (code, type, val, headers) {
if (headers === undefined) {
headers = new Object ();
}
if (type === undefined) { //7/20/18 by DW
type = "text/plain";
}
<?php
if ($argc !== 2) {
echo "Usage: php csv-to-opml.php <csvFilePath>\n";
exit(1);
}
$csvFilePath = $argv[1];
// Define the output OPML file path
$opmlFilePath = 'output.opml'; // You can customize the output file name here
@cagrimmett
cagrimmett / yotpo-disable-updates.php
Created September 6, 2023 14:04
Disable updates for Yotpo
<?php
/*
Plugin Name: Disable Auto-update for Yotpo Social Reviews for WooCommerce
Description: This plugin disables auto-updates for the Yotpo Social Reviews for WooCommerce plugin.
*/
function disable_autoupdate_specific_plugins($update, $item) {
// Array of plugin slugs to never auto-update
$plugins = array(
'yotpo-social-reviews-for-woocommerce',
@cagrimmett
cagrimmett / wayback-checker.php
Last active August 24, 2023 20:05
Script to check if broken links exist on the Wayback machine
<?php
// Function to check if a URL exists in Wayback Machine
function checkWayback( $url ) {
$apiUrl = 'https://archive.org/wayback/available?url=' . urlencode( $url );
$response = file_get_contents( $apiUrl );
$json = json_decode( $response, true );
if ( isset( $json['archived_snapshots']['closest']['url'] ) ) {
return $json['archived_snapshots']['closest']['url'];
}
@cagrimmett
cagrimmett / socialshareurls.txt
Created August 24, 2023 18:01
Social share links
blogger.com/blog-this
buffer.com/add
digg.com/submit
facebook.com/sharer
flipboard.com/redirect
getpocket.com/edit
getpocket.com/save
instapaper.com/hello2
line.me/R/msg
linkedin.com/cws/share
@cagrimmett
cagrimmett / well-known-feeds.php
Created August 24, 2023 15:29
mu-plugin for /.well-known/feeds
<?php
/*
Plugin Name: Custom OPML Feed
Description: Implements a custom OPML feed at /.well-known/feeds/
Author: cagrimmett
*/
// Add custom rewrite rule
function custom_opml_rewrite_rule() {
add_rewrite_rule( '^\.well-known/feeds/?$', 'index.php?custom_opml_feed=1', 'top' );
@cagrimmett
cagrimmett / jetpack-set-opengraph-tags.php
Created November 22, 2022 18:14
Manually set opengraph tags in Jetpack
<?php
function wwu_twitter_filter_jetpack_open_graph_tags( $og_tags ) {
if ( is_page( 'twitter' ) ) {
$og_tags['og:image'] = 'https://secure.gravatar.com/blavatar/0d6c430459af115394a012d20b6711d6?s=240';
$og_tags['twitter:image'] = 'https://secure.gravatar.com/blavatar/0d6c430459af115394a012d20b6711d6?s=240';
}
return $og_tags;
}