This file contains hidden or 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['username']) ){ | |
| $_GET['username'] = 'vagrant'; | |
| } | |
| function adminer_object() { | |
| class AdminerSoftware extends Adminer { | |
| function credentials() { |
This file contains hidden or 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
| /** | |
| * AJAX обертка для WordPress REST API | |
| */ | |
| let sb_ajax = function ( ep, success, error, type = 'GET', data = '' ) { | |
| url = wpApiSettings.root + ep; | |
| // Feature detection | |
| if ( !window.XMLHttpRequest ) return; |
This file contains hidden or 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
| gzip -d backup-20100910164109.sql.gz |
This file contains hidden or 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
| Search and replace | |
| https://wp-cli.org/commands/search-replace/ | |
| wp search-replace | |
| wp search-replace 'http://example.dev' 'http://example.com' | |
| Optmize database | |
| https://wp-cli.org/commands/db/optimize/ | |
| wp db optimize | |
| Repair database |
This file contains hidden or 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
| DELETE cm | |
| FROM wp_commentmeta as cm | |
| LEFT JOIN wp_comments as c ON c.comment_ID = cm.comment_id | |
| WHERE c.comment_ID is null |
This file contains hidden or 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
| -- WordPress - Comments 1 year ago | |
| SELECT * | |
| FROM wp_comments as c | |
| WHERE c.comment_date_gmt < DATE_SUB(NOW(),INTERVAL 1 YEAR) | |
| ORDER BY c.comment_date_gmt DESC | |
| LIMIT 50 |
This file contains hidden or 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
| -- delete comments 1 year ago | |
| DELETE c | |
| FROM wp_comments as c | |
| WHERE c.comment_date_gmt < DATE_SUB(NOW(),INTERVAL 1 YEAR) |
This file contains hidden or 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('u/log', function($msg, $data = []){ | |
| error_log( PHP_EOL . $msg); | |
| if(!empty($data)){ | |
| ob_start(); | |
| echo PHP_EOL; | |
| var_dump($data); | |
| error_log(ob_get_clean()); |
This file contains hidden or 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 | |
| namespace SB\Models; | |
| /** | |
| * Class Event model for map data | |
| * | |
| * @package SB | |
| */ | |
| class Event { | |
| /** |