RTCX https://www.rtcx.net Mon, 23 Apr 2018 09:06:46 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.5 https://www.rtcx.net/ifiles/cropped-pen-1-150x150.png RTCX https://www.rtcx.net 32 32 WordPress Static Site Generator, Part 6 – The Static Generator Script https://www.rtcx.net/wordpress-static-site-generator-6 Mon, 23 Apr 2018 07:39:30 +0000 https://www.rtcx.net/?p=4416 Although this is the last ingredient in the WordPress static site generator, there are still a few things you need to be aware of when you start using it. I won’t be leaving you in the lurch. I’ll explain everything after I explain this script (to the best of my abilities). The WordPress Static Site […]

The post WordPress Static Site Generator, Part 6 – The Static Generator Script appeared first on RTCX.

]]>
Although this is the last ingredient in the WordPress static site generator, there are still a few things you need to be aware of when you start using it.

I won’t be leaving you in the lurch. I’ll explain everything after I explain this script (to the best of my abilities).

The WordPress Static Site Generator Script

This is the entire script. I’ll try to explain it as best I can after you take a minute to review it.

<php
#
# Edit Below
#
$path                 = '/home/rtcunningham/www.rtcx.local';
$master               = $path . '/static_master/';
$new                  = $path . '/static_new/';
$real_site_url        = 'https://www.rtcx.net/';
$schema_real_site_url = str_replace('/', '\/', $real_site_url);
$user                 = 'rtcunningham';
$group                = 'rtcunningham';
$timezone             = 'America/Los_Angeles';
$user_agent           = 'WPSSG';
$page_to_skip         = 'about-rtcx';
#
# Stop Editing
#
function my_file_put_contents($fname, $fcontent, $user, $group) {
  file_put_contents($fname, $fcontent);
  chmod($fname, 0644);
  chown($fname, $user);
  chgrp($fname, $group);
}
#
# Load WordPress and Get the Local Site URL
#
include $path . '/wp-load.php';
$site_url = home_url('/');
$schema_site_url = str_replace('/', '\/', $site_url);
#
# Queue File Names
#
$queue = array();
$posts = get_posts(array('numberposts' => -1, 'orderby' => 'modified', 'post_type' => array('post','page'), 'post_status' => 'publish'));
foreach ($posts as $post) {
  if ($post->post_name == $page_to_skip) continue;
  $queue[] = $post->post_name;
}
$queue[] = 'index.html';
$queue[] = 'feed.rss';
#
# Create Pages
#
$context = stream_context_create(array('http'=>array('method'=>"GET", 'ignore_errors' => true, 'header'=>"User-Agent: " . $user_agent . "\r\n")));
foreach($queue as $item) {
  echo ".";
  $url = $site_url . $item;
  if ($item == 'index.html') $url = $site_url;
  if ($item == 'feed.rss')   $url = $site_url . 'feed';
  $page = file_get_contents($url, false, $context);
  $page = str_replace(trim($site_url, '/'), trim($real_site_url, '/'), $page);
  $page = str_replace(trim($schema_site_url, '/'), trim($schema_real_site_url, '/'), $page);
  $page = trim($page) . "\n";
  $master_page = '';
  if (file_exists($master . $item)) $master_page = file_get_contents($master . $item);
  if ($page != $master_page) my_file_put_contents($new . $item, $page, $user, $group);
}
#
# Create Sitemap
#
echo ".";
date_default_timezone_set($timezone);
$sitemap = 'sitemap.xml';
$today = date('Y-m-d');
$page = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n\t<url>\n\t\t<loc>$real_site_url</loc>\n\t\t<lastmod>$today</lastmod>\n\t\t<changefreq>monthly</changefreq>\n\t</url>\n";
foreach ($posts as $post) {
  if ($post->post_name == $page_to_skip) continue;
  $item = $post->post_name;
  if (strstr($item, '?')) continue;
  $a = explode(' ', $post->post_modified);
  $postdate = $a[0];
  $page .= "\t<url>\n\t\t<loc>$real_site_url$item</loc>\n\t\t<lastmod>$postdate</lastmod>\n\t\t<changefreq>daily</changefreq>\n\t</url>\n";
}
$page .= "</urlset>\n";
$master_page = '';
if (file_exists($master . $sitemap)) $master_page = file_get_contents($master . $sitemap);
if ($page != $master_page) my_file_put_contents($new . $sitemap, $page, $user, $group);
echo "\n";

