Checking if a block is anywhere around a player

I want to see if theres a block in any of the cardinal directions around a player or under and to set a score of 1 while there is and have a score of 0 when it isnt

execute as @a run execute at @s run execute if block ~ ~-0.5 ~ minecraft:cactus run scoreboard players set @s cactusnear 1
execute as @a run execute at @s run execute if block ~0.5 ~ ~ minecraft:cactus run scoreboard players set @s cactusnear 1
execute as @a run execute at @s run execute if block ~-0.5 ~ ~ minecraft:cactus run scoreboard players set @s cactusnear 1
execute as @a run execute at @s run execute if block ~ ~ ~0.5 minecraft:cactus run scoreboard players set @s cactusnear 1
execute as @a run execute at @s run execute if block ~ ~ ~-0.5 minecraft:cactus run scoreboard players set @s cactusnear 1

execute as @a run execute at @s run execute unless block ~ ~-0.5 ~ minecraft:cactus run execute unless block ~0.5 ~ ~ minecraft:cactus run execute unless block ~-0.5 ~ ~ minecraft:cactus run execute unless block ~ ~ ~0.5 minecraft:cactus run execute unless block ~ ~ ~-0.5 minecraft:cactus set @s cactusnear 0```
Unfortunately this kinda brute forcey way of doing it didnt work because of the command limit so any suggestions of a better way to manage this would be appreciated :)
Continue to help post