WordPress.org

Ready to get started?Download WordPress

Forums

New URL Mover
functions.php problem (11 posts)

  1. Suranappar
    Member
    Posted 2 years ago #

    When I add this
    <?php define('ROOT_URL',get_option('ROOT_URL')); ?>
    to the functions.php, I get an error on line 325 (324) and pages don't load.

    http://wordpress.org/extend/plugins/new-url-mover/

  2. SAHIL
    Member
    Posted 2 years ago #

    Try this:

    <?php define('ROOT_URL',get_option('home')); ?>

    or

    <?php define('ROOT_URL',site_url()); ?>

  3. Suranappar
    Member
    Posted 2 years ago #

    <?php define('ROOT_URL',get_option('home')); ?>
    <?php
    /**
    * Main WordPress API

    Result

    Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 325

    ===

    <?php define('ROOT_URL',site_url()); ?>
    <?php
    /**
    * Main WordPress API

    Result

    Fatal error: Call to undefined function site_url() in /home/suranapp
    /public_html/site/wp-includes/functions.php on line 1

    ===

    <?php define('ROOT_URL',get_option('ROOT_URL')); ?>
    <?php
    /**
    * Main WordPress API

    Result

    Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 325

  4. Suranappar
    Member
    Posted 2 years ago #

    This is from a file called error.log

    [17-May-2011 08:13:07] PHP Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 324
    [17-May-2011 08:13:12] PHP Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 324
    [17-May-2011 08:14:15] PHP Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 324
    [17-May-2011 08:14:19] PHP Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 324
    [17-May-2011 13:58:09] PHP Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 325
    [17-May-2011 13:59:53] PHP Fatal error: Call to undefined function site_url() in /home/suranapp/public_html/site/wp-includes/functions.php on line 1
    [17-May-2011 14:02:05] PHP Fatal error: Call to undefined function apply_filters() in /home/suranapp/public_html/site/wp-includes/functions.php on line 325

  5. SAHIL
    Member
    Posted 2 years ago #

    does this plugin work without adding any line to functions.php ??

  6. Suranappar
    Member
    Posted 2 years ago #

    I do not know, without that line I do not get any errors. But I do not have any indication on what ever or not it works. Is there a simple way to check, part from moving the site?

  7. ThoughtLab
    Member
    Plugin Author

    Posted 2 years ago #

    This plugin will only set your 'home' and 'siteurl' values in your database if it discovers that your index.php file is in a different location from what they are currently set. So, if you move your WordPress site into a subfolder, all you have to do is navigate to the new location of your index.php, and it will automatically set those values.

    The ROOT_URL value is meant for the url of your main site, if your blog is somewhere else. At ThoughtLab, we develop blogs on a separate development server from the main site. During that time, we set the 'ROOT_URL' variable to the IP Address of the main site. This way, any changes to the css are only made once, and they automatically carry over to the blog. When the site is ready to go live, we move the site and the blog to a single live server, and we have to update the url in the database, and update the ROOT_URL variable to match. So, I created this plugin to take care of that process for us.

    This plugin doesn't use the 'apply_filters()' function of WordPress, so I'm not sure why you would get that error. You may want to try to define the global constant as something other than 'ROOT_URL.' try 'MAIN_SITE' or 'SITE_URL' or something equally descriptive.

  8. Suranappar
    Member
    Posted 2 years ago #

    Not sure I got this right but.

    Move http://suranappar.donk.in/site/
    to
    http://suranappar.donk.in/site2/
    then run index.php
    should be a working WordPress site and not just a text version?

    In that case it do not work.
    All links in the new one goes to old location.

    Changed back to site again and it works, so I take it database did not get tuched at all.

    Are there any known crashes or error due to other plug-ins?
    I use WordPress.org Stats thinga, can that one affect any?

    And yah, I am about to move later on. I been moving a lot from free hosting to free hosting, and had to update the database with a text replacer for smoothies move. But sometimes it left old paths in database wich whould casue problems. I am soon to move to a pai hosting, thought this one could help me out and save some time.

  9. Suranappar
    Member
    Posted 2 years ago #

    This is my pressent plug-in list.

    Active onces:
    Akismet
    Akismet Credit Inserter
    ContentShare
    Fast Secure Contact Form
    GTranslate
    New URL Mover
    WangGuard
    WordPress.com Stats

    InActive onces:
    Akismet htaccess writer
    W3 Total Cache
    WordPress Importer

  10. Suranappar
    Member
    Posted 2 years ago #

    ** Can be removed **

  11. ThoughtLab
    Member
    Plugin Author

    Posted 2 years ago #

    anywhere in your theme that bloginfo('url') is used, should echo out the new url. If you moved your site from example.net to example.net/blog then you would navigate to example.net/blog to update your database. You may also need to open up the permalinks option page in your admin, and save the settings again, since the permalinks aren't updated until you either save a post (which updates only that post) or save the permalink settings (which will update them all). Doing so should update all your permalinks to the new url.

    We will look into automating this process.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic