This thread is resolved. Here is a description of the problem and solution.
Problem:
You are trying to access the URL and encounter an error message indicating that your site doesn't meet WPML's minimum requirements because the WordPress REST API must be enabled.
Solution:
We recommend modifying a specific section of the code in your WPML plugin files to resolve the issue. Here are the steps:
1. Navigate to the file
sitepress-multilingual-cms/vendor/wpml/wpml/src/Infrastructure/WordPress/SharedKernel/Server/Application/WordPressRestApiStatus.php
.
2. Locate the following section of code starting from line 70:
// Add basic authentication if present<br /> if ( isset( $_SERVER['PHP_AUTH_USER'] ) && isset( $_SERVER['PHP_AUTH_PW'] ) ) {<br /> $args['headers']['Authorization'] =<br /> 'Basic ' . base64_encode( $_SERVER['PHP_AUTH_USER'] . ':' . $_SERVER['PHP_AUTH_PW'] );<br /> }3. Immediately after this section, add the following lines:
// Add authentication from cookies<br /> $args['cookies'] = $_COOKIE;
This modification should help enable the WordPress REST API and meet the WPML's minimum requirements. If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins.
If you need further assistance, please open a new support ticket at WPML support forum.
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 topic contains 2 replies, has 0 voices.
Last updated by 2 months, 2 weeks ago.
Assisted by: Dražen.