Brachylog, 10 bytes
↔?ḍt↰+₁|∧0 Alternate 10-byte solution: ↔?ḍt↰+₁.∨0 (Try it online!)
Explanation
↔?ḍt↰+₁|∧0 ↔ The input reversed ? is the same as the input ḍ Split into two halves t Take the second half (which is the longer one if they aren't the same) ↰ Recurse +₁ Add 1 to the result of the recursive call | If the preceding part failed (because the input isn't a palindrome): ∧ Break unification with the input 0 and set the output to 0