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: Elementor Pro – Restore 404s on Non-Existent Term Archives | |
| * Description: Fixes a fatal error ("Object of class WP_Error could not be converted to string") and incorrect 200 responses on non-existent tag/category/taxonomy URLs when an Elementor Pro Archive template with a paginated posts widget is active. | |
| * Version: 1.0.0 | |
| * Author: https://robertwent.com | |
| * License: GPL-2.0-or-later | |
| * | |
| * --------------------------------------------------------------------------- | |
| * THE PROBLEM |
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 | |
| /** | |
| * MU-plugin: make is_plugin_active() available on the front-end. | |
| * | |
| * Works around an Elementor Angie-promotion fatal where Hints::is_plugin_active() | |
| * calls the wp-admin-only is_plugin_active() during 'init' on front-end requests, | |
| * where wp-admin/includes/plugin.php is never loaded. | |
| */ | |
| if ( ! function_exists( 'is_plugin_active' ) ) { | |
| require_once ABSPATH . 'wp-admin/includes/plugin.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
| options { | |
| directory "/var/cache/bind"; | |
| forwarders { | |
| 169.254.169.253; // AWS VPC resolver (primary) | |
| 1.1.1.1; // Cloudflare fallback | |
| 8.8.8.8; // Google fallback | |
| }; | |
| forward only; |
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( 'wp_rest_cache/allowed_endpoints', function ( $allowed_endpoints ) { | |
| if ( ! isset( $allowed_endpoints['contact-form-7/v1'] ) ) { | |
| $allowed_endpoints['contact-form-7/v1'] = []; | |
| } | |
| if ( ! in_array( 'contact-forms', $allowed_endpoints['contact-form-7/v1'], true ) ) { | |
| $allowed_endpoints['contact-form-7/v1'][] = 'contact-forms'; | |
| } |
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
| <script> | |
| if (window.jQuery) { | |
| jQuery(document).ready(function() { | |
| jQuery(document).on('submit_success', '.elementor-form', function(event) { | |
| // Push the event to the dataLayer for Google Tag Manager | |
| window.dataLayer = window.dataLayer || []; | |
| window.dataLayer.push({ | |
| event: 'elementor_form_submission', | |
| formName: event.target.getAttribute('name') || | |
| (event.target.querySelector('[name="form_id"]') ? event.target.querySelector('[name="form_id"]').value : 'unknown') || |
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 | |
| /** | |
| * Remove the SearchAction schema from the graph. | |
| */ | |
| add_filter( 'wpseo_schema_website', function( $website ) { | |
| if ( isset( $website['potentialAction'] ) && is_array( $website['potentialAction'] ) ) { | |
| foreach ( $website['potentialAction'] as $key => $action ) { | |
| if ( isset( $action['@type'] ) && $action['@type'] === 'SearchAction' ) { | |
| unset( $website['potentialAction'][$key] ); |
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
| include /etc/nginx/bots.d/abuseipdb; | |
| # BingBot | |
| 13.66.139.0/24 0; | |
| 13.66.144.0/24 0; | |
| 13.67.10.16/28 0; | |
| 13.69.66.240/28 0; | |
| 13.71.172.224/28 0; | |
| 139.217.52.0/28 0; |
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 | |
| # Save this file as /usr/local/sbin/update-abuseipdb.sh | |
| # Edit api key and confidence level | |
| # Make it Executable chmod 700 /usr/local/sbin/update-abuseipdb.sh | |
| # Daily Cron as root (every 4 hours) | |
| # 0 */4 * * * /usr/local/sbin/update-abuseipdb.sh > /dev/null 2>&1 | |
| # Include the output in /etc/nginx/bots.d/blacklist-ips.conf | |
| # include /etc/nginx/bots.d/abuseipdb; |
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: Sitemap Test | |
| * Description: A simple plugin to test Yoast sitemap integration. | |
| */ | |
| function add_to_yoast_sitemap( $custom_sitemaps ) { | |
| $custom_sitemaps .= '<sitemap><loc>' . site_url() . '/my-custom-sitemap.xml</loc></sitemap>'; | |
| return $custom_sitemaps; |
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 | |
| $args = array( | |
| 'post_type' => 'any', | |
| 'post_status' => 'publish', | |
| 'posts_per_page' => - 1, | |
| 'post_parent' => $post_id, // Available in ACF blocks by default | |
| 'order' => 'ASC', | |
| 'orderby' => 'menu_order', | |
| 'suppress_filters' => false, |
NewerOlder