Hi @yaelhagag
To answer your main question: Yes, Code Snippets is designed exactly for this. Whether you choose our plugin or WPCode, both are robust enough to handle the tasks you’ve described. However, there are some specific ways our plugin handles these that might help you decide.
1. Embedding JS (Google Tag Manager & Userway)
Our plugin handles JavaScript snippets easily. You don’t need to edit your theme’s header.php or footer.php files manually.
- How it works: You create a new snippet, set the “Code Type” to JavaScript (or HTML for the GTM tag), and then use our Auto-Insert rules.
- Placement: You can specifically target the
wp_head (for the Head section) or wp_footer (for the Footer) with just a few clicks.
- Performance: These scripts are injected cleanly, ensuring your accessibility tool (Userway) and tracking (GTM) load exactly where they need to.
2. PHP for Cross-Site Information
Displaying info from Site X on Site Y is a classic PHP use case (often involving REST API calls or custom database queries).
- Shortcodes: You can wrap your PHP code in a shortcode using our plugin. This allows you to place
[your-custom-info] anywhere on Site Y (a page, post, or sidebar), and it will execute the PHP to fetch the data from Site X.
- Safety: Our plugin includes a “Safe Mode.” If you make a mistake in your PHP that would normally “White Screen” your site, our plugin detects the error and deactivates the snippet automatically so you can fix it.
If it helps, we’re the Original Code Snippets plugin (since 2012), a deliberately small and strong team without corporate greed. Check our website and the about section if you want to learn more about the people behind this. If you still have doubts, email us and I’ll be happy to set up a videocall with you myself. Not to sell you stuff, but show we actually care. Quite deeply in fact.
Looking forward to hear of this helped you decide, cheers!