---
name: evolution_plugin_hook_eval_include
description: "Plugin eval-hooks (var=='' branch) silently no-op unless the plugin file is include_once'd before eval"
metadata: 
  node_type: memory
  type: project
  originSessionId: 941e8096-f9d8-4794-a779-91887ec57031
---

Evolution plugin hook runners in `functions.php` (`PluginHooksPreScriptCheck` ~L3668, `PluginHooksPostScriptCheck` ~L3730) have two branches. The `var != ''` branch does `include_once('plugins/'.$v['php_path'])` **before** `eval($v2['newcall'])`. The `var == '' && eval != ''` branch evals `$v2['eval']` but historically did NOT include the plugin first — so eval strings referencing plugin globals (e.g. `$shopify`, instantiated at the bottom of `plugins/shopify/plugin.php`) hit a null object. The eval is wrapped in try/catch, so it fails **silently** — logged as "Plugin post/pre-hook eval failed … on null", hook never runs.

**Fixed (2026-07-15):** added the missing `include_once` to the POST branch (~L3763) — surfaced via the Apache PHP-warning feed [[apache_error_log_feed]] (shopify `invoiceCheckPayments` on invoiceadd).

**OPEN:** the PRE branch (~L3710) has the identical defect, NOT yet fixed — fixing it would activate dead `var==''` pre-hooks (e.g. dispatchsave `jobSetOrderStatus`) whose behavior change is unverified. Confirm with user before patching.

Related: [[evolution_ajax_save_auth_gate]], [[plugin_security_review]].
