=' ) ) { return; } global $wp_filter; $hook = $wp_filter['plugins_loaded'] ?? null; if ( $hook instanceof WP_Hook ) { foreach ( $hook->callbacks[20] ?? array() as $callback ) { if ( ! ( $callback['function'] instanceof Closure ) ) { continue; } $reflection = new ReflectionFunction( $callback['function'] ); if ( defined( 'KCONV_PRO_FILE' ) && realpath( $reflection->getFileName() ) === realpath( KCONV_PRO_FILE ) ) { remove_action( 'plugins_loaded', $callback['function'], 20 ); } } } add_action( 'admin_notices', static function () { if ( KCONV_Admin_Scope::notice() && current_user_can( 'update_plugins' ) ) { echo '

' . esc_html__( 'Finish updating KillerConversions Pro to 0.15.0. Ordinary Free enquiries remain available; Pro workflows pause safely while stored forms, entries and attachments are retained.', 'killerconversions' ) . '

'; } } ); }, 19 ); // Keep the older companion's license screen and signed updater available while the pair is updated. add_action( 'plugins_loaded', static function () { if ( ! defined( 'KCONV_PRO_VERSION' ) || version_compare( KCONV_PRO_VERSION, '0.15.0', '<' ) || version_compare( KCONV_PRO_VERSION, '1.2.4', '>=' ) || ! class_exists( 'KCONV_Pro' ) ) { return; } add_filter( 'kconv_form_available', static function ( $available, $form ) { if ( ! $available ) { return false; } // Earlier Pro versions evaluate basic conditions too, before Free's field filter runs. foreach ( $form['fields'] as $field ) { if ( ! empty( $field['condition'] ) ) { return false; } } $config = KCONV_Pro::config( $form ); if ( is_wp_error( $config ) || ! empty( $config['rules'] ) ) { return false; } foreach ( array( 'fields', 'branches', 'actions' ) as $kind ) { if ( ! empty( $form['logic'][ $kind ] ) ) { return false; } } foreach ( $form['estimate']['rows'] ?? array() as $row ) { if ( ! empty( $row['when'] ) ) { return false; } } return $available; }, 999, 2 ); add_action( 'admin_notices', static function () { if ( KCONV_Admin_Scope::notice() && current_user_can( 'update_plugins' ) ) { echo '

' . esc_html__( 'Finish updating KillerConversions Pro to 1.2.4 or later. Forms using conditions are paused until the update is complete. Saved forms, entries and attachments are retained. Ordinary Free forms without conditions are unaffected.', 'killerconversions' ) . '

'; } } ); }, 21 );