This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:

When cloning a site with ManageWP, you get a fatal error.

Fatal error: method_exists()

Solution:

As a temporary workaround edit the DB and in the wp_options table find an delete the option with the option_name

wpml_language_switcher

The user that opened this ticket says that for him deleting the option

wpml_language_switcher_template_objects

solves the issue. It might be that both of those options need to be deleted. After the deletion, WPML created the correct option.

This topic contains 15 replies, has 4 voices.

Last updated by Itamar 5 months ago.

Assigned support staff: Itamar.

Author Posts
December 24, 2018 at 8:41 am #3029941

Tiit Sau

I am using ManageWP for many years now & cloning several sites per week. Problems with cloning related to wpml started i guess 10 or 12 month ago. I met this issue probably 20-30 times and finaly decided to ask your help. Issue is described on attachment.
Clone stopped attempting to create .htaccess file:
E_ERROR: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition occurred in wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-templates.php on line 304.

December 25, 2018 at 4:09 pm #3032460

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi.

This issue has been already reported to us. It seems to happen only on certain servers as we could not replicate the issue on our servers. Here is the link to the other forum ticket where we handle this issue. https://wpml.org/forums/topic/wpml-preventing-backupbuddy-managewp-from-restoring-backups/
Can you please tell me on which server (hosting service) do you get this error?

Currently, our main suspicion is cache on the server.
Do you know if there any cache methods on your server and can you try to see if the issue persists when you clear or deactivate the server's cache?

Thanks,
Itamar.

December 27, 2018 at 6:29 pm #3038234

Tiit Sau

Yes, i found ZendOPCache on server, wich i can turn off.
But do not close this topic, because i got another error related to OnTheGo plugins. Look at picture added - comment this, if you have an idea why this happens.
Will do more tests.

December 27, 2018 at 7:13 pm #3038311

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi and thanks for the extra details.

I'm consulting our compatibility developer whether the issue might be with the ZendOPCache.
I'll wait to hear your test results.

Meanwhile could you please tell me if your site is on the Serverpilot WordPress hosting service?
hidden link

About the other error that you are getting. It looks like it is related to the Toolset Layout plugin by OnTheGoSystems (us). But I do not see that this plugin on the list of plugins that you are using in the debug information that you attached to this ticket.
Do you use the Layout plugin?

Furthermore, could you tell me please what is generating those error messages that you get?
I ask it because I've never seen such a format for error messages.
Both of the errors start with The process finished, but we got an error when we attempted to create the .htaccess file.

Could you tell me please who is 'WE'?
In other words, what is generating those errors?
Why is it attempting to create the .htacces file each time?
Did you try their suggestion to go to Settings -> General and save the changes?
If you do that does it make the error go away?
Did you try to contact THEM with details as it says at the bottom of the error message?

Thanks,
Itamar.

December 28, 2018 at 4:32 pm #3040838

Tiit Sau

> Could you tell me please who is 'WE'?

As topic name says, it's ManageWP interface. Script attempts to finish the cloning process writing over the .htaccess, but target site does no answer as WPML killed site already. In result same error message appears on target website front end and back end also, until Sitepress plugin manually removed.

> Meanwhile could you please tell me if your site is on the Serverpilot

No, most of my sites are running on Elkdata servers. They are mostly Estonian-oriented, but today i moved all test to Zone Media (www.zone.ee/en/). Professional people, no doubt.

> Did you try to contact THEM

Yes of course i did. Here you are the ManageWP support answer:
"Unfortunately, this is not something we can influence much, due to the way Sitepress serializes its data. During the cloning process we try a default way to deserialize it, but if its anything other than default way of serializing it, the function fails and you get the error you described."

Well, the situation is no any good.

I spend a lot of hours today testing all kind of WP and WPML combinations on and between different servers. Final result still same:
----------------------------------------------------------------------
Fatal error: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /.../www.flowene.com/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-templates.php on line 304
----------------------------------------------------------------------
WordPress 5.0.2 clean install
WPML Sitepress 4.1.3 (with full package and Sitepress only tested)
Zend OPCache off on servers
WPML Lang swicher template cache disabled