The only section you need to edit is the section called “Edit Below”. Those parameters are exactly what I use on my Linux Mint laptop. You obviously need to change them to suit your system.

The “user” and “group” parameters are ignored on Windows (probably not on a Mac). Leaving them in place won’t hurt anything. The user agent can be anything you want it to be. WPSSG just tells my logs what it is. The page to skip is the page slug you use for the front page. It won’t hurt anything for it to exist, but it’s wasted space.

This script will create files without any extensions, except for “index.html” and “feed.rss”. That isn’t a problem with WordPress. It’s a problem at the online web server. The web server won’t know what file type it is.

In the Nginx location block, you’ll need to insert “default_type text/html;” just before the “try_files” line. The line is “ForceType text/html” in Apache 2.4, but I don’t know where it goes.

Using the WordPress Static Site Generator

After I publish a post, I run the script to create the files. When I connect by FTP, I transfer new images from “/ifiles” to the online “/ifiles”. Then I transfer the files from “/static_new” to the online root directory for the website. The last step is to move the files from “/static_new” to “/static_master”. With the Linux “mv” command, files get overwritten.

The script compares the files in the master directory to the database contents for each file. Only new files or those that have been changed show up in the new directory. I usually have to transfer less than 50 files (because the related posts change). FTP uploads are typically slow. If I ever switch to a fiber connection, it probably won’t matter if I upload all of them every time.

Last Notes

I’m sure there’s something I left out, somewhere along the process. If there’s a glaring omission or just something you need to know, feel free to leave a comment or contact me personally. I’ll review everything I’ve written about the WordPress static site generator at least 10 times. If I find a mistake or something I left out, I’ll fix it.

This is what works for me. It may or may not work for you. At this point, all I can say is “good luck”.

The post WordPress Static Site Generator, Part 6 – The Static Generator Script appeared first on RTCX.

]]>
WordPress Static Site Generator, Part 5 – Functions https://www.rtcx.net/wordpress-static-site-generator-5 Sun, 22 Apr 2018 07:09:40 +0000 https://www.rtcx.net/?p=4415 After the functions we need for the WordPress static site generator, the actual generation script will be all that’s left. If you’re not comfortable with editing files, you may be better off using a plugin for your functions. It has the advantage of retaining the functions when you switch themes. In the following function snippets, […]

The post WordPress Static Site Generator, Part 5 – Functions appeared first on RTCX.

]]>
After the functions we need for the WordPress static site generator, the actual generation script will be all that’s left.

If you’re not comfortable with editing files, you may be better off using a plugin for your functions. It has the advantage of retaining the functions when you switch themes. In the following function snippets, I’m going to leave out the opening and closing PHP tags. If you use a functions.php file, you need to add them yourself.

WordPress Static Site Generator – Functions to Remove Unnecessary Lines

The first snippet isn’t a function. It calls existing functions. Unfortunately, this won’t remove everything we need to remove.

remove_action('wp_head', 'feed_links', 2);               # Removes links to the general feeds (Posts and Comments)
remove_action('wp_head', 'feed_links_extra', 3);         # Removes the links to the extra feeds such as category feeds
remove_action('wp_head', 'wlwmanifest_link');            # Removes the link to the Windows Live Writer manifest file
remove_action('wp_head', 'wp_generator');                # This isn't a normal WordPress installation
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); # This is a link that no longer works

These functions use output buffering to change lines just before they’re displayed. It shouldn’t be too hard to figure out. You’ll understand the “feed” line when we get to the next article. As you can probably see, this routine can be used to change lines as well as skip them.

add_action('template_redirect', 'ob_template_redirect', 99);
function ob_template_redirect() {
  ob_start('ob_callback');
}
function ob_callback($buffer) {
  $temp_buffer = explode("\n", $buffer);
  $buffer = '';
  $skip = 0;
  foreach ($temp_buffer as $line) {
    if (stristr($line, '<pre')  || stristr($line, '<code'))  $skip = 1;
    if (stristr($line, '</pre') || stristr($line, '</code')) $skip = 0;
    if (!$skip) {
      $line = trim($line);
      if ($line == '') continue;
      if (strstr($line, '/s.w.org')) continue;
      if (strstr($line, '/wp-json/')) continue;
      if (strstr($line, '/xmlrpc.php')) continue;
      if (strstr($line, 'Schema plugin')) continue;
      if (strstr($line, 'Yoast SEO plugin')) continue;
      if (strstr($line, '<link rel="next"')) continue;
      if (strstr($line, '<link rel="prev')) continue;
      if (is_feed()) $line = str_replace('/feed', '/feed.rss', $line);
    }
    $buffer .= $line . "\n";
  }
  return $buffer;
}

