Skip to content

Instantly share code, notes, and snippets.

View georgestephanis's full-sized avatar

George Stephanis georgestephanis

View GitHub Profile
@georgestephanis
georgestephanis / index.php
Created March 29, 2021 15:22
`off-with-its-head` theme
<?php
if ( ! headers_sent() ) {
nocache_headers();
header( 'X-Robots-Tag: noindex, nofollow, noarchive, nosnippet' );
wp_safe_redirect( admin_url() );
}
?>
<!DOCTYPE html>
<?php
/**
* Plugin Name: Multisite Login Consolidation
* Author: georgestephanis
* License: GPLv2+
* Requires PHP: 7
* Network: true
*/
.site {
max-width: 85% !important;
}
article.post {
width: 200px;
height: 300px;
border-radius: 15px;
border-bottom: 0;
box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.35);
@georgestephanis
georgestephanis / build-markdown-table-of-plugins.php
Created November 27, 2020 21:55
This will build a github markdown table of all the plugins on a site.
<?php
include( 'the/path/to/wp-load.php' );
if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
}
$updates = get_site_transient( 'update_plugins' );
<?php
/**
* Plugin Name: Child Theme Settings Migrator
*/
add_action( 'admin_init', 'child_theme_settings_migrator' );
function child_theme_settings_migrator() {
$theme = wp_get_theme();
<?php
/**
* Plugin Name: Extra User Registration Source Tracking
* Description: Store data about a user's origin -- IP Address and User Agent -- when registering.
* Author: georgestephanis
* Author URI: http://wpspecialprojects.wordpress.com/
* License: GPLv2+
*/
@georgestephanis
georgestephanis / client.js
Last active March 1, 2024 09:12
This is an example client app to integrate with the WordPress 5.6 Application Passwords system. It walks the user through authenticating, and then queries and enumerates all users on the site.
(function($){
const $root = $( '#root' );
const $stage1 = $( '.stage-1', $root );
const $stage2 = $( '.stage-2', $root );
// If there's no GET string, then no credentials have been passed back. Let's get them.
if ( ! window.location.href.includes('?') ) {
// Stage 1: Get the WordPress Site URL, Validate the REST API, and Send to the Authentication Flow
const $urlInput = $( 'input[type=url]', $stage1 );
@georgestephanis
georgestephanis / environment-notifier.php
Last active October 13, 2020 13:56
This plugin adds a node to the adminbar clarifying the current environment setting if not production.
<?php
/*
* Plugin Name: Environment Notifier
* Plugin URI: http://github.com/georgestephanis/environment-notifier/
* Description: This plugin adds a node to the adminbar clarifying the current environment setting if not production.
* Author: George Stephanis
* Version: 1.0
* Author URI: http://wpspecialprojects.wordpress.com
*/