WordPress on Glitch, Improved

(I kind of stole the idea from @javaarchive, but I improved on it a little bit.)

Wordpress on Glitch


Yes, it is WordPress on Glitch!

What is it built on?

How do I set up the project?

  1. Remix the project here.
  2. Visit the app, if it says “Error establishing a database connection”, skip to step 4.
  3. If it does not say “Error establishing a database connection”, type and paste the following commands.
mysql -u root
DROP DATABASE wp; DROP USER 'wp'@'localhost';EXIT;
What is that command?

Let’s break at down:
mysql -u root logs into to mysql as the root user
DROP DATABASE wp; drops the wp database
DROP USER 'wp'@'localhost'; drops the wp user
EXIT; exits the mysql session

  1. Open the terminal, and launch mySQL using mysql -u root
  2. Type in the following command:
CREATE USER 'wp'@'localhost' IDENTIFIED BY 'wp';CREATE DATABASE wp; GRANT ALL PRIVILEGES ON wp. * TO 'wp'@'localhost';FLUSH PRIVILEGES; EXIT;
What is that command?

Here, let’s break it down.
CREATE USER 'wp'@'localhost' IDENTIFIED BY 'wp'; Creates a user with the username “wp” and the password “wp”
CREATE DATABASE wp; Creates a dataabse with the name “wp”
GRANT ALL PRIVILEGES ON wp. * TO 'wp'@'localhost'; Gives the user “wp” Read/Write access to the database “wp”
FLUSH PRIVILEGES; Reloads the table to make sure the user “wp” can use the database.
EXIT; Exits the MySQL Monitor.

  1. Run the command chmod 777 /app/ to make sure wordpress can set thing up correctly.
  2. Choose a language. Then click “Next”. When It ask you for database details, Enter this infomation:
Database Name: wp
Username: wp
Password: wp
Database Host: localhost

Click next, then finish the on-screen prompts.

Tips:

  • Never go into the editor again after if you don’t have a Higher-end PC. It could crash your browser
  • You should only click the “Next” button(s) once. Do not click it more than one time.
  • Private your project after setting it up so no database info is leaked.
  • WordPress’s CSS hates HTTPS, so, try to serve WordPress over HTTP.
  • Oh oh! All of my blog post are gone! If you remixed the project after the 3rd of September (3:54 PM Eastern), Do this:
  1. Login into mySQL (mysql -u root)
  2. Run this command:
DROP DB wp; SOURCE /tmp/backup.sql; GRANT ALL PRIVILEGES ON wp. * TO 'wp'@'localhost'; FLUSH PRIVILEGES; EXIT;
  • Moving your blog away from Glitch? We will be sad to see you go, but run refresh to get a new backup. Then grab your backup from /tmp/backup.sql.
6 Likes

Yeah gltich needs to optimize it’s file tree viewing method. It should only fetch the information about the visible directories not all the directories

1 Like

Yeah. It just makes lower-end computers lag.

it could be worse if collapse wasn’t added. It might work better if they used react’s virtual dom for performance

1 Like

what do you mean by “error establishing a database connection”

When you remix the project visit the app, it should say that.

it doesn’t

same with javaarchive’s old one

Let me make a small edit.

1 Like

it loops on starting up so I guess you made a little typo in the code or something like that

Let me reinstall wordpress.

1 Like

Instead of throwing out a bug, your swatting one. That’s ten times harder.

1 Like

Your better off deleting most of the text for now instead of adding something bc people just copy and paste away!

You can use the terminal and vim/nano/vi/any other editor

1 Like

That’s what I did to fix it.

whenever the project goes to sleep I have to set it back up! how do i fix this

You might have to use a free mySQL host, like this one (for now until I can get a PHP script made). The demo works fine for me.

I believe data was stored in.data or some other . directory which shouldn’t be deleted

@code-alt
Modify your glitch.json file to look like this:

{
  "install": "echo 'No install needed'",
  "start": "mysqldump -u root wp > /tmp/backup.sql && bash lamp-start.sh"
}
1 Like

I’m making a setup script which allows you to remix lamp-poc.
I tried and the way I tried won’t work.

1 Like

Wasn’t expecting this to work but it did :tada:

1 Like