npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nodebb-plugin-import-wordpress

v0.1.9

Published

Export your Wordpress sites posts and comments into NodeBB

Downloads

7

Readme

nodebb-plugin-import-wordpress

a Wordpress 4.0 forum exporter to be required by nodebb-plugin-import.

What is this?

It's just an exporter of Wordpress 4.0, that provides an API that nodebb-plugin-import can use to exporter source forum data and import it to NodeBB's database. So, it's not really a conventional nodebb-plugin.

Why is it even a NodeBB plugin?

it doesn't really need to be, nor that you can use it within NodeBB it self, but, having this as a plugin have few benefits:

  • a nodebb- namespace, since you can't really use it for anything else
  • it can easily require NodeBB useful tools, currently

BBPress

(tested against 2.5.4) in order to migrate your BBPress forum instead of the core WP stuff, just enter the following in the "Exporter specific configs"

{"bbpress": true}

img

[gallery] Shortcode note

Since wordpress uses a [gallery] shortcode, this exporter, by default, will automatically replace the shortcodes with HTML

For example, this

[gallery type="rectangular" ids="123,987,002" order="rand"]

will become

<div class="imported-wp-gallery" data-content-index="123"
         data-imported-wp-gallery-type="rectangular"
         data-imported-wp-gallery-order="rand"
         data-imported-wp-gallery-ids="123,987,002"
>
    <img class="imported-wp-gallery-img" data-id="123" src="http://real.image.url.com/path/to/image/123.jpg" />
    <img class="imported-wp-gallery-img" data-id="987" src="http://real.image.url.com/path/to/image/987.jpg" />
    <img class="imported-wp-gallery-img" data-id="002" src="http://real.image.url.com/path/to/image/002.jpg" />
</div>

However, if you are converting HTML to Markdown via the Importer plugun and you're using Markdown plugin which strips all HTML classes and data-attribute, you won't see the the custom classes and stuff.

if you dont like this solution, then you could

  • Don't convert content from HTML to Markdown after the Import
  • Disable the HTML sanitization from the Markdown plugin options
  • Install this plugin, to stay safe https://github.com/akhoury/nodebb-plugin-sanitizehtml
  • Allow the class attribute on DIVs and on IMG tags in the Sanitize-HTML plugin options

Then you can write whatever client-side JS to handle your gallery images however you want.

Don't want [gallery] to HTML?

if you want to keep the [gallery] shortcodes in the original post content, but replace the old ids ids="123,456,789" to urls, i.e.:

[gallery type="rectangular" ids="http://real.image.url.com/path/to/image/123.jpg,http://real.image.url.com/path/to/image/987.jpg,http://real.image.url.com/path/to/image/002.jpg" order="rand"]

To do that, you can pass custom JSON value to the importer, in the Exporter specific configs (JSON) field

{"galleryShortcodes": "toURLs"}

Then, on the client side (or even server side using NodeBB filter hooks), you can use something like this WP utility wp.shortcode.js to parse the shortcodes, instead of writing your own regular expression.

Wordpress Versions tested on:

  • WP 4.0

Markdown note

read nodebb-plugin-import#markdown-note

It's an exporter, why does it have 'import' in its title

To keep the namespacing accurate, this exporter is designed to export data for nodebb-plugin-import only, also for a 1 time use.