Updating Wordpress via Installatron

Regarding problems encountered while using the website owner interface.
nickutis
Posts: 3
Joined: Mon Dec 29, 2008 9:10 am

Updating Wordpress via Installatron

Postby nickutis » Mon Dec 29, 2008 9:12 am

Hey guys.

I really love your software, but i have a problem..

When i try to update wordpress installations i have, everything goes ok EXCEPT all plugins get disabled. So i have to login to wp-admin and manually enable them. That would'nt be a problem if i had 1 or 2 wordpress blogs, but i have about hundred, and now i have to login to each one.. A really headache to do this :)

Do you have any solution for that?

Rowan
Staff
Posts: 235
Joined: Tue Jun 19, 2007 7:39 am

Re: Updating Wordpress via Installatron

Postby Rowan » Mon Dec 29, 2008 10:58 pm

Hi,

Wordpress's upgrade docs say you should disable all plugins when doing an upgrade, and then reactivate them one at a time to see if any break the new version of Wordpress. We can automate the disable bit, but not the reactivate-one-at-a-time bit.

But I can see how that could be a problem for you.

It will be possible to automate it, just so long as you're aware that it will probably break some installs, when an old plugin is enabled on a version of Wordpress that doesn't support it.

One method, if you know how to enable plugins with phpMyAdmin (I don't, I only know how to disable them that way) would be to use an installer customization like:

Code: Select all

<?php
class i_installer_customcode
{
   function init()
   {
$this->registerCustomCode("wordpress", "all", "upgrade", "last", "process", "wordpressupgrade");
   }
   function wordpressupgrade($o)
   {
$tables = $o->db_tables(); if (in_array($o->db_prefix."options",$tables)) {$o->db_query("UPDATE {$o->db_prefix}options SET option_value='...SOMETHINGHERE...' WHERE option_name='active_plugins' LIMIT 1;");}
   }
}
?>

Where ...SOMETHINGHERE... is the value needed to enable the plugins. You would need to experiment with some Wordpress plugins, turning them on and off, to see if there's a usable pattern to the value used there. Installatron sets it to a:0:{} to disable all the plugins.

And that customization would be run at the end of any upgrade.

Alternatively, I could tweak the upgrader to only disable the plugins if a certain file doesn't exist in the install location. You could create the file in any Wordpress install that you didn't want the plugins disabled on, or use a wordpressinstall($o) customization to have Installatron automatically create that file any time someone installs Wordpress on your system.

I can show you how to set up the latter one if you want to go that way, but if Wordpress needs the plugins to be disabled before running its core upgrade script, then this latter approach will screw up the upgrades. The first approach would be better if there's a way to make that work.

Rowan.

nickutis
Posts: 3
Joined: Mon Dec 29, 2008 9:10 am

Re: Updating Wordpress via Installatron

Postby nickutis » Tue Dec 30, 2008 1:02 am

Thanks for the answer, Rowan.

I would like to go with the second solution, cause to be honest im not very familiar with mysql and the syntax they have here.


I like your suggestion about the custom file in every wp installation, so installatron could upgrade without disable'ing plugins. On this dedicated machine im the only user, so there will be no additional problems about not compatible plugins or so.

I would really love to have additional option when installing WP (or upgrading), that i don't want to disable plugins at all.

Btw on the other server i have very same ammount of WP blogs, and there i use cpanel + fantastico, so seems they don't care about disabling plugins :)

Oh and one more thing, seems like you guys recently upgraded WP installations so they would make that unique string in the wp-config file.. Now i always receive error at the top, and the only way to get rid of that just delete those 4 unique codes from the wp-config. This is the error i get:

Code: Select all

Warning: Wrong parameter count for define() in /home/blabla/public_html/wp-config.php on line 47

Warning: Cannot modify header information - headers already sent by (output started at /home/blabla/public_html/wp-config.php:47) in /home/blabla/public_html/wp-admin/install.php on line 36


I wonder if it's problems with my php, or something wrong with the config file?

Thank you for the support!

Rowan
Staff
Posts: 235
Joined: Tue Jun 19, 2007 7:39 am

Re: Updating Wordpress via Installatron

Postby Rowan » Tue Dec 30, 2008 1:50 am

Re plugins:

I've just published a new version of the Wordpress installer that checks for a file named ".dont_disable_plugins" in the install directory before it disables the plugins. You can create that file in the install dir of any Wordpress you dont want plugins disabled on for future upgrades.

To have that file automatically created for new installs, you can paste this code into Customize installers code in Administration >> Settings >> General:

Code: Select all

<?php
class i_installer_customcode
{
   function init()
   {
$this->registerCustomCode("wordpress", "all", "install", "last", "process", "wordpressinstall");
   }
   function wordpressinstall($o)
   {
$o->write(".dont_disable_plugins", "please");
   }
}
?>

If you have some code already there, be sure to merge rather than replace.

Or if you want that file to be automatically created during any new install and and any future upgrade:

Code: Select all

<?php
class i_installer_customcode
{
   function init()
   {
$this->registerCustomCode("wordpress", "all", "install", "last", "process", "wordpressinstall");
$this->registerCustomCode("wordpress", "all", "upgrade", "last", "process", "wordpressupgrade");
   }
   function wordpressinstall($o)
   {
$o->write(".dont_disable_plugins", "please");
   }
   function wordpressupgrade($o)
   {
$o->write(".dont_disable_plugins", "please");
   }
}
?>


Re fantastico:

I guess they didn't notice when it was added to the upgrade docs.

Re the config codes:

It was fixed, rather than added, but yes it now fills those four keys correctly.

I couldn't reproduce the warning you get, but perhaps our PHP suppresses PHP warnings. Could you do a fresh install, and if you get the warning on it paste the entire contents of the wp-config.php into a reply here. I can't see any reason why it wouldn't work, but perhaps that will identify something.

Rowan.

nickutis
Posts: 3
Joined: Mon Dec 29, 2008 9:10 am

Re: Updating Wordpress via Installatron

Postby nickutis » Mon Jan 05, 2009 5:02 am

Thank you, i will try this and let you know how it goes.

One more question, maybe there is a way i could upgrade all installations with one click? Just check all scripts, click "upgrade", and they upgrade to the latest version, all at once?

Rowan
Staff
Posts: 235
Joined: Tue Jun 19, 2007 7:39 am

Re: Updating Wordpress via Installatron

Postby Rowan » Mon Jan 05, 2009 5:12 am

You can run the upgrades serially, by selecting multiple installs and then clicking upgrade. It'll just take you through them one by one, and Wordpress upgrading is pretty simple so that should work ok.

If you're the server administrator you can run the upgrades for multiple users from the Install Overview tab.

Rowan.


Return to “Website Owner Technical Discussion and Troubleshooting”

Who is online

Users browsing this forum: No registered users and 3 guests