Switch from Woody Code Snippets
Snipfire imports snippets from Woody Code Snippets (the plugin once called Insert PHP), with their locations, paragraph and post numbers, and display conditions, and switches them over without a gap. Read Switching from another snippet plugin first for how importing, Check first and Switch over work.
Steps
- Snipfire → Snippets → Import, then pick Woody Code Snippets.
- Select the snippets and click Import … selected. They arrive switched off in Imported/Woody Code Snippets.
- Look at anything marked Check first, and read the notes in the snippets' descriptions.
- Click Switch over.
- Clear your page cache, check the site, then deactivate and delete Woody Code Snippets.
Command line: wp snipfire import-from woody --dry-run, then wp snipfire import-from woody --switch.
What comes across
| Woody | In Snipfire |
|---|---|
| Title, description, tags, priority | Title, description, tags, priority |
| PHP snippets that run everywhere | PHP on init, priority 1 |
| PHP snippets in the header or footer | PHP on wp_head or wp_footer |
| PHP snippets at any other insertion location | An HTML snippet with the PHP inside, at that location |
| Universal and HTML snippets | HTML snippets |
| Text and advertisement snippets | HTML snippets, wrapped in Woody's winp-text-snippet-container box as before. Text shortcodes still get paragraphs added, as in Woody |
| CSS and JavaScript snippets in the header or footer, or everywhere | Real CSS or JavaScript snippets, inline or as a file as Woody's link setting was |
| CSS and JavaScript snippets anywhere else, or as a shortcode | An HTML snippet with a <style> or <script> tag |
| Shortcode snippets | As a shortcode; shortcode attributes are available as variables, as in Woody |
| Display conditions | Conditions: user role, logged out ("guest"), mobile or desktop, page URL, referrer, post type, taxonomy terms, page types, "entire website" |
| "Hide if" conditions | The same conditions turned around |
| WPML languages | A Language condition (Pro) |
Woody only runs a snippet that's switched on, published and has a priority, so those are the ones Switch over switches on in Snipfire.
Insertion locations
| Woody location | Snipfire location |
|---|---|
| Header, footer | Site header, Site footer |
| Before or after the content | Before post content, After post content |
| Before or after paragraph N | Before a paragraph of the post, After a paragraph of the post, with the same number |
| Before or after the excerpt | Before the excerpt (archives), After the excerpt (archives) |
| Between posts | Between posts in archive lists |
| Before or after post N in a list | Before a post in archive lists, After a post in archive lists, with the same number |
| Before or after the post (single posts) | Before post content, After post content (see below) |
More about these locations in Where snippets run.
Marked "Check first"
- A location Snipfire doesn't have: Woody location "…" has no match in Snipfire. Choose where it runs before switching it on. It's imported on Site footer for you to change.
- A display condition Snipfire can't convert: Some of Woody's display conditions have no match in Snipfire. Set the conditions before switching it on.
- An HTML, text, CSS or JavaScript snippet that Woody ran "everywhere": Woody printed it before the page started; Snipfire puts it in the page head. Check that's where you want it.
- Referrer and language conditions without Snipfire Pro: they're kept, but can't match until Pro is active.
Close, but not identical
- Before or after the post on single posts: Woody printed the HTML just outside the post; Snipfire puts it at the start or end of the post content.
- Display conditions on PHP snippets: Woody ignored them, so they aren't brought across. The note says so.
Shortcodes
Woody's shortcodes keep working after switching over, even with Woody deleted: [wbcr_php_snippet id="…"], [wbcr_snippet id="…"], [wbcr_html_snippet id="…"], [wbcr_text_snippet id="…"], [wbcr_css_snippet id="…"], [wbcr_js_snippet id="…"] and [wbcr_advert_snippet id="…"].
Switching over
Snipfire switches each snippet off in Woody, then switches the copy on and test-loads the site.
Something unclear or missing? Tell us