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 | |
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file | |
add_filter( 'wpe_heartbeat_allowed_pages', 'my_wpe_add_allowed_pages' ); | |
function my_wpe_add_allowed_pages( $heartbeat_allowed_pages ) { | |
$heartbeat_allowed_pages = array( | |
'index.php', | |
'admin.php', | |
'edit.php', |
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 FROM iwp_history WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); | |
DELETE FROM iwp_history_additional_data WHERE historyID NOT IN ( SELECT historyID FROM iwp_history ); | |
DELETE FROM iwp_history_raw_details WHERE historyID NOT IN ( SELECT historyID FROM iwp_history ); | |
DELETE FROM iwp_site_stats WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); | |
DELETE FROM iwp_user_access WHERE siteID NOT IN ( SELECT siteID FROM iwp_sites ); |
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
#!/bin/bash | |
echo -n "GitHub User: " | |
read USER | |
echo -n "GitHub Password: " | |
read -s PASS | |
echo "" | |
echo -n "GitHub Repo (e.g. imFORZA/REPO): " |
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
cd .. | |
# Install CodeSniffer for WordPress Coding Standards checks. | |
git clone https://github.com/squizlabs/PHP_CodeSniffer.git php-codesniffer | |
# Install WordPress Coding Standards. | |
git clone https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git wordpress-coding-standards | |
# Hop into CodeSniffer directory. | |
cd php-codesniffer | |
# Set install path for WordPress Coding Standards | |
scripts/phpcs --config-set installed_paths ../wordpress-coding-standards | |
# After CodeSniffer install you should refresh your path. |
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
TARGET=/path/to/theme | |
USER=deployuser | |
SERVER=ip.or.domain | |
PORT=port | |
cd ~/clone/ | |
find . -type f -iname \*.coffee -delete | |
find . -type f -iname \*.scss -delete | |
find . -type f -iname \*.less -delete | |
find . -type f -iname \*.scssc -delete | |
find . -name .sass-cache -type d -exec rm -r {} + |
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
REMOTE_REPOSITORY=${REMOTE_REPOSITORY:?'You need to configure the REMOTE_REPOSITORY environment variable!'} | |
REMOTE_BRANCH=${REMOTE_BRANCH:?'You need to configure the REMOTE_BRANCH environment variable!'} | |
set -e | |
git fetch --unshallow || true | |
git push ${REMOTE_REPOSITORY} ${CI_COMMIT_ID}:${REMOTE_BRANCH} | |
cd wp-content/themes/<theme> | |
npm install -g bower gulp | |
npm install | |
bower install | |
gulp --production |
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
# You must set up two environment variables: | |
# repoSlug = slug for WP Engine repository | |
# themeDir = path from the top of the repository, to the theme directory | |
git remote add production [email protected]:production/${repoSlug}.git | |
git remote add staging [email protected]:staging/${repoSlug}.git | |
cd ${themeDir} | |
npm install | |
npm install -g bower | |
bower install |
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_filter( 'jetpack_get_available_modules', 'prefix_hide_jetpack_modules' ); | |
/** | |
* Disable all non-whitelisted jetpack modules. | |
* | |
* As it's written, this will allow all of the currently available Jetpack | |
* modules to work display and be activated normally. | |
* | |
* If there's a module you'd like to disable, simply comment it out or remove it | |
* from the whitelist and it will no longer be available for activation. |
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 | |
/* | |
* Plugin Name: Jetpack default image | |
* Plugin URI: http://wordpress.org/extend/plugins/ | |
* Description: Add a default fallback image if no image can be found in a post | |
* Author: Jeremy Herve | |
* Version: 1.0 | |
* Author URI: http://jeremyherve.com | |
* License: GPL2+ | |
*/ |
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 | |
/* | |
Disable Dify | |
*/ | |
add_action( 'admin_init', 'wpe_disable_dashboard_widgets', 9999 ); | |
function wpe_disable_dashboard_widgets() { | |
remove_meta_box('dashboard_primary', 'dashboard', 'core'); // WordPress News Widget | |
remove_meta_box('wpe_dify_news_feed', 'dashboard', 'normal'); // WPEngine News Widget | |
} |