WordPress.org

Ready to get started?Download WordPress

Forums

PHP Code Widget
PHP widget disappeared when creating local WordPress copy (3 posts)

  1. webmastert21
    Member
    Posted 2 years ago #

    Hello,

    I decided to create a local PC copy of a WordPress web site.
    The local copy is working fine. However, I realized that all PHP widgets disappeared on the local site. I was able to recreate them based on the code on the web site. However, do you see any reason for this behaviour?

    For your info, here is the high level procedure I used to create a local WordPress copy :

    • I installed XAMPP, copied my wordpress folder + index.php into xampp\htdocs directory.
    • I exported the wordpress web site database using phpMyAdmin and I replaced the web site URL by http://localhost in the exported database file.
    • Then I imported the database in my local MySQL and updated it (UPDATE wp_options SET option_value = "http://localhost" WHERE option_name = "home"; UPDATE wp_options SET option_value = "http://localhost/wordpress" WHERE option_name = "siteurl";)
    • Finally, I went to settings -> permaliens -> Save modifications without changing anything on the settings (not 100% of the wording as I am using a french wordpress installation).

    So, is there any specific steps I should consider in regards to PHP widget for creating such wordpress local copy?

    Thanks in advance for your support.

    Best regards

    P.S. Thanks for your extension

    http://wordpress.org/extend/plugins/php-code-widget/

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 2 years ago #

    Widgets and options don't get saved in export/import operations. This isn't specific to the PHP widget, no widget data is in an export.

    Edit: Nevermind, I see you did an SQL dump.

    I dunno, did your other widgets survive? There's nothing special about the PHP widget that would make it not survive a dump operation, but I know that there's more to it than just replacing the URL with "localhost" in such a move.

  3. webmastert21
    Member
    Posted 2 years ago #

    I am using another widget called "Random Text". This widget worked ok after the local copy. I did not have to modify anything for it.

    For the PHP widget, I had to put them back in the Global Margin & in the various columns for the bottom part of the page and I had to copy back the php code into the widgets. Here is the link to our site to make it more explicit : http://www.t21.ch

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic