Background of the issue:
I was trying to use the WPML Multilingual CMS plugin on my WordPress site. The error is related to the ItemWordCountService.php file.
Symptoms:
I encountered a sporadic error with the WPML Multilingual CMS plugin. The error message is: 'Uncaught TypeError: WPMLCoreComponentPostApplicationWordCountItemWordCountService::__construct(): Argument #3 ($stringCalculator) must be of type WPMLCoreComponentPostDomainWordCountItemContentCalculatorStringCalculator, WPMLCoreComponentPostDomainWordCountItemContentCalculatorStringCalculator given in D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorwpmlwpmlsrcCoreComponentPostApplicationWordCountItemWordCountService.php:22'.
Questions:
Can you check WPML Multilingual CMS error below?!
Now after change PHP version in hosting control panel the error has disappeared, but error occurs sporadically.
-----Izvorna poruka-----
Pošiljatelj: kontakt@malomore.com [mailto:kontakt@malomore.com]
Poslano: srijeda, 7. svibnja 2025. 20:57
Primatelj: info@mariva.net
Predmet: [Malo More - Resort] Your Site is Experiencing a Technical Issue
Howdy!
WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, WPML Multilingual CMS.
First, visit your website (hidden link) and check for any visible issues. Next, visit the page where the error was caught (hidden link) and check for any visible issues.
Please contact your host for assistance with investigating this issue further.
To keep your site safe, this link will expire in 1 day. Don't worry about that, though: a new link will be emailed to you if the error occurs again after it expires.
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.8.1
Active theme: w4w (version 1.0.0)
Current plugin: WPML Multilingual CMS (version 4.7.4)
PHP version 8.3.15
Error Details
=============
An error of type E_ERROR was caused in line 22 of the file D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorwpmlwpmlsrcCoreComponentPostApplicationWordCountItemWordCountService.php. Error message: Uncaught TypeError: WPMLCoreComponentPostApplicationWordCountItemWordCountService::__construct(): Argument #3 ($stringCalculator) must be of type WPMLCoreComponentPostDomainWordCountItemContentCalculatorStringCalculator, WPMLCoreComponentPostDomainWordCountItemContentCalculatorStringCalculator given in D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorwpmlwpmlsrcCoreComponentPostApplicationWordCountItemWordCountService.php:22
Stack trace:
#0 [internal function]: WPMLCoreComponentPostApplicationWordCountItemWordCountService->__construct()
#1 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorrdlowreyaurynlibInjector.php(415): ReflectionClass->newInstanceArgs()
#2 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorrdlowreyaurynlibInjector.php(373): AurynInjector->provisionInstance()
#3 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorrdlowreyaurynlibInjector.php(542): AurynInjector->make()
#4 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorrdlowreyaurynlibInjector.php(474): AurynInjector->buildArgFromTypeHint()
#5 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorrdlowreyaurynlibInjector.php(414): AurynInjector->provisionFuncArgs()
#6 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorrdlowreyaurynlibInjector.php(373): AurynInjector->provisionInstance()
#7 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorwpmlwpmlsrcInfrastructureDic.php(41): AurynInjector->make()
#8 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorwpmlwpmlsrcUserInterfaceWebInfrastructureWordPressCompositionRootConfigEventItemWordCountEvents.php(126): WPMLInfrastructureDic->make()
#9 D:Domainsmalomore.comwwwrootwp-contentpluginssitepress-multilingual-cmsvendorwpmlwpmlsrcUserInterfaceWebInfrastructureWordPressCompositionRootConfigEventItemWordCountEvents.php(88): WPMLUserInterfaceWebInfrastructureWordPressCompositionRootConfigEventItemWordCountEvents->getOnPostSavedListener()
#10 D:Domainsmalomore.comwwwrootwp-includesclass-wp-hook.php(326): WPMLUserInterfaceWebInfrastructureWordPressCompositionRootConfigEventItemWordCountEvents->WPMLUserInterfaceWebInfrastructureWordPressCompositionRootConfigEventItemWordCount{closure}()
#11 D:Domainsmalomore.comwwwrootwp-includesclass-wp-hook.php(348): WP_Hook->apply_filters()
#12 D:Domainsmalomore.comwwwrootwp-includesplugin.php(517): WP_Hook->do_action()
#13 D:Domainsmalomore.comwwwrootwp-includespost.php(5110): do_action()
#14 D:Domainsmalomore.comwwwrootwp-adminincludespost.php(765): wp_insert_post()
#15 D:Domainsmalomore.comwwwrootwp-adminincludesdashboard.php(556): get_default_post_to_edit()
#16 D:Domainsmalomore.comwwwrootwp-adminincludestemplate.php(1456): wp_dashboard_quick_press()
#17 D:Domainsmalomore.comwwwrootwp-adminincludesdashboard.php(274): do_meta_boxes()
#18 D:Domainsmalomore.comwwwrootwp-adminindex.php(204): wp_dashboard()
#19 {main}
thrown
I would like to look at this directly on your site. For this I would need temporary access (WP-Admin and FTP) to your site, preferably to a test/staging site where the problem has been replicated if possible.
The required fields can be found below the comments section. The information you enter is private, i.e. only you and I can see it and have access to it.
I may need to replicate your website locally. To do this, I need to temporarily install a plugin called "Duplicator" or "All in One WP Migration" on your website. This will allow me to create a copy of your website and content. Once the issue is resolved, I will delete the local website. Let me know if this works for you.
IMPORTANT
Please make a backup copy of the site files and database before giving us access.
- If you do not see the wp-admin/FTP fields, this means your post and site login details are being made PUBLIC. DO NOT post your website details if you do not see the required wp-admin/FTP fields. If you do not, ask me to enable the private box. The private box looks like this:
hidden link
The topic ‘[Closed] WPML Multilingual CMS error in ItemWordCountService.php’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.