Skip to content

Instantly share code, notes, and snippets.

View sc0ttkclark's full-sized avatar
🍕
Working hard reviewing and deploying code

Scott Kingsley Clark sc0ttkclark

🍕
Working hard reviewing and deploying code
View GitHub Profile
@sc0ttkclark
sc0ttkclark / wp-68-auto-rehash-password.php
Created May 6, 2025 17:25
WordPress 6.8.x has new hashing that can be brittle with multisite and object caching. Logging into main site may upgrade the existing password but then hashing could become invalid on other sites. This is NOT a long term solution, you should investigate your object caching issues.
<?php
/*
Plugin Name: Auto rehash password if needed for multisite
Plugin URI: https://www.scottkclark.com/
Description: WordPress 6.8 has new hashing that can be brittle with multisite. Logging into main site may upgrade the existing password but then hashing could become invalid on other sites.
Version: 1.0
Author: Scott Kingsley Clark
Author URI: https://www.scottkclark.com/
This program is free software; you can redistribute it and/or modify
@sc0ttkclark
sc0ttkclark / pods-eval.php
Last active May 1, 2025 16:27
For Pods 3.3 -- Allow PHP eval for various areas of Pods that was deprecated in Pods 2.1-2.3 and finally removed in Pods 3.3
<?php
/**
* Allow PHP eval for various areas of Pods that was deprecated in Pods 2.1-2.3 and finally removed in Pods 3.3
*
* You should avoid using this and start migrating to the recommended solutions:
*
* Pod Pages - https://docs.pods.io/displaying-pods/pod-page-template-hierarchy-for-themes/
* Pod Templates - https://docs.pods.io/displaying-pods/pod-template-hierarchy-for-themes/
*/
{
"landingPage": "\/wp-admin\/admin.php?page=pods&pods_wasm_demo=1",
"preferredVersions": {
"php": "8.0",
"wp": "latest"
},
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
@sc0ttkclark
sc0ttkclark / Bindings.php
Last active March 16, 2024 18:05
The new Custom Binding Logic for Pods
<?php
namespace Pods\WP;
use Pods\Blocks\Types\Field;
use WP_Block;
/**
* Bindings specific functionality.
*
@sc0ttkclark
sc0ttkclark / php-error.php
Created August 15, 2022 19:05
A quick handy debugging file for wp-content/php-error.php to expose critical errors more thoroughly. DO NOT LEAVE THIS ON PROD SITES.
<?php
/**
* A quick handy debugging file for wp-content/php-error.php to expose critical errors more thoroughly.
*
* DO NOT LEAVE THIS ON PROD SITES.
*/
echo '<h1>Site PHP Error</h1>';
echo '<pre>';
var_dump( [
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active November 15, 2022 18:59
WebStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

WebStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and webstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the webstorm-toolbox.sh to use your username for the /Users/yourusername/ path and the correct version number (WebStorm > About > Build #WS-XXX.XXXXX.XX where XXX.XXXXX.XX is the version number to use).
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/webstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "WebStorm (Toolbox)" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@sc0ttkclark
sc0ttkclark / 0-README.md
Last active March 3, 2024 09:22
PhpStorm.app (Toolbox) Mac integration with Tower.app for diff and merge

Toolbox PhpStorm.app Mac integration with Tower.app for diff and merge

How to use this

  1. Add CompareTools.plist and phpstorm-toolbox.sh files in the ~/Library/Application Support/com.fournova.Tower3/CompareTools/ directory. You may need to mkdir ~/Library/Application\ Support/com.fournova.Tower3/CompareTools if the folder does not already exist
  2. Update the phpstorm-toolbox.sh to use your username for the /Users/yourusername/ path and the correct version number (PhpStorm > About > Build #PS-XXX.XXXXX.XX where XXX.XXXXX.XX is the version number to use).
  3. Run chmod +x ~/Library/Application\ Support/com.fournova.Tower3/CompareTools/phpstorm-toolbox.sh
  4. Go into Tower.app Preference > Git Config > Select "PhpStorm" for "Diff tool" and "Compare tool", you can optionally enable "Perform directory diff"
@sc0ttkclark
sc0ttkclark / my-pmpro-set-user-display-name-as-first-last-name.php
Last active March 11, 2022 20:56
Automatically update the display name to be set as the first/last name when the user is registered or the profile is saved or during checkout.
<?php
/**
* Automatically update the display name to be set as the first/last name when the user is registered or the profile is saved.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / my-pmpro-reset-cron-schedules-full.php
Created March 2, 2022 15:26
Reset the Cron Schedules for Paid Memberships Pro. The single-use version can be found at: https://gist.github.com/sc0ttkclark/bd319a47656b786ccee3eca6f2dc4a9a and the PMPro admin page only version can be found at: https://gist.github.com/sc0ttkclark/e11691d6c5a278662e3c694a0bb12e5a
<?php
/**
* Reset the Cron Schedules for Paid Memberships Pro on any page load.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
@sc0ttkclark
sc0ttkclark / my-pmpro-reset-cron-schedules-single-use.php
Last active February 23, 2022 17:37
Reset the Cron Schedules for Paid Memberships Pro (single-use run with Code Snippets plugin). The solution that runs on every PMPro Admin page load can be found here: https://gist.github.com/sc0ttkclark/e11691d6c5a278662e3c694a0bb12e5a
<?php
/**
* Reset the Cron Schedules for Paid Memberships Pro (single-use run with Code Snippets plugin).
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/