WordPress Static Site Generator – Functions to Change the System

First, we need to change the taxonomy forward slashes to dashes. A forward slash points to a subdirectory in a file system (pretty permalinks won’t work on static sites). I’m not supporting post tags and you’ll understand why when I’m through with all this.

add_action('init', 'change_taxonomy_permalinks', 1);
function change_taxonomy_permalinks() {
  global $wp_rewrite;
  $wp_rewrite->author_structure = '/' . $wp_rewrite->author_base . '-%author%';
  add_permastruct('category', 'category-%category%');
}

Next, we need to make page URIs have priority over taxonomy URIs. I found the code here and shortened it a bit.

add_action('init', 'ppot_init');
function ppot_init() {
  $GLOBALS['wp_rewrite']->use_verbose_page_rules = true;
}
add_filter('page_rewrite_rules', 'ppot_collect_page_rewrite_rules');
function ppot_collect_page_rewrite_rules($page_rewrite_rules) {
  $GLOBALS['ppot_page_rewrite_rules'] = $page_rewrite_rules;
  return array();
}
add_filter('rewrite_rules_array', 'ppot_prepend_page_rewrite_rules' );
function ppot_prepend_page_rewrite_rules($rewrite_rules) {
  return $GLOBALS['ppot_page_rewrite_rules'] + $rewrite_rules;
}

Shortcodes

This shortcode will provide a list of all posts (or articles) in reverse chronological order with the date. Use [article-list] on a page.

add_shortcode('article-list', 'shortcode_article_list');
function shortcode_article_list() {
  $posts_array = get_posts(array('posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish'));
  $output = '<ul>';
  foreach ($posts_array as $post) {
    $a = explode(' ', $post->post_date);
    $output .= '<li><a href="' . home_url('/') . $post->post_name . '">' . wptexturize($post->post_title) . '</a> (' . $a[0] . ')</li>';
  }
  $output .= '</ul>';
  return $output;
}

This shortcode will provide a list of all the categories in alphabetical order. Use [category-list] on a page.

add_shortcode('category-list', 'shortcode_category_list');
function shortcode_category_list() {
  $posts_array = get_terms(array('taxonomy' => 'category', 'orderby' => 'name', 'hide_empty' => true));
  $output = '<ul>';
  foreach ($posts_array as $cat) {
    $output .= '<li><a href="' . home_url('/') . 'category-' . $cat->slug . '">' . wptexturize($cat->name) . '</a></li>';
  }
  $output .= '</ul>';
  return $output;
}

This shortcode will provide a list of all the posts belonging to a single category. It’s a replacement for archive pages.

add_shortcode('category-page', 'shortcode_category_page');
function shortcode_category_page() {
  $slug = str_replace('category-', '', $_SERVER['REQUEST_URI']);
  $posts_array = get_posts(array('category_name' => $slug, 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC', 'post_type' => 'post', 'post_status' => 'publish'));
  $output =  "<ul>\n";
  foreach ($posts_array as $posts) {
    $a = explode(' ', $posts->post_date);
    $output .= '<li><a href="' . home_url('/') . $posts->post_name . '">' . wptexturize($posts->post_title) . '</a> (' . $a[0] . ')</li>' . "\n";
  }
  $output .= "</ul>\n";
  return $output;
}

You need to create a page to list all the categories. Every time you add a category and assign it to a post, you have to create another page with the category slug and title. The easiest way to do it is copy the slug and title from the category list. It may seem like a lot of work but it really isn’t. Most people don’t add new categories every day.

Post tags, on the other hand, would eat up your time. You’d have to create a lot of matching pages. Don’t bother if you value your sanity.

The post WordPress Static Site Generator, Part 5 – Functions appeared first on RTCX.

]]>
WordPress Static Site Generator, Part 4 – Configuring Plugins https://www.rtcx.net/wordpress-static-site-generator-4 Sun, 22 Apr 2018 01:22:10 +0000 https://www.rtcx.net/?p=4413 Your WordPress static site generator will work without any plugins at all. Unfortunately, it’ll be just like WordPress fresh out of the box. The plugins you’ll be using will help to enhance and minimize WordPress. In some ways, they’ll increase the payload and in other ways decrease it. You can add each of these plugins […]

The post WordPress Static Site Generator, Part 4 – Configuring Plugins appeared first on RTCX.

]]>
Your WordPress static site generator will work without any plugins at all. Unfortunately, it’ll be just like WordPress fresh out of the box.

The plugins you’ll be using will help to enhance and minimize WordPress. In some ways, they’ll increase the payload and in other ways decrease it.

You can add each of these plugins from within WordPress. The “Plugins” menu item is where you need to go.

Disable Embeds and Disable Emojis

No one will be able to embed your posts. Static sites don’t work that way. Also, you’re not going to use emojis or smileys while composing your masterpiece.

These plugins will disable both functions and remove the code WordPress automatically inserts in each page or post. There are no configuration options.

WP Smush

This plugin will reduce all of your image sizes, if they can be reduced. The settings page is under the “Media” menu item. The pro version will let you do a bit more, but the free version is really all you need.

WP-Sweep

Although you need to clean up your database, you really don’t need to do it that often. I use this plugin maybe once a month. Create a database backup before using it. I’ve never had a problem with it but you never know.

A bloated database slows everything down.

Broken Link Checker

Your visitors won’t come back if they encounter broken links all the time. This plugin will help you repair bad links. Go to “Settings” and then “Link Checker” in the admin menu to configure it.

You shouldn’t need to check for bad links more than once a week. Therefore, check each link every 168 hours. Enter that number in the correct place in the “General” tab. All the check boxes on that page should be blank except the last one.

In the “Look For Links In” tab, make sure only the “Pages”, “Posts” and “Published” check boxes are checked. Make sure the first two check boxes are checked in the “Which Links To Check” tab. In the “Protocols & APIs” tab, make sure they’re all checked.

In the “Advanced” tab, make sure all the check boxes are checked, except “Enable Logging”.

Schema

The settings option is under the main “Schema” menu item. In the “General” tab, fill in everything except “Use Yoast SEO markup?”.

Create a directory from the root of the website (and at the online server) to house special files. I call mine “assets” because it houses CSS and JavaScript files as well as what I use it for here. This is where you’ll put your image file.

Skip to the “Knowledge Graph” tab and fill in everything. In the “Search Results” tab, there are two links below the tab title. Fill in both areas but leave “Site Alternate Name” blank.

Yoast SEO

The settings are split into separate menu items under the main “SEO” menu item.

General:

In the “Features” tab, turn everything on and then turn off “Cornerstone Content”, “XML Sitemaps” (we’ll make our own), “Ryte Integration” and “Admin Bar Menu”. In the “Webmasters Tools” tab, fill in the verification codes for those you use. I only use “Bing” and “Google”.

Search Appearance:

In the “General” tab, make sure the “Force rewrite titles” is disabled and ignore the rest. In the “Content Types” tab, makes sure %%title%% is the only thing in the input boxes for “Title Template” (in two places). “Yes” and “Show” for everything but “Date in Snippet Preview”. Leave the rest of the tabs alone. I’ll explain why in an upcoming article.

Social:

In the “Accounts” tab, fill in those you use. In the “Facebook” tab, make sure it’s enabled and filled in. This is for your visitors, not you. I use Facebook comments, so I have a Facebook App ID.

In the Twitter tab, make sure it’s enabled even if you don’t use Twitter. Again, this is for your visitors, not you. If you’re not a Pinterest member, you can skip that tab. If you don’t have a business, you can skip the Google+ tab as well.

WordPress Static Site Generator and Contextual Related Posts, Easy Updates Manager, External Links to New Window

I recommend using them, with reservations. If you use Google Matched Content, don’t use Contextual Related Posts.

By using Easy Updates Manager, you can keep from upgrading anything. Since this isn’t an online WordPress site, you may want things to remain as is.

It’s a good idea to open links to external sites in a new tab. Visitors sometimes want to see the link you provide without leaving your site.

These plugins aren’t necessary with the WordPress Static Site Generator, but they can make some things easier.

The post WordPress Static Site Generator, Part 4 – Configuring Plugins appeared first on RTCX.

]]>
WordPress Static Site Generator, Part 3 – Configuring WordPress https://www.rtcx.net/wordpress-static-site-generator-3 Sat, 21 Apr 2018 00:44:31 +0000 https://www.rtcx.net/?p=4373 The next step in creating your WordPress static site generator is to install and configure WordPress. This is where it all begins. The default theme is okay for now. You may or may not want to change it before you finish. You need to add some specific plugins and then configure those plugins. Configure the […]

The post WordPress Static Site Generator, Part 3 – Configuring WordPress appeared first on RTCX.

]]>
The next step in creating your WordPress static site generator is to install and configure WordPress. This is where it all begins.

The default theme is okay for now. You may or may not want to change it before you finish. You need to add some specific plugins and then configure those plugins.

Configure the Settings for the WordPress Static Site Generator

The original uploads directory for media files won’t exist on your static site. You have to change the location by adding a line to your wp-config.php file, just below the other “define” lines. The line is like this:

define('UPLOADS', 'uploads');

You can use anything in place of the second “uploads”. I use “ifiles” on my sites. From the root directory, create your new uploads directory. You’ll need to add it the same way at your online web server.

In the “General” WordPress settings, enter your site title and use the local domain name URL for both the WordPress address and the site address (without trailing slashes). Even though your e-mail address isn’t going to be used for anything, you still have to enter it.

In the “Writing” WordPress settings, remove anything in the “Update Services” block. You’ll be using the Pingshot service provided by FeedBurner, which I’ll explain in a later article.

Before you continue, you need at least one page (not post). Create one if one doesn’t exist. Give it any title (“front page” is a good idea). Then, in the “Reading” WordPress settings, select it as the static page your home page displays.

In the “Discussion” WordPress settings, make sure every check box is unchecked. You won’t be notifying other blogs and you can’t receive link notifications. You won’t be using the WordPress comment system at all.

In the “Media” WordPress settings, make sure the check boxes are unchecked. That’s they way they should be by default but aren’t.

In the “Permalinks” WordPress settings, click on the radio button for “Post name”. Then, click on the radio button for “Custom Structure”. Finally, remove the trailing slash in that input box. The input box should contain /%postname% only. You’ll understand why later on.

Plugins for the WordPress Static Site Generator

Your WordPress static site generator only needs a few plugins. Some of them could probably be eliminated by custom functions in the theme’s functions.php file but it isn’t worth the effort. These are the plugins needed, at a bare minimum:

  • Disable Embeds
  • Disable Emojis
  • WP Smush (reduce image sizes)
  • WP-Sweep (clean the database)

If you’re concerned about social media and search engine optimization, you also need:

  • Broken Link Checker
  • Schema
  • Yoast SEO

I personally recommend these:

  • Contextual Related Posts
  • Easy Updates Manager
  • External Links to New Window

I’ll go over the configuration options for all these plugins in the next article. Even the ones I merely recommend.

The post WordPress Static Site Generator, Part 3 – Configuring WordPress appeared first on RTCX.

]]>
WordPress Static Site Generator, Part 2 – Your Online and Offline Servers https://www.rtcx.net/wordpress-static-site-generator-2 Fri, 20 Apr 2018 08:14:38 +0000 https://www.rtcx.net/?p=4372 Your WordPress static site generator requires two locations. The first, your online server. The second, your offline server – your home computer. If you’re using anything other than Nginx as your online web server, change it to Nginx. Nginx serves static files like nobody’s business. I’ll be using example.com as the domain name in the […]

The post WordPress Static Site Generator, Part 2 – Your Online and Offline Servers appeared first on RTCX.

]]>
Your WordPress static site generator requires two locations. The first, your online server. The second, your offline server – your home computer.

If you’re using anything other than Nginx as your online web server, change it to Nginx. Nginx serves static files like nobody’s business. I’ll be using example.com as the domain name in the online examples and example.local in the offline examples.

WordPress Static Site Generator Domain Names

No matter what you’re real domain name happens to be, you’ll need to assign a local domain name within the WordPress software. Before you can do that, you have to edit your computer’s host file. On Linux, it’s /etc/hosts and on Windows, it’s C:\Windows\System32\Drivers\etc\hosts. I have no idea what it is on a Mac.

You only need to add a single line:

127.0.0.1 example.local www.example.local

When the WordPress static site generator script runs, it will replace the “.local” TLD with the “.com” TLD. That is, if you use a local domain name that closely mirrors your real domain name. I’ll mention it again in a later article.

