Support » Plugins » Cloning a WordPress Plugin

  • 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, 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    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.

    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.


    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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cloning a WordPress Plugin’ is closed to new replies.