/
plugin.php
68 lines (59 loc) · 1.62 KB
/
plugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
// Das Plugin liest Beiträge ein und unterzieht diese einer SEO-Prüfung.
// Das Ergebnis wird im Dashboard angezeigt
class pluginSeoCheck extends Plugin {
public function dashboard() {
global $pages;
global $syslog;
global $L;
$pageNumber = 1;
$numberOfItems = -1;
$onlyPublished = true;
$items = $pages->getList($pageNumber, $numberOfItems, $onlyPublished);
foreach ($items as $key) {
$page = buildPage($key);
//$syslog->add(array('dictionaryKey'=>strlen($page->title().' - '.$page->category()) ));
if (strlen($page->title()) > 70) {
$syslog->add(array('dictionaryKey'=>
$L->get('icon_arrow_right')
.$L->get('icon_heading')
.$L->get('icon_arrow_left')
,'notes'=>
strlen($page->title())
.' - '
.$page->title() ));
}
if (strlen($page->title()) < 50) {
$syslog->add(array('dictionaryKey'=>
$L->get('icon_arrow_left')
.$L->get('icon_heading')
.$L->get('icon_arrow_right')
,'notes'=>
strlen($page->title())
.' - '
.$page->title() ));
}
if (strlen($page->description()) > 160) {
$syslog->add(array('dictionaryKey'=>
$L->get('icon_arrow_right')
.$L->get('icon_text')
.$L->get('icon_arrow_left')
,'notes'=>
strlen($page->description())
.' - '
.$page->title() ));
}
if (strlen($page->description()) < 150) {
$syslog->add(array('dictionaryKey'=>
$L->get('icon_arrow_left')
.$L->get('icon_text')
.$L->get('icon_arrow_right')
,'notes'=>
strlen($page->description())
.' - '
.$page->title() ));
}
}
}
}
?>