versionpress / support

Unofficial support for VersionPress. Note that VersionPress is currently not being developed: https://github.com/versionpress/versionpress/issues/1481.
19 stars 7 forks source link

Clone warnings and Cloned site issues #93

Closed kliqks closed 7 years ago

kliqks commented 7 years ago

When I clone or Pull to the staging site, I get the warning below. As well, the clone sites home page is missing the top sticky post and the header and footer nav menus are showing different text/links. Site is populated with basic sample data- theme-unit-test-data.xml, and has all plugins, but VersionPress, disabled.

A clone or a Pull will produce the same warnings and a Pull does not correct the Sticky post or nav menus. Otherwise the site appears to be the same and working off the same child theme.

wp vp clone --name=xxxx_vpstaging --siteurl=http://vpstaging.XXX.com --dbname=xxxx --dbuser=xxxx --dbpass="xxx" --dbprefix=xxx X's are removed content, but I don't think its otherwise relevant since all the params work.

`Success: Site files cloned The Git repo of this site already defines remote 'papagrunt_vp_staging', overwrite it? [y/n] y Success: Updated remote configuration Success: Enabled pushing to the original repository Success: Enabled pushing to the clone Success: wp-config.php updated Success: Copied VersionPress Success: PHP 5.6+ Success: 'mbstring' extension Success: Execute external commands Success: Git 1.9+ installed Success: Write access on the filesystem Success: Access rules can be installed

Success: Database tables created Success: VersionPress tables created Success: Git merge driver added

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Database/ShortcodesReplacer.php on line 148

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Utils/WordPressMissingFunctions.php on line 24

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Database/ShortcodesReplacer.php on line 148

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Utils/WordPressMissingFunctions.php on line 24

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Database/ShortcodesReplacer.php on line 148

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Utils/WordPressMissingFunctions.php on line 24

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Database/ShortcodesReplacer.php on line 148

Warning: Invalid argument supplied for foreach() in .../wp-content/plugins/versionpress/src/Utils/WordPressMissingFunctions.php on line 24 Success: Database synchronized Success: All done. Clone created here:

Path: xxx/app/xxx_vp_staging URL: http://vpstaging.XXXL.com`

'wordpress-version' => '4.7.3', 'versionpress-version' => '4.0-alpha1', 'operating-system' => 'Linux xxxx.inmotionhosting.com 3.10.0-427.36.1.lve1.4.37.el7.x86_64 #1 SMP Sat Feb 4 07:05:07 EST 2017 x86_64', 'php-version' => '5.6.30', 'php-sapi' => 'cgi-fcgi', 'git-version' => '2.12',

Live Site http://prnt.sc/ev09fa

Clone Site http://prnt.sc/ev0a8c

borekb commented 7 years ago

Hi @kliqks, sorry for the trouble. Could try to work out what returns the shortcode_parse_atts function in ShortcodesReplacer.php#L146? Is it an array or something else? That's where the root cause probably is.

kliqks commented 7 years ago

Hi @borekb - thank you for the reply. You are talking a bit over my head here. I'm not exactly sure what you're asking or how to get it, but I'm a quick learner if you can point me in the right direction. I think you're asking me to see what values get returned here - $attributes = shortcode_parse_atts($m[3]); unfortunately, I'm not sure how to get those values as it runs on my hosts server. Can you give me details on how to get this?

borekb commented 7 years ago

It would be best if you could reproduce the problem on a test site. I'd suggest:

  1. Create a new, empty WordPress site.
  2. Run the clone there, see if it works.
  3. If it does, populate the site with the same data as your current site (theme-unit-test-data.xml).
  4. Do the clone again, see if there are any issues.
kliqks commented 7 years ago

I did as you suggested with the clean WP install and the clone went fine with no warnings or issues that I could see. (I did not do an theme-unit-test-data.xml import however. I suppose I should have to test because the shortcode posts come from this data.)

Shortcodes is the issue causing my warnings during the VersionPress clone and pull. I tried adding this command "git config --global core.autocrlf input” on the server, but it does not appear to help any. Deleting the posts that had the shortcodes from admin panel, cause the same Warnings/errors as cloning did. I deactivated VersionPress, trashed/then deleted trash of the shortcode posts.

Attempted to clone again and it worked with no warnings; however, I still now have issues with the missing sticky post being on the home page and the menus are still not right.

Any ideas on the shortcodes, sticky posts and menus? BTW, the theme I'm using is called Popper.

pavelevap commented 7 years ago

Hi @kliqks,

do you know which shortcodes caused the issue? If you have any example, we can test it to see if it is any general issue or only unsupported plugin material.

Sticky posts are not supported yet, see https://github.com/versionpress/versionpress/issues/1171 Can you please apply simple patch and let us know if it works well?

Also menus are currently broken :-( Can you please also apply another simple patch and let us know if it works well?

Thank you very much for your help!

borekb commented 7 years ago

I also think we might have a bug in shortcodes. If you can provide specific examples that would be great @kliqks. Thanks for your cooperation and sorry for the trouble.

kliqks commented 7 years ago

You could probably replicate it easily. The theme is Popper and the data is just the theme-unit-test-data.xml. I do have a child theme with some menu and other minor customizations that I was doing as a training exercise. I have the child theme zipped, just don't know where I could put it. It's only 63KB zip file. If you know of an easy place for me to upload it so you can grab it, let me know. Here is a dropbox link to the child theme zip

I think all that in a nutshell is all I have. The shortcode issues are within the unit test data posts (easy enough to find with a shortcode search). Sticky post is in there and the menus, well, not sure if that is a child theme or test data interaction problem with VersionPress.

I will see what I can do about testing the patches you suggested. Am I just supposed to copy and past the code I see in green into those files, over top and replacing the original line?

borekb commented 7 years ago

The split view might be more useful:

image

Also, I'm attaching the child theme ZIP here just to have it readily available. Thanks for it, we'll take a look.

popper-child.zip

kliqks commented 7 years ago

I made the patches as requested and they appear to have worked for sticky posts and menus, as well as some other sidebar formatting that I did not notice earlier. So we're good there. On my first pull, I had added a post on the live site and pulled to staging, I did receive the DB warning below, however, on subsequent pulls, so far I have not received the same error. Looks like all is good accept for shortcodes in posts.

I am going to run tests now on a copy of my actual company production site to see how it goes. So far, it was stuck in maintenance mode for a very long time when I just activated the plugin (second activation that is, after requirements screen), but it is a very large site, about 4GB when migrated and I am on a shared host, whereas the actual site is on a larger VPS. This site has a lot of shortcodes, so I'm not very optimistic for the clone. We'll see. Thanks for all the help so far!

[xxxx@xxxxx]$ wp vp pull Success: Maintenance mode turned on Success: Pulled changes from 'origin' Warning: Error while sending QUERY packet. PID=413168 in /xxx.../wp-includes/wp-db.php on line 1888 Success: Synchronized database Success: Maintenance mode turned off Success: All done**

pavelevap commented 7 years ago

I was able to reproduce issue with shortcodes, please see https://github.com/versionpress/versionpress/issues/1197. Thank you for your report!

Please note that VersionPress currently does not support many plugins, see docs. But it would be nice if you can let us know how it works with large site.

I am not sure about Error while sending QUERY packet warning. It can be caused by hosting limitation or something else. But if the error was related only to a small change (new post) and it is clean site without many plugins, it should work well. Any chance you can check Apache and PHP logs for related errors? Please let us know if you can reproduce it somehow.

pavelevap commented 7 years ago

I am closing this issue for now, please reopen if you have additional info or need further assistance.