<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wordpress Archives - Chris Gilligan » new media</title>
	<atom:link href="http://chrisgilligan.com/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://chrisgilligan.com/wordpress/</link>
	<description>portfolio of web work</description>
	<lastBuildDate>Tue, 10 Oct 2023 19:13:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>High Ed Web 2023 Presentation</title>
		<link>https://chrisgilligan.com/wordpress/hew2023/</link>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Fri, 15 Sep 2023 13:46:15 +0000</pubDate>
				<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2569</guid>

					<description><![CDATA[<p>WordPress has a ridiculously low point of entry, and that may be fine for a single developer or site owner who does everything from the Dashboard and Theme Customizer. But what if you have multiple developers and multiple environments?</p>
<p>The post <a href="https://chrisgilligan.com/wordpress/hew2023/">High Ed Web 2023 Presentation</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2023/09/hew-conf.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p>
<p class="wp-block-paragraph"> I have been accepted to High Ed Web 2023 as a presenter:</p>



<ul class="wp-block-list">
<li><a class="" href="https://events.highedweb.org/heweb23/session/1435234/modernize-wordpress-for-a-multi-developer-multi-environment-workflow">Modernize WordPress for a multi-developer, multi-environment workflow</a></li>



<li><a href="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2023/10/utc-chris-wordpress.pdf?x25141">Presentation slides (PDF)</a></li>
</ul>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="687" height="200" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2023/09/hew-2023.png?x25141" alt="" class="wp-image-2580" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2023/09/hew-2023.png?x25141 687w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2023/09/hew-2023-300x87.png?x25141 300w" sizes="(max-width: 687px) 100vw, 687px" /></figure>


<p>WordPress has a ridiculously low point of entry, and that may be fine for a single developer or site owner who does everything from the Dashboard and Theme Customizer. But what if you have multiple developers and multiple environments? How do you develop and deploy new features, maintain software dependencies, and keep your sanity? There really is a better way: Bedrock from <a href="http://roots.io/" target="_blank" rel="noreferrer noopener">Roots.io</a>, a professional WordPress project boilerplate.</p>
<p>UT Chattanooga had a WordPress Multisite that was managed &#8220;the old way&#8221; since 2007. We had a test environment and a production environment, running on a solid infrastructure, but making updates to our custom theme and plugins was done via FTP and sheer luck. Project history included broken deployments, seat-of-the-pants recoveries, and well-meaning super-admins crashing the production site by installing incompatible plugins.</p>
<p>In 2021, with several new coders onboard and increased pressure to develop and deliver custom plugins and themes, we knew we needed to modernize our WordPress project, and automate deployment to the on-prem infrastructure.</p>
<p>For local development, Lando was an obvious choice, since we were already using it for Drupal development. But what about defining the project with Composer, and using Git for multi-dev source control? Enter Bedrock, from <a href="http://roots.io/" target="_blank" rel="noreferrer noopener">Roots.io</a>, a professional WordPress project boilerplate. Bedrock makes WordPress multi-environment capable, while PHP Composer manages all WordPress software, even custom private themes and plugins. Bedrock restructures WordPress core for multiple environments with individual configurations, and makes it easy to keep the project under version control with Git.</p>
<p>Laravel Envoy makes multi-environment deployments predictable, with zero downtime and scripted server commands. No more long nights of maintenance, no more running WordPress automated updates direct from the Dashboard. No more trying to remember all of the post-deployment tasks, such as updating the database and flushing caches. And what if something fails and we need to roll back to the previous deployment? Well, we have that covered! Envoy lets you run any command line SSH or WP-CLI task in a storybook script.</p><p>The post <a href="https://chrisgilligan.com/wordpress/hew2023/">High Ed Web 2023 Presentation</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Responsive and Accessible Charts and Graphs</title>
		<link>https://chrisgilligan.com/portfolio/responsive-accessible-charts-graphs/</link>
					<comments>https://chrisgilligan.com/portfolio/responsive-accessible-charts-graphs/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 15 Mar 2017 13:24:55 +0000</pubDate>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2429</guid>

					<description><![CDATA[<p>I have been looking for a simple solution to create and manage &#8220;dashboard&#8221; type charts on a website. Something that would produce editable graphs, accessible content for screen readers, and fit into a responsive design. Chartist.js is a simple and independent library to create SVG charts in the DOM. Various plugins are available to extend [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/responsive-accessible-charts-graphs/">Responsive and Accessible Charts and Graphs</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2017/03/screen-shot-2017-03-15-at-9.27.13-AM.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p>I have been looking for a simple solution to create and manage &#8220;dashboard&#8221; type charts on a website. Something that would produce editable graphs, accessible content for screen readers, and fit into a responsive design.</p>
<p><a href="https://gionkunz.github.io/chartist-js/">Chartist.js</a> is a simple and independent library to create SVG charts in the DOM. Various plugins are available to extend the functionality and display options. In this example, the accessibility and axis label plugins are used. There are also plugins available for frameworks, and for WordPress (as a <a href="https://wordpress.org/plugins/charts-for-tablepress-chartist/">TablePress plugin extension</a>).</p>
<div>It makes a responsive chart, with an optional accessible table (hidden by default, but displayed on this example, to show the values).</div>
<div></div>
<div>Check out the CodePen attached to this post. You can interact with the chart by clicking on the legend labels to toggle the series on/off.</div>
<div></div>
<div>After a chart is set up, the only values a user would need to modify are the data variables at the top of the JS: labels and series. If the y-axis series values change, they would have to modify axisY values for ticks, high/low. The remainder of the JS is display parameters and accessibility options.</div>
<div></div>
<hr />
<p><p class='codepen'  data-height='688' data-theme-id='0' data-slug-hash='yMzKMQ' data-default-tab='js,result' data-animations='run' data-editable='' data-embed-version='2'>
See the Pen Chartist Graph with (visible) accessibility, point label, legend and axis label plugins: CCTN by utcwebdev (@utcwebdev) on CodePen.</p>
</p>
<p>&nbsp;</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/responsive-accessible-charts-graphs/">Responsive and Accessible Charts and Graphs</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/portfolio/responsive-accessible-charts-graphs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Integrating Content from External Sources into OU Campus Using RSS, PHP, and JavaScript</title>
		<link>https://chrisgilligan.com/consulting/integrating-content-from-external-sources-into-ou-campus-using-rss-php-and-javascript/</link>
					<comments>https://chrisgilligan.com/consulting/integrating-content-from-external-sources-into-ou-campus-using-rss-php-and-javascript/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Tue, 23 Feb 2016 00:50:35 +0000</pubDate>
				<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[OU Campus]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2386</guid>

					<description><![CDATA[<p>The web team of the University of Tennessee at Chattanooga&#160;uses PHP and RSS to syndicate blog content, news releases, and calendar events into their main website. PHP SimpleXML is used to parse the XML of the RSS feeds. We import a variety of feeds, from WordPress, from Master Calendar, and from other sites such as [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/consulting/integrating-content-from-external-sources-into-ou-campus-using-rss-php-and-javascript/">Integrating Content from External Sources into OU Campus Using RSS, PHP, and JavaScript</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2016/02/screen-shot-2016-02-22-at-4.45.18-PM.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p><strong>The web team of the University of Tennessee at Chattanooga</strong>&nbsp;uses PHP and RSS to syndicate blog content, news releases, and calendar events into their main website.</p>
<p><a href="http://php.net/manual/en/book.simplexml.php" target="_blank" rel="noopener noreferrer">PHP SimpleXML</a> is used to parse the XML of the RSS feeds. We import a variety of feeds, from WordPress, from Master Calendar, and from other sites such as an external athletics CMS. WordPress provides some RSS features, including RSS from categories, tags and search strings, but we have added media attachments and a customized template to output a more complicated RSS feed on the University home page.</p>
<ul>
<li><em>this is a companion blog post for a <a href="https://s3.amazonaws.com/cgilligan-share/OUTC16-presentation-chris-gilligan-php-rss-ou-campus.pdf">presentation</a> given at<br />
<a href="https://www.outc16.com" target="_blank" rel="noopener noreferrer">OmniUpdate OU Campus User Training Conference 2016</a></em></li>
<li><em>shortcut to this blog post:&nbsp;<a href="http://utc.edu/outc16">utc.edu/outc16</a></em></li>
<li><em>links below are production&nbsp;examples of the concepts outlined in this post</em></li>
</ul>
<h2>News releases, events and content from WordPress via RSS</h2>
<p>Example web pages:</p>
<ul>
<li><a href="http://www.utc.edu/sustainability/" target="_blank" rel="noopener noreferrer">OU Campus PHP page with news feed and events feed from WordPress</a></li>
<li><a href="http://www.utc.edu/athletics/" target="_blank" rel="noopener noreferrer">OU Campus PHP page with news feed from SideArm Sports</a></li>
</ul>
<h3>WordPress plugin &amp; PHP to add media attachments to RSS feed</h3>
<p>Example RSS feeds <em>(view XML/XSL styled page in FireFox; View Source to see XML structure, namespaces, node names and structure)</em>:</p>
<ul>
<li><a href="http://watoosa.com/feed/" target="_blank" rel="noopener noreferrer">normal WordPress RSS feed</a></li>
<li><a href="http://blog.utc.edu/news/headlines.xml/" target="_blank" rel="noopener noreferrer">customized WordPress feed with additional namespace and media attachments</a>
<ul>
<li>headlines-customfeed.php&nbsp;<em>(custom feed template)</em></li>
<li>functions.php: load_template&nbsp;<em>(registers and loads the custom feed template)</em></li>
</ul>
</li>
<li><a href="http://gomocs.com/rss.aspx" target="_blank" rel="noopener noreferrer">RSS feed with inline images</a>&nbsp;<em>(open in Firefox to see XML &amp; XSL)</em></li>
</ul>
<p>Custom WordPress RSS feed template, followed by the functions call to load and create it:</p>
<pre class="theme:monokai lang:php decode:true " title="custom-headlines.php goes in (child) template directory">&lt;?php
/*
Template Name: Custom Current Headlines Feed

*/

$numposts = 10;
$category_id = get_cat_ID('Current Headlines');

function custom_rss_date( $timestamp = null ) {
  $timestamp = ($timestamp==null) ? time() : $timestamp;
  echo date(DATE_RSS, $timestamp);
}

function custom_rss_text_limit($string, $length, $replacer = '&amp;hellip;') { 
  $string = strip_tags($string);
  if(strlen($string) &gt; $length) 
    return (preg_match('/^(.*)\W.*$/', substr($string, 0, $length+1), $matches) ? $matches[1] : substr($string, 0, $length)) . $replacer;   
  return $string; 
}

$posts = query_posts('cat='.$category_id.'&amp;showposts='.$numposts);

$lastpost = $numposts - 1;



header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
$more = 1;

echo '&lt;?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'&gt;'; ?&gt;

&lt;rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	&lt;?php do_action('rss2_ns'); ?&gt;
&gt;

&lt;channel&gt;
	&lt;title&gt;&lt;?php bloginfo_rss('name'); wp_title_rss(); ?&gt;&lt;/title&gt;
	&lt;atom:link href="&lt;?php self_link(); ?&gt;" rel="self" type="application/rss+xml" /&gt;
	&lt;link&gt;&lt;?php bloginfo_rss('url') ?&gt;&lt;/link&gt;
	&lt;description&gt;&lt;?php bloginfo_rss("description") ?&gt;&lt;/description&gt;
	&lt;lastBuildDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?&gt;&lt;/lastBuildDate&gt;
	&lt;language&gt;&lt;?php bloginfo_rss( 'language' ); ?&gt;&lt;/language&gt;
	&lt;sy:updatePeriod&gt;&lt;?php echo apply_filters( 'rss_update_period', 'hourly' ); ?&gt;&lt;/sy:updatePeriod&gt;
	&lt;sy:updateFrequency&gt;&lt;?php echo apply_filters( 'rss_update_frequency', '1' ); ?&gt;&lt;/sy:updateFrequency&gt;
	&lt;?php do_action('rss2_head'); ?&gt;
	&lt;?php while( have_posts()) : the_post(); ?&gt;
	&lt;item&gt;
		&lt;title&gt;&lt;?php the_title_rss() ?&gt;&lt;/title&gt;
		&lt;link&gt;&lt;?php the_permalink_rss() ?&gt;&lt;/link&gt;
		&lt;comments&gt;&lt;?php comments_link_feed(); ?&gt;&lt;/comments&gt;
		&lt;pubDate&gt;&lt;?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?&gt;&lt;/pubDate&gt;
		&lt;dc:creator&gt;&lt;?php the_author() ?&gt;&lt;/dc:creator&gt;
&lt;?php the_category_rss('rss2') ?&gt;
		&lt;guid isPermaLink="false"&gt;&lt;?php the_guid(); ?&gt;&lt;/guid&gt;
&lt;?php if (get_option('rss_use_excerpt')) : ?&gt;
		&lt;description&gt;&lt;![CDATA[&lt;?php get_the_excerpt(); ?&gt;]]&gt;&lt;/description&gt;
&lt;?php else : ?&gt;
		&lt;description&gt;&lt;?php echo '&lt;![CDATA['.custom_rss_text_limit($post-&gt;post_content, 256).']]&gt;';  ?&gt;&lt;/description&gt;
&lt;?php $content = get_the_content_feed('rss2'); ?&gt;
	&lt;?php if ( strlen( $content ) &gt; 0 ) : ?&gt;
		&lt;content:encoded&gt;&lt;![CDATA[&lt;?php echo $content; ?&gt;]]&gt;&lt;/content:encoded&gt;
	&lt;?php else : ?&gt;
		&lt;content:encoded&gt;&lt;![CDATA[&lt;?php the_excerpt(); ?&gt;]]&gt;&lt;/content:encoded&gt;
	&lt;?php endif; ?&gt;
&lt;?php endif; ?&gt;
		&lt;wfw:commentRss&gt;&lt;?php echo esc_url( get_post_comments_feed_link(null, 'rss2') ); ?&gt;&lt;/wfw:commentRss&gt;
		&lt;slash:comments&gt;&lt;?php echo get_comments_number(); ?&gt;&lt;/slash:comments&gt;
&lt;?php rss_enclosure(); ?&gt;
&lt;?php do_action('rss2_item'); ?&gt;
		&lt;/item&gt;
	&lt;?php endwhile; ?&gt;
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<pre class="theme:monokai lang:php decode:true " title="goes in functions.php to load the custom feed">/* Custom RSS Feed for Home Page headlines */

function create_my_customfeed() {
load_template( get_stylesheet_directory() . '/headlines-customfeed.php');
}
add_action('do_feed_headlines', 'create_my_customfeed', 10, 1);
</pre>
<h3>OU Campus PHP helper file and code asset</h3>
<p>To parse an existing external RSS feed, such as a standard or custom WordPress feed, we use a helper file that employs PHP&#8217;s simplexml_load_string to load the targeted RSS feed, traverse the XML document, select node content, then echo out a block of styled html for each set of targeted XML nodes. The helper file accepts&nbsp;the $feed variable to specify the location of the targeted feed, and the $maxitems variable to specify the number of items to select from the top of the that feed.</p>
<p>On its own, the PHP helper file can be hit in a browser, to verify the targeted feed type exists and is parsed correctly. The browser will return an un-styled&nbsp;html page from the helper file URL.</p>
<p>The OU Campus Code Asset includes the helper file, over-rides the helper&#8217;s default variables, is and is very simple to copy and modify, according to the intended target feed and desired number of items to be presented on the final page. Many different Assets can include a single helper file.</p>
<p><em>(Vinit from OmniUpdate outlined a much better way to handle the feed URL and number of items in his Server Side Scripting class: via PCF Page Parameters.)</em></p>
<h3>PHP file</h3>
<ul>
<li><a href="http://www.utc.edu/_resources/php/get-headlines-gomocs.php" target="_blank" rel="noopener noreferrer">parses feed and displays HTML</a>
<ul>
<li>variables set to defaults for testing
<ul>
<li>may need to verify feed access and XML structure</li>
</ul>
</li>
</ul>
</li>
<li>various types of display html
<ul>
<li>title, excerpt, thumbnail from WordPress</li>
<li>title only from WordPress</li>
<li>RSS feed with formatting or namespaces different&nbsp;from WordPress</li>
</ul>
</li>
</ul>
<pre class="theme:monokai lang:php decode:true" title="/_resources/get-headlines-sidebar.php">&lt;?php

$input = $_SERVER['QUERY_STRING'];
parse_str($input);

if (!isset($feed))//script or page property will choose which feed to display
	$feed = "http://blog.utc.edu/news/headlines.xml/";

if(!isset($maxitems))
	$maxitems = 3;

$file = file_get_contents($feed);
$file = str_ireplace('src="http://', 'src="//', $file);
$file = str_ireplace('media:content url="http://', 'media:content url="//', $file);
$file = str_ireplace('media:thumbnail url="http://', 'media:thumbnail url="//', $file);

$sxml = simplexml_load_string($file);

$i = 0;
	foreach ($sxml-&gt;channel-&gt;item as $item) {
		if (++$i &gt; $maxitems) {
				break;
			}
		$namespaces      = $item-&gt;getNameSpaces( true );
		$content         = isset($namespaces['content']) ? $item-&gt;children( $namespaces['content'] ) : '';
		$content_encoded = isset($content-&gt;encoded)      ? $content-&gt;encoded                         : '';
		$media           = isset($namespaces['media'])   ? $item-&gt;children( $namespaces['media'] )   : '';
		$html       = "&lt;div class=\"row-fluid\"&gt;"
					.     "&lt;h3&gt;&lt;a href=\"{$item-&gt;link}\"&gt;{$item-&gt;title}&lt;/a&gt;&lt;/h3&gt;"
					.     "{$content_encoded}"
					.  "&lt;/div&gt;";
	echo($html);
}
?&gt;
&lt;script&gt;
	$(document).ready(function(){
		$('.sidebar img').removeClass().addClass('thumbnail pull-right span5');
		$('aside.well img').removeClass().addClass('thumbnail pull-right span5');
	});
&lt;/script&gt;
</pre>
<h3>OU Campus Assets</h3>
<ul>
<li>simple structure
<ul>
<li>specify RSS source</li>
<li>number of posts to display</li>
</ul>
</li>
</ul>
<pre class="lang:php decode:true " title="OU Campus Asset">&lt;?php
$feed = "//blog.utc.edu/hr/category/benefits/feed/";
include($_SERVER['DOCUMENT_ROOT']. '/_resources/php/get-headlines-sidebar.php');
$maxitems = 5;
?&gt;</pre>
<p><em>(Vinit from OmniUpdate outlined a much better way to handle the feed URL and number of items in his Server Side Scripting class: via PCF Page Parameters.)</em></p>
<h3>More Speed</h3>
<p>After you verify the final production page, you should set up cron jobs for any external feeds that are created via database calls on the external servers. A&nbsp;WordPress feed will require a bit of PHP and MySQL work to generate the RSS feed. This requires some processing, and will introduce a delay in service of the OU Campus PHP page. To avoid this latency, we create cron jobs on the production server to periodically fetch the feeds and cache them locally on the production server. The speed increase for the final page product is noticeable.</p>
<p>If your OU Campus Sites include development, test, training, or mobile Sites, you will want to duplicate the local static feeds on all of the OU Sites.</p>
<p>If you control an external WordPress site, you can&nbsp;employ caching mechanisms or plugins to more efficiently serve RSS feeds.</p>
<ul>
<li>cache RSS feeds via WordPress plugin, e.g. W3 &nbsp;Total Cache</li>
<li>cron job to fetch feeds to local production servers</li>
<li>minimize external requests for faster page load</li>
</ul>
<p>This cron job can be placed in /etc/cron.hourly to fetch WordPress feeds, check <code>lastBuildDate</code>, and compare that to the existing build date, and create a cached RSS xml file.</p>
<pre class="theme:monokai lang:default decode:true" title="wget the feeds to local via cron">#!/bin/bash

# Preload WordPress Feeds for Website

# UTC News
wget http://blog.utc.edu/news/headlines.xml/ -O /data/web/prod/www/_resources/rss/wp-news.tmp &gt;/dev/null 2&gt;&amp;1
TMP_LASTBUILD="$(xml_grep '/rss/channel/lastBuildDate' --text_only /data/web/prod/www/_resources/rss/wp-news.tmp)"
XML_LASTBUILD="$(xml_grep '/rss/channel/lastBuildDate' --text_only /data/web/prod/www/_resources/rss/wp-news.xml)"
MIMETYPE=`file -b --mime-type /data/web/prod/www/_resources/rss/wp-news.tmp`
if [ "$MIMETYPE" == "application/xml" -a  "$TMP_LASTBUILD" != "$XML_LASTBUILD" ] ; then
    mv /data/web/prod/www/_resources/rss/wp-news.tmp /data/web/prod/www/_resources/rss/wp-news.xml
fi

# Duplicate for development, test &amp; training environments
cp -p /data/web/prod/www/_resources/rss/wp*.xml /data/web/test/www/_resources/rss/
cp -p /data/web/prod/www/_resources/rss/wp*.xml /data/web/test/train/_resources/rss/
cp -p /data/web/prod/www/_resources/rss/wp*.xml /data/web/dev/www/_resources/rss/
</pre>
<p>For other RSS sources, the structure may be different; maybe we can&#8217;t do a <code>lastBuildDate</code> check. And&#8230; some servers may not respond to a default wget request from a shell script. No problem: just specify <code>--header</code> and <code>--user-agent</code>, don&#8217;t do the <code>lastBuildDate</code> check, and just write the RSS XML file.</p>
<pre class="theme:monokai lang:default decode:true">#!/bin/bash

# Preload GoMocs Feeds for Website


# Gomocs.com News
wget  --header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0" http://www.gomocs.com/rss.aspx -O /data/web/prod/www/_resources/gomocs-news.xml

# Duplicate for development, test &amp; training environments
cp -p /data/web/prod/www/_resources/rss/gomocs*.xml /data/web/test/www/_resources/rss/
cp -p /data/web/prod/www/_resources/rss/gomocs*.xml /data/web/test/train/_resources/rss/
cp -p /data/web/prod/www/_resources/rss/gomocs*.xml /data/web/dev/www/_resources/rss/</pre>
<h2>Event Calendar RSS feeds from Master Calendar via RSS</h2>
<p>Example pages that include feeds from Master Calendar. MC has a very rudimentary RSS output of title, date/time and description. MC caches its RSS feeds by default, and expects a lot of traffic to the feed locations, so it is not so necessary to create cron jobs to fetch them. However, if you have an OU Campus page that fetches and displays a large number of MC feeds, you will see a performance increase by using cron jobs. UTC.edu&#8217;s home page fetches a number of feeds, and we saw a noticeably faster page load after moving these calls to cron jobs.</p>
<ul>
<li><a href="http://www.utc.edu/" target="_blank" rel="noopener noreferrer">home page tabbed calendar</a></li>
<li><a href="http://www.utc.edu/music/" target="_blank" rel="noopener noreferrer">simple sidebar calendar</a></li>
</ul>
<h2>Social Media Streams</h2>
<p><strong>UTC uses a jQuery plugin and PHP</strong>&nbsp;to pull in social media posts for the university account, as well as for individual departments and colleges. This is an easy way to create a social stream sidebar or social wall page.</p>
<ul>
<li><a href="http://codecanyon.net/item/jquery-social-stream/2103997" target="_blank" rel="noopener noreferrer">jQuery Social Stream</a></li>
<li><a href="http://www.utc.edu/read-achieve/" target="_blank" rel="noopener noreferrer">program site with Twitter feed</a></li>
<li><a href="http://www.utc.edu/" target="_blank" rel="noopener noreferrer">home page with multiple feeds in a sidebar stream</a></li>
<li><a href="http://www.utc.edu/mocs-news/" target="_blank" rel="noopener noreferrer">social wall page with YouTube videos</a></li>
</ul>
<p><em>Facebook, Twitter and Instagram require PHP &nbsp;API script for connection to signed apps.<a href="http://lulalake.org/" target="_blank" rel="noopener noreferrer">&nbsp;jquery.imagesloaded</a>&nbsp;is helpful for the wall display</em></p>
<h2>Code Samples</h2>
<p><em>(A compilation zip including all code mentioned in the presentation is available. Comment and subscribe to this post&nbsp;to be notified of updates.)</em></p>
<ul>
<li>WordPress plugin to add media attachments to RSS feed</li>
<li>WordPress functions.php changes</li>
<li>PHP files to parse feeds and display HTML</li>
<li>OU Campus Assets to specify RSS source and set number of posts</li>
<li>cron job to fetch RSS feeds to local server</li>
</ul>
<p>The post <a href="https://chrisgilligan.com/consulting/integrating-content-from-external-sources-into-ou-campus-using-rss-php-and-javascript/">Integrating Content from External Sources into OU Campus Using RSS, PHP, and JavaScript</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/consulting/integrating-content-from-external-sources-into-ou-campus-using-rss-php-and-javascript/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>TEDx Event Website</title>
		<link>https://chrisgilligan.com/portfolio/tedx-event-website/</link>
					<comments>https://chrisgilligan.com/portfolio/tedx-event-website/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 04 Nov 2015 17:13:14 +0000</pubDate>
				<category><![CDATA[Arts and Nonprofit]]></category>
		<category><![CDATA[NginX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[Web Server Performance Tuning]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2342</guid>

					<description><![CDATA[<p>I&#8217;m very excited to help out with Chattanooga&#8217;s premier TEDx event: TEDxChattanooga. For this site, I chose a responsive Bootstrap 3 SASS WordPress theme, originally developed for TEDxToronto. I made a few tweaks and improvements to better fit our event, and worked with April Cox from UT Chattanooga to dial in&#160;the design and architecture. Developed&#160;on [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/tedx-event-website/">TEDx Event Website</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.46.47-AM.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p>I&#8217;m very excited to help out with Chattanooga&#8217;s premier TEDx event: <a href="https://www.tedxchattanooga.com/">TEDxChattanooga</a>.</p>
<p><div id="attachment_2346" style="width: 933px" class="wp-caption aligncenter"><a href="http://www.tedxchattanooga.com/"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2346" class="size-large wp-image-2346" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.46.47-AM-923x1024.png?x25141" alt="TEDxChattanooga website screenshot" width="923" height="1024" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.46.47-AM-923x1024.png?x25141 923w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.46.47-AM-270x300.png?x25141 270w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.46.47-AM.png?x25141 1378w" sizes="auto, (max-width: 923px) 100vw, 923px" /></a><p id="caption-attachment-2346" class="wp-caption-text">TEDxChattanooga website</p></div></p>
<p><a href="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.51.25-AM.png?x25141"><img loading="lazy" decoding="async" class="size-medium wp-image-2343 alignright" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.51.25-AM-177x300.png?x25141" alt="screen-shot 2015-11-04 at 11.51.25 AM" width="177" height="300" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.51.25-AM-177x300.png?x25141 177w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.51.25-AM-605x1024.png?x25141 605w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.51.25-AM.png?x25141 616w" sizes="auto, (max-width: 177px) 100vw, 177px" /></a>For this site, I chose a responsive Bootstrap 3 SASS WordPress theme, originally developed for TEDxToronto. I made a few tweaks and improvements to better fit our event, and worked with April Cox from UT Chattanooga to dial in&nbsp;the design and architecture. Developed&nbsp;on an Amazon EC2+Ubuntu+Webmin&nbsp;server running a Nginx+MySQL+PHP-FPM stack, the site&nbsp;should handle plenty of traffic, and can be scaled up to meet spikes in demand coinciding with the event.</p>
<p>Please check out <a href="http://www.tedxchattanooga.com/">TEDxChattanooga.com</a>!</p>
<p>Love Open Source software, but hate the generic&nbsp;branding? No problem. It&#8217;s very simple to create a fully-branded login&nbsp;screen for&nbsp;WordPress and Webmin/Virtualmin, to&nbsp;match a client&#8217;s logo and color scheme.</p>
<hr>
<p>&nbsp;</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-2344 size-medium" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.49.19-AM-283x300.png?x25141" alt="screen-shot 2015-11-04 at 11.49.19 AM" width="283" height="300" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.49.19-AM-283x300.png?x25141 283w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-11.49.19-AM.png?x25141 616w" sizes="auto, (max-width: 283px) 100vw, 283px" /></p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-2347 size-full" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.06.49-PM.png?x25141" alt="screen-shot 2015-11-04 at 12.06.49 PM" width="969" height="865" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.06.49-PM.png?x25141 969w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.06.49-PM-300x268.png?x25141 300w" sizes="auto, (max-width: 969px) 100vw, 969px" /></p>
<p><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-2348" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.09.52-PM-1024x793.png?x25141" alt="screen-shot 2015-11-04 at 12.09.52 PM" width="1024" height="793" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.09.52-PM-1024x793.png?x25141 1024w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.09.52-PM-300x232.png?x25141 300w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2015/11/screen-shot-2015-11-04-at-12.09.52-PM.png?x25141 1061w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></p>
<p>The post <a href="https://chrisgilligan.com/portfolio/tedx-event-website/">TEDx Event Website</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/portfolio/tedx-event-website/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Land Trust Website with Events Calendar</title>
		<link>https://chrisgilligan.com/portfolio/land-trust-website-with-events-calendar/</link>
					<comments>https://chrisgilligan.com/portfolio/land-trust-website-with-events-calendar/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 14 Aug 2013 20:44:39 +0000</pubDate>
				<category><![CDATA[Arts and Nonprofit]]></category>
		<category><![CDATA[Organizations]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2043</guid>

					<description><![CDATA[<p>Lula Lake Land Trust needed a quick website update to replace a neglected site that had been dormant for years. I chose WordPress with a Bootstrap theme for quick and flexible development, and generated a color palette using the Lavish Bootstrap color scheme generator. This is a great example of a site that can come [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/land-trust-website-with-events-calendar/">Land Trust Website with Events Calendar</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.47.54-PM.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p><strong><a href="http://lulalake.org/">Lula Lake Land Trust</a> needed a quick website update</strong> to replace a neglected site that had been dormant for years. I chose WordPress with a <a href="http://strappress.com/">Bootstrap theme</a> for quick and flexible development, and generated a color palette using the <a href="http://lavishbootstrap.com/">Lavish Bootstrap color scheme generator</a>.</p>
<p>This is a great example of a site that can come together in mere days, look great, and function well on every device from desktop to tablet to smart phone.</p>
<p><div id="attachment_2044" style="width: 1034px" class="wp-caption aligncenter"><a href="http://lulalake.org/"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2044" class="size-large wp-image-2044" alt="Lula Lake Land Trust website" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.33.11-PM-1024x969.png?x25141" width="1024" height="969" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.33.11-PM-1024x969.png?x25141 1024w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.33.11-PM-300x284.png?x25141 300w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.33.11-PM.png?x25141 1320w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><p id="caption-attachment-2044" class="wp-caption-text">Lula Lake Land Trust website</p></div></p>
<p><a href="http://lulalake.org/"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-2047" alt="screen-shot 2013-08-14 at 4.47.54 PM" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.47.54-PM.png?x25141" width="396" height="744" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.47.54-PM.png?x25141 396w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/screen-shot-2013-08-14-at-4.47.54-PM-159x300.png?x25141 159w" sizes="auto, (max-width: 396px) 100vw, 396px" /></a></p>
<p>The post <a href="https://chrisgilligan.com/portfolio/land-trust-website-with-events-calendar/">Land Trust Website with Events Calendar</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/portfolio/land-trust-website-with-events-calendar/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>University Website and Blog Redesign</title>
		<link>https://chrisgilligan.com/portfolio/university-website-and-blog-redesign/</link>
					<comments>https://chrisgilligan.com/portfolio/university-website-and-blog-redesign/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 14 Aug 2013 18:03:46 +0000</pubDate>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2038</guid>

					<description><![CDATA[<p>This was a team project for the University of Tennessee at Chattanooga, my alma mater and current employer. I was hired by UTC as web development specialist in late 2012, and worked with a cross-discipline team on the redesign, information architecture, 10,000 page migration to CMS and user training for over 300 web editors. The [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/university-website-and-blog-redesign/">University Website and Blog Redesign</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/utc-edu-bootstrap-site.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p>This was a team project for the <a href="http://utc.edu/">University of Tennessee at Chattanooga</a>, my <em>alma mater</em> and current employer. I was hired by UTC as web development specialist in late 2012, and worked with a cross-discipline team on the redesign, information architecture, 10,000 page migration to CMS and user training for over 300 web editors.</p>
<p>The design was built on <a href="http://getbootstrap.com/">Bootstrap</a>, a versatile framework that includes a flexible, responsive grid system, icon font, and <a href="http://lesscss.org/">LESS/CSS</a> styling for nearly any imaginable UI element. The site looks great on desktop, tablet and mobile phone; images are resized according to users&#8217; maximum screen width by <a href="http://adaptive-images.com">Adaptive Images</a>.</p>
<p style="text-align: center;"><a href="http://utc.edu/"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-2041img-thumbnail" alt="utc-edu-bootstrap-site" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/utc-edu-bootstrap-site-601x1024.png?x25141" width="601" height="1024" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/utc-edu-bootstrap-site-601x1024.png?x25141 601w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/utc-edu-bootstrap-site-176x300.png?x25141 176w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2013/08/utc-edu-bootstrap-site.png?x25141 1198w" sizes="auto, (max-width: 601px) 100vw, 601px" /></a></p>
<p>We worked with <a href="http://www.omniupdate.com/">OmniUpdate</a> to port the functional HTML templates to the OU Campus Content Management System.</p>
<p>A companion WordPress theme was created to retrofit the <a href="http://blog.utc.edu/">UTC Blogs</a> MultiSite. Enhanced WordPress RSS feeds in the media namespace populate news feeds on the home page.</p>
<h3>Deets for Devs</h3>
<p><div class="woo-sc-box  note   ">We’re using <a href="http://getbootstrap.com/2.3.2/">Bootstrap 2.3.2</a> with <a href="http://fontawesome.io/3.2.1/">Font Awesome 3.2.1</a> icons.</p>
<p>For initial HTML development, I used  <a href="http://getkickstrap.com">Kickstrap</a>.</p>
<p>I found a lot of great examples and code at  <a href="http://wrapbootstrap.com">WrapBootstrap</a> and <a href="http://bootsnip.com">Bootsnip</a>.</p>
<p>Our custom CSS files work for both the OU Campus site and WordPress blogs, because templates for both are built on Bootstrap… on WordPress, we use a child theme with a  <a href="http://bootswatch.com">BootSwatch style custom CSS</a>.</p>
<p>We host our own CSS, but pull fonts and JavaScript libraries from CDNs. Off-Canvas, drop-down sidenav was custom built using Bootstrap components, but now Jasny’s Bootstrap 3.0 fork (jasny.github.io/bootstrap) has a similar extension.</p>
<p>LESS Files: along with the entire <a href="http://mainandwilliams.net/">development site</a> (was easier to zip this way). <a href="https://drive.google.com/folderview?id=0B8InB6W8DuctdkNxTUtfUU9HT28&amp;usp=sharing">Download</a> &amp; unzip, it will run as a local site if you like…</p>
<p>Start with kickstrap.less, see what it includes — mostly the standard Bootstrap LESS files. Next look at theme.less, which jumps to Kickstrap/themes/utcms/theme.less, which has all of the custom stuff and some comments. Read the comments and then look at the individual files to see what’s going on: basically, anything that’s commented out uses the base Bootstrap CSS. At some point, I would like to change this workflow to pull the standard Bootstrap CSS from a CDN, and only load the override CSS.</p>
<p>Most of our specific changes are in variables.less, navbar.less, main.less (final custom overrides and tweaks) and logotype.less (for the header). I used CODA as an IDE, with <a href="http://incident57.com">CodeKit</a> as my LESS compiler.</div></p>
<div></div>
<p>The post <a href="https://chrisgilligan.com/portfolio/university-website-and-blog-redesign/">University Website and Blog Redesign</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/portfolio/university-website-and-blog-redesign/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress Fail2Ban RegEx for RedHat, CentOS, Amazon Linux</title>
		<link>https://chrisgilligan.com/consulting/wordpress-wp-fail2ban-regex-redhat-centos-amazon-linux/</link>
					<comments>https://chrisgilligan.com/consulting/wordpress-wp-fail2ban-regex-redhat-centos-amazon-linux/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Thu, 30 May 2013 00:30:24 +0000</pubDate>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=1875</guid>

					<description><![CDATA[<p>VacantServer WordPress sites are getting hammered with bad logins and probes. We&#8217;ve implemented a plugin to log failed login attempts to syslog, and a Fail2Ban filter for the same. If you run these on RedHat, you&#8217;ll need some additional configuration info&#8230; here it is: WordPress login failure regex (error_log): ^%(__prefix_line)sAuthentication failure for .* from &#60;HOST&#62;$ [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/consulting/wordpress-wp-fail2ban-regex-redhat-centos-amazon-linux/">WordPress Fail2Ban RegEx for RedHat, CentOS, Amazon Linux</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong><a href="http://vacantserver.net/">VacantServer</a> WordPress sites are getting hammered with bad logins and probes.</strong></p>
<p>We&#8217;ve implemented a <a href="http://wordpress.org/extend/plugins/wp-fail2ban/">plugin to log failed login attempts to syslog</a>, and a Fail2Ban filter for the same. If you run these on RedHat, you&#8217;ll need some additional configuration info&#8230; here it is:</p>
<div>
<div><strong>WordPress login failure regex (error_log):</strong></div>
<div>
<pre class="lang:default decode:true ">^%(__prefix_line)sAuthentication failure for .* from &lt;HOST&gt;$</pre>
<p><strong>Apache nohome regex (error_log):</strong></p>
</div>
<div>
<pre class="lang:default decode:true ">[[]client &lt;HOST&gt;[]] File does not exist: .*/~.*</pre>
<p><strong>PHP noscript regex (/home/*/logs/error_log,/var/log/httpd/error_log):</strong></p>
</div>
<div>
<pre class="lang:default decode:true">[[]client &lt;HOST&gt;[]] (File does not exist|script not found or unable to stat): /\S*(\.php|\.asp|\.exe|\.pl)
[[]client &lt;HOST&gt;[]] script '/\S*(\.php|\.asp|\.exe|\.pl)\S*' not found or unable to stat *$</pre>
<p><strong>XMLRPC flood attacks &#8212; DDoS and probing (/home/*/logs/access_log):</strong></p>
<pre class="lang:default decode:true crayon-selected">&lt;HOST&gt;\s.*\s.POST\s/xmlrpc.php*.\s.*</pre>
<p>Please also enable the generic apache-nohome, apache-noscript. Install wp fail2ban plugin (and configure it for your server) on your high traffic blogs. These all are helping during the current onslaught, which also includes probing for wp-admin directories, probing for /wp-admin/login.php, plus comment spam.</p>
<p>A new XMLRPC exploit has the script kiddies doing DDoS and probing for vulnerable services, and possibly doing remote code execution on vulnerable services.</p>
<h4>Here are some additional resources:</h4>
<ul>
<li>RegEx testing tool: <a href="http://gskinner.com/RegExr/">RegExr (AIR and web versions)</a></li>
<li>use <a href="http://www.fail2ban.org/wiki/index.php/MANUAL_0_8#Testing">Fail2Ban&#8217;s built-in regex testing</a></li>
<li>additionally, try <a href="http://23x.net/908/securing-wordpress-using-fail2ban.html">23x&#8217;s Apache WordPress Fail2Ban advice</a></li>
<li>block spammer IP&#8217;s via <a href="http://blog.shadypixel.com/spam-log-plugin/">Akismet: Spam-Log Plugin</a></li>
</ul>
</div>
</div>
<p>The post <a href="https://chrisgilligan.com/consulting/wordpress-wp-fail2ban-regex-redhat-centos-amazon-linux/">WordPress Fail2Ban RegEx for RedHat, CentOS, Amazon Linux</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/consulting/wordpress-wp-fail2ban-regex-redhat-centos-amazon-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Portable Wifi Hotspot Rental Site</title>
		<link>https://chrisgilligan.com/portfolio/portable-wifi-hotspot-rental-site/</link>
					<comments>https://chrisgilligan.com/portfolio/portable-wifi-hotspot-rental-site/#respond</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 12 Sep 2012 16:25:53 +0000</pubDate>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[E-Commerce]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Small Business]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[Virtualmin]]></category>
		<category><![CDATA[Web Server Performance Tuning]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=2318</guid>

					<description><![CDATA[<p>Trawire.com offers portable 4G MiFi and iPad rentals for visitors traveling to Iceland. Trawire&#8217;s CIO approached me for assistance after his systems administrator bailed and left him with a poorly maintained, self-hosted MacMini server running unoptimized WordPress installs. I migrated the site to Amazon Web Services, where it now can handle traffic spikes and can be [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/portable-wifi-hotspot-rental-site/">Portable Wifi Hotspot Rental Site</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2014/10/screen-shot-2014-10-02-at-12.29.29-PM.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p><strong><a href="http://iceland.trawire.com/">Trawire.com</a> offers portable 4G MiFi and iPad rentals for visitors traveling to Iceland.</strong> Trawire&#8217;s CIO approached me for assistance after his systems administrator bailed and left him with a poorly maintained, self-hosted MacMini server running unoptimized WordPress installs.</p>
<p><div id="attachment_2319" style="width: 310px" class="wp-caption aligncenter"><a href="http://iceland.trawire.com/"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2319" class="size-medium wp-image-2319" src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2014/10/screen-shot-2014-10-02-at-12.29.29-PM-300x259.png?x25141" alt="Trawire website" width="300" height="259" srcset="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2014/10/screen-shot-2014-10-02-at-12.29.29-PM-300x259.png?x25141 300w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2014/10/screen-shot-2014-10-02-at-12.29.29-PM-1024x886.png?x25141 1024w, https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2014/10/screen-shot-2014-10-02-at-12.29.29-PM.png?x25141 1235w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2319" class="wp-caption-text">Trawire website</p></div></p>
<p>I migrated the site to Amazon Web Services, where it now can handle traffic spikes and can be scaled and built out more easily, should the concept grow to additional markets. Working with my WordPress coding contacts in India, Trawire developed plugins to add features, and keep the software up-to-date. My contributions: caching and content distribution for static assets &amp; queries, Virtualmin and phpMyAdmin for ease of management and development.</p>
<p>&nbsp;</p>
<p>The post <a href="https://chrisgilligan.com/portfolio/portable-wifi-hotspot-rental-site/">Portable Wifi Hotspot Rental Site</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/portfolio/portable-wifi-hotspot-rental-site/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SSL and CloudFront CDN Support for WebFonts via .htaccess</title>
		<link>https://chrisgilligan.com/wordpress/add-cloudfront-cdn-support-for-webfonts-via-htaccess/</link>
					<comments>https://chrisgilligan.com/wordpress/add-cloudfront-cdn-support-for-webfonts-via-htaccess/#comments</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 05 Sep 2012 21:33:27 +0000</pubDate>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[webfont]]></category>
		<category><![CDATA[webfonts]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=1005</guid>

					<description><![CDATA[<p>I recently upgraded my WordPress theme to WooThemes Canvas 5.x, and I found that some of the icons were not rendering, but were showing a letter or integer instead. I dug into the code and found that these icons are now delivered via @font-face webfonts. Meanwhile, I&#8217;m working on a client&#8217;s e-commerce site with Google [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/wordpress/add-cloudfront-cdn-support-for-webfonts-via-htaccess/">SSL and CloudFront CDN Support for WebFonts via .htaccess</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/09/twitter_font-face.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p>I recently upgraded my WordPress theme to <a href="http://zfer.us/OtCqz">WooThemes Canvas 5.x</a>, and I found that some of the icons were not rendering, but were showing a letter or integer instead. I dug into the code and found that these icons are now delivered via @font-face webfonts.</p>
<p>Meanwhile, I&#8217;m working on a client&#8217;s e-commerce site with Google WebFonts and a custom webfont to display the Rupee symbol (Indian currency).</p>
<p>Though the fonts were uploading properly to the CloudFront CDN, and were properly referenced in the minified CSS on the CDN, they were not rendering in Firefox or IE, and the SSL pages on the client&#8217;s site were throwing security warnings.</p>
<p>At first I thought this might be a W3 Total Cache issue, because upgrading to the latest development release had solved some other CSS issues. However, it turned out to be a browser security issue.</p>
<p>Evidently this is a security measure to prevent cross-site attacks, but you can allow this via Apache mod_headers, to allow your specific CloudFront (or other) domain, specified in the .htaccess file.</p>
<p>Some sites have suggested using &#8220;*&#8221; wildcards to allow all domains&#8230; but obviously this is a security issue: with this Header, you are granting JavaScript clients basic access to your resources. I recommend you only allow access to the specific CDN domains you require. Do this with a comma separated list, in double quotes.</p>
<pre class="lang:default decode:true" title=".htaccess for CDN webfonts cross-site"># BEGIN CDN Cross-Site for Webfonts
&lt;IfModule mod_mime.c&gt;
        AddType font/ttf .ttf
        AddType font/eot .eot
        AddType font/opentype .otf
        AddType font/x-woff .woff
&lt;/IfModule&gt;
&lt;FilesMatch "\.(svg|ttf|otf|eot|woff)$"&gt;
    &lt;IfModule mod_headers.c&gt;
        Header set Access-Control-Allow-Origin "fonts.googleapis.com,{{yourdistro69}}.cloudfront.net"
    &lt;/IfModule&gt;
&lt;/FilesMatch&gt;
# END CDN Cross-Site for Webfonts</pre>
<p>Yay! Delicious webfonts, even on SSL pages via CDN!</p>
<p>The post <a href="https://chrisgilligan.com/wordpress/add-cloudfront-cdn-support-for-webfonts-via-htaccess/">SSL and CloudFront CDN Support for WebFonts via .htaccess</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/wordpress/add-cloudfront-cdn-support-for-webfonts-via-htaccess/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Varnish VCL and Config for WordPress with W3 Total Cache</title>
		<link>https://chrisgilligan.com/consulting/varnish-vcl-and-config-for-wordpress-with-w3-total-cache/</link>
					<comments>https://chrisgilligan.com/consulting/varnish-vcl-and-config-for-wordpress-with-w3-total-cache/#comments</comments>
		
		<dc:creator><![CDATA[Chris Gilligan]]></dc:creator>
		<pubDate>Wed, 15 Aug 2012 00:23:11 +0000</pubDate>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[Web Server Performance Tuning]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[apc cache]]></category>
		<category><![CDATA[apc fcgid]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[varnish cache]]></category>
		<category><![CDATA[w3 total cache]]></category>
		<category><![CDATA[w3tc]]></category>
		<guid isPermaLink="false">https://chrisgilligan.com/?p=867</guid>

					<description><![CDATA[<p>I have been working on a Varnish front-end for Apache, to be used with WordPress sites. I described the architecture in Load Balancing Virtualmin WordPress Hosting Server with Varnish on AWS. I now have a configuration that seems to work for all WordPress features, including logged-out commenting. This configuration also works well with W3 Total [&#8230;]</p>
<p>The post <a href="https://chrisgilligan.com/consulting/varnish-vcl-and-config-for-wordpress-with-w3-total-cache/">Varnish VCL and Config for WordPress with W3 Total Cache</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="float: right; margin: 0 0 10px 15px; width:240px; height: auto;">
		<img src="https://d2lehxir4n36oh.cloudfront.net/wp-content/uploads/2012/08/wordnish.png?x25141" width="240" style="max-width: 100%; height: auto;" />
		</p><p>I have been working on a Varnish front-end for Apache, to be used with WordPress sites. I described the architecture in <a title="Load Balancing Virtualmin WordPress Hosting Server with Varnish on AWS" href="https://chrisgilligan.com/consulting/load-balancing-virtualmin-wordpress-hosting-server-varnish-aws/">Load Balancing Virtualmin WordPress Hosting Server with Varnish on AWS</a>. I now have a configuration that seems to work for all WordPress features, including logged-out commenting. This configuration also works well with W3 Total Cache.</p>
<p>This configuration is for Varnish on a separate server, but should also work on a single server with appropriate changes to the port and backend IP settings.</p>
<h3>Varnish Config (/etc/sysconfig/varnish)</h3>
<pre class="lang:perl decode:true crayon-selected"># Configuration file for varnish
#
# /etc/init.d/varnish expects the variable $DAEMON_OPTS to be set from this
# shell script fragment.
#
#
# Maximum number of open files (for ulimit -n)
NFILES=131072
#
# Locked shared memory (for ulimit -l)
# Default log size is 82MB + header
MEMLOCK=82000
#
# Maximum size of corefile (for ulimit -c). Default in Fedora is 0
# DAEMON_COREFILE_LIMIT="unlimited"
#
# Set this to 1 to make init script reload try to switch vcl without restart.
# To make this work, you need to set the following variables
# explicit: VARNISH_VCL_CONF, VARNISH_ADMIN_LISTEN_ADDRESS,
# VARNISH_ADMIN_LISTEN_PORT, VARNISH_SECRET_FILE
RELOAD_VCL=1
#
## Advanced configuration
#
# # Main configuration file.
VARNISH_VCL_CONF=/etc/varnish/wordpress-varnish3.vcl
#
# # Default address and port to bind to
# # Blank address means all IPv4 and IPv6 interfaces, otherwise specify
# # a host name, an IPv4 dotted quad, or an IPv6 address in brackets.
# VARNISH_LISTEN_ADDRESS=
VARNISH_LISTEN_PORT=80
#
# # Telnet admin interface listen address and port
VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
VARNISH_ADMIN_LISTEN_PORT=6082
#
# # Shared secret file for admin interface
VARNISH_SECRET_FILE=/etc/varnish/secret
#
# # The minimum number of worker threads to start
VARNISH_MIN_THREADS=1
#
# # The Maximum number of worker threads to start
VARNISH_MAX_THREADS=1000
#
# # Idle timeout for worker threads
VARNISH_THREAD_TIMEOUT=120
#
# # Cache file location if using file cache
#VARNISH_STORAGE_FILE=/var/lib/varnish/varnish_storage.bin
#
# # Cache size: in bytes, optionally using k / M / G / T suffix,
# # or in percentage of available disk space using the % suffix.
VARNISH_STORAGE_SIZE=3G
#
# # Backend storage specification
# malloc runs from RAM, file from file
VARNISH_STORAGE="malloc,${VARNISH_STORAGE_SIZE}"
#VARNISH_STORAGE="file,${VARNISH_STORAGE_FILE},${VARNISH_STORAGE_SIZE}"
#
# # Default TTL used when the backend does not specify one
VARNISH_TTL=120
#
# # DAEMON_OPTS is used by the init script. If you add or remove options,
# # be sure you update this section, too.
DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
-f ${VARNISH_VCL_CONF} \
-T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
-t ${VARNISH_TTL} \
-w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \
-u varnish -g varnish \
-S ${VARNISH_SECRET_FILE} \
-s ${VARNISH_STORAGE}"
#</pre>
<h3>Varnish VCL (/etc/varnish/wordpress-varnish3.vcl)</h3>
<pre class="lang:default decode:true">backend origin {
.host = "10.11.12.13";
.port = "80";
.connect_timeout = 60s;
.first_byte_timeout = 60s;
.between_bytes_timeout = 60s;
}
#
sub vcl_recv {
# only using one backend
set req.backend = origin;
#
# set standard proxied ip header for getting original remote address
set req.http.X-Forwarded-For = client.ip;
#
# logged in users must always pass
if( req.url ~ "^/wp-(login|admin)" || req.http.Cookie ~ "wordpress_logged_in_" ){
return (pass);
}
# accept purges from w3tc and varnish http purge
if (req.request == "PURGE") {
return (lookup);
}
#
# don't cache search results
if( req.url ~ "\?s=" ){
return (pass);
}
#
# always pass through posted requests and those with basic auth
if ( req.request == "POST" || req.http.Authorization ) {
return (pass);
}
#
# else ok to fetch a cached page
unset req.http.Cookie;
return (lookup);
}
#
# accept purges from w3tc and varnish http purge
sub vcl_hit {
if (req.request == "PURGE") { purge; }
return (deliver);
}
#
# accept purges from w3tc and varnish http purge
sub vcl_miss {
if (req.request == "PURGE") { purge; }
return (fetch);
}
#
sub vcl_fetch {
#
# remove some headers we never want to see
unset beresp.http.Server;
unset beresp.http.X-Powered-By;
#
# only allow cookies to be set if we're in admin area - i.e. commenters stay logged out
if( beresp.http.Set-Cookie &amp;&amp; req.url !~ "^/wp-(login|admin)" ){
unset beresp.http.Set-Cookie;
}
#
# don't cache response to posted requests or those with basic auth
if ( req.request == "POST" || req.http.Authorization ) {
return (hit_for_pass);
}
#
# only cache status ok
if ( beresp.status != 200 ) {
return (hit_for_pass);
}
#
# don't cache search results
if( req.url ~ "\?s=" ){
return (hit_for_pass);
}
#
# else ok to cache the response
set beresp.ttl = 24h;
return (deliver);
}
#
sub vcl_deliver {
# add debugging headers, so we can see what's cached
if (obj.hits &gt; 0) {
set resp.http.X-Cache = "HIT";
}
else {
set resp.http.X-Cache = "MISS";
}
# remove some headers added by varnish
unset resp.http.Via;
unset resp.http.X-Varnish;
}
#
sub vcl_hash {
hash_data( req.url );
# altering hash so subdomains are ignored.
# don't do this if you actually run different sites on different subdomains
if ( req.http.host ) {
hash_data( regsub( req.http.host, "^([^\.]+\.)+([a-z]+)$", "\1\2" ) );
} else {
hash_data( server.ip );
}
# ensure separate cache for mobile clients (WPTouch workaround)
if( req.http.User-Agent ~ "(iPod|iPhone|incognito|webmate|dream|CUPCAKE|WebOS|blackberry9\d\d\d)" ){
hash_data("touch");
}
return (hash);
}</pre>
<p>The post <a href="https://chrisgilligan.com/consulting/varnish-vcl-and-config-for-wordpress-with-w3-total-cache/">Varnish VCL and Config for WordPress with W3 Total Cache</a> appeared first on <a href="https://chrisgilligan.com">Chris Gilligan » new media</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://chrisgilligan.com/consulting/varnish-vcl-and-config-for-wordpress-with-w3-total-cache/feed/</wfw:commentRss>
			<slash:comments>25</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Page Caching using Disk: Enhanced 
Content Delivery Network via Amazon Web Services: CloudFront: d2lehxir4n36oh.cloudfront.net
Lazy Loading (feed)

Served from: chrisgilligan.com @ 2026-07-01 12:39:31 by W3 Total Cache
-->