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

Commit 00746d3

Browse files
authored
Merge pull request #112 from Sterc/develop
SEO Tab 2.0 release
2 parents eff0970 + 9cc764c commit 00746d3

File tree

101 files changed

+5286
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+5286
-403
lines changed

301-migrate.php

Lines changed: 0 additions & 63 deletions
This file was deleted.

301export.php

Lines changed: 0 additions & 51 deletions
This file was deleted.

README.md

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,73 @@
1-
SEOTab
2-
========
1+
# MODX SEO Tab - The best way to perform in search engines
2+
![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)
33

4-
Author: Sterc.nl <modx@sterc.nl>
4+
SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google.
55

6-
Description:
7-
--------------------
8-
MODX SEOTab is a MODX package that helps you manage your pages in Google. It allows you to:
9-
- Manage noindex, nofollow
6+
### Key features of SEO Tab:
7+
- Manage search engine visibility (noindex, nofollow)
108
- Manage internal search engine behavior
11-
- Manage your Google Sitemap
9+
- Manage your Google XML Sitemap(s)
1210
- Manage 301 redirects
13-
- Automatically generate 301 redirects when changing a resource URL from the resource itself
11+
- Automatically generate 301 redirects when changing a resource URL
12+
- Freeze URL functionality is moved into the SEO-tab
1413