The Web Server Stack for the Online Server

I won’t tell you how to set it up because there’s a good LEMP stack tutorial at DigitalOcean. You can skip the database part but you should install PHP even if you won’t be using it on your website. I’ll mention it again in a later article.

Since HTTPS (SSL/TLS) is going to be the new standard sooner than later, you should also follow the Let’s Encrypt tutorial at DigiatalOcean.

The Web Server Stack for the Offline Server

I won’t get into Linux. Most Linux users know exactly what to do. For Windows, I think WinNMP is the best development stack to use. I used an earlier version on Windows 8 years ago.

Don’t try to set it up with HTTPS. You’ll get nothing but grief from the web browser you test it with. The WordPress static site generator script will change it for you anyway.

Get WordPress installed here. You won’t need to worry it about it at the online server.

The post WordPress Static Site Generator, Part 2 – Your Online and Offline Servers appeared first on RTCX.

]]>
WordPress Static Site Generator, Part 1 – Introduction https://www.rtcx.net/wordpress-static-site-generator-1 Fri, 20 Apr 2018 04:43:02 +0000 https://www.rtcx.net/?p=4371 This my second attempt to describe the WordPress static site generator I’ve developed over time. I removed the articles describing my first attempt months ago. The idea is to develop your website using web development tools on your home computer. You use scripts and other software to turn the pages and posts into static pages […]

The post WordPress Static Site Generator, Part 1 – Introduction appeared first on RTCX.

]]>
This my second attempt to describe the WordPress static site generator I’ve developed over time. I removed the articles describing my first attempt months ago.

The idea is to develop your website using web development tools on your home computer. You use scripts and other software to turn the pages and posts into static pages and then upload them to your online web server.

Why a WordPress Static Site Generator?

I hosted my website using WordPress the normal way for years. I started developing the WordPress static site generator when I got tired of the brute force login attacks and the constant barrage of comment spam. Although I solved all those problems eventually, I continued to develop it.

I no longer need to host a database server. I don’t even need PHP to process forms. With static pages, there’s nothing left to attack. I can ignore my website for days without having to worry about someone hacking into it. The best thing about all this is that static websites can be hosted anywhere.

Static websites are static, obviously. Most dynamic features can’t be converted to static. If you need dynamic features, especially for display, a static website is not your best option.

Software for your WordPress Static Site Generator

While I’m using the Linux Mint operating system on my home computer, you’re probably using something else. If you’re using Linux, it’s best to install Apache or Nginx, PHP and MySQL (or a compatible replacement) just like you would on a server. Otherwise, you should use a LAMP or LEMP stack designed for your operating system.

You need a good text editor. I like Geany for Linux and Notepad++ on Windows. You may or may not need an FTP client and you may or may not need an SSH client. It depends on how you intend to transfer files to the online web server. I like FileZilla as my FTP client and I like PuTTY as my SSH client. There are other ways to transfer files that I’m not familiar with.

Once you have your local web server running, you need to install WordPress and set it up properly. Get a theme you like and make sure there’s nothing dynamic going on with it.

WordPress Static Site Generator PHP Scripts

You need two scripts. The first is “functions.php”, which is usually one of the files in your theme. The second is a PHP file you can name anything before the “.php”. If a functions file already exists and it’s being used, you’ll have to add the necessary functions to it.

The second script is the WordPress static site generator itself. You can’t do anything without this script, which you’ll keep with your theme files. It loads WordPress, queries the database and saves the pages and posts as complete static pages.

Upcoming Articles

I’ll be writing articles to set everything up, step by step, from beginning to end. Some of the information may seem simple and some of it may seem complex. I’ll be trying to keep it simple.

The post WordPress Static Site Generator, Part 1 – Introduction appeared first on RTCX.

]]>
There are at Least Three Kinds of Spinach in the Philippines https://www.rtcx.net/spinach Thu, 12 Apr 2018 09:51:16 +0000 https://www.rtcx.net/?p=4367 There are at least three kinds of spinach in the Philippines that I know of. Only one of them is actually called spinach. There are three varieties of that one and I don’t know which variety is sold here. Regardless of which one I decide to eat, I don’t like it cooked in any way. […]

The post There are at Least Three Kinds of Spinach in the Philippines appeared first on RTCX.

]]>
There are at least three kinds of spinach in the Philippines that I know of. Only one of them is actually called spinach. There are three varieties of that one and I don’t know which variety is sold here.

