Subfolders
Latest "WordPress" files
private » Programming Hacks Used In This Site

War And Precedence: Plugin positioning of unpositioned elements that aren’t yet positioned by later-loading stylesheets: A CSS Odyssey

So, I had a crazy problem. You'll notice that there's various draggable elements on this site... such as the "Kupietools" plugin tabs seen at left, the occasional "the site is being worked on right now" notices that pop up, etc. You can drag them around with your mouse.

This is done with a plugin (also available as a standalone javascript module, a few versions behind the plugin as I write this) that retrofits code onto various HTML elements by giving the plugin the classnames it needs to make interactive.

I was doing some optimization on the site loading to speed things up, such as getting WordPress to load a lot of CSS file late so as not to interfere with initial page load stats. (This is a whole art, beyond the scope of this article.)
Suddenly…

Workshop » Reference Section » Grimoires » IT » Platforms » Linux » Packages » rsync & rsnapshot

How to backup a WordPress site via SSH

To make a complete local backup of a remote WordPress install over SSH, you need to perform two distinct steps:

  1. Download the files (using rsync).
  2. Export and download the database (using mysqldump piped through ssh).

Here is the step-by-step guide.

Prerequisites
  • SSH Access: You need the username, host (IP or domain), and password (or SSH key) for the remote server.
  • WordPress Path: You need to know where WordPress is installed (e.g., /var/www/html or /home/user/public_html).
  • Database Credentials: You will need the database name, user, and password. (I will show you how to find these below).
Step 1: Find Database Credentials (Optional)

If you don't know your database login details, run this command to read them from your remote wp-config.php file: ssh user@remote-server.com "cat /path/to/wordpress/wp-config.php" | grep 'DB_'

Note the DB_NAME, DB_USER, and DB_PASSWORD for Step 2.

Step 2: Download the Database (SQL Dump)…
Workshop » Reference Section » Grimoires » IT » Platforms » Web » WordPress » Yoast

CURL and Browser get different page versions (301 redirects, content changed, etc. — due to Yoast url parameter stripping only for non-logged-in users)

I had a truly maddening problem where my /embed/ functionality was sometimes returning full pages to CURL commands and online services like redirect-checker.org, etc.

It turned out, it was Yoast's URL parameter stripping. I had failed to update Yoast's settings with some new parameters I was using, and what Yyoast never tells you is that when you're logged in, it lets everything work fine, and only strips parameters for non-logged in users. It just lets you proceed on your way thinking everything is working fine until you can't figure out why curl -I https://mysite.com/blah?param1¶m2 is getting a 301 redirect while https://mysite.com/blah?param1¶m2 is loading fine in your browser. This is especially fun on sites like mine where things like /embed/ and ?embed get written back and forth to each other internally.

I lost several hours to this.

Yoast's docs say there's a way of registering parameters but,…