All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: Can't Enable Plug-in: Cannot redeclare format_filesize()  (Read 2591 times)

0 Members and 1 Guest are viewing this topic.

Offline war59312

  • Newbie
  • *
  • Posts: 13
    • View Profile
Hi,

I'm getting the following error when I attempt to enable WP-DownloadManager 1.30 with WP 2.5.1:

Quote
Plugin could not be activated because it triggered a fatal error.

Fatal error: Cannot redeclare format_filesize() in /wp-content/plugins/wp-downloadmanager/wp-downloadmanager.php on line 219


Any thoughts?

Thanks,

Will
God Bless America

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Can't Enable Plug-in: Cannot redeclare format_filesize()
« Reply #1 on: 09 May 2008, 04:41 »
Can you try to disable all plugins?

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline war59312

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Can't Enable Plug-in: Cannot redeclare format_filesize()
« Reply #2 on: 09 May 2008, 20:02 »
OK the problem happens when WP-ServerInfo is installed and active.

If you activate WP-ServerInfo first and then activate WP-DownloadManager you can reproduce the problem.

Oddly if you activate WP-DownloadManager first and then activate WP-ServerInfo there is no problem.
God Bless America

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: Can't Enable Plug-in: Cannot redeclare format_filesize()
« Reply #3 on: 10 May 2008, 04:22 »
Thanks, fixed it =D

Open up wp-downloadmanager.php,

Find:
Code: [Select]
function format_filesize($rawSize) {
if($rawSize / 1099511627776 > 1) {
return round($rawSize/1099511627776, 1).' '.__('TiB', 'wp-downloadmanager');
} elseif($rawSize / 1073741824 > 1) {
return round($rawSize/1073741824, 1).' '.__('GiB', 'wp-downloadmanager');
} elseif($rawSize / 1048576 > 1) {
return round($rawSize/1048576, 1).' '.__('MiB', 'wp-downloadmanager');
} elseif($rawSize / 1024 > 1) {
return round($rawSize/1024, 1).' '.__('KiB', 'wp-downloadmanager');
} elseif($rawSize > 1) {
return round($rawSize, 1).' '.__('bytes', 'wp-downloadmanager');
} else {
return __('unknown', 'wp-downloadmanager');
}
}
Replace:
Code: [Select]
if(!function_exists('format_filesize')) {
function format_filesize($rawSize) {
if($rawSize / 1099511627776 > 1) {
return round($rawSize/1099511627776, 1).' '.__('TiB', 'wp-downloadmanager');
} elseif($rawSize / 1073741824 > 1) {
return round($rawSize/1073741824, 1).' '.__('GiB', 'wp-downloadmanager');
} elseif($rawSize / 1048576 > 1) {
return round($rawSize/1048576, 1).' '.__('MiB', 'wp-downloadmanager');
} elseif($rawSize / 1024 > 1) {
return round($rawSize/1024, 1).' '.__('KiB', 'wp-downloadmanager');
} elseif($rawSize > 1) {
return round($rawSize, 1).' '.__('bytes', 'wp-downloadmanager');
} else {
return __('unknown', 'wp-downloadmanager');
}
}
}

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline war59312

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Can't Enable Plug-in: Cannot redeclare format_filesize()
« Reply #4 on: 11 May 2008, 02:43 »
Nice! :D

Thanks!
God Bless America