This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from Sterc/develop
SEO Tab 2.0 release
- Loading branch information
Showing
101 changed files
with
5,286 additions
and
403 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,73 @@ | ||
SEOTab | ||
======== | ||
# MODX SEO Tab - The best way to perform in search engines | ||
![SEO Tab version](https://img.shields.io/badge/version-2.0.0-blue.svg) ![MODX Extra by Sterc](https://img.shields.io/badge/checked%20by-sterc-ff69b4.svg) ![MODX version requirements](https://img.shields.io/badge/modx%20version%20requirement-2.4%2B-brightgreen.svg) | ||
|
||
Author: Sterc.nl <[email protected]> | ||
SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google. | ||
|
||
Description: | ||
-------------------- | ||
MODX SEOTab is a MODX package that helps you manage your pages in Google. It allows you to: | ||
- Manage noindex, nofollow | ||
### Key features of SEO Tab: | ||
- Manage search engine visibility (noindex, nofollow) | ||
- Manage internal search engine behavior | ||
- Manage your Google Sitemap | ||
- Manage your Google XML Sitemap(s) | ||
- Manage 301 redirects | ||
- Automatically generate 301 redirects when changing a resource URL from the resource itself | ||
- Automatically generate 301 redirects when changing a resource URL | ||
- Freeze URL functionality is moved into the SEO-tab | ||
|
||
Bugs and Features: | ||
-------------------- | ||
https://github.com/Sterc/SEOTab | ||
## Installation | ||
Simply install it through the top menu ```Extras > Installer``` and search for ```SEO Tab```. Install it from there. After installing it, it is recommended to clear your MODX cache, through the top menu ```Manage > Clear Cache```. | ||
|
||
## Upgrade risks | ||
First of all: ALWAYS MAKE A BACKUP BEFORE UPDATING! Especially the modx_site_content database table in this case. | ||
|
||
Upgrading to 2.0.0 from 1.* is highly recommended, but it does introduce some risks. SEO Tab 1.* stored the 301 redirects into the properties-column of a resource. SEO Tab 2 stores it in a seperate database table. This means a migration is needed. The migration-process is memory-intensive and might take a very long time, so just let it roll until it mentions a finished migration. | ||
|
||
Possible problems (and solutions): | ||
- Long migration-process because of many resources and redirects (think of 1000+ resource websites). Not really a problem, but if you have a big site, just plan your update at a low-traffic time, because redirects won't work 100% during the migration. | ||
- A blank page with a 500 error. This usually is because of memory issues. Try to re-run the migration with a lower limit and queryLimit. It is currently set to limit:1000 and queryLimit=100. Try setting it to 500 and 50 in core/components/stercseo/processors/mgr/redirect/migrate.class.php | ||
- If you somehow end up with an unfinished migration and the migration-notice is gone, you can fix it by setting the SystemSetting stercseo.migration_status to 0. | ||
|
||
## Usage | ||
SEO Tab is automatically enabled after install. Don't forget to clear your cache. | ||
|
||
## Using the Google XML Sitemap | ||
You have to manually create a resource within MODX, ```Template: (empty)```. go to the tab ```Settings``` and set ```Content Type: XML```, ```Cachable``` and ```Rich Text``` should be ticked off. In the content field, use the following code: | ||
|
||
|
||
```HTML | ||
[[!StercSeoSiteMap]] | ||
``` | ||
|
||
The sitemap-snippet has multiple (all optional) properties. | ||
|
||
Property | Default value | Description | ||
---|---|--- | ||
contexts|web|Specify one or more contextKey's, separated by a comma. | ||
allowSymlinks|0|Set this to ```1``` if you want to include symlinks in your sitemap. | ||
outerTpl|sitemap/outertpl|Refer to a chunk here to change the outer template, which contains rows of rowTpl's (see below). | ||
rowTpl|sitemap/rowtpl|Refer to a chunk here to change the rowTpl which is repeated for every resource which is included in the sitemap. | ||
|
||
An example of a sitemap-call with all properties set to a default-value would be: | ||
```HTML | ||
[[!StercSeoSiteMap? &contexts=`web` &allowSymlinks=`0` &outerTpl=`sitemap/outertpl` &rowTpl=`sitemap/rowtpl`]] | ||
``` | ||
|
||
## Using the robots-tag | ||
Within the tab ```SEO > Findability```, you can manage three options which determine the robots-tag. If you leave out a robots-tag and do not have a robots.txt in your website-root, the Search engine will use the following robots-tag: | ||
```HTML | ||
<meta name="robots" content="index, follow"> | ||
``` | ||
|
||
The settings ```Include in search engines``` and ```Following links``` result in two placeholders which you can add to your template/chunks: | ||
|
||
```HTML | ||
<meta name="robots" content="[[+seoTab.robotsTag]]"> | ||
``` | ||
|
||
If you set ```Include in search engines``` to ```no```, it will generate the following HTML: | ||
|
||
```HTML | ||
<meta name="robots" content="noodp,noydir,noindex"> | ||
``` | ||
|
||
We add noopd,noydir by default, because we don't want the [Open Directory Project](http://www.dmoz.org/) and the Yahoo Directory (deprecated) to change how are pages are displayed within Google. | ||
|
||
## Bugs and feature requests | ||
We greatly value your feedback, feature requests and bug reports. Please issue them on [Github](https://github.com/Sterc/SEOTab/issues/new). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<?php | ||
/** | ||
* Resolve creating db tables | ||
* | ||
* THIS RESOLVER IS AUTOMATICALLY GENERATED, NO CHANGES WILL APPLY | ||
* | ||
* @package stercseo | ||
* @subpackage build | ||
*/ | ||
|
||
if ($object->xpdo) { | ||
$modx =& $object->xpdo; | ||
switch ($options[xPDOTransport::PACKAGE_ACTION]) { | ||
case xPDOTransport::ACTION_INSTALL: | ||
case xPDOTransport::ACTION_UPGRADE: | ||
$modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/'; | ||
|
||
$modx->addPackage('stercseo', $modelPath, null); | ||
|
||
|
||
$manager = $modx->getManager(); | ||
|
||
$manager->createObjectContainer('seoUrl'); | ||
|
||
break; | ||
} | ||
} | ||
|
||
<?php | ||
/** | ||
* Resolve creating db tables | ||
* | ||
* THIS RESOLVER IS AUTOMATICALLY GENERATED, NO CHANGES WILL APPLY | ||
* | ||
* @package stercseo | ||
* @subpackage build | ||
*/ | ||
|
||
if ($object->xpdo) { | ||
$modx =& $object->xpdo; | ||
switch ($options[xPDOTransport::PACKAGE_ACTION]) { | ||
case xPDOTransport::ACTION_INSTALL: | ||
case xPDOTransport::ACTION_UPGRADE: | ||
$modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/'; | ||
|
||
$modx->addPackage('stercseo', $modelPath, null); | ||
|
||
|
||
$manager = $modx->getManager(); | ||
|
||
$manager->createObjectContainer('seoUrl'); | ||
|
||
break; | ||
} | ||
} | ||
|
||
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* StercSEO setup options resolver | ||
* | ||
* @package StercSEO | ||
* @subpackage build | ||
*/ | ||
$package = 'StercSEO'; | ||
|
||
$success = false; | ||
switch ($options[xPDOTransport::PACKAGE_ACTION]) { | ||
case xPDOTransport::ACTION_INSTALL: | ||
case xPDOTransport::ACTION_UPGRADE: | ||
$settings = array( | ||
'user_name', | ||
'user_email', | ||
); | ||
foreach ($settings as $key) { | ||
if (isset($options[$key])) { | ||
$settingObject = $object->xpdo->getObject( | ||
'modSystemSetting', | ||
array('key' => strtolower($package) . '.' . $key) | ||
); | ||
|
||
if ($settingObject) { | ||
$settingObject->set('value', $options[$key]); | ||
$settingObject->save(); | ||
} else { | ||
$error = '[' . $package . '] ' . strtolower($package) . '.' . $key . ' setting could not be found,'; | ||
$error .= ' so the setting could not be changed.'; | ||
|
||
$object->xpdo->log( | ||
xPDO::LOG_LEVEL_ERROR, | ||
$error | ||
); | ||
} | ||
} | ||
} | ||
|
||
$success = true; | ||
break; | ||
case xPDOTransport::ACTION_UNINSTALL: | ||
$success = true; | ||
break; | ||
} | ||
|
||
return $success; |
Oops, something went wrong.