Blog items tagged with "advanced-tips"
PHP and Exponent in 2017 (and Browsers too)
This article is a follow up to PHP AND EXPONENT IN 2016. Roughly one year after that previous article, PHP development is proceeding at breakneck speeds and we have seen two minor versions pass (though v7.2 is in release candidate status). Here's how it affects Exponent CMS.
The current release of Exponent (v2.4.1) is compatible with PHP v5.3 through v7.1. However, it is not compatible with PHP v7.2 (this will be corrected in the v2.4.2 release). The next release of Exponent (v2.4.2) will be compatible with PHP v5.5 through v7.2. We'll drop support for PHP v5.3 and v5.4 in that release because they are simply too insecure and should not be used in a production environment. And even though we will support PHP v5.5 in the next release, it is no longer recommended for production use since it was marked 'end of life' over one year ago. PHP v5.6 and v7.0 will be supported by their organization through the end of 2018, at which point only PHP v7.1 or later would be recommended. Another reason to remove old PHP version support in Exponent is that many of our 3rd party libraries simply no longer support ancient versions of PHP.
While we're on the subject of obsolete software, many browser software versions have also been termed 'end of life' and it is strongly encouraged they NOT be used! This would include Internet Explorer versions less than v11 (Edge in Windows 10 is considered Internet Explorer v12/v13). A beneficial side effect to this is that recommended browser versions are all now HTML5 compliant...which means that Exponent shouldn't need to use patches/tweaks to support HTML5 non-compliant browsers.Therefore, in the near future (though not in v2.4.2), we will drop support for obsolete/ancient browsers, which in turn should speed up page loading a bit.
PHP and Exponent in 2016
The primary scripting language used in Exponent CMS is PHP, just as with most other CMS packages such as W***P****, J***la, and D***pal. PHP is a scripting processor running on the web server which parses the PHP scripts to perform a task or output a page. Unlike javascript which is processed within the browser on the viewer's device. PHP development has been advancing at break-neck speed over recent months, and here's how it affects Exponent CMS.
Exponent CMS v2.0 was originally released supporting PHP version 5.2.1 or later, which at the time was v5.3.x. Support for PHP v5.4 was added in Exponent v2.0.7. Support for PHP v5.5 was added in Exponent v2.2.1. Support for PHP v5.6 was added in Exponent v2.3.1. Support for PHP version 5.2.x was DROPPED in Exponent v2.3.2 because several of the supporting libraries no longer supported such an old version of PHP. And support for PHP version 7.0, the current stable release was added in Exponent v2.3.7.
Most site administrators have little control over which version of PHP their web host server is running, but some hosts do offer a selection within their 'control panel' settings. Therefore, you have to trust your web host provider in keeping your PHP versions up to date since many of the updates remove security vulnerabilities. PHP version 5.2.x has been obsolete for quite some time. PHP version 5.3.x was termed 'end of life' meaning it was no longer updated in August 2014. PHP version 5.4.x was termed 'end of life' September 2015 and PHP version 5.5 reached 'end of life' a few months ago. With that being said, PHP versions 5.6.x and v7.0.x are the only recommended and supported versions available, both of which will be supported until at least late 2018. PHP version 7.1.x should be released before the end of 2016 and is in beta testing now.
Therefore, if you have a new enough version of Exponent to support a newer version of PHP, you should probably encourage your web host provider to move to it to prevent security attacks from harming your site or data. Furthermore, running PHP v7.0.x will give your site a tremendous speed increase because it is so much more efficient. The next version of Exponent (v2.3.9) will be released in a few days and supports PHP versions 5.3.x, 5.4.x, 5.5.x, 5.6.x, and 7.0.x and likely supports 7.1.x though testing isn't complete. You can expect Exponent to drop support for PHP v5.3.x very soon, with v5.4.x support not being provided too much longer either.
jQuery and Exponent....sitting in a tree...
The jQuery javascript library has been integrated into Exponent since v2.2.0 in an effort to help us move away from the YUI library. jQuery is more popular and has many more add-ons/plugins/widgets than does YUI. It is also the javascript library of choice for Twitter Bootstrap. Just like YUI, Exponent easily integrates the use of jQuery into the Exponent framework. Here are some tips on using jQuery with your custom theme or view.
Just like YUI, jQuery is NOT automatically loaded, but only loaded if needed on the page. (However, most every page has some YUI code or widget, therefore it appears that YUI is always loaded). We load jQuery (or YUI) using the {script} Smarty template tag. We can either simply load the base jQuery library script, or we can use it to also load add-ons/plugins and associated stylesheets (again just like the YUI module loader).
The {script} block is used within view templates to delineate a javascript script or javascript code (docs found here). It is recommended that you NOT load your own jQuery library within the view template or theme template, as it will likely conflict with the integrated version. We ship the latest versions with Exponent and load jQuery v2.x in most browsers and v1.x in Internet Explorer versions less than 9 and Firefox version less than 3.7. The simplest approach is to use this to embed a jQuery code snippet:
{script unique="myuniqueid" jquery=1}
{literal}
$(document).ready(function() {
// jQuery code goes here
} );
{/literal}
{/script}
We can also use the tag to load jQuery add-ons/plugins either in the system or within the custom theme. To load an addon, just enter its name (sans the .js) into the jquery parameter. It will first search the theme's /js folder and if found will then look for a like named .less or .css file in the /less or /css sibling folder. The system jQuery add-ons are located in /external/jquery/addons/. So to load the jQuery Colorbox (lightbox) addon (jquery.colorbox.js and jquery.colorbox.css), you'd use the following:
{script unique="myuniqueid" jquery='jquery.colorbox'}
{literal}
$('a.calpopevent').click(function(e) {
target = e.target; $.colorbox({
href: EXPONENT.PATH_RELATIVE+"index.php?controller=eventregistration&action=show&ajax_action=1&title="+target.id,
maxWidth: 650
});
e.preventDefault();
});
{/literal}
{/script}
We can also use the tag to load a jQuery script just as we would any other script.
{script unique="myuniqueid" jquery=1 src='myjqueryscript.js'}
{literal}
$(document).ready(function() {
// jQuery code goes here
myjsfunction(1, 2, 3); // function contained in myjqueryscript.js
} );
{/literal}
{/script}
Hopefully this little introduction to using jQuery within Exponent has whetted you appetite for using javascript within your custom theme or view.
Part V – Google Analytics – Advanced SEO Tips for Your Exponent CMS Website
In this, Part V of my advanced SEO tips for Exponent CMS websites, I'll discuss a critical component for search engine marketing: Analytics.
A gigantic aspect of search marketing is measuring, analyzing, and modifying your SEO and PPC campaigns to ensure they're always performing at their best. The best way to gather this data is by integrating a comprehensive traffic analytics program into your Exponent CMS website.
One of the most popular Analytics programs available – and is 100 percent free – is Google Analytics. Google Analytics gathers detailed statistics about web traffic and its sources and measures conversions and sales. All of this data is essential for running a well optimized SEO campaign.
So how do you get Google Analytics to work on your Exponent CMS website? If you're the webmaster of an Exponent site, the process takes a few steps but it's really quite simple.
Setting Up Your Google Analytics Account
If you or your client don't already have a Google Analytics account set up, it's very easy to get a new account. Simply go to Google.com/Analytics and sign in with your Google Account. From there, you'll need to go to Accounts list and click to add a “New Account.”
Next, fill out the pertinent information about your Exponent CMS website, giving it an account name and providing your website's URL. Whether or not you choose to allow Google to view your account data is up to you.
When you're done, simply click “Get Tracking ID” and accept the Google Terms & Conditions to get the code snippet you'll need to integrate into your Exponent CMS theme files.
Installing Your Google Analytics Code
As you can see in the image above, you'll need to simply copy the code snippet tracking code found in the box that is specific to your account and paste it into each page of your site.
If you were working with a straight HTML site, this could get a little cumbersome, however because we're working with a dynamic CMS that uses themes/subthemes, you'll only need to paste it into each of your theme files.
You can access these theme files within cPanel or by pulling them down via FTP.
Within your public_html directory, you'll need to navigate into your Exponent theme folder and into the directory of the theme you're using for your website.
Within your theme directory you'll first want to edit your index.php file, inserting your code snippet just before the closing body tag of the file:
Once you've pasted in your snippet, save the file or push it back up via FTP. Go back into your theme folder and into “subthemes” and repeat this paste/save step for each of your website's subtheme files.
Once you've saved the snippet, you can verify its tracking status by going back to your Google Analytics account and into Tracking Info where you copied your code snippet. There you'll see the tracking status for your Analytics account:
Now that you've successfully setup and installed Google Analytics into your Exponent CMS website, you can now set goals, track traffic sources and gather other pertinent website data that will help you continually measure and analyze the performance of your SEO marketing strategy.
About the Author
This SEO tutorial article was written by Chris Everett, a search engine marketing consultant at Captivate Search Marketing in Atlanta, Georgia.
Chris has worked with Exponent CMS websites since 2007 and continues to help improve the system's SEO friendliness.
Connect with Chris on Google+ to learn more.
Part IV – XML Sitemaps – Advanced SEO Tips for Your Exponent CMS Website
As a follow up to Part III of my advanced SEO tips for Exponent CMS webmasters that discussed installing webmaster tools, I'll now discuss the importance of XML Sitemaps and how to create and configure one for your Exponent site.
What are XML Sitemaps?
XML Sitemaps for your website that notifies the search engines about each web pages on your site, how important each page is, as well as how often the site is updated.
Creating a XML Sitemap also provides a way for the search engines to discover pages on your website that they might not have found through the normal site crawling process.
A complement to the Robots.txt file, after they are generated, XML Sitemaps are uploaded to Google and Bing Webmaster tools to help you manage the indexation of your web pages.
Creating & Uploading a XML Sitemap
Generating an XML sitemap is very easy by going to www.xml-sitemaps.com.
This website gives step by step instructions on how to create your XML Sitemap. You'll first need to enter your website URL and then select the frequency that your site is changed.
Next you can tell the search engines precisely when the last time your site was updated:
The Priority tag for your XML sitemap assigns a value to your URLs between 0.0 and 1.0, where 0.0 identifies the lowest priority URLs on your site and 1.0 identifies the highest priority URLs. The default priority of a page is 0.5.
Once you've filled out the necessary data, you can then run your XML Sitemap by clicking the “Start” Button.
As you can see in the image above, you can run a XML Sitemap for a website up to 500 pages for free. If your website has more than 500 pages that need to be indexed, you'll have to find an alternative sitemap generator, or pay for the advanced version.
Once you click “Start” the Sitemap crawler will start to build your XML Sitemap:
Once the Sitemap generator is finished running, you can download it and push it up to the public_html directory of your Exponent CMS website via FTP or cPanel/WHM.
You can verify that you've properly uploaded your XML sitemap by going to www.yourwebsite.com/sitemap.xml It should look something like this:
Configuring Your XML Sitemap in Webmaster Tools
So now that you've created and uploaded your new XML Sitemap to your web server, you now must go to Webmaster tools for both Google and Bing and submit your XML Sitemap URL.
Google Webmaster Tools
In the Google Webmaster Tools, you can access the Sitemap configuration page from the dashboard, or on the left hand menu under Optimization by clicking the “Sitemaps” link.
Once you've landed on the Sitemaps configuration page, you can submit a new sitemap by clicking the red “Add/Test Sitemap” button on the right hand side.
There, you'll simply enter “sitemap.xml” in the rest of the URL field and click “Submit Sitemap”
You'll receive a “Sitemap Submitted” message to let you know that you've successfully completed the process:
Bing Webmaster Tools
Similarly to the Google Webmaster Tools, you can submit a XML Sitemap on the Bing Webmaster Tools dashboard under the “Sitemaps” section:
To submit the sitemap, simply click “Submit a Sitemap” and fill out your XML Sitemap URL:
Once you've filled out your URL, click submit and you're done.
You now have successfully notified the search engines about each page on your website. While it does not guarantee every page will be indexed, it does help eliminate URLs not getting picked up through normal crawling.
In Part V of this Advanced SEO Tips series, I'll discuss how to configure and install Google Analytics on your Exponent CMS website.
About the Author
Chris Everett is an organic SEO expert and is the founder of the Captivate Search Marketing search engine marketing firm in Atlanta, GA.
If you'd like to learn more about how to optimize your Exponent CMS website for maximum SEO value, feel free to contact Chris on Google+ or by visiting his website.
Part III – Webmaster Tools – Advanced SEO Tips for Your Exponent CMS Website
If you're the webmaster of an Exponent CMS website that is undergoing a search engine marketing program, there are several metrics you'll need to analyze to measure the performance of your campaign.
Among those basic trends are web page indexation, as well as website traffic and its sources.
In this, the third part of my Advanced SEO Tips for Exponent CMS Websites series, I'll discuss how to verify and install Google & Bing Webmaster Tools. In later posts, I'll discuss how to create and upload XML sitemaps, as well has how to setup and install Google Analytics.
Webmaster Tools
Webmaster tools allow you to manage the indexation of your website, as well as analyze its visibility in the search index. Before you can do this, though, you must first verify ownership of your site with both Google and Bing search engines.
Install Google Webmaster Tools
After logging into your Google Account, you'll want to go to https://www.google.com/webmasters/tools/. To setup your website profile, you'll need to select the red “Add a Site” Button on the right hand side of your screen.
A popup box will then appear, where you'll type in your website's domain name.
You'll next be directed to Verify ownership of your website.
There are multiple ways to verify ownership including inserting a meta tag in the header of your theme file or selecting your DNS provider, but the method I like to use is uploading an html verification file.
Simply download your HTML verification file and then upload that file to your public_html directory through cPanel or FTP.
Once your file is uploaded, go back to Google Webmaster Tools and click the red verify button.
If you've successfully uploaded your verification file, you'll get a Green check mark letting you know you've retained ownership of the site.
Install Bing Webmaster Tools
Similarly to Google, Bing Webmaster Tools can also be verified multiple ways. First you'll go to http://www.bing.com/toolbox/webmaster and either sign in or create a new account.
Once you are logged in you'll see your Bing Webmaster Tools domain dashboard and immediately you'll notice the “Add a Site” box where you can quickly type in your site's domain and then click “Add”
You'll then be directed to a screen where you're given the option to declare whether an XML sitemap has been uploaded to your server:
If you don't have an XML sitemap already on your web server, you can simply click “Add” and move forward through the process. I'll discuss creating and uploading XML sitemaps in Part IV of this advanced SEO tips for Exponent CMS websites.
You can download your “BingSiteAuth.xml” verification file from Bing and then push that file up to public_html through FTP or cPanel/WHM. Once you've uploaded the file, click the “Verify” button to complete the process.
Once you've verified ownership of your website with both Google and Bing Webmaster Tools, you can then remove URLs from the search index, view any crawl errors experienced by search spiders, analyze the overall health of your site, as well as submit XML sitemaps - all of which are essential tasks for properly maintaining a website undergoing an advanced SEO program.
About the Author
This article was written by SEO consultant Chris Everett of Captivate Search Marketing in Atlanta, Georgia.
Chris has worked with the Exponent CMS open source project since 2007.
Feel free to connect with him on Google+ or LinkedIn.
Part II - .HTACCESS - Advanced SEO Tips For Your Exponent CMS Website
In Part II of my Advanced SEO Tips for Exponent CMS websites, I'll discuss how you can utilize your .htaccess file to practice better SEO.
.HTACCESS
Your .htaccess file, which also ships in your Exponent CMS install, is used to override the Apache or PHP configuration files on your web server.
The .htaccess file can be pulled down from your Exponent site's public_html directory much like the robots.txt, which I discussed in Part I of this advanced series file can through FTP or cPanel/WHM. The one catch here is if you're trying to pull it down from cPanel/WHM, you must check the box that allows you to see hidden files (dotfiles) in your directories.
For SEOs who are optimizing Exponent CMS sites, there are two primary modifications that they can make to the file in order to make their Exponent CMS sites more SEO friendly.
Forcing a Preferred Domain URL
The first .htaccess modification you can make to optimize your website for SEO is to force a www. or a non-www. domain URL structure. This prohibits the possibility of two identical pages being indexed by the search engines with a www. and a non-www. version of the same website (the dreaded duplicate content issue!)
In the latest releases of Exponent CMS that support canonical URLs, this isn't such a big deal (so long as you're defining the canonical URL), but in previous versions of Exponent CMS before 2.2.0, you'll want to make sure you put this modification in place.
All you need to do is pull down your .htaccess file, uncomment out the example rule you want to follow, fill in the proper domain name, save, and re-push your file to the live server:
301 Redirects
During a website redesign project, one of the most important items to cross off the go-live check list (for the SEO minded at least) is to ensure you have any 301 redirects in place for URLs that have been indexed by the search engines.
Often times when a website is moved from one CMS platform to another, or undergoes an SEO overhaul, the URLs of each web page are updated.
When this happens, SEOs want to ensure that every URL that's been indexed by the search engines are permanently (301) redirected to their new URLs so the website does not lose any of their current organic rankings, nor deter potential customers who have found the website via organic search and landed on a “Page Not Found” (404 error) because the URL they landed on wasn't properly redirected.
Plotting out 301 Redirects is relatively simple in the .htaccess file. All you need to do is pull it down from your public_html directory and at the bottom of your .htaccess file start adding your 301 Redirect rules, which would look as such:
These two .htaccess modifications are critical for websites undergoing SEO programs, particularly when that site is going through a redesign.
About the Author
This blog post was written by Chris J. Everett, a small business SEO consultant based in Atlanta, Georgia.
Chris has used Exponent CMS extensively over the past 5 years and writes about topics related to the SEO friendliness of the system.
To learn more about Chris, connect with him on Google+.
Advanced SEO Tips For Your Exponent CMS Website (Part I - Robots.txt)
When reading blogs that discuss topics related to SEO, most of the time you'll read about on-site strategies such as keyword optimization, image optimization, cross linking, etc.
Most of these on-site strategies can be easily executed through the administration interface of your Exponent CMS website.
Some of the mission critical items for SEO that you can't execute through the admin interface of your Exponent CMS must be done on the web server through a FTP or cPanel/WHM type interface.
This post is the first in a series of submissions I'll write over the next few days discussing advanced server-side SEO tips for your Exponent CMS website include editing your robots.txt and .htaccess files, as well as pushing webmaster tools verification files and XML sitemaps to your web server.
In this edition, Part I, I'll discuss how modifying the Robots.txt file that resides on your web server can eliminate issues with duplicate content.
Robots.txt
The Robots.txt file on your web server defines crawling parameters for robots that crawl websites all over the Internet. For SEO, the Robots.txt file is a way to allow/disallow search engine robots (such as Googlebot) that index your web pages from crawling specific directories on your website.
If you're working with a new install of Exponent CMS, the Robots.txt file will be included in your installation with a basic set of disallow parameters that will look like this:
Because Exponent CMS is a dynamic platform, there are several modules within the system such as blog/news/portfolio or ecommerce that can pose some SEO headaches revolving around duplicate content.
Some of the most frequent issues that I encounter from Exponent CMS websites in terms of duplicate title tags, content, etc., come from the tagging functionality (blogs in specific) and when login/view cart links are hard coded for users on ecommerce websites.
If a robot can crawl a link to a blog tag or a link to login, this often times causes that URL to be indexed – more often than not with a duplicate Title or Description tag as other dynamic pages on your site. The example below shows an ecommerce Exponent CMS website that has had its login module link indexed. As you can see, the meta description is exactly the same as the homepage meta description:
You can easily prevent this type of SEO issue by disallowing the /loginmodule (or for newer versions of Exponent the /login) or any other troublesome directories within your Robots.txt file.
In the screenshot below, you can see where this Robots.txt file has added more parameters than the initial file that comes with your Exponent CMS install.
Simply pull down this file from public_html through your FTP or cPanel/WHM interface, make these modifications and push that file back up to your web server to ensure you don't experience these easily avoidable SEO headaches.
In Part II of these server-side SEO tips for Exponent CMS sites, I'll discuss how to modify the .htaccess in order to redirect URLs and set a preferred domain URL structure.
About the Author
Chris J. Everett is an SEO expert and the founder of Captivate Search Marketing, a digital marketing firm based in Atlanta, Georgia.
Chris has worked with Exponent CMS in a variety of roles since 2007 and continues to work with the software's developers to further enhance its SEO friendliness.