Title: erwinbr's Replies | WordPress.org

---

# erwinbr

  [  ](https://wordpress.org/support/users/erwinbr/)

 *   [Profile](https://wordpress.org/support/users/erwinbr/)
 *   [Topics Started](https://wordpress.org/support/users/erwinbr/topics/)
 *   [Replies Created](https://wordpress.org/support/users/erwinbr/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/erwinbr/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/erwinbr/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/erwinbr/engagements/)
 *   [Favorites](https://wordpress.org/support/users/erwinbr/favorites/)

 Search replies:

## Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PublishPress Permissions: Access Control, Content Permissions, User Access] Since your 3.8.7: fatal error in other plugin(s)](https://wordpress.org/support/topic/since-your-3-8-7-fatal-error-in-other-plugins/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/since-your-3-8-7-fatal-error-in-other-plugins/#post-16712760)
 * I updated your plugin and so far, no more problems. Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PublishPress Permissions: Access Control, Content Permissions, User Access] Since your 3.8.7: fatal error in other plugin(s)](https://wordpress.org/support/topic/since-your-3-8-7-fatal-error-in-other-plugins/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/since-your-3-8-7-fatal-error-in-other-plugins/#post-16625723)
 * Fine, that you are looking into this.
 * I forgot to mention that while looking into the problem, I also ran your code
   through the static checker of my IDE and found that the class Module in wp-content/
   plugins/press-permit-core/vendor/publishpress/wordpress-version-notices/src/Module/
   Footer/Module.php does not seem to implement the interface AdInterface as it 
   should. This will give a fatal error as well when loaded.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Social Media Share Buttons & Social Sharing Icons] PHP Warning: unserialize() expects parameter 1 to be string, array given](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/#post-14542156)
 * I updated your plugin and the notices are gone. Thanks a lot!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Social Media Share Buttons & Social Sharing Icons] PHP Warning: unserialize() expects parameter 1 to be string, array given](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/#post-14425646)
 * Thanks for your response,
 * I did some further digging and found that it only occurs if I use a persistent
   object cache (or more specifically, I am using Docket Cache as I am working on
   a site whose hoster does not offer memcached, apcu or Redis). Apparently, the
   values of the options as stored in the cache get unserialized while still being
   linked/referenced to the cache or are stored before being serialized or something
   like that.
 * However, it also looks like your plugin doubly serializes its options (in the
   plugin itself and in add/update_option()) which seems unnecessary as well. So
   I think that changing unserialize() to maybe_unserialize() solves the problem.(
   You could then even remove the calls to serialize() in your own code and not 
   have to write an db update function.)
 * I hope this helps,
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Social Media Share Buttons & Social Sharing Icons] PHP Warning: unserialize() expects parameter 1 to be string, array given](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/#post-14418935)
 * Oh, I now see that unserialize() returns false if the passed string cannot be
   unserialized (instead of just returning the value). This means that this is now
   a real error and no longer a warning: all option values are changed into false
   and thus settings being ignored with lots of
 * > Trying to access array offset on value of type bool
 * notices.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] On activation, db user name used to initialise db password](https://wordpress.org/support/topic/on-activation-db-user-name-used-to-initialise-db-password/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/on-activation-db-user-name-used-to-initialise-db-password/#post-14088712)
 * Thanks for correcting it. Marking as resolved.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] Error creating backup on Windows](https://wordpress.org/support/topic/error-creating-backup-on-windows/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/error-creating-backup-on-windows/#post-14088693)
 * This problem has now been solved in [https://github.com/splitbrain/php-archive](https://github.com/splitbrain/php-archive)
   and is part of the new release 1.2.1. I hope you can update your project soon
   to include that version.
 * Thanks for this plugin.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] Error 500 always when backup reaches the same file](https://wordpress.org/support/topic/error-500-always-when-backup-reaches-the-same-file/)
 *  [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/error-500-always-when-backup-reaches-the-same-file/#post-14084795)
 * Error is probably due to fopen() not working onfolders on Windows, I got the 
   same error on adding wp-admin (folder) to the archive: I logged an issue on https://
   github.com/splitbrain/php-archive.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] Error creating backup on Windows](https://wordpress.org/support/topic/error-creating-backup-on-windows/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/error-creating-backup-on-windows/#post-14084241)
 * I also reported this error at [https://github.com/splitbrain/php-archive](https://github.com/splitbrain/php-archive)
   where it should be solved. If they don’t, you could solve it at a higher level
   in your own code, but that’s not what we should do.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Smash Balloon Social Photo Feed – Easy Social Feeds Plugin] redirect change](https://wordpress.org/support/topic/redirect-change/)
 *  [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/redirect-change/#post-13021303)
 * I’m joining in on this issue as I do think there’s also a change you can make
   in your code. As the original post states there are 2 redirects:
    1. 301: from ..media?size=t to …media/?size=t
    2. 302: from …media/?size=t to [https://scontent-&#8230](https://scontent-&#8230);.
       cdninstagram.com/…
 * The latter, the 302, cannot be prevented, but the former, the 301 (permanently
   moved), can be prevented by changing the code to render URLs like …media/?size
   =t instead of …media?size=t. So I hope you will change this for the next version.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] Error “Could not open file for reading: […]\\public_html\\wp” (Windows)](https://wordpress.org/support/topic/error-could-not-open-file-for-reading-public_htmlwp-windows/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-could-not-open-file-for-reading-public_htmlwp-windows/#post-13003462)
 * Forget the above change, That didn’t do the whole trick. It turns out that folders
   do not have to be added to a tar archive anyway, you just add files with a relative
   path and on viewing it in a GUI or extracting it, those sub folders will be shown/
   created automatically.
 * Thus just add:
 *     ```
       if ($file['type'] !== 'dir) {
         ...
       }
       ```
   
 * around calls to addFile(), both in includes/class-xcloner-archive.php, method
   add_file_to_archive(); and in includes/class-xcloner-api.php, method download_restore_script()(
   the call within the foreach).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] Error “Could not open file for reading: […]\\public_html\\wp” (Windows)](https://wordpress.org/support/topic/error-could-not-open-file-for-reading-public_htmlwp-windows/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-could-not-open-file-for-reading-public_htmlwp-windows/#post-13002471)
 * I did a quick test by replacing the call to addfile() in wp-content/plugins/xcloner-
   backup-and-restore/includes/class-xcloner-archive.php, method add_file_to_archive()
   with this code:
 *     ```
       if ($bytes_wrote !== 0) {
         $this->backup_archive->addFile(
           $start_adapter->applyPathPrefix( $file_info['path'] ),
           $file_info['target_path']
         );
       } else {
         $this->backup_archive->addData(
           $file_info['target_path'],
           ''
         );
       }
       ```
   
 * And this works for me, and looks like a way to prevent some (unnecessary?) file
   IO for all folders and empty files in the backup.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Backup, Restore and Migrate your sites with XCloner] Error “Could not open file for reading: […]\\public_html\\wp” (Windows)](https://wordpress.org/support/topic/error-could-not-open-file-for-reading-public_htmlwp-windows/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-could-not-open-file-for-reading-public_htmlwp-windows/#post-13002275)
 * Thanks for your quick response.
 * – I tested fopen() with several folders around my drive and all fail with the
   same message.
    – If I adjust the backup to only include wp-content, it fails 
   on that, or, it fails on the first folder it tries to add. – If I adjust the 
   PHP version to 5.6.40, it also fails.
 * So, it almost seems like this plugin (and the tar archive library) will not work
   with Windows, but given its widespread use and lack of reports about that, this
   is also hard to believe. So perhaps the php builds I use are giving the problems???
   I use WampServer 3.2.2.2 X64 on Windows 10 X64 (build 18362)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Performance Pack] class.wppp_mo_dynamic.php:515 – substr() expects parameter 2 to be int, string g](https://wordpress.org/support/topic/class-wppp_mo_dynamic-php515-substr-expects-parameter-2-to-be-int-string-g/)
 *  Thread Starter [erwinbr](https://wordpress.org/support/users/erwinbr/)
 * (@erwinbr)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/class-wppp_mo_dynamic-php515-substr-expects-parameter-2-to-be-int-string-g/#post-12481337)
 * Thanks!

Viewing 14 replies - 1 through 14 (of 14 total)