Filter Uncanny Redemption Codes

uncanny_owl_disable_ssl_verify

Filters to disable SSL certificate verification for outgoing requests.

add_filter( 'uncanny_owl_disable_ssl_verify', $callback, 10, 1 );

Description

Filters whether SSL verification is enforced for Uncanny Owl connections. Return `true` to disable verification, or `false` to keep it enabled. Defaults to enabled if not filtered or defined by `UNCANNY_OWL_DISABLE_SSL_VERIFY` constant.


Usage

add_filter( 'uncanny_owl_disable_ssl_verify', 'your_function_name', 10, 1 );

Return Value

The filtered value.


Examples

add_filter( 'uncanny_owl_disable_ssl_verify', 'my_custom_ssl_verification_filter', 10, 1 );

/**
 * Custom filter to disable SSL verification for Uncanny Owl plugins.
 *
 * This function intercepts the 'uncanny_owl_disable_ssl_verify' filter.
 * If the filter is not otherwise handled, this will return `true` to disable SSL verification.
 * In a real-world scenario, you might have conditions here to decide whether to disable.
 * For example, you might only disable it on a development environment.
 *
 * @param mixed $ssl_verification_setting The current SSL verification setting (initially null).
 * @return bool True to disable SSL verification, false to enable it.
 */
function my_custom_ssl_verification_filter( $ssl_verification_setting ) {
	// For demonstration purposes, let's disable SSL verification only if a specific constant is defined.
	// In a real scenario, you might check a database option, a user role, or a specific environment.
	if ( defined( 'MY_LOCAL_DEV_ENVIRONMENT' ) && MY_LOCAL_DEV_ENVIRONMENT ) {
		// Return true to tell the plugin to disable SSL verification.
		return true;
	}

	// If our conditions aren't met, let the plugin's default logic handle it.
	// Returning null here means the filter hasn't explicitly set a value.
	return null;
}

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

src/classes/class-shared-functionality.php:275

public static function should_verify_ssl() {
		// Allow filtering via WordPress filter (universal across all plugins)
		$sslverify = apply_filters( 'uncanny_owl_disable_ssl_verify', null );
		if ( null !== $sslverify ) {
			return ! $sslverify; // Filter returns true to disable, so invert
		}

		// Check if explicitly disabled via wp-config.php constant (universal across all plugins)
		if ( defined( 'UNCANNY_OWL_DISABLE_SSL_VERIFY' ) && true === UNCANNY_OWL_DISABLE_SSL_VERIFY ) {
			return false;
		}

		// Default to verifying SSL for production environments
		return true;
	}

Scroll to Top