0

I'm building a new plugin to import Pinterest Pins from a user into Wordpress. It will NOT work using the Pinterest API (which is too limited for what I want to do) and requires the user login and password (so it can retrieve the user's secret boards).

I would like to know what you think of my "workflow" here and if you have any suggestions about it.

  1. User's authentification / get raw boards data (request to Pinterest)

    1. Form where the plugin asks for the user's login and password
    2. Request to Pinterest : check if connection to Pinterest works
    3. Store user's login and password for further use (in table users_meta)
    4. Request to Pinterest : get boards data for this user and store it (one single meta, in users_meta, eg. pinterest_boards_raw)
  2. Boards settings

    1. Load boards data from WP (pinterest_boards_raw)
    2. Form with import settings related to each board (do include board, which WP category to use, ...)
    3. Store boards settings in WP (in users_meta, eg. pinterest_boards_settings)
    4. Remove pinterest_boards_raw (from step 1.4)
  3. Import pins raw data (request to Pinterest)

    • For each board (using pinterest_boards_settings from step 2.3);
      1. Request to Pinterest : get pins raw data for this board. Could be long as each request retrieves 25 pins. So if you have 5 boards with 200 pins each, it will need 40 requests to Pinterest.
      2. Store pins raw data for this board (one meta for each board, in users_meta, eg. pinterest_board_XXX_pins_raw)
  4. Create WP posts for pins

    • For each board [using "pinterest_board_XXX_pins_raw" from previous step];
      • For each pin;
        1. Request to web : grab pin image
        2. Format raw data
        3. Insert new post in WP
      • Remove "pinterest_board_XXX_pins_raw"

There it is :) Sould already looong to do :)

So here's my concern :

  1. I need to store Pinterest login and password.
    But this seems unsafe. What can I do ? I was thinking to use a transient to store it as transients so it is destroyed after 15 minutes.

  2. The script can be long to run (at step 3.1 when retrieving raw pins data - at step 4 when creating new posts), what could I do to make it work the best possible ?

I was maybe thinking using ajax at step 2 when setting up board.

  • There would be a "retrieve pins" button next to each board settings and the board pins would be collected individually there without leaving the step 2 page (so we get raw pins data by board instead of getting all pins),

  • In the same way, once the pins have been retrieved, there could be a "do import" button next the previous one, to create WP posts without leaving the step 2 page.

But the problem there is that it requires more user's actions (which could / should be avoided)

Any ideas ?

Thanks for having read !

1

Don't even start.

Ignoring official API is a no go, at best it will just creat headache for you and nasty surprise for the users when the plugin will fail when pinterest changes something and since it forces you to.....

store user and password in a very unsecure way. This might be ok if your pugin is aimed to be run only for admins of non network wordpress or the super admin of a network, but if you aim to let users with restricted access to use it as well, then they might just send their pinterested user and password directly to the admin of the site. No one with security awareness will be willing to use your plugin.

  • Ok, storing login & pass for administrator only is probably the best. But it does not change a lot since if someone want to stole passwords from user, they just have to hack WP or plugins and they will be able to do it (eg. do not md5 encrypt passwords when registering) About the API, yes I will start this, because their API is really too restrictive and I want to have a tool to backup my pins. There SHOULD be a way to export it from Pinterest, so.... :) Well, and what do you think about my "workflow" ? – gordie Apr 10 '15 at 13:47
  • you don't understand the risk. The risk is first from the administrator and then (lower probably) is from the hosting. This is why no one does it like that. – Mark Kaplun Apr 10 '15 at 16:34
  • And what do you think of storing it in a session or something like that ? (not in the db then) – gordie Apr 11 '15 at 9:12
  • Ok, I know this is risky but I made the plugin... For those of you that it interests, here it is : wordpress.org/plugins/pinterest-importer. And it works :) – gordie Oct 5 '15 at 9:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.