WorPress Editor Won’t Load Content Anymore

Got this weird WordPress behaviour recently. While most pages load successfully, editing something – like a post or a page – will draw a blank browser tab. Zero content whatsoever. It has the same result for both Firefox and Chrome. Not tried on other browsers.

ANSWER

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'unsafe-inline'

This was the error that I got when I went into the page, opened developer tools, then reloaded the page.

Caused by additional custom Header policy on the web server of the website. Looks something like this:

Header set Content-Security-Policy "default-src 'unsafe-inline' 

Add ‘unsafe-eval’ to go around it. Use of eval() is usually considered bad practice and not secure hence it’s getting blocked until it is allowed by adding it into the policy. Now the Header will look like this after modifying it. Don’t forget to restart the web server.

Header set Content-Security-Policy "default-src 'unsafe-inline' 

More detailed explanations can be had here: https://scotthelme.co.uk/content-security-policy-an-introduction/

What is the purpose of running PHP-FPM in its own container instead in the same container as apache2/nginx?

I’m fairly new to Docker so excuse any obvious ignorance or misunderstandings. That said, I’ve been coding and configuring web applications for a long time now. I have recently been dabbling with some more sophisticated (Docker and “traditional”) web/application server setups and experimenting with performance enhancements and simplifying deployments.

My personal favorite configuration to use for most projects thus far is nginx as a (mostly) “static file” web server &&|| caching mechanism &&|| Load Balancer in a reverse proxy config with Apache v2.4+ as the “backend” which runs PHP (also Perl &&|| Python) in a “FastCGI” (PHP-FPM) configuration (with mod_php disabled) and mpm_events (instead of mpm_prefork). We can always add in something else also such as REDIS or memcached, where applicable (but I rarely see a significant performance gain when using Cloudflare caching).

I’ve been dabbling with a few different ways to keep my “favorite web server composition” flexible and “ephemeral” enough to accommodate any and all possible options for further performance gain or resource load management. What I keep seeing is that there seems to have been a shift towards using PHP-FPM in its own separate “stand-alone” Docker container sometimes around late 2019.

Why?

While I can appreciate keeping resources isolated and separate for an easier to debug/config/secure configuration(s), I don’t fully understand what the benefits are to having PHP-FPM in a separate Docker container that is implicitly REQUIRED by the application that the Docker containers are comprising.

If anything, having a separate PHP-FPM container seems like additional configuration, additional resource consumption and an even more complicated build/deploy consideration in a CI/CD pipeline.

I can even get onboard with “simple preference”, such as instead of using Apache2 and nginx on the same Ubuntu/Debian or RHEL/CentOS container, break off nginx into its own container(s) and simply config your hostname(s) &&|| IPs and ports appropriately.

But what is a practical use case and advantages for having PHP-FPM separated from Apache or nginx containers for any additional benefit beyond perhaps using more Dockerfile &&|| docker-compose.yaml and less ba.sh scripting to get the same job done? If any part of the application fails or falters, then functionality will suffer. The additional network &&|| docker-network communications and hostname resolutions seems like it would just be a performance penalty over combining certain aspects of the docker-composer-ed application together, rather than splitting them up simply for the sake of splitting them up.

Go to Source
Author: kanidrive

How to migrate data from custom site to WordPress?

Currently I have a site with around 6.000 articles running on a custom built cms platform, but due to demand from the client, we have been tasked to convert all data to WordPress. Everything is stored in MongoDB in a custom structure (nothing extraordinary) and I have been looking at how I could convert the data to match the XML structure of WordPress for easy import, though not sure if I have to build such conversion script myself, or if an open source data-pairing tool exists, where I can match a MongoDB query and its data to the designated fields in a WordPress DB.

The article contents have been structured using EditorJS which acts a lot in the same way as the Gutenberg editor in WordPress, though I would need to know, how I should convert the data to match the Gutenberg editor, or if I should simply render the data as HTML and save it as such in the XML for import?

Categories are stored in a separate collection with a parent -< child structure, and pages pretty much acts as normal html.

Q: How would one go about converting this to WordPress data?

Go to Source
Author: Dimser

ubuntu doesn’t work :UUID=xxxx does not exitst

My computer has two systems, Windows 10 and ubuntu18.04. Today, when I tried to get into Ubuntu(I already laid it aside for about one week ), the whole screen showed pure purple for at least 10 minutes, so I forced the computer to shut down.Then when I tried to get into Ubuntu again, it showed :
[enter image description here][1]
Then I tried to open ubuntu in recovery mode,but the outcome was same.And I also tried this solution:https://forums.linuxmint.com/viewtopic.php?t=47594,doesn’t work either.
At last I run fsck.ext4 -y /dev/sda1(where the root is),and showed:
[enter image description here][2]
Anyone know how to deal with is issue?Any help would be appreciated!
[1]: https://i.stack.imgur.com/n0nw2.png
[2]: https://i.stack.imgur.com/xEiga.png

Go to Source
Author: OilLight