Just does not work.

Ok, it's not so hard for me to remove the Sitepress plugin, save again WP settings and put back all the WPML plugins, as suggested by ManageWP, but after this kind error there is no way to activate Sitepress plugin - every attempt will end with same error.

Looks like gnomes all hates me. What you suggest for next step?

December 31, 2018 at 10:17 pm #3046322

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks, Tiit for the detailed information that you have shared with me.

I'm sending it to our compatibility developer. When I have an answer from him, I'll reply here.

Thank you for your patience.
Itamar.

January 12, 2019 at 5:27 pm #3083548

Daniel

I'm having the same issue. Do you have a solution yet?

January 14, 2019 at 11:14 am #3087039

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, Daniel.

I'm sorry but we do not have a solution yet. We are still debugging the issue.
I'll keep updating here.

Thank you for your patience.
Itamar.

January 18, 2019 at 1:29 pm #3106063

Tiit Sau

Here is the difference of WMPL swicher template related entries in database after clone.

Source website table wp_options:

(476, 'wpml_language_switcher_template_objects', 'a:6:{s:20:"wpml-legacy-dropdown";O:16:"WPML_LS_Template":10:{s:26:"\0WPML_LS_Template\0template";

Target website table wp_options:

(263, 'wpml_language_switcher_template_objects', 'a:6:{s:20:"wpml-legacy-dropdown";O:22:"__PHP_Incomplete_Class":10:{s:26:"\0WPML_LS_Template\0template";

Deleting this entry from database fixes everything, as WPML generates correct one.
Hope this gets you closer to the issue.

Tiit

January 21, 2019 at 9:32 pm #3114162

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thank you, Tiit.

Our second tier supporter has recently found out the same. The issue is now escalated to our developers.

As a temporary workaround edit the DB and in the wp_options table find an delete the option with the option_name

wpml_language_switcher

I'll keep you updated here for any news about this issue.

Thanks,
Itamar.

March 12, 2019 at 3:24 pm #3324521

bartS-11

I reported this over a year ago. Currently not using WPML because of this issue. Very happy to see I am not the only one!

My many sites are hosted on Linode using ServerPilot to install WP stack and finally ManageWP for updates, clones, monitoring, etc.

I confirm that ManageWP site Clone only works if I deactivate WPML Multilingual CMS first.

Error:

Fatal error: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded before unserialize() gets called or provide an autoloader to load the class definition in /srv/users/coastsciencepro/apps/livecoastsciencepro/public/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-templates.php on line 304

March 12, 2019 at 3:59 pm #3325207

bartS-11

Just ran a test. Used Adminer to As a temporary workaround edit the DB and in the wp_options table find an delete the option wpml_language_switcher.

I did this on the source site.

Then wen to run the clone from ManageWP and just go this same error. Was the DB change supposed to be done to the target site?

The process finished, but we got an error when we attempted to create the .htaccess file: E_ERROR: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in /srv/users/coastsciencepro/apps/livecoastsciencepro/public/wp-content/plugins/sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-templates.php on line 304.
You can complete the process manually by going to the destination's WordPress admin dashboard, then to "Settings > General" and clicking "Save Changes".

May 13, 2019 at 12:03 pm #3797747

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi, @barts-11
From reading our internal documentation about this issue you suppose to delete it on the source file before the migration.

Regards,
Itamar.

May 13, 2019 at 12:57 pm #3798415

Tiit Sau

To @barts-11

By my experience, the database entry containing "__PHP_Incomplete_Class", should be deleted after clone on target site, if according error message appears on ManageWP. As WPML greates quickly new entry, deleting it on source does no help. I did it 50-60 times during a year.

Wish you luck,
Tiit

May 16, 2019 at 7:38 am #3822711

Tiit Sau

Have not seen this error last 3 month.
Nothing was solved intentionally, but issue is gone(maybe hiding somewhere).

Thank you for chatting!