Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #112 from Sterc/develop
Browse files Browse the repository at this point in the history
SEO Tab 2.0 release
  • Loading branch information
gpsietzema authored Mar 9, 2017
2 parents eff0970 + 9cc764c commit 00746d3
Show file tree
Hide file tree
Showing 101 changed files with 5,286 additions and 403 deletions.
63 changes: 0 additions & 63 deletions 301-migrate.php

This file was deleted.

51 changes: 0 additions & 51 deletions 301export.php

This file was deleted.

80 changes: 68 additions & 12 deletions README.md
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).
33 changes: 29 additions & 4 deletions _build/config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"name": "StercSEO",
"lowCaseName": "stercseo",
"description": "SEOTab is a MODX package that helps you manage your pages in Google.",
"description": "SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google.",
"author": "Sterc",
"version": "2.0.0-pl",
"package":{
"menus": [{
"text": "stercseo.seotab",
"description": "stercseo.menu_desc",
"action": "home"
}],
"elements": {
"plugins": [{
"name": "StercSEO",
"description": "Plugin to render SEOTab and save all the data.",
"description": "Plugin to render SEO Tab and save all the data.",
"file": "stercseo.plugin.php",
"events": [
"OnDocFormPrerender",
Expand All @@ -21,12 +22,14 @@
"OnPageNotFound",
"OnResourceDuplicate",
"OnManagerPageBeforeRender",
"OnResourceBeforeSort"
"OnResourceBeforeSort",
"OnDocFormSave",
"OnEmptyTrash"
]
}],
"snippets": [{
"name": "StercSeoSiteMap",
"description": "Outputs the sitemap based on the resource settings made in SEOTab",
"description": "Outputs the sitemap based on the resource settings made in SEO Tab",
"file": "stercseositemap.snippet.php"
}],
"chunks": [],
Expand Down Expand Up @@ -69,9 +72,31 @@
"key": "hide_from_usergroups",
"value": "",
"area": "general"
},{
"key": "user_name",
"type": "textfield",
"area": "general",
"value": ""
}, {
"key": "user_email",
"type": "textfield",
"area": "general",
"value": ""
}]
},
"database": {
"tables": ["seoUrl"]
},
"build":{
"resolver": {
"after": [
"setupoptions.resolver.php",
"stercextra.resolver.php",
"uninstall.resolver.php"
]
},
"setupOptions":{
"source": "setup.options.php"
}
}
}
56 changes: 28 additions & 28 deletions _build/gpm_resolvers/gpm.resolve.tables.php
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;
47 changes: 47 additions & 0 deletions _build/resolvers/setupoptions.resolver.php
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;
Loading

0 comments on commit 00746d3

Please sign in to comment.