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 | |
/** | |
* PemFTP - A Ftp implementation in pure PHP | |
* | |
* @package PemFTP | |
* @since 2.5.0 | |
* | |
* @version 1.0 | |
* @copyright Alexey Dotsenko | |
* @author Alexey Dotsenko |
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
DELETE FROM wp_og6o50l3ph_options WHERE option_name LIKE '%jpsq_sync-%' | |
https://wordpress.org/support/topic/jpsq_sync-table-constantly-generated-to-the-db/ |
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
// Use only to test/check object cache. | |
add_action( 'wp_footer', function () { | |
$GLOBALS['wp_object_cache']->stats(); | |
echo '<style>.site-menu { display:none!important;}</style>'; | |
var_dump( wp_json_encode( $GLOBALS['wp_object_cache']->stats() ) ); | |
} ); |
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 get_all_meta_keys(){ | |
global $wpdb; | |
$table = $wpdb->prefix . 'postmeta'; | |
$results = $wpdb->get_results("SELECT DISTINCT meta_key FROM $table;"); | |
var_dump($results); |
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 | |
/** | |
* Default Get Queries | |
* | |
* @access public | |
* @param WP_REST_Request $request | |
* @return void | |
*/ | |
public function get_queries( WP_REST_Request $request ) { | |
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
# Use Dockerized infrastructure | |
sudo: false | |
# Use node_js environnement | |
language: node_js | |
node_js: | |
- "6" | |
# Cache Gcloud SDK between commands | |
cache: |
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
const IncomingWebhook = require('@slack/client').IncomingWebhook; | |
const url = 'Webhook URL' | |
const defaults = { | |
username: 'webhookbot', | |
iconEmoji: ':ghost:', | |
channel: '#general' | |
} | |
const webhook = new IncomingWebhook(url, defaults); | |
exports.subscribe = function subscribe(event, callback) { |
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
'use strict'; | |
const Datastore = require('@google-cloud/datastore'); | |
// Instantiates a client | |
const datastore = Datastore(); | |
/** | |
* Gets a Datastore key from the kind/key pair in the request. | |
* |
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
-- This will show you the size of post, revision, attachment and other fields in `wp_posts` | |
-- this method can be applied to any WordPress table to get a breakdown of clutter and data use | |
-- this will not get you index size, but WP indexes are typically a small fraction of overall table size | |
SELECT post_type | |
COUNT(*) AS NUM, -- adds a column with the number of rows for each key value for comparison | |
SELECT post_type, COUNT(*) AS NUM, | |
(SUM(LENGTH(ID) -- add all column data together to group the total row data by post_type | |
+LENGTH(post_author) | |
+LENGTH(post_date) | |
+LENGTH(post_date_gmt) |
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 wp_update_privacy( $query ) { | |
unset($query['php']); | |
unset($query['mysql']); | |
unset($query['local_package']); | |
unset($query['blogs']); | |
unset($query['users']); | |
unset($query['multisite_enabled']); | |
unset($query['initial_db_version']); | |
return $query; | |
} |