15-
Bugs and Features:
16-
--------------------
17-
https://github.com/Sterc/SEOTab
14+
## Installation
15+
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```.
16+
17+
## Upgrade risks
18+
First of all: ALWAYS MAKE A BACKUP BEFORE UPDATING! Especially the modx_site_content database table in this case.
19+
20+
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.
21+
22+
Possible problems (and solutions):
23+
- 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.
24+
- 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
25+
- 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.
26+
27+
## Usage
28+
SEO Tab is automatically enabled after install. Don't forget to clear your cache.
29+
30+
## Using the Google XML Sitemap
31+
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:
32+
33+
34+
```HTML
35+
[[!StercSeoSiteMap]]
36+
```
37+
38+
The sitemap-snippet has multiple (all optional) properties.
39+
40+
Property | Default value | Description
41+
---|---|---
42+
contexts|web|Specify one or more contextKey's, separated by a comma.
43+
allowSymlinks|0|Set this to ```1``` if you want to include symlinks in your sitemap.
44+
outerTpl|sitemap/outertpl|Refer to a chunk here to change the outer template, which contains rows of rowTpl's (see below).
45+
rowTpl|sitemap/rowtpl|Refer to a chunk here to change the rowTpl which is repeated for every resource which is included in the sitemap.
46+
47+
An example of a sitemap-call with all properties set to a default-value would be:
48+
```HTML
49+
[[!StercSeoSiteMap? &contexts=`web` &allowSymlinks=`0` &outerTpl=`sitemap/outertpl` &rowTpl=`sitemap/rowtpl`]]
50+
```
51+
52+
## Using the robots-tag
53+
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:
54+
```HTML
55+
<meta name="robots" content="index, follow">
56+
```
57+
58+
The settings ```Include in search engines``` and ```Following links``` result in two placeholders which you can add to your template/chunks:
59+
60+
```HTML
61+
<meta name="robots" content="[[+seoTab.robotsTag]]">
62+
```
63+
64+
If you set ```Include in search engines``` to ```no```, it will generate the following HTML:
65+
66+
```HTML
67+
<meta name="robots" content="noodp,noydir,noindex">
68+
```
69+
70+
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.
71+
72+
## Bugs and feature requests
73+
We greatly value your feedback, feature requests and bug reports. Please issue them on [Github](https://github.com/Sterc/SEOTab/issues/new).

_build/config.json

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{
22
"name": "StercSEO",
33
"lowCaseName": "stercseo",
4-
"description": "SEOTab is a MODX package that helps you manage your pages in Google.",
4+
"description": "SEO Tab is a MODX Extra that helps you optimize your pages for the best possible performance in search engines, like Google.",
55
"author": "Sterc",
66
"version": "2.0.0-pl",
77
"package":{
88
"menus": [{
99
"text": "stercseo.seotab",
10+
"description": "stercseo.menu_desc",
1011
"action": "home"
1112
}],
1213
"elements": {
1314
"plugins": [{
1415
"name": "StercSEO",
15-
"description": "Plugin to render SEOTab and save all the data.",
16+
"description": "Plugin to render SEO Tab and save all the data.",
1617
"file": "stercseo.plugin.php",
1718
"events": [
1819
"OnDocFormPrerender",
@@ -21,12 +22,14 @@
2122
"OnPageNotFound",
2223
"OnResourceDuplicate",
2324
"OnManagerPageBeforeRender",
24-
"OnResourceBeforeSort"
25+
"OnResourceBeforeSort",
26+
"OnDocFormSave",
27+
"OnEmptyTrash"
2528
]
2629
}],
2730
"snippets": [{
2831
"name": "StercSeoSiteMap",
29-
"description": "Outputs the sitemap based on the resource settings made in SEOTab",
32+
"description": "Outputs the sitemap based on the resource settings made in SEO Tab",
3033
"file": "stercseositemap.snippet.php"
3134
}],
3235
"chunks": [],
@@ -69,9 +72,31 @@
6972
"key": "hide_from_usergroups",
7073
"value": "",
7174
"area": "general"
75+
},{
76+
"key": "user_name",
77+
"type": "textfield",
78+
"area": "general",
79+
"value": ""
80+
}, {
81+
"key": "user_email",
82+
"type": "textfield",
83+
"area": "general",
84+
"value": ""
7285
}]
7386
},
7487
"database": {
7588
"tables": ["seoUrl"]
89+
},
90+
"build":{
91+
"resolver": {
92+
"after": [
93+
"setupoptions.resolver.php",
94+
"stercextra.resolver.php",
95+
"uninstall.resolver.php"
96+
]
97+
},
98+
"setupOptions":{
99+
"source": "setup.options.php"
100+
}
76101
}
77102
}
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
<?php
2-
/**
3-
* Resolve creating db tables
4-
*
5-
* THIS RESOLVER IS AUTOMATICALLY GENERATED, NO CHANGES WILL APPLY
6-
*
7-
* @package stercseo
8-
* @subpackage build
9-
*/
10-
11-
if ($object->xpdo) {
12-
$modx =& $object->xpdo;
13-
switch ($options[xPDOTransport::PACKAGE_ACTION]) {
14-
case xPDOTransport::ACTION_INSTALL:
15-
case xPDOTransport::ACTION_UPGRADE:
16-
$modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/';
17-
18-
$modx->addPackage('stercseo', $modelPath, null);
19-
20-
21-
$manager = $modx->getManager();
22-
23-
$manager->createObjectContainer('seoUrl');
24-
25-
break;
26-
}
27-
}
28-
1+
<?php
2+
/**
3+
* Resolve creating db tables
4+
*
5+
* THIS RESOLVER IS AUTOMATICALLY GENERATED, NO CHANGES WILL APPLY
6+
*
7+
* @package stercseo
8+
* @subpackage build
9+
*/
10+
11+
if ($object->xpdo) {
12+
$modx =& $object->xpdo;
13+
switch ($options[xPDOTransport::PACKAGE_ACTION]) {
14+
case xPDOTransport::ACTION_INSTALL:
15+
case xPDOTransport::ACTION_UPGRADE:
16+
$modelPath = $modx->getOption('stercseo.core_path', null, $modx->getOption('core_path') . 'components/stercseo/') . 'model/';
17+
18+
$modx->addPackage('stercseo', $modelPath, null);
19+
20+
21+
$manager = $modx->getManager();
22+
23+
$manager->createObjectContainer('seoUrl');
24+
25+
break;
26+
}
27+
}
28+
2929
return true;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
/**
3+
* StercSEO setup options resolver
4+
*
5+
* @package StercSEO
6+
* @subpackage build
7+
*/
8+
$package = 'StercSEO';
9+
10+
$success = false;
11+
switch ($options[xPDOTransport::PACKAGE_ACTION]) {
12+
case xPDOTransport::ACTION_INSTALL:
13+
case xPDOTransport::ACTION_UPGRADE:
14+
$settings = array(
15+
'user_name',
16+
'user_email',
17+
);
18+
foreach ($settings as $key) {
19+
if (isset($options[$key])) {
20+
$settingObject = $object->xpdo->getObject(
21+
'modSystemSetting',
22+
array('key' => strtolower($package) . '.' . $key)
23+
);
24+
25+
if ($settingObject) {
26+
$settingObject->set('value', $options[$key]);
27+
$settingObject->save();
28+
} else {
29+
$error = '[' . $package . '] ' . strtolower($package) . '.' . $key . ' setting could not be found,';
30+
$error .= ' so the setting could not be changed.';
31+
32+
$object->xpdo->log(
33+
xPDO::LOG_LEVEL_ERROR,
34+
$error
35+
);
36+
}
37+
}
38+
}
39+
40+
$success = true;
41+
break;
42+
case xPDOTransport::ACTION_UNINSTALL:
43+
$success = true;
44+
break;
45+
}
46+
47+
return $success;

0 commit comments

Comments
 (0)