Author Topic: I'm at my wits end and I don't what to do  (Read 3320 times)

Chunkford

  • Inner Core
  • Hero Member
  • *
  • Posts: 1057
    • View Profile
I'm at my wits end and I don't what to do
« on: April 13, 2014, 07:17:32 PM »
OK, ready..... go

I have a WP site that uses woo + subs

I noticed last week that data wasn't being saved when I updated a post.
OK, I've come across this before so I customised a php.ini file to increase the memory limit and the max input vars.
But this didn't fix the problem.
But what's really annoying me is I have a plugin - http://ignitewoo.com/woocommerce-extensions-plugins/woocommerce-subscriptions-sync/ - that syncs the paypal payment date using the number free trial days to a day I specify e.g. the 1st, and this isn't automatically updating meaning I have to manually change the no. free trail days.
I can't even deactivate it on a per product basis either in simple or variation mode.

So I start deactivating plugins, nothing. Still doesn't save.
I change the theme, nothing.
I re-install the core WP files, nothing.
I reinstall the plugin files, still nothing.
I've even restored the site and DB to a time when I knew it was working and even that doesn't work.

Anyway, I setup another WP site on another domain but on the same hosting, installed the same plugins, same theme and have copied most of the data over to mimic the problem site.
And guess what, it works.

I've contact the host and they say it must be the plugin, I've contacted the plugin devs and they say it must be the host.

I'm going round in circles and it's driving me nuts!
Anyone here fancy a challenge (will happily pay) or can give me pointers on what the hell is going on as I'm losing years off my life with this.
"If my answers frighten you then you should cease asking scary questions"

littleman

  • Administrator
  • Hero Member
  • *****
  • Posts: 6552
    • View Profile
Re: I'm at my wits end and I don't what to do
« Reply #1 on: April 13, 2014, 11:47:07 PM »
It sounds like you may have a file or database permission issue.  Check your chmod settings on the files at both the working and non-working accounts to see if they are matching up.  Also, make sure you have write access to your database -- make sure the user, password and database in the script matches the user in your control panel.

Chunkford

  • Inner Core
  • Hero Member
  • *
  • Posts: 1057
    • View Profile
Re: I'm at my wits end and I don't what to do
« Reply #2 on: April 14, 2014, 12:19:23 PM »
Thanks LM, but I have dug deeper, deeper than I ever have done and it seems to be a problem with using wordpress's get_post_meta()
When set to true it should return a string, but for some reason it's returning an array.
So any checks done on the variable associated with it fails because it's geared up for single values.

On other news, the site it was working on, now doesn't :(
"If my answers frighten you then you should cease asking scary questions"

ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9294
    • View Profile
Re: I'm at my wits end and I don't what to do
« Reply #3 on: April 14, 2014, 03:54:04 PM »
What's the actual code you're using to call get_post_meta() and assign the value? Any chance that the function is returning a string, but for some other reason you're assigning it as an array somehow?

Do you have a dev platform and an IDE that let's you set breakpoints and do a backtrace?

Were the working sites and the non-working sites running on the exact same data and do you still have the DB dump you used to clone the site? If so, can you dump the site now that it's not working and do a file compare on the two databases?
« Last Edit: April 14, 2014, 04:58:03 PM by ergophobe »

ergophobe

  • Inner Core
  • Hero Member
  • *
  • Posts: 9294
    • View Profile

Chunkford

  • Inner Core
  • Hero Member
  • *
  • Posts: 1057
    • View Profile
Re: I'm at my wits end and I don't what to do
« Reply #5 on: April 14, 2014, 05:12:38 PM »
I went even further and found out it was a serialization issue, if that's the correct term to use
Where before it was storing it as just 'yes', it's now storing this - http://screencast.com/t/F4izx73WgNK

For some reason, $_POST is grabbing the data submitted and putting it in an array to be saved in the database.
I have not idea why it was a string before and now an array, but I'm hoping the plugin dev's can sort it.
If not BoL has kindly shown me I can use array_pop with a is_array statement. Just means I need to go through the code and work out where to put it.
Luckily it's only one php file I need to sort.
« Last Edit: April 14, 2014, 05:14:57 PM by Chunkford »
"If my answers frighten you then you should cease asking scary questions"