<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

/**
 * Safe defaults (correct WP pattern)
 */
$gridpress_card_data = $gridpress_card_data ?? [];

/**
 * Safe variables (normalize early)
 */
$gridpress_url   = $gridpress_card_data['url'] ?? '';
$gridpress_image = $gridpress_card_data['imag_url'] ?? '';
$gridpress_title = $gridpress_card_data['title'] ?? '';
?>
<div class="jc-cards">
    <div class="jc-cards-image">
        <a class="jc-cards-image-wrap" href="<?php echo esc_url( $gridpress_url ); ?>">
            <img
                src="<?php echo esc_url( $gridpress_image ); ?>"
                alt="<?php echo esc_attr( $gridpress_title ); ?>"
            >
        </a>
    </div>
</div>