Skip to content

Instantly share code, notes, and snippets.

View stephenfeather's full-sized avatar

Stephen Feather stephenfeather

View GitHub Profile
@lukecav
lukecav / Commands
Created June 27, 2023 19:27
WPVulnerability WP-CLI support
wp wpvulnerability core
wp wpvulnerability plugins
wp wpvulnerability themes
@lukecav
lukecav / Links
Created December 8, 2022 19:17
CodeWP AI code generation
@lukecav
lukecav / Links
Created September 23, 2022 20:59
WP Activity Log plugin information
@RadGH
RadGH / wp-optimized-taxonomy-mysql.php
Last active May 21, 2023 21:35
Optimize wordpress WP_Term_Query mysql request
<?php
// Example long query (2.557 seconds):
// @see https://radleysustaire.com/s3/1c66a3/
// Example optimized query (0.316 seconds):
// @see https://radleysustaire.com/s3/fb794e/
// Example of what your code would look like:
$args = array(
'taxonomy' => array( 'account-menu' ),
@imanispatel
imanispatel / functions.php
Last active March 17, 2023 02:56
Replace display name with first name & last name in name value
<?php
/**
* Set custom user variable for WooCommerce Wave Connector
* Replace display name with first name & last name in name value
*
* @param array $variables get variables.
* @param array $user_ids get user's id.
* @return array
*/
function custom_customer_variable( $variables, $user_ids ) {
@menushka
menushka / airdropSorter.scpt
Created December 30, 2018 22:47
A Folder Action script written in AppleScript used to separate AirDropped files into a different folder other than the default Downloads folder
property AIRDROP_FOLDER : "Path:to:AirDrop:Folder:in:Alias:format"
property QUARANTINE_KEY : "59"
property GET_QUARANTINE_COMMAND_START : "ls -l -@ '"
property GET_QUARANTINE_COMMAND_END : "' | tr '\\n' ' ' | sed 's/.*com\\.apple\\.quarantine\\s*\\(\\d*\\)/ \\1/' | awk '{$1=$1};1'"
on adding folder items to this_folder after receiving added_items
repeat with i from 1 to length of added_items
set current_item to item i of added_items
set quarantine_type to getQuarantineType(POSIX path of current_item)
@thangman22
thangman22 / register.js
Created April 1, 2018 07:21
Workbox for Wordpress
async function addToCache(urls) {
const pageCache = await window.caches.open('page-cache');
await pageCache.addAll(urls);
}
// Check that service workers are registered
if ('serviceWorker' in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener('load', () => {
addToCache(['/hello-world/', '/main-page/']);
@mehrshaddarzi
mehrshaddarzi / wordpress_image.php
Last active April 12, 2023 22:58
wordpress image thumbnail list Hook
<?php
// Upload to Custom folder in media_handle_upload
https://wordpress.stackexchange.com/questions/290257/media-handle-upload-with-custom-upload-folder
//Download image and to attachment
https://codex.wordpress.org/Function_Reference/media_handle_sideload
//change SrcSet
https://gschoppe.com/wordpress/fix-broken-images-after-wordpress-4-4-update/
@webseo-onilne
webseo-onilne / flatsome3-custom-post-type-support.php
Last active March 6, 2024 15:58
Integrate custom post types into Flatsome 3 page builder application using a child theme; providing: (1.) Page Builder Editor support for custom post types, and (2.) Integration with page builder post element components.
<?php
/**
* Integrate custom post types into Flatsome 3 page builder application using a child theme.
*
* This will provide:
*
* 1. Page Builder Editor support for custom post types
* 2. Integration with page builder post element components
**/
@robinsloan
robinsloan / shh.rb
Last active August 18, 2023 12:09
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above