Skip to content

Instantly share code, notes, and snippets.

View vardumper's full-sized avatar
:accessibility:
too lazy to update my status

Erik Pöhler vardumper

:accessibility:
too lazy to update my status
View GitHub Profile
@vardumper
vardumper / gist:53c06689f95b720e011440069cdef0ec
Last active January 21, 2022 13:24
Optimise and rebuild Wordpress Meta Table Indexes
CREATE TABLE wp_postmeta_new (
meta_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
post_id BIGINT UNSIGNED NOT NULL,
meta_key VARCHAR(255) NOT NULL,
meta_value LONGTEXT NOT NULL,
PRIMARY KEY(post_id, meta_key, meta_id), -- to allow dup meta_key for a post
INDEX(meta_id), -- to keep AUTO_INCREMENT happy
INDEX(meta_key)
) ENGINE=InnoDB;
INSERT INTO wp_postmeta_new SELECT * FROM wp_postmeta;
@vardumper
vardumper / .env
Created September 22, 2019 12:18
Example Wordpress .env File
#--------------------------------------------------------------------------------------------------#
# ENVIRONMENT SETTING #
# It can be anything, but "development", "staging" and "production" are supported out of the box. #
# Do not use "development" on production and viceversa, because it has effect on debug settings. #
#--------------------------------------------------------------------------------------------------#
WORDPRESS_ENV=development
#--------------------------------------------------------------------------------------------------#
# MANDATORY DATABASE SETTINGS #
#--------------------------------------------------------------------------------------------------#
@vardumper
vardumper / composer.json
Created September 22, 2019 12:09
Example composer file for Wordpress & WooCommerce
{
"name" : "githubuser/projectname",
"description" : "Project Name",
"type" : "project",
"license" : "GPL",
"authors" : [{
"name" : "Your Name"
}
],
"repositories" : [{
@vardumper
vardumper / wp-config.php
Created September 22, 2019 11:51
Block external communication via wp_remote_post() and wp_remote_get()
define('WP_HTTP_BLOCK_EXTERNAL', true);
define('WP_ACCESSIBLE_HOSTS', 'api.wordpress.org,*.api.mailchimp.com,api.pay1.de,*.google.com');
@vardumper
vardumper / wordpress-and-woocommerce-development-boilerplate.sh
Last active September 21, 2019 19:59
Working with vardumper/wordpress-and-woocommerce-development-boilerplate
# either fork the repo and clone your fork, or clone this repo directly
git clone [email protected]:vardumper/wordpress-and-woocommerce-development-boilerplate.git my-project-folder
# installs all dependencies, themes and plugins
cd my-project-folder
composer install
# copies the distribution default .env file
cp .env-distribution .env