WordPress.org

Forums

WP eCommerce
[resolved] Fatal Error WPSC_Countries (83 posts)

  1. dan_1
    Member
    Posted 1 year ago #

    Thoughts on the below message? Happens only when WP ecommerce plugin is active. If I deactivate and delete the plugin, the error goes away. Thanks!

    Fatal error: WPSC_Countries::get_countries(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3nexnas05_data03/62/2100362/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 462

    Fatal error: WPSC_Countries::_dirty(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3nexnas05_data03/62/2100362/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 1142

    https://wordpress.org/plugins/wp-e-commerce/

  2. Jeff Pye Brook
    Member
    Posted 1 year ago #

    Hi dan_1,

    I would like to help figure out that issue. What are you doing when the error appears?

    Are you using any kind of object cache like APC or memcached? If so has it been cleared recently?

  3. dan_1
    Member
    Posted 1 year ago #

    Thanks Jeff. This is a brand new wordpress site. I have only applied a theme (Storefront Paper) and installed the wp-ecommerce plugin. I do not have any kind of object cache.

    It's a weird error. I get it every time I visit any page on the site, including the home page. The only exception is if I am logged into wp-admin. I can actually browse the site with no errors if I am logged in; however once I logout I receive the error again.

  4. WPforME
    Member
    Posted 10 months ago #

    I seem to be getting the same error ... any word on a fix?

  5. tesage
    Member
    Posted 5 months ago #

    I got same error this morning all the sudden.

    I logged in my WP dashboard then went to my site lightweightpurse dot com.
    See black WP tool ribbon on top next to the Edit page, see Flush Catch

    Clicked on Flush Catch

    Then my website is cleared the Error

  6. TCG89
    Member
    Posted 4 months ago #

    I am also getting the same error and clearing the cache doesn't seem to get the job done. any updates?

  7. ray-instinct
    Member
    Plugin Author

    Posted 4 months ago #

    Hi all,

    Speaking with my developer, he advised to clear up the transient cache to solve this issue. I did some googling and found a plugin that does that: https://wordpress.org/plugins/artiss-transient-cleaner/

    Perhaps can you give this a try?

    Thanks!

  8. squbrossi
    Member
    Posted 3 months ago #

    Hi all,

    I am also having this issue... I tried what ray-instinct suggested and installed the transient cache and have it running and am still having the same error codes come up..

    Fatal error: WPSC_Countries::get_countries(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3nexnas05_data03/62/2100362/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 462

    Fatal error: WPSC_Countries::_dirty(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3nexnas05_data03/62/2100362/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 1142

    Would really like some help to resolve this. The urlof the site is http://www.swgameproduction.com. normally gives the error when you try to initially visit the site right on the home page. Does not happen 100 percent of the time, but frequently enough that I have had issues... any help would be great. Thanks in advance

  9. Edward
    Member
    Plugin Author

    Posted 3 months ago #

    When I've had trouble with the countries list something I've found that can help is to hit the select NONE option in the store general settings tab save the settings then go back and select the regions you want to sell in and save these settings again.

  10. Edward
    Member
    Plugin Author

    Posted 3 months ago #

    Also the transient cleaner I prefer is Transient Cleaner https://wordpress.org/plugins/artiss-transient-cleaner/

    Install and then click Tools > Transients

    Run both options

    Clear Expired Transients

    Remove All Transients

    Click "Run Now" for both

  11. conniemk224
    Member
    Posted 3 months ago #

    I'm having the same problem and have tried all of the above, cleared all the cache's. Oddly, things look great on my laptop, but I'm getting the error on my phone and ipad.

    Any other suggestions?

  12. squbrossi
    Member
    Posted 1 month ago #

    still having this issue.... really need a solution. I cannot launch my website until this is fixed.... again this is the error code i get:

    Fatal error: WPSC_Countries::get_countries(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3pnexwpnas04_data01/25/2443025/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 462

    Fatal error: WPSC_Countries::_dirty(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3pnexwpnas04_data01/25/2443025/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 1142

  13. Jeff Pye Brook
    Member
    Posted 1 month ago #

    Just curious, have you done an upgrade recently?

    Confirm that all transients and cache have been deleted. The problem happens when a collection of the active countries / regions / currencies information specific for your store is stored or future use, but can't be retrieved and used.

    Have only seen the cached data get messed up on a failed/botched upgrade, or a manual install where the upgrade doesn't happen in the typical order.

    jeff

  14. paulhaberstroh
    Member
    Posted 1 month ago #

    I have tried all suggested fixes with no luck. The message is very intermittent. Usually will clear with a cache clear and refresh but not this time.

    Fatal error: WPSC_Countries::get_countries(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3nexnas06_data02/02/2145302/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 462

    Fatal error: WPSC_Countries::_dirty(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "WPSC_Data_Map" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /home/content/p3nexnas06_data02/02/2145302/html/wp-content/plugins/wp-e-commerce/wpsc-includes/wpsc-countries.class.php on line 1142

  15. Jeff Pye Brook
    Member
    Posted 1 month ago #

    paulhaberstroh,

    there is a potential patch for the issue you have reported. Because I haven't been able to reproduce it I can't say for sure if it will be effective.

    Is there any chance you can try it out on your site and let me know if the issue goes away?

    It only involves moving one line of code.

    in the file wpsc-core/wpsc-includes.php:
    Move the line that has:
    require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-data-map.class.php' );
    above the line that has:
    require_once( WPSC_FILE_PATH . '/wpsc-includes/wpsc-country.class.php' );

    Jeff

  16. paulhaberstroh
    Member
    Posted 1 month ago #

    Hi Jeff, Thanks for the suggestion, I will try it. In the meantime I did a 24 hour database backup which cleared it up. I will move the code to see if it is a permanent fix.

    Paul

  17. Jeff Pye Brook
    Member
    Posted 1 month ago #

    thanks paul.

    i am very sure that there is an issue in here somewhere, but without being able to reproduce it in my test environment we'll have to do some gentle live testing.

    For reference I have submitted the change I suggested above to the product code repository for community review

    https://github.com/wp-e-commerce/WP-e-Commerce/pull/1828

    jeff

  18. PlymouthCRAFT
    Member
    Posted 1 month ago #

    I am having exactly the same problem as Paul (and had it 2 months ago for a while). I have tried everything suggested above, plus some voodoo, and maybe have it under control, although I'm not sure exactly which thing may have cured it. But I would appreciate learning as much as possible as to how to keep from having this issue crop up again. Seems to come up out of the blue, and is a frustrating time-suck.

    Thanks for your helpful work.
    Paula

  19. PlymouthCRAFT
    Member
    Posted 1 month ago #

    Actually, no. It only seems to be fixed for a few minutes. I deactivated the WPeC plug-in and that allows the remainder of the site to be seen, at least. But it would be nice to sell some tickets…

  20. Jeff Pye Brook
    Member
    Posted 1 month ago #

    did you try the suggested code change?

  21. PlymouthCRAFT
    Member
    Posted 1 month ago #

    Yes, I did. (And, let me tell you that it took a little nerve because I am not that kind of person. Just a WP user who needs the darn thing to work, not someone who wants to look under the hood.)

    It was after I had tried the code change (and pretty much everything else in this thread) to no avail that I threw in the towel and pulled the plug on the plugin. But I still do need to get it to work, or our little non-profit is dead in the water.

    Thanks...

  22. timjea
    Member
    Posted 1 month ago #

    Just to acknowledge this little gremlin started to occur on my website intermittently today. Website has been in place for a few years now, why today? rjsbeefarm.com
    Clearing caches and all the normal high level non expert stuff had no effect. site loads fine one time, then 2 minutes later the nasty little fatal error messages. Not sure I am confident to attempt the code changes specified above.

  23. timjea
    Member
    Posted 1 month ago #

    Ok, I WAS able to find and make the code change above, the problem still exists, BUT with 2 browser windows open, one on the WordPress admin panel, and the other one the webpage, when I get the fatal error (roughly every 3rd try) I can hit F5 to refresh as many times as I want and always get the fatal error. BUT if I flip to the admin panel and flush the cache and flip back to the browser window on my website and hit f5, it loads every single time!. I've now replicated it nearly 20-25 times. Does this piece of information help anyone more knowledgeable?

  24. timjea
    Member
    Posted 1 month ago #

    I failed to say, that only fixes it for a few minutes. Chrome SEEMS to encounter the error less than IE, that may just be my perception.

  25. Justin Sainton
    Member
    Plugin Author

    Posted 1 month ago #

    @timjea and @PlymouthCRAFT,

    Would you mind emailing me privately so we could work with you, directly on your site, to see about getting this issue resolved? You can email me at justinsainton at gmail dot com. I'l loop Jeff into that as well, as he's primarily responsible for this bit of code.

    Thanks guys!

  26. Jeff Pye Brook
    Member
    Posted 1 month ago #

    justin, what we need to look for first is some bit of code, Either in WP-Commerce or somewhere else that is including the countries class php file directly, without including the classes it depends on.

    The error message is very descriptive in this regard, a class that was serialized is trying to be unserialized, before the class definition does this. I have not been able to find any way for this to happen inside of the product. And there isn't any other explanation for the issue. If we can have some access to a site that has the issue perhaps we can identify the cause.

    jeff

  27. Jeff Pye Brook
    Member
    Posted 1 month ago #

    timjea, in your test above what are you using the "flush the cache"

  28. Jeff Pye Brook
    Member
    Posted 1 month ago #

    @timjea

    Justin and I spent some hours on your site trying to find the cause of the issue. There are definitely some configuration issues with your site that you should think about addressing. But we haven't been able to understand if any of those issues are causing the fatal error you are seeing. There may be some correlation, but we can't say definitively either way.

    This morning an updated version of the free WP-eCommerce site checkup plugin was installed and activated. You can see the report that this plugin created from the tools menu or via this link:

    http://rjsbeefarm.com/wp-admin/tools.php?page=snappy_site#

    If you need help with any of the warnings or errors feel free to reach out.

    jeff

  29. Jeff Pye Brook
    Member
    Posted 1 month ago #

    @PlymouthCRAFT & @timjea are you both using GoDaddy shared hosting plans?

  30. squbrossi
    Member
    Posted 1 month ago #

    @Jeff Pye Brook,

    I am still have issues with this could really use the help... any chance you can connect into my backend and see what is going on? I can't really promote my business until I stop getting all these error messages... another issue I am having is that even though in the backend it says I have inventory of an item, on the front end it says sold out for one of my items... please help!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic