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 | |
// This file replaces your DDEV generated xpprof_prepend.php and can likely be used by any xhprof setup. | |
// As for DDEV, mind that you need to use `ddev xhprof on` to turn xhprof on. | |
// When xhprof is enabled, It is mounted into the ddev-webserver container | |
// as /usr/local/bin/xhprof/xhprof_prepend.php | |
// In addition it will create a log file with additional information, not covered by xhprof, like the URL opened, parameter etc, | |
// which will help if you want to optimize hidden processes, like saving a post with the WordPress Block editor. |
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 | |
/** | |
* A class to create custom tables within WordPress. | |
* | |
* @version 1.0.0 | |
*/ | |
namespace apermo\WPTools; | |
use Exception; |
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 ( ! defined( 'PHP_SAPI' ) || PHP_SAPI !== 'cli' ) { | |
exit( 'You shall not pass' ); | |
// echo '<pre>'; | |
// set_time_limit( 0 ); | |
} | |
$dir = $argv[1] ?? __DIR__; | |
// Load wp-config to make sure we can use WordPress. |
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
<html> | |
<head> | |
<style type="text/css"> | |
textarea { | |
width: 100%; | |
height: 300px; | |
} | |
td { | |
border: 2px dashed grey; | |
padding: 1em; |
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: Timed redirect | |
* Description: Redirects all traffic to [hardcoded domain] starting [hardcoded time] | |
* Version: 1.0.0 | |
* Author: Christoph Daum | |
*/ | |
// Mind possible UTC time differences here. |
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 | |
require_once 'wp-config.php'; | |
// Add your desired credentials here. Using these is a super bad idea. | |
//$user = 'YOUR USERNAME'; | |
//$pass = 'YOUR_SUPER_SECURE_PASSWORD'; | |
//$email = 'YOUR@ADMIN_EMAIL.ADDRESS'; | |
if ( ! username_exists( $user ) && ! email_exists( $email ) ) { |
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 | |
// file is older than 3600s, better delete this. | |
if ( filemtime( __FILE__ ) + 3600 < time() ) { | |
unlink( __FILE__ ); | |
header( "HTTP/1.0 404 Not Found" ); | |
exit(); | |
} | |
phpinfo(); |
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 | |
/** | |
* Contains Class Settings_Abstract | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
header( 'HTTP/1.0 404 Not Found' ); | |
exit( 'You shall not pass' ); | |
} |
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
body::after { | |
content: ""; | |
display: block; | |
position: fixed; | |
top: 0; | |
left: 0; | |
height: 100%; | |
height: 100vh; | |
width: 100%; | |
width: 100vw; |
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
function custom_add_interface_to_wp_block( $args, $post_type ) { | |
global $pagenow; | |
if ( 'wp_block' !== $name ) { | |
return $args; | |
} | |
$changed_args = array( | |
'show_ui' => true, | |
'show_in_menu' => true, |
NewerOlder