This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: FF Plugin Disabler | |
Description: Disable selected plugins for optimization | |
Version: 2.0 | |
Author: Five by Five | |
Author URI: https://www.fivebyfive.com.au/ | |
*/ | |
if( strpos( $_SERVER['REQUEST_URI'], '/wp-admin/' ) !== false ) return; // front-end only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_shortcode('broker_init', function(){ | |
ob_start(); | |
include 'broker/init.php'; | |
return ob_get_clean(); | |
}); | |
add_action('init', 'custom_rewrite_rules'); | |
function custom_rewrite_rules(){ | |
add_rewrite_rule( | |
'^broker/([\w+-]*)/([\w+-]*)/?$', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set url=https://next-level-racing-new.local/wp-admin/ | |
set runs=3 | |
for /L %%i in (1,1,%runs%) do ( | |
curl -o NUL -s -w "%%{time_total}\n" -H "Pragma: no-cache" -H "cookie:{INSERT_COOKIE_HERE}" "!url!" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ffdb($args){ | |
global $wpdb; | |
$post_type = $args['post_type'] ?? 'post'; | |
$post_status = $args['post_status'] ?? 'publish'; | |
$term_id = $args['term_id'] ?? null; | |
$meta_key = $args['meta_key'] ?? null; | |
$meta_value = $args['meta_value'] ?? null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[xdebug] | |
{{#if os.windows}} | |
zend_extension = php_xdebug.dll | |
{{else}} | |
zend_extension = {{extensionsDir}}/xdebug.so | |
{{/if}} | |
{{#if xdebugEnabled}} | |
{{!-- xdebug.mode=debug,develop --}} | |
xdebug.mode=profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set url=https://next-level-racing-new.local/sample-home/ | |
set runs=10 | |
for /L %%i in (1,1,%runs%) do ( | |
curl -o NUL -s -w "%%{time_total}\n" -H "Pragma: no-cache" "!url!" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function batch_items(items, items_per_batch){ | |
let batched_items = []; | |
let group_items = []; | |
let group_index = 0; | |
for( let i = 0; i < items.length; i++ ) { | |
group_index++; | |
group_items.push(items[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set "plugin_name=plugin-boilerplate" | |
set "zip_file=%plugin_name%.zip" | |
set "source_path=%CD%" | |
set "exclude=node_modules;.git;_temp;zip.ps1;publish.bat;.gitignore;jsconfig.json;package.json;package-lock.json;wp-manifest.cjs;vite.config.js;%zip_file%" | |
echo Creating zip file... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Before_After_Slider { | |
constructor(el){ | |
this.el = el; | |
this.init(); | |
} | |
init(){ | |
this.before = this.el.querySelector('.before_image'); |
NewerOlder