WordPress.org

Ready to get started?Download WordPress

Forums

Cloning a WordPress Plugin (5 posts)

  1. blabbr
    Member
    Posted 8 years ago #

    Hey everyone,

    I wonder if there's a more or less simple way to clone a WordPress plugin?

    Is there somewhere a tutorial, a hack or something similar?

    Or would that be too complicated?

    I'd need it for the WPG2-Plugin (Gallery v2.0 implementation for WordPress by Ozgreg, http://www.ozgreg.com). I'm running two galleries on my site and would like to implement both of them. What exactly would need to be changed?

    Thanks for any suggestions and for support!

    Regards, blabbr

  2. logista
    Member
    Posted 8 years ago #

    It's simple, really. Make a copy of the plugin, and edit its header information to a new name.

    Plugin Name: Hello Dolly to Plugin Name: My Hello Dolly

    You may have to change some plugin specific parameters (like if it uses a specific folder, you might need to change all of the references in the plugin to folder2 or some such).

    Upload it, and activate it.

  3. blabbr
    Member
    Posted 8 years ago #

    Hmm, I'm afraid, it's not that easy ... (or it is and I just can't do it)

    anyways: I made a copy of the WPG2-plugin folder. Then I tried activating the plugin in the admin panel, but then of course the expected php error came about: it couldn't redeclare a function previously defined by the original plugin.

    So - would I need to rename all the functions?
    And - what do you exactly mean by "edit its header information"? Where can this "header information" be found?

    Thanks anyway for your help.

  4. Cypher
    Member
    Posted 8 years ago #

    You will have to go through and change all the function declarations on the two instances to be entirely different.

    You might also have to rename global functions and so on. This, as you've already found out, can be quite extensive and error prone if the plugin is fairly complicated.

    Regards

  5. And if it saves any preferences or anything else to the database, you'll either have to change the name of the option valies or if it uses it's own database table, use a different name for that.

Topic Closed

This topic has been closed to new replies.

About this Topic