UPDATE
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: CropLogic Performance Guards
|
||||
* Description: Reduces delays caused by blocked external services on this WordPress install.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert env values like 1/true/on/yes into booleans.
|
||||
*/
|
||||
function croplogic_env_flag( $name, $default = false ) {
|
||||
$value = getenv( $name );
|
||||
|
||||
if ( false === $value || '' === $value ) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
return filter_var( $value, FILTER_VALIDATE_BOOLEAN );
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop the theme from waiting on Google Fonts when external traffic is blocked.
|
||||
*/
|
||||
function croplogic_disable_upstudy_google_fonts() {
|
||||
wp_dequeue_style( 'upstudy-main-fonts' );
|
||||
wp_deregister_style( 'upstudy-main-fonts' );
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'croplogic_disable_upstudy_google_fonts', 100 );
|
||||
|
||||
/**
|
||||
* Short-circuit login/admin notification emails that can hang on blocked SMTP calls.
|
||||
*/
|
||||
function croplogic_skip_slow_wp_mail( $pre, $atts ) {
|
||||
if ( ! croplogic_env_flag( 'WORDPRESS_DISABLE_SLOW_MAIL', true ) ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_unslash( $_SERVER['REQUEST_URI'] ) : '';
|
||||
$is_login = false !== strpos( $request_uri, 'wp-login.php' );
|
||||
$is_admin = is_admin();
|
||||
$action = isset( $_REQUEST['action'] ) ? sanitize_key( wp_unslash( $_REQUEST['action'] ) ) : '';
|
||||
|
||||
if ( in_array( $action, array( 'lostpassword', 'retrievepassword', 'rp', 'resetpass' ), true ) ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
if ( ! $is_login && ! $is_admin ) {
|
||||
return $pre;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
add_filter( 'pre_wp_mail', 'croplogic_skip_slow_wp_mail', 10, 2 );
|
||||
@@ -1 +0,0 @@
|
||||
.elementor-11 .elementor-element.elementor-element-b4730ed{--display:flex;}.elementor-11 .elementor-element.elementor-element-8d8be18 .crop-logic-chat{min-height:760px;--cl-radius:28px;--cl-primary:#2b8a3e;--cl-accent:#2d9cdb;--cl-bg:#f5f7f1;--cl-surface:#ffffff;--cl-border:rgba(43, 138, 62, 0.15);--cl-text:#16331b;--cl-muted:#5f6f62;--cl-user-bubble:rgba(43, 138, 62, 0.12);--cl-assistant-bubble:#ffffff;--cl-input-bg:#ffffff;}
|
||||
@@ -1 +0,0 @@
|
||||
.elementor-13 .elementor-element.elementor-element-f2b90d8{--display:flex;}.elementor-13 .elementor-element.elementor-element-b47d29f .crop-logic-chat{--cl-primary:#2b8a3e;--cl-accent:#2d9cdb;--cl-bg:#f5f7f1;--cl-surface:#ffffff;--cl-border:rgba(43, 138, 62, 0.15);--cl-text:#16331b;--cl-muted:#5f6f62;--cl-user-bubble:rgba(43, 138, 62, 0.12);--cl-assistant-bubble:#ffffff;--cl-input-bg:#ffffff;}
|
||||
@@ -1 +0,0 @@
|
||||
.elementor-20 .elementor-element.elementor-element-0bf8074{--display:flex;}.elementor-20 .elementor-element.elementor-element-105d04b .crop-logic-chat{--cl-primary:#2b8a3e;--cl-accent:#2d9cdb;--cl-bg:#f5f7f1;--cl-surface:#ffffff;--cl-border:rgba(43, 138, 62, 0.15);--cl-text:#16331b;--cl-muted:#5f6f62;--cl-user-bubble:rgba(43, 138, 62, 0.12);--cl-assistant-bubble:#ffffff;--cl-input-bg:#ffffff;}
|
||||
@@ -1 +0,0 @@
|
||||
.elementor-kit-5{--e-global-color-primary:#6EC1E4;--e-global-color-secondary:#54595F;--e-global-color-text:#7A7A7A;--e-global-color-accent:#61CE70;--e-global-typography-primary-font-family:"Roboto";--e-global-typography-primary-font-weight:600;--e-global-typography-secondary-font-family:"Roboto Slab";--e-global-typography-secondary-font-weight:400;--e-global-typography-text-font-family:"Roboto";--e-global-typography-text-font-weight:400;--e-global-typography-accent-font-family:"Roboto";--e-global-typography-accent-font-weight:500;}.elementor-section.elementor-section-boxed > .elementor-container{max-width:1140px;}.e-con{--container-max-width:1140px;}.elementor-widget:not(:last-child){--kit-widget-spacing:20px;}.elementor-element{--widgets-spacing:20px 20px;--widgets-spacing-row:20px;--widgets-spacing-column:20px;}{}h1.entry-title{display:var(--page-title-display);}@media(max-width:1024px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:1024px;}.e-con{--container-max-width:1024px;}}@media(max-width:767px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:767px;}.e-con{--container-max-width:767px;}}
|
||||
Reference in New Issue
Block a user