projectnami
projectnami copied to clipboard
Yoast SEO plugin v9.0.3 Causes Compilation failed Error
I updated my version of the Yoast SEO plugin to 9.0.3 and started getting the following errors at the top of my blog site at rehansaeed.com.
Warning: preg_replace(): Compilation failed: missing ) at offset 246 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 247 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 248 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 249 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 246 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 247 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 248 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
Warning: preg_replace(): Compilation failed: missing ) at offset 249 in D:\home\site\wwwroot\wp-includes\translations.php on line 1483
I've now uninstalled the plugin and even deleted it, then re-synced Project Nami from Azure deployments but the error remains. Any ideas on how I can fix this issue?
The new version of Yoast (9.x ?) has a few issues on NAMI.
https://github.com/ProjectNami/projectnami/issues/284 https://github.com/ProjectNami/projectnami/issues/169
The quick and simple fix with this one is to edit the fields_map.parsed_types.php file in the wp-includes/ folder and update the mappings to include a paren at the end.
One of them will look something like:
yoast_seo_links ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT,url varchar(255) NOT NULL,post_id bigint(20) unsigned NOT NULL,target_post_id bigint(20) unsigned NOT NULL,type VARCHAR(8) NOT NULL,PRIMARY KEY (id),KEY link_direction'
But should look like:
yoast_seo_links ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT,url varchar(255) NOT NULL,post_id bigint(20) unsigned NOT NULL,target_post_id bigint(20) unsigned NOT NULL,type VARCHAR(8) NOT NULL,PRIMARY KEY (id),KEY link_direction )'
Not sure why it is doing this, but each time you reinstall the plugin or disable/reenable it, it will mess up that file again. You'll have to touch it by hand each time. Additionally, we now have translation issues with Yoast I have yet to be able to track down.
This was happening to me as well. I have Yoast SEO v9.3 working with Project Nami v2.0.1.
The previous fix #169 did not fix the issue but I did keep it, just in case. What I did was this. Edit the translations.php
file located in wp-includes
and add these lines just after line 1482, which is foreach($operators as $oper => $val) {
.
//line 1483
if ($table === 'wp_search_terms ( id bigint(20) NOT NULL AUTO_INCREMENT, search_term varchar(256) NOT NULL, search_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY') $table .= ')';
//line 1485
if ($table === 'wp_yoast_seo_links ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT,url varchar(255) NOT NULL,post_id bigint(20) unsigned NOT NULL,target_post_id bigint(20) unsigned NOT NULL,type VARCHAR(8) NOT NULL,PRIMARY KEY (id),KEY link_direction') $table .= ')';
Do not change the spacing in the query or it will fail the if/then.
Reload the Projects page or the Pages page and no more error.
If there are further issues just dump out the SQL statement by putting an
//line 1487
echo $table;
before the $query
assignments so you can see the failing SQL statement. Hopefully it is something easy like a missing )
.
Hope this helps. Cheers
Is there a more permantent fix coming? I'd rather wait than hack around with PHP files.
I believe the permanent fix will be to finally end the association with the fields map. It's a holdover from the plugin which the translation engine was adapted from. I think it might be replaced by querying the table structure from the DB, but haven't had the time to pursue it yet.
Any plans to fix this?
Yes, except that it slipped my mind recently. Need to make time to work on it.
@patrickebates Any movement on this issue?
Plugin is still returning this error... Please help!
@patrickebates Any updates? Appreciate it may not be top of mind.
Has this issue been fixed?
There will be an announcement coming in a matter of days directly related to this issue. I'll do my best to remember to link to it from here once it's released.
Here's that announcement as promised https://projectnami.org/changes-coming-in-2020/