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: Staging URL Finder | |
| * Description: Finds and lists URLs in the database that differ from the site URL | |
| * Version: 0.2.0 | |
| * Author: Nazar Hotsa | |
| */ | |
| // Prevent direct access | |
| if ( ! defined( 'ABSPATH' ) ) { |
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 | |
| require( 'wp-load.php' ); // Make sure to set the correct path to wp-load.php file | |
| set_time_limit( 300 ); // Optional, yet might be necessary depending on the server configuration | |
| // BEGIN Configuration | |
| $admin_email = 'email@example.com'; | |
| $max_log_size_bytes = 1024 * 1024; // 1 MB | |
| $log_file = '/home/user/multisite-cron.log'; |
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
| RewriteCond %{HTTP_HOST} ^www\. [OR] | |
| RewriteCond %{HTTPS} off | |
| RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ | |
| RewriteRule ^ https://%1%{REQUEST_URI} [NE,L,R=301] |
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
| function bnn_image_sizes_override( $sizes ) { | |
| unset( $sizes['thumbnail'] ); | |
| unset( $sizes['medium'] ); | |
| unset( $sizes['medium_large'] ); | |
| unset( $sizes['large'] ); | |
| unset( $sizes['1536x1536']); // 2x medium-large | |
| unset( $sizes['2048x2048']); // 2x large | |
| return $sizes; | |
| } | |
| add_filter( 'intermediate_image_sizes_advanced', 'bnn_image_sizes_override' ); |
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
| add_filter( 'the_content', function( $content ) { | |
| return preg_replace_callback ( | |
| '#https?://[^\s<]+#i', | |
| function( $matches ) { | |
| $url = $matches[0]; | |
| $display = preg_replace( '#https?://#', '', $url ); | |
| if( strlen( $display ) > 50 ) { | |
| $display = substr( $display, 0, 25 ) . '…' . substr( $display, -15 ); | |
| } |
OlderNewer