[Plugin: PHP Snippets] Uncalled snippet getting executed
-
When I execute a snippet, the snippet following it in the wp_post table gets executed also.
For example… I executed a snippet to modify a user account. It’s shortcode is [account.myaccount] and its wp_post id is 787. 2 entries sequentially after in the wp_post table is a snippet shortcode [account.view-order-details], post id 846. These snippets are unrelated and neither references the other. Yet when I execute the first, the second executes also. And this occurs for any snippet I execute. The succeeding snippet in the wp_post table will get executed also.
I know this to be true because I put traps in every snippet module to output its snippet name when executed.
I am using a plugin called plugin-organizer to activate a plugin only on the page it’s needed.
In the example about, there is a page called Update Account which contains the php snippet [account.myaccount] and there is a page called View Account Details which contains the php snippet [account.view-account-details]. The php-snippets plugin is activated for both pages.
If I disable the php-snippets plugin on the Update Account page and then execute the page, the shortcode [account.myaccount] shows as output to the page and not the contents of the snippet itself. As would be expected, there is no trap output for the account.myaccount snippet, but also, there is no trap output for the account.view-account-details snippet either.
If I reactivate the php-snippets plug on the Update Account page and execute again, I get a trap output for both snippets, proving the 2nd snippet is being executed even though it wasn’t requested.
I can replicate this same scenario for any snippet combo as listed in wp_post.
- The topic ‘[Plugin: PHP Snippets] Uncalled snippet getting executed’ is closed to new replies.