Warning: file_get_contents(/home/u365-xgnvix6kximm/www/nukedbit.io/public_html/wp-content/plugins/jetpack/_inc/blocks/images/tiled-gallery_example-4-2c82eb59aaea53932f5e718e17284db71.jpg): failed to open stream: No such file or directory in /home/customer/www/nukedbit.io/public_html/wp-includes/init.php(265) : runtime-created function on line 1

Warning: gzinflate(): data error in /home/customer/www/nukedbit.io/public_html/wp-includes/init.php(265) : runtime-created function on line 1
WordPress CORS Error Trying to load assets from old domain after migration. – NukedBit

WordPress CORS Error Trying to load assets from old domain after migration.

WordPress

I did a lot of WordPress development and optimizations. So for my testing and development I’m using my local development environment built with WSL with nginx, php and mariadb.

As you already knew we need to run a few fixes on the db to get wordpress loading from our local domain. For my migrations i use the wonderful WP Migrate DB Pro (you can also do it by yourself as written here), but while it fixed almost everything for me one damn thing was left unchanged. Basically, my theme was still trying to load fonts and images from the production server and so failing because of CORS an Access Control Allow Origin error.

After a few text search in my db I discovered that inside the table wp_options a wp_less_cached_files record with the cached less file!!

So the fix was very simple and quick by just issuing the following delete statement.

DELETE FROM wp_options WHERE option_name='wp_less_cached_files'

And voila! If you reload your page it should now be loading your resources from your local setup.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Sebastian Faltoni

Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT and now Blazor