- run
wp --allow-root db query "select post_content from wp_posts where post_content like '%<img src%';" --skip-column-names --silent | grep -oP "<img\s+.*?src=['\"](.*?)['\"].*?>" | grep -oP "https?://[^\"]*" | sort | uniq
- using
parse_url()
, create a PHP function* to find unique hosts and add first occurence of each to an array of links. - Itterate through new list of links and run through a CURL function** to determine
- Add links with 200-300 status to an array
- Produce Search & Replace script based of returned values
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 | |
/** | |
* Take Accent color, and convert it to RGBA, and add an opacity of .75. | |
*/ | |
$accent = get_theme_mod( 'site_accent_color' ); | |
$accent_string = ltrim( $accent, '#' ); | |
$arr = str_split( $accent_string, '2' ); | |
foreach ( $arr as $value ) { | |
$new_value = hexdec( $value ) . ', '; |
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
#!/bin/bash | |
#get siteurl option from prod and dev | |
PROD_SITEURL=$(wp @prod option get siteurl); | |
DEV_SITEURL=$(wp @dev option get siteurl); | |
#Export database from prod and import to dev | |
wp @prod db export - > prod.sql | |
wp @dev db import /srv/www/edmund/prod.sql | |
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 | |
// Add the following code snippet to the functions.php file of the active theme of your Child Site site. | |
add_filter( 'mainwp-child-get-total-size', 'mycustom_mainwp_child_get_total_size', 10 , 1 ); | |
function mycustom_mainwp_child_get_total_size( $value ) { | |
return false; | |
} | |
?> |
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 | |
// Add the following code snippet to the functions.php file of the MainWP Customisations plugin | |
// Download MainWP Customisations here: https://github.com/mainwp/mainwp-customisations | |
// More about the plugin: https://mainwp.com/mainwp-customisations/ | |
// WP Version example | |
add_filter( 'mainwp-sitestable-getcolumns', 'mycustom_sites_table_column', 10 ); | |
add_filter( 'mainwp-sitestable-item', 'mycustom_sitestable_item', 10 ); |
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 | |
remove_theme_support( 'wc-product-gallery-zoom' ); |
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 | |
/** | |
* Adds a cURL version test to Site Health | |
* | |
* Info here: https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/ | |
* NOTE: Requires version 5.2+ of 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
/** | |
* Add a weekly email report that summarizes which domains that | |
* your products are being used on. | |
*/ | |
add_filter( 'cron_schedules', function( $schedules ) { | |
$schedules['weekly'] = array( | |
'interval' => 604800, | |
'display' => __('Once Weekly') | |
); |
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
$args = array( | |
'expiration' => date( 'Y-m-d 23:59:59', strtotime( 'January 3, 2018', current_time( 'timestamp' ) ) ), | |
'created' => date( 'Y-m-d 23:59:59', strtotime( current_time( 'timestamp' ) ) ), | |
'status' => 'pending', | |
'profile_id' => 0, | |
'transaction_id' => 0, | |
'initial_amount' => 1, | |
'recurring_amount' => 700, | |
'bill_times' => '1', | |
'period' => 'yearly', |
OlderNewer