Support » Plugins and Hacks » BackUpWordPress » [Plugin: BackUpWordPress] 1.6.1 issues with ABSPATH to site root

[Plugin: BackUpWordPress] 1.6.1 issues with ABSPATH to site root

  • Hi there,

    I just updated my BackupWordPress from release 1.5 to the new 1.6.1 today.
    But now, the backup fails.
    In fact, I got a ‘strpos’ error message (in backupwordpress/plugin.php – line 112) on all pages (backend and frontend) of the wordpress site.
    Just sneaking around inside the faulty file, I found an explanation to all that mess: my backups path is the default one, and the wordpress path is on the site root. I clarify:
    – the wordpress site is something like http://my.beautiful.wp/ (so ABSPATH = ‘//’)
    – the backup folder is ‘/wp-content/backups/’ (relative to site tree)
    Thus, the ‘strpos’ function does not seem to appreciate when the second argument is empty; which is the case here with “hmbkp_conform_dir( ABSPATH )” providing an empty string…
    I tried to fix adding a test on the emptiness of the conform ABSPATH. I did not get anymore the strpos error message, but the backup is still impossible because of another issue with the class file hm_backup.php.

    I finally gave up at that point, and I reloaded the old 1.5 version that works fine for me…
    It’s a pretty good plugin I used for months without any problem. Thanks for it.
    It’s a pity the new release is not working as fine.



Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Tom Willmot


    Hi Coustini,

    Thanks for digging further into the issue, 1.6.2 should make your backups work again as it doesn’t fail backups for php warnings.

    I’ve created a ticket for your issue on github, I’ll fix in the next release.


    Great news.
    Many thanks for your job, Tom.

    Sorry! I change back to unresolved, as the problem I described is not fix with release 1.6.2 yet

    I resend a new post her:

    Plugin Author Tom Willmot


    This should be fixed in 1.6.3

    Hi Tom,

    Thank you for all your job.
    I installed the new release (1.6.3).

    Well, I have no more the error message with strpos on the plugin.php file: you fixed it!
    Unfortunately, I still get some PHP messages (warning) when calculating the size of the site:
    Warning: strpos() [function.strpos]: Empty delimiter in /wp-content/plugins/backupwordpress/hm-backup/hm-backup.php on line 782

    Warning: readdir(): supplied argument is not a valid Directory resource in /wp-content/plugins/backupwordpress/hm-backup/hm-backup.php on line 640
    And the result of the size is 1Mb, while I should get 35 Mb…

    Furthermore, the backup is not complete, as it contains only the mysqldump, and the received email has no attached file!

    Last point, there’s a file .backup_warnings within the backup directory, containing the following information:
    {"php":{"47f945bb3f18d38bb367f4c385fbe4f9":[2,"strpos() [<a href='function.strpos'>function.strpos<\/a>]: Empty delimiter","\/wp-content\/plugins\/backupwordpress\/hm-backup\/hm-backup.php",782],"394e917f225e0fb080d5252d7d295305":[2,"readdir(): supplied argument is not a valid Directory resource","\/wp-content\/plugins\/backupwordpress\/hm-backup\/hm-backup.php",640]}}
    I used to see the backup errors within the “Manage backups” page; so I am surprised that the above info are not displayed.

    Still some job to do. Really sorry, but you do it well. The plugin is very useful.


    Huh! By the way, the “Settings” button in the “Manage Backups” page does no more move to the setting part (this behaves since the release 1.6)

    Plugin Author Tom Willmot


    Thanks for reporting all this, I’ll look into it for the next release

    Hey, I’m not sure if my issue relates to the above, but it does relate to the title of this thread.

    The problem I’m having is that while ABSPATH correctly points to WordPress, which I have at “public_html/wp”, the actual content of my site is not in there. It’s beside the wp folder at “public_html/wp-content”. This is so I can easily upgrade WordPress via Subversion without it messing with my content.

    So I obviously want to backup my content. On line 157 of hm-backup.php, I see $this->root = $this->conform_dir( ABSPATH );
    That only works when the site’s content is in the same folder as WordPress. I changed that line and it correctly backed up my content.

    Am I missing something here? Is there a way I can fix this without tweaking the plugin?

    Plugin Author Tom Willmot


    Hi David,

    That is indeed a problem with the plugin in it’s current form, I’ll make that overridable in the next release.

    Tom, thanks for trying to fix it.

    There are still some issues though. The problem isn’t that my ABSPATH is at ‘/’; it’s that my ABSPATH is different from my content path. In fact ABSPATH for me is what it always is: the path to WordPress. But my content sits outside of that. For me, ABSPATH = “/wp/”, and WP_CONTENT_DIR = “/wp-content/”. To backup everything I have, I’d need to backup from the document root, not ABSPATH. For me personally though, I only care about backing up from WP_CONTENT_DIR, since WordPress is already backed up through the repo.

    Here’s what I see: when I activate the plugin it lets me backup like normal, which backs up /wp/. When I go download the zip, it has a problem with the url. It tries to download it from “www.my-site.com-content/backups…”. Obviously that throws an error, so when I manually insert in the missing “/wp”, it works. I make a change on line 157 (mentioned up above) and it backs up everything like I want it to. I exclude some paths (like “/wp-content/uploads/2010”), and it always throws a warning error, since it’s not in /wp/.

    Hope that helps you understand what’s going on, and I think this setup of mine is not unique, since I did it by following Otto’s tutorial. Thanks.

    Plugin Author Tom Willmot


    Hi David,

    I’ll add in the ability to define a custom backup root folder in the next release.

    Tom, thanks for adding the option of a custom root to the latest update. The plugin now works out-of-the-box for me, and I’m finally using the latest version! I did notice a few minor bugs. Please let me know if some of these should go in another thread.

    1. The download link to the zipped archive is going to “http://example.com-content/backups…” instead of “http://example.com/wp-content/backups…”

    2. I can exclude folders like “/uploads/” in the exclude section, which correctly excludes that folder from the backup. However, at the top of every admin page it shows a warning: “BackUpWordPress has detected a problem. You have defined a custom exclude list but the following paths don’t exist /plugins/, /uploads/”, etc.
    If I use “http://example.com/wp-content/uploads/”, then that doesn’t show a warning, but it also doesn’t actually exclude the uploads folder from the backup.
    An easy “fix” for now would be to limit the warning to only BackupWordpress admin pages. I would be fine with that, because I know that it’s a false warning. But when all my editors have to look at that on every admin page, it’s a bit annoying.

    3. In the exclude box, “, /plugins/, /uploads/” correctly excludes both of those directories, but “/plugins/, /uploads/” does not exclude the plugins directory.

    Hope that helps.

    Plugin Author Tom Willmot


    Thanks for your report David,

    The whole excludes section has been massively overhauled in BackUpWordPress 2.0 which I’m working on getting released as soon as possible.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: BackUpWordPress] 1.6.1 issues with ABSPATH to site root’ is closed to new replies.
Skip to toolbar