Regardless of which one I decide to eat, I don’t like it cooked in any way. I like raw, green, leafy vegetables in salads. I don’t know why, but I don’t like the taste of cooked leafy vegetables.

Spinach

Again, I don’t know which variety is sold here. I’ve seen it sold at the SM grocery store inside the SM City Olongapo mall. As far as I know, there isn’t a Tagalog (Filipino) word for it. My relatives call it spinach, in English, because they don’t know a Tagalog word for it either.

This is the vegetable that made Popeye strong.

Kangkong – Water Spinach

Kangkong is called different things in other languages. This is what it’s called in Tagalog. It’s classified as a weed in the United States.

This plant doesn’t taste like spinach.

Alugbati – Vine Spinach

There are two varieties of Alugbati. I can’t tell you which one I’ve eaten except that it has stems purple or violet in color.

This plant doesn’t taste like spinach either.

Salads with Spinach, Kangkong or Alugbati

I haven’t had a salad with spinach in it since I’ve lived in the Philippines. I’ve had salads with iceberg lettuce, romaine lettuce, alugbati and kangkong in them. Not only the leafy, green vegetables, of course.

I’ve changed my daily diet so many times, I don’t remember what it was 10 years ago. I’ve added these leafy, green vegetables to my diet over time because I have circulation problems.

Spinach Alone isn’t Enough

It’s impossible for me to eat all the things I need to eat to stay healthy. My stomach simply can’t hold that much food. I eat “roughage” and high fiber foods so I won’t suffer from constipation.

I’m taking nutritional supplements to get the vitamins and minerals I can’t get any other way. The pills are huge. If I could be more active, I could eat my way to good health. Unfortunately, I can’t and it isn’t because I don’t want to. Old injuries won’t allow it.

The post There are at Least Three Kinds of Spinach in the Philippines appeared first on RTCX.

]]>
Massage Chairs at the Harbor Point Ayala Mall at Subic Bay https://www.rtcx.net/massage-chairs-harbor-point-ayala-mall Tue, 10 Apr 2018 09:03:53 +0000 https://www.rtcx.net/?p=4365 I had a bad experience earlier today with one of the commercial massage chairs at the mall. My wife, Josie, sentenced me to one for half an hour while she was getting a manicure and pedicure at a nail salon. To be honest, Josie had no idea I would hate it so much. Neither of […]

The post Massage Chairs at the Harbor Point Ayala Mall at Subic Bay appeared first on RTCX.

]]>
I had a bad experience earlier today with one of the commercial massage chairs at the mall. My wife, Josie, sentenced me to one for half an hour while she was getting a manicure and pedicure at a nail salon.

To be honest, Josie had no idea I would hate it so much. Neither of us had ever sat in one before. Nevertheless, I made sure she knew exactly how I felt about it after it finally released me.

I Think I Hate Massage Chairs

Before I tell you why, I’ll tell you how I came to be in such a position. This morning, the local power company decided to cut power on our street at exactly 8:15 am. I don’t buy the “scheduled interruption” notice on Facebook because I check for their notices every day and this afternoon was the first time I saw this one.

Not knowing when the power was going to be turned back on, we (me and my immediate family) decided to spend the day at the mall. Life sucks without air conditioning. We had a light lunch at a place called “Ben’s Kitchen”. After that, Josie and I followed Cathy (our daughter-in-law) from floor to floor. We ended up near by those massage chairs.

Josie told me they (her and Cathy) hadn’t planned the trip to salon, but I think it was their scheme all along. Josie paid 100 pesos for 30 minutes and they just left me there. After I was in position, and it was a bit snug, the chair clamped down on me and I knew I had no choice but to suffer for the next half hour.

Commercial Massage Chairs are Painful

At least the one that took me prisoner was painful. I could feel the balls rotating under my feet and the pressure of the balls on my back. The real pain came when they started pushing down on my lower spine area, the lumbar region.

I really think no one should have to endure what I endured for more than five minutes. By the time the 30 minutes was up, I was almost numb from my neck to my waist on my back.

I’m not making any of this up. I actually tried to get out of that chair long before my time was up. I don’t know what was going on but I couldn’t do anything. I told our driver (another relative) about all of this and everyone inside the vehicle started cracking up – except for me.

I will never voluntarily sit in one of those massage chairs again for as long as I live.

The post Massage Chairs at the Harbor Point Ayala Mall at Subic Bay appeared first on RTCX.

]]>
Splitting this Website into Multiple Parts is Keeping Me Busy https://www.rtcx.net/splitting-website-multiple-parts Mon, 09 Apr 2018 04:41:27 +0000 https://www.rtcx.net/?p=4363 I’ve been busy. I’ve taken this website and split it into three parts. Well, kind of. The three parts still represent the whole. Slicing away a couple of the parts will make it easier for me to focus on those individual parts. The “satellite” parts should perform better separately with the search engines as well. […]

The post Splitting this Website into Multiple Parts is Keeping Me Busy appeared first on RTCX.

]]>
I’ve been busy. I’ve taken this website and split it into three parts. Well, kind of.

The three parts still represent the whole. Slicing away a couple of the parts will make it easier for me to focus on those individual parts. The “satellite” parts should perform better separately with the search engines as well.

Satellite Websites on Subdomains

My music site, “Music Notes“, is at the music.rtcx.net subdomain. My coffee site, “Coffee Corner“, is at the coffee.rtcx.net subdomain.

It’s taken me far longer than it should have and I’m not even close to being where I want to be. I realized, after I created the new websites as pure AMP websites, that I needed four application IDs for the Facebook ingredients. And I was having trouble connecting to Facebook from my laptop for some reason.

When I start having connection problems, the best thing for me to do is walk away. Sometimes, I tend to walk away for more than a day at a time.

The Programming Aspect

I don’t know who or what to blame. It could have been my failure to concentrate or it could have been one of many interruptions. It took me far too long to copy and change existing scripts and functions.

I made a lot of mistakes, something I never would have done a few years ago. The only saving grace is that I can test everything on my laptop before uploading anything.

There are several components to each website. I have a WordPress website set up for each on my laptop. The “theme” is a single web page, using conditions for branching. A script alters the output to make it work online instead of off. I call it my “WordPress Static Site Generator”.

The devil is in the details. One mistake in any of the parts means I have to go back and check everything. Basically starting over, but not quite from scratch.

At least I’m done with the programming aspect. Now all I have to do is move and rewrite content. And create more content, of course.

The post Splitting this Website into Multiple Parts is Keeping Me Busy appeared first on RTCX.

]]>
I Restored the Option to Subscribe to Receive Articles by Email https://www.rtcx.net/subscribe-articles-email-2 Wed, 04 Apr 2018 05:25:12 +0000 https://www.rtcx.net/?p=4357 On March 14, I removed the option to subscribe to receive articles by email. Today, I restored that option. I did this despite what I said before. Why? Because it doesn’t cost me anything now, not even my time. My latest bout of depression ended a few days ago and I decided to make things […]

The post I Restored the Option to Subscribe to Receive Articles by Email appeared first on RTCX.

]]>
On March 14, I removed the option to subscribe to receive articles by email. Today, I restored that option.

I did this despite what I said before. Why? Because it doesn’t cost me anything now, not even my time. My latest bout of depression ended a few days ago and I decided to make things a little easier for everyone.

I’m Not Restoring Email Subscriptions

I deleted the list of email addresses when I removed the option. Although I looked at them a few times, I don’t have a photographic memory.

I don’t think it’s a good idea for me to keep any kind of information when it isn’t needed. I recently deleted thousands of files on an external hard drive for exactly that reason.

Email from FeedBurner

I redirected my feed to FeedBurner and enabled email subscriptions at the same time. Both links in the footer below will take you to FeedBurner.

I tried to get rid of all third-party services. I really did. When I decided to switch to a pure AMP website, I no longer had that choice.

I’ve used other third-party services for both the feeds and the email. The only third-party service that isn’t a pain to use is FeedBurner. I realize Google could shut down FeedBurner at any given time, even without much notice. That’s okay with me and I’ll cross that bridge when they do.

Perspective

Instead of removing things that bother me, I need to change them. On the other hand, some things absolutely have to be removed. I won’t go into details, but I’ve removed things no one should have to see. Not even me.

I converted this website to the AMP format and I need to do that with Music Notes. I stopped working on that website when I started redesigning this one.

I’m planning to move other articles to yet another website, when I get caught up. It’s going to take me a while to get caught up.

The post I Restored the Option to Subscribe to Receive Articles by Email appeared first on RTCX.

]]>