15 Commits

Author SHA1 Message Date
c85d93e06f Bugfixes 2024-03-17 16:18:06 +01:00
3fcd0f2c2b Updated makefile 2024-03-16 17:00:12 +01:00
caa2bc6493 updated menu structure 2024-03-16 16:58:13 +01:00
49f1ebc5ba updated menu structure 2024-03-16 16:58:00 +01:00
d2c74a158a Added new user roles 2024-03-16 16:35:18 +01:00
bee1f6c96c Support for site verification codes 2024-03-16 14:21:57 +01:00
96e084e353 some design improvements 2024-03-06 22:45:27 +01:00
c7ba74d7e3 new navigation tree
desing optimization
language fixes
2024-03-05 22:59:42 +01:00
76ecb7d978 new navigation tree
desing optimization
language fixes
2024-03-05 22:59:15 +01:00
5492bda6d2 structure for autodeployment 2024-03-02 18:14:08 +01:00
dd6af287f3 Bugfix timezone on events 2024-03-02 18:13:44 +01:00
9835f32dfa multi language support
support for small devices
2024-03-02 16:00:58 +01:00
b3b58ce103 multi language support
support for small devices
2024-03-02 15:09:07 +01:00
4d479cedaf celanup 2024-02-27 12:06:55 +01:00
e204c8a53e Merge pull request 'v4.2.1' (#1) from v4.2.1 into main
Reviewed-on: #1
2024-02-27 12:00:24 +01:00
117 changed files with 1503 additions and 5560 deletions

View File

@ -0,0 +1,27 @@
<?php
if (!isset($argv[1])) {
die('No version set, please use ' . PHP_EOL .'make setup version=' . PHP_EOL);
}
$file = file_get_contents(dirname(__FILE__) . '/info.json.tpl');
$file = str_replace('%version%', $argv[1], $file);
$file = str_replace('%date%', date('d.m.Y H:i:00'), $file);
$file = str_replace('%changelog%', parseChangeLog(), $file);
$ptr = fopen('info.json', 'w');
fwrite($ptr, $file);
fclose($ptr);
system('lftp -e "put -O / info.json; bye" -u "lv-sachsen-main_ftp3,sE&xDXc8za#S" bdp.mein-verein.online');
function parseChangeLog()
{
$return = '';
foreach (file(dirname(__FILE__) . '/../changelog') as $line) {
$line = trim($line);
if ($line !== '') {
$return .= $line;
}
};
return $return;
}

17
.deployment/info.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "BdP Kompass",
"slug": "bdp-kompass",
"author": "Thomas Günther",
"author_profile": "https://sachsen.pfadfinden.de",
"version": "4.3.2",
"download_url": "http://lv-sachsen-main.bdp.mein-verein.online/wordpress/bdp-kompass-4.3.2.zip",
"requires": "6.0",
"tested": "6.5",
"requires_php": "8.2",
"last_updated": "02.03.2024 16:24:00",
"sections": {
"description": "Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite",
"installation": "Bitte wendet euch an den LB IT, falls ihr zur Installation oder zu Updates Fragen habt.",
"changelog": "<h4>Version 4.3.1</h4><ul><li>Mehrsprachrigkeit unterstütz</li><li>Unterstützung für Smartphones</li></ul><h4>Version 4.2.1</h4><ul><li>Erweiterte Sicherheitsfunktionen implemntiert</li><li>Passwort-Policies implementiert</li><li>Integration von Limit Login Attempts (classic)</li><li>Integration von WPS Hide Login</li></ul><h4>Version 4.1.1</h4><ul><li>Erster release des Plugins</li></ul>"
}
}

17
.deployment/info.json.tpl Normal file
View File

@ -0,0 +1,17 @@
{
"name": "BdP Kompass",
"slug": "bdp-kompass",
"author": "Thomas Günther",
"author_profile": "https://sachsen.pfadfinden.de",
"version": "%version%",
"download_url": "http://lv-sachsen-main.bdp.mein-verein.online/wordpress/bdp-kompass-%version%.zip",
"requires": "6.0",
"tested": "6.5",
"requires_php": "8.2",
"last_updated": "%date%",
"sections": {
"description": "Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite",
"installation": "Bitte wendet euch an den LB IT, falls ihr zur Installation oder zu Updates Fragen habt.",
"changelog": "%changelog%"
}
}

17
Makefile Normal file
View File

@ -0,0 +1,17 @@
translate: bdp-kompass.php
msgfmt lang/bdp-kompass_de_DE.po -olang/bdp-kompass-de_DE.mo
deploy: bdp-kompass.php
make translate
@php ./.deployment/create_info_json.php $(version)
mkdir -p ./.deployment/bdp-kompass/bdp-kompass
cp -r * ./.deployment/bdp-kompass/bdp-kompass
rm ./.deployment/bdp-kompass/bdp-kompass/changelog
rm ./.deployment/bdp-kompass/bdp-kompass/Makefile
rm -rf ./.deployment/bdp-kompass/bdp-kompass/.deployment
rm -rf ./.deployment/bdp-kompass/bdp-kompass/.git
cd ./.deployment/bdp-kompass/ && zip -qr ./bdp-kompass-$(version).zip ./bdp-kompass/
lftp -e "put -O / ./.deployment/bdp-kompass/bdp-kompass-$(version).zip; bye" -u "lv-sachsen-main_ftp3,sE&xDXc8za#S" bdp.mein-verein.online
rm -rf ./.deployment/bdp-kompass/
rm -rf ./.deployment/info.json/
rm -rf ./info.json

View File

21
assets/searchtable.js Normal file
View File

@ -0,0 +1,21 @@
function searchTable(tableId, searchField) {
var input, filter, table, tr, td, i, j, txtValue;
input = searchField;
filter = input.value.toUpperCase();
table = document.getElementById(tableId);
tr = table.getElementsByTagName("tr");
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td");
for (j = 0; j < td.length; j++) {
if (td[j]) {
txtValue = td[j].textContent || td[j].innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
break;
} else {
tr[i].style.display = "none";
}
}
}
}
}

View File

@ -52,7 +52,7 @@
width: 80%;
}
.protect-login-no-blocked-ips
.bdp-kompass-no-blocked-ips
{
padding: 5px 10px;
width: 90%;

View File

@ -1,85 +1,90 @@
#adminmenuback, #adminmenuwrap, #adminmenu, #adminmenu .wp-has-current-submenu > .wp-submenu {
width: 250px;
}
#wpcontent, #wpfooter {
margin-left: 230px;
background-color: #ffffff !important;
padding-left: 40px;
}
#adminmenu .wp-submenu {
left: 210px;
}
#adminmenu .wp-not-current-submenu .wp-submenu, .folded #adminmenu .wp-has-current-submenu .wp-submenu, #adminmenu .ame-has-deep-submenu:not(.ame-has-highlighted-item) > .wp-submenu {
width: 30px;
}
body {
background: #fff;
--ame-ms-menu-width: 250px;
}
/* Admin Menu */
#adminmenuback,
#adminmenuwrap,
#adminmenu {
margin-top: 12px;
background: #f0f0f0;
width: 300px;
@media screen and (min-width: 783px) {
body:not(.folded) #widgets-editor .interface-interface-skeleton {
left: 250px;
}
#adminmenu {
#adminmenu .wp-not-current-submenu .wp-submenu {
display: none !important;
}
}
@media screen and (max-width: 960px) and (min-width: 783px) {
body.auto-fold #widgets-editor .interface-interface-skeleton {
left: var(--ame-ms-collapsed-menu-width, 36px);
}
}
#wpwrap {
background-color: #ffffff;
border-radius: 10px;
}
#adminmenuback {
box-shadow: none;
}
#adminmenu a {
#adminmenu .wp-submenu a {
font-weight: 200;
}
#adminmenu > li {
padding: 10px 5px;
font-weight: bolder;
}
#adminmenu > li a {
color: #020918;
}
#adminmenu > li div.wp-menu-image:before {
color: #020918;
}
#adminmenu > li a:hover, #adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
color: #020918;
}
#adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
background-color: rgb(240, 244, 247);
color: #1d4899 !important;
font-weight: bold !important;
margin-left: 30px !important;
border-color: #f0f0f0;
}
#wpbody {
background-color: #f0f0f0;
position: relative;
padding-left: 150px;
padding-top: 25px;
}
#wpfooter, #wpwrap
{
background-color: #f0f0f0;
}
#wpfooter {
padding-left: 150px;
}
#wpbody-content {
background-color: #ffffff;
width: 95%;
padding-left: 50px;
box-shadow: 10px 10px 10px #c0c0c0;
border-radius: 10px;
border-width: 1px;
border-style: solid;
border-color: #c0c0c0;
}
#adminmenu div.wp-menu-image:before {
color: rgba(29, 72, 153, 0.75);
}
#adminmenu a:hover,
#adminmenu li.menu-top:hover,
#adminmenu li.opensub > a.menu-top,
#adminmenu li > a.menu-top:focus {
#adminmenu > li.menu-top:hover div.wp-menu-image:before, #adminmenu > li.menu-top > a:focus div.wp-menu-image:before, #adminmenu > li.opensub > a.menu-top div.wp-menu-image:before {
color: #1d4899;
border-color: #f0f0f0;
font-weight: bold;
background: linear-gradient(to right, #efefef, rgba(255, 203, 4, 0.45));
border-radius: 10px;
border-width: 0 !important;
}
#adminmenu li.menu-top:hover div.wp-menu-image:before,
#adminmenu li.opensub > a.menu-top div.wp-menu-image:before {
color: #1d4899;
font-weight: bold;
background: linear-gradient(to right, #efefef, rgba(255, 203, 4, 0.45));
border-radius: 10px;
border-width: 0;
border-color: #f0f0f0;
#adminmenu > li .wp-submenu, #adminmenu > li.wp-has-current-submenu .wp-submenu, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu, .folded #adminmenu > li.wp-has-current-submenu .wp-submenu a.wp-has-current-submenu:focus + .wp-submenu {
background: #ffcb04;
}
.nav-tab {
border-color: rgb(128, 159, 245);
background-color: rgba(185, 203, 255, 0.84);
border-radius: 5px 5px 0 0;
}
/* Active tabs use a bottom border color that matches the page background color. */
@ -87,249 +92,43 @@ body {
.nav-tab-active,
.nav-tab-active:hover {
border-style: none;
background-color: #fff;
background-color: #F0F4F7;
border-bottom-color: #fff;
box-shadow: 2px 2px 5px #c0c0c0;
}
/* Admin Menu: submenu */
#adminmenu .wp-submenu,
#adminmenu .wp-has-current-submenu .wp-submenu,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu,
.folded #adminmenu .wp-has-current-submenu .wp-submenu,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu {
background: #ffffff;
width: 300px;
}
#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
display: none;
}
#adminmenu .wp-submenu .wp-submenu-head {
color: #ccdbe0;
}
#adminmenu .wp-submenu a,
#adminmenu .wp-has-current-submenu .wp-submenu a,
.folded #adminmenu .wp-has-current-submenu .wp-submenu a,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu a {
color: #ccdbe0;
}
#adminmenu .wp-submenu a:focus, #adminmenu .wp-submenu a:hover,
#adminmenu .wp-has-current-submenu .wp-submenu a:focus,
#adminmenu .wp-has-current-submenu .wp-submenu a:hover,
.folded #adminmenu .wp-has-current-submenu .wp-submenu a:focus,
.folded #adminmenu .wp-has-current-submenu .wp-submenu a:hover,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:focus,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu a:hover,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:focus,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu a:hover {
color: #f0f0f0;
}
/* Admin Menu: current */
#adminmenu .wp-submenu li.current a,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a {
color: #f2fcff;
}
#adminmenu .wp-submenu li.current a:hover, #adminmenu .wp-submenu li.current a:focus,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover,
#adminmenu a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:hover,
#adminmenu .wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
color: #e0e0e0;
.button-primary {
border-style: none;
background-color: #F0F4F7 !important;
color: #404040 !important;
box-shadow: 2px 2px 5px #c0c0c0;
}
ul#adminmenu a.wp-has-current-submenu:after,
ul#adminmenu > li.current > a.current:after {
border-right-color: #fff;
display: none;
#adminmenu > li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
border-right-color: #ffcb04;
}
#adminmenu li.current a.menu-top,
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
#adminmenu li.wp-has-current-submenu .wp-submenu .wp-submenu-head,
.folded #adminmenu li.current.menu-top {
color: #000000;
background: linear-gradient(to right, #efefef, rgba(255, 203, 4, 0.45));
border-radius: 10px;
#adminmenu > li .wp-submenu .wp-submenu-head {
color: #1d4899;
}
#adminmenu li.wp-has-current-submenu div.wp-menu-image:before,
#adminmenu a.current:hover div.wp-menu-image:before,
#adminmenu li.wp-has-current-submenu a:focus div.wp-menu-image:before,
#adminmenu li.wp-has-current-submenu.opensub div.wp-menu-image:before,
#adminmenu li:hover div.wp-menu-image:before,
#adminmenu li a:focus div.wp-menu-image:before,
#adminmenu li.opensub div.wp-menu-image:before,
.ie8 #adminmenu li.opensub div.wp-menu-image:before {
color: #f2fcff;
.wp-has-current-submenu:hover {
background-color: #fafafa !important;
}
.wp-menu-open .wp-submenu {
display: block;
}
.wp-menu-open .wp-submenu li {
padding-left: 30px !important;
color: #1d4899 !important;
font-weight: bold;
border-color: #f0f0f0;
.wp-submenu li a {
padding: 10px 0px 10px 10px;
padding-top: 10px !important;
padding-bottom: 10px !important;
}
.wp-submenu {
display: none;
}
/* Admin Menu: bubble */
#adminmenu .awaiting-mod,
#adminmenu .update-plugins {
color: #f2fcff;
background: #aa9d88;
}
#adminmenu li.current a .awaiting-mod,
#adminmenu li a.wp-has-current-submenu .update-plugins,
#adminmenu li:hover a .awaiting-mod,
#adminmenu li.menu-top:hover > a .update-plugins {
#color: #f2fcff;
}
/* Admin Menu: collapse button */
#collapse-button {
display: none;
color: #1d4899;
font-weight: bold;
border-radius: 10px;
border-width: 0;
border-color: #f0f0f0;
}
#collapse-button:hover,
#collapse-button:focus {
color: rgba(255, 203, 4, 0.45);
}
/* Admin Bar */
#wpadminbar {
color: #f2fcff;
background: rgba(29, 72, 153, 0.7);
}
#wpadminbar .ab-item,
#wpadminbar a.ab-item,
#wpadminbar > #wp-toolbar span.ab-label,
#wpadminbar > #wp-toolbar span.noticon {
color: #f2fcff;
}
#wpadminbar .ab-icon,
#wpadminbar .ab-icon:before,
#wpadminbar .ab-item:before,
#wpadminbar .ab-item:after {
color: #f1f3f3;
}
#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item,
#wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus,
#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
#wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item,
#wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
color: #f2fcff;
background: rgba(29, 72, 153, 0.7);
}
#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label,
#wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label,
#wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label {
color: #ffffff;
}
#wpadminbar:not(.mobile) li:hover .ab-icon:before,
#wpadminbar:not(.mobile) li:hover .ab-item:before,
#wpadminbar:not(.mobile) li:hover .ab-item:after,
#wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
color: #f2fcff;
}
/* Admin Bar: submenu */
#wpadminbar .menupop .ab-sub-wrapper {
background: rgba(29, 72, 153, 0.78);
}
#wpadminbar .quicklinks .menupop ul.ab-sub-secondary,
#wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
background: #8f9a9e;
}
#wpadminbar .ab-submenu .ab-item,
#wpadminbar .quicklinks .menupop ul li a,
#wpadminbar .quicklinks .menupop.hover ul li a,
#wpadminbar.nojs .quicklinks .menupop:hover ul li a {
color: #ccdbe0;
}
#wpadminbar .quicklinks li .blavatar,
#wpadminbar .menupop .menupop > .ab-item:before {
color: #f1f3f3;
}
#wpadminbar .quicklinks .menupop ul li a:hover,
#wpadminbar .quicklinks .menupop ul li a:focus,
#wpadminbar .quicklinks .menupop ul li a:hover strong,
#wpadminbar .quicklinks .menupop ul li a:focus strong,
#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a,
#wpadminbar .quicklinks .menupop.hover ul li a:hover,
#wpadminbar .quicklinks .menupop.hover ul li a:focus,
#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
#wpadminbar li:hover .ab-icon:before,
#wpadminbar li:hover .ab-item:before,
#wpadminbar li a:focus .ab-icon:before,
#wpadminbar li .ab-item:focus:before,
#wpadminbar li .ab-item:focus .ab-icon:before,
#wpadminbar li.hover .ab-icon:before,
#wpadminbar li.hover .ab-item:before,
#wpadminbar li:hover #adminbarsearch:before,
#wpadminbar li #adminbarsearch.adminbar-focused:before {
color: #ffffff;
}
#wpadminbar .quicklinks li a:hover .blavatar,
#wpadminbar .quicklinks li a:focus .blavatar,
#wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar,
#wpadminbar .menupop .menupop > .ab-item:hover:before,
#wpadminbar.mobile .quicklinks .ab-icon:before,
#wpadminbar.mobile .quicklinks .ab-item:before {
color: #ffffff;
}
#wpadminbar.mobile .quicklinks .hover .ab-icon:before,
#wpadminbar.mobile .quicklinks .hover .ab-item:before {
color: #f1f3f3;
}
/* Admin Bar: search */
#wpadminbar #adminbarsearch:before {
color: #f1f3f3;
}
.button {
background: rgba(29, 72, 153, 0.62) !important;
color: #ffffff !important;
border-color: #071e4d;
box-shadow: 5px 5px 10px #d0d0d0;
}
.bdp_setting_box {
width: 100%;
margin-right: 10px;
background-color: #ffffff;
padding: 15px;
border-style: solid;
@ -351,3 +150,232 @@ ul#adminmenu > li.current > a.current:after {
width: 10pt;
color: #a0a0a0;
}
@media screen and (min-width: 783px) {
.wp-has-current-submenu li a {
width: 210px !important;
}
}
.wp-submenu li a:hover {
background-color: rgb(240, 244, 247) !important;
color: #1d4899 !important;
}
.current .menu-top .wp-menu-name,
.wp-has-current-submenu .wp-menu-name {
background-color: #ffcb04 !important;
border-style: none !important;
width: 202px;
}
.wp-has-submenu:after {
border-right-color: #ffcb04 !important;
}
@media screen and (min-width: 783px) {
.wp-submenu, .wp-submenu-wrap {
background-color: #fafafa !important;
width: 220px !important;
}
#adminmenu .current .menu-top .wp-menu-name {
padding: 10px;
width: 225px !important;
}
}
ul#adminmenu a.wp-has-current-submenu::after, ul#adminmenu > li.current > a.current::after,
.auto-fold ul#adminmenu a.wp-has-current-submenu::after, .auto-fold ul#adminmenu > li.current > a.current::after {
display: none !important;
}
#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head, #adminmenu .wp-menu-arrow, #adminmenu .wp-menu-arrow div, #adminmenu li.current a.menu-top, #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu
{
background-color: #fafafa;
}
@media screen and (max-width: 782px) {
#adminmenu > li.menu-top:hover, #adminmenu > li.opensub > a.menu-top, #adminmenu > li > a.menu-top:focus {
background-color: #fafafa;
color: #1d4899 !important;
width: 285px !important;
}
#adminmenu .current .menu-top{
width: 280px;
}
#adminmenu .current .menu-top .wp-menu-name {
width: 245px !important;
}
#adminmenu > li .wp-submenu, #adminmenu > li.wp-has-current-submenu .wp-submenu, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu, .folded #adminmenu > li.wp-has-current-submenu .wp-submenu a.wp-has-current-submenu:focus + .wp-submenu {
width: 285px !important;
}
.wp-submenu:hover,
.wp-submenu .wp-submenu-wrap:hover,
.nav-tab-active:hover {
border-style: none;
background-color: #fafafa !important;
}
#adminmenuback, #adminmenuwrap, #adminmenu, #adminmenu .wp-has-current-submenu > .wp-submenu {
width: 300px !important;
}
.wp-submenu,
.wp-submenu .wp-submenu-wrap li,
.auto-fold #adminmenu li.menu-top .wp-submenu > li > a {
background-color: #fafafa !important;
width: 285px !important;
}
}
#adminmenu div.wp-menu-name {
}
#adminmenu > li .wp-submenu a, #adminmenu > li.wp-has-current-submenu .wp-submenu a, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu a, .folded #adminmenu > li.wp-has-current-submenu .wp-submenu a, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu a {
color: #020918;
padding-left: 25px;
}
#adminmenu > li .wp-submenu a:focus, #adminmenu > li .wp-submenu a:hover, #adminmenu > li.wp-has-current-submenu .wp-submenu a:focus, #adminmenu > li.wp-has-current-submenu .wp-submenu a:hover, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu a:focus, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu a:hover, .folded #adminmenu > li.wp-has-current-submenu .wp-submenu a, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu a:focus, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu a:hover {
color: #ffcb04;
background-color: #ffffff;
}
#adminmenu > li .wp-submenu li.current a, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu li.current a, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu li.current a {
color: #010a1a;
}
#adminmenu > li .wp-submenu li.current a:hover, #adminmenu > li .wp-submenu li.current a:focus, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu li.current a:hover, #adminmenu > li a.wp-has-current-submenu:focus + .wp-submenu li.current a:focus, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu li.current a:hover, #adminmenu > li.wp-has-current-submenu.opensub .wp-submenu li.current a:focus {
color: #ffcb04;
background-color: #ffffff;
}
#adminmenu > li.current a.menu-top, #adminmenu > li.wp-has-current-submenu a.wp-has-current-submenu, #adminmenu > li.wp-has-current-submenu .wp-submenu .wp-submenu-head, .folded #adminmenu > li.current.menu-top {
color: #1d4899;
}
#adminmenu > li.wp-has-current-submenu div.wp-menu-image:before, #adminmenu a.current:hover div.wp-menu-image:before, #adminmenu > li.current div.wp-menu-image::before, #adminmenu > li.wp-has-current-submenu a:focus div.wp-menu-image:before, #adminmenu > li.wp-has-current-submenu.opensub div.wp-menu-image:before, #adminmenu > li:hover div.wp-menu-image:before, #adminmenu > li a:focus div.wp-menu-image:before, #adminmenu > li.opensub div.wp-menu-image:before, .ie8 #adminmenu > li.opensub div.wp-menu-image:before, #adminmenu a.current:hover div.wp-menu-image:before {
color: #ffffff;
}
#adminmenu > li .awaiting-mod, #adminmenu > li .update-plugins {
background: #ffcb04 !important;
color: #1d4899;
}
#adminmenu > li .current a .awaiting-mod, #adminmenu > li a.wp-has-current-submenu .update-plugins, #adminmenu > li:hover a .awaiting-mod, #adminmenu > li.menu-top:hover > a .update-plugins {
color: #1d4899;
background: #ffcb04;
}
#adminmenuback, #adminmenuwrap, #adminmenu {
background-color: #fafafa;
}
#adminmenuback {
box-shadow: 10px 10px 5px rgb(240, 244, 247);
}
@media screen and (min-width: 783px) {
}
#wpadminbar {
background-color: rgb(240, 244, 247);
color: #1d4899;
}
#wpadminbar .ab-item, #wpadminbar a.ab-item, #wpadminbar > #wp-toolbar span.ab-label, #wpadminbar > #wp-toolbar span.noticon {
color: #1d4899;
}
#wpadminbar .ab-icon, #wpadminbar .ab-icon:before, #wpadminbar .ab-item:before, #wpadminbar .ab-item:after {
color: #1d4899;
}
#wpadminbar:not(.mobile) .ab-top-menu > li:hover > .ab-item, #wpadminbar:not(.mobile) .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, #wpadminbar.nojs .ab-top-menu > li.menupop:hover > .ab-item, #wpadminbar .ab-top-menu > li.menupop.hover > .ab-item {
background-color: #ffffff;
color: #ffcb04;
}
#wpadminbar:not(.mobile) > #wp-toolbar li:hover span.ab-label, #wpadminbar:not(.mobile) > #wp-toolbar li.hover span.ab-label, #wpadminbar:not(.mobile) > #wp-toolbar a:focus span.ab-label, #wpadminbar:not(.mobile) li:hover .ab-icon:before, #wpadminbar:not(.mobile) li:hover .ab-item:before, #wpadminbar:not(.mobile) li:hover .ab-item:after, #wpadminbar:not(.mobile) li:hover #adminbarsearch:before {
color: #ffcb04;
background-color: #ffffff;
}
#wpadminbar .menupop .ab-sub-wrapper {
background-color: #ffffff;
}
#wpadminbar .quicklinks .menupop ul.ab-sub-secondary, #wpadminbar .quicklinks .menupop ul.ab-sub-secondary .ab-submenu {
background-color: #ffffff;
}
#wpadminbar .ab-submenu .ab-item, #wpadminbar .quicklinks .menupop ul li a, #wpadminbar .quicklinks .menupop.hover ul li a, #wpadminbar.nojs .quicklinks .menupop:hover ul li a {
color: #1d4899;
}
#wpadminbar .quicklinks li .blavatar, #wpadminbar .menupop .menupop > .ab-item:before {
color: #f3f3f1;
}
#wpadminbar .quicklinks .menupop ul li a {
padding: 10px;
}
#wpadminbar .quicklinks .menupop ul li a:hover, #wpadminbar .quicklinks .menupop ul li a:focus, #wpadminbar .quicklinks .menupop ul li a:hover strong, #wpadminbar .quicklinks .menupop ul li a:focus strong, #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a, #wpadminbar .quicklinks .menupop.hover ul li a:hover, #wpadminbar .quicklinks .menupop.hover ul li a:focus, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, #wpadminbar li:hover .ab-icon:before, #wpadminbar li:hover .ab-item:before, #wpadminbar li a:focus .ab-icon:before, #wpadminbar li .ab-item:focus:before, #wpadminbar li .ab-item:focus .ab-icon:before, #wpadminbar li.hover .ab-icon:before, #wpadminbar li.hover .ab-item:before, #wpadminbar li:hover #adminbarsearch:before, #wpadminbar li #adminbarsearch.adminbar-focused:before, #wpadminbar .quicklinks li a:hover .blavatar, #wpadminbar .quicklinks li a:focus .blavatar, #wpadminbar .quicklinks .ab-sub-wrapper .menupop.hover > a .blavatar, #wpadminbar .menupop .menupop > .ab-item:hover:before, #wpadminbar.mobile .quicklinks .ab-icon:before, #wpadminbar.mobile .quicklinks .ab-item:before {
color: #1d4899;
background-color: rgb(240, 244, 247);
}
#wpadminbar #wp-admin-bar-user-info .display-name {
color: #1d4899;
}
#wpadminbar #wp-admin-bar-user-info a:hover .display-name {
color: #ffcb04;
background-color: #ffffff;
}
#wpadminbar #wp-admin-bar-user-info .username {
color: #1d4899;
}
#wpadminbar.mobile .quicklinks .hover .ab-icon:before, #wpadminbar.mobile .quicklinks .hover .ab-item:before, #wpadminbar #adminbarsearch:before {
color: #f3f3f1;
}
li.wp-has-submenu.wp-not-current-submenu.opensub:after,
li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after,
.wp-menu-name:after {
display: none !important;
}
#adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after {
display: none;
}
#adminmenu .wp-menu-arrow div {
display: none !important;
background-color: #FFFFFF !important;
}

View File

@ -2,7 +2,7 @@
/**
* Plugin Name: BdP Kompass
* Description: Wordpress-Plugin zur Unterstützung von Stämmen im Bund der Pfadfinderinnen und Pfadfinder e.V. zur optimalen Verwaltung eurer Webseite
* Version: 4.2.1
* Version: 4.3.9
* Tags: bdp, utility, helper
* Requires at least: 6.0
* Requires PHP: 8.2
@ -12,6 +12,7 @@
* Text Domain: bdp-kompass
*/
use Bdp\Modules\KompassSettings\Controllers\SettingsPage as KomnpassSettings;
use Bdp\Modules\LimitLoginAttempts\Controllers\OptionsPage as OptionsPageAlias;
use Bdp\Modules\Security\Security;
use Bdp\Modules\Seo\Seo;
@ -24,6 +25,7 @@ function bdp_plugin_install() {
function bdp_plugin_init() {
bdp_kompass_load_plugin_textdomain();
Security::ProhibitBots();
Security::SetPageFilters();
@ -34,11 +36,14 @@ function bdp_plugin_init() {
update_option('kompass_already_installed', true);
wp_redirect( 'site-health.php?tab=bdp_enhanced_security');
}
Seo::importVerificationKeys();
}
add_action('admin_menu', function () {
bdp_kompass_load_plugin_textdomain();
new OptionsPageAlias();
new KomnpassSettings();
});
@ -52,6 +57,7 @@ function register_custom_theme_directory() {
}
function enqueue_custom_password_js() {
wp_enqueue_script( 'searchable-table', BDP_LV_PLUGIN_URL . '/assets/searchtable.js');
wp_enqueue_script( 'custom-password-js', BDP_LV_PLUGIN_URL . 'assets/password.js');
wp_localize_script( 'custom-password-js', 'php_vars', [
'allowed_strengths' => kompass_get_minimal_password_strength(),
@ -59,4 +65,4 @@ function enqueue_custom_password_js() {
]);
}
#add_action( 'after_setup_theme', 'register_custom_theme_directory' );
add_action( 'after_setup_theme', 'kompass_after_setup_theme' );

61
changelog Normal file
View File

@ -0,0 +1,61 @@
<h4>Version 4.3.9</h4>
<ul>
<li>Fehlerbehebung</li>
</ul>
<h4>Version 4.3.8</h4>
<ul>
<li>Google- und Bing-Verifizierung nun auch im Plugin möglich</li>
<li>Neue Nutzerrollen</li>
<li>Update in Menüstruktur</li>
</ul>
<h4>Version 4.3.7</h4>
<ul>
<li>Design - Optimierungen</li>
</ul>
<h4>Version 4.3.6</h4>
<ul>
<li>Sicherheitspatch</li>
</ul>
<h4>Version 4.3.5</h4>
<ul>
<li>Translation fixes</li>
</ul>
<h4>Version 4.3.4</h4>
<ul>
<li>Optimized menu tree</li>
</ul>
<h4>Version 4.3.3</h4>
<ul>
<li>Bugfix für osobletete Plugins</li>
</ul>
<h4>Version 4.3.2</h4>
<ul>
<li>Bugfix: Zeitzone in Kalender korrigiert</li>
</ul>
<h4>Version 4.3.1</h4>
<ul>
<li>Mehrsprachigkeit unterstützt</li>
<li>Unterstützung für Smartphones</li>
</ul>
<h4>Version 4.2.1</h4>
<ul>
<li>Erweiterte Sicherheitsfunktionen implemntiert</li>
<li>Passwort-Policies implementiert</li>
<li>Integration von Limit Login Attempts (classic)</li>
<li>Integration von WPS Hide Login</li>
</ul>
<h4>Version 4.1.1</h4>
<ul>
<li>Erster release des Plugins</li>
</ul>

View File

@ -1,12 +1,11 @@
<?php
function kompass_print_checkbox($settingName) {
function kompass_print_checkbox(string $settingName) {
$currentSetting = get_option($settingName, []);
if (!is_array($currentSetting)) {
$currentSetting = [$currentSetting];
}
$options = ['kompass_limit_login_lockout_notify' => [
'email' => 'E-Mail an Administrator'
'email' => __('E-Mail to site admin', BDP_LV_PLUGIN_SLUG)
],
];

View File

@ -1,19 +1,19 @@
<?php
function kompass_print_radio($settingName) {
$currentSetting = get_option($settingName);
function kompass_print_radio(string $settingName) {
$currentSetting = get_option($settingName, '');
$options = [
'kompass_limit_login_client_type' => [
'REMOTE_ADDR' => 'Direkte Verbrindung',
'HTTP_X_FORWARDED_FOR' => 'Hinter einem Proxy'
'REMOTE_ADDR' => __('Direct connection', BDP_LV_PLUGIN_SLUG),
'HTTP_X_FORWARDED_FOR' => __('Behind a proxy', BDP_LV_PLUGIN_SLUG)
],
'kompass_limit_login_cookies' => [
true => 'Ja',
false => 'Nein'
true => __('Yes', BDP_LV_PLUGIN_SLUG),
false => __('No', BDP_LV_PLUGIN_SLUG)
],
'kompass_password_minimal_strength' => [
'1' => 'Alle Passwörter erlauben',
'2' => 'Mittelstarke Passwörter',
'3' => 'Nur Starke Passwörter'
'1' => __('Allow all password strengths', BDP_LV_PLUGIN_SLUG),
'2' => __('At least passwords with medium strength', BDP_LV_PLUGIN_SLUG),
'3' => __('Only allow strong passwords', BDP_LV_PLUGIN_SLUG)
]
];
@ -30,6 +30,6 @@ function kompass_print_radio($settingName) {
name="' . $settingName . '"
value="' . $radioOption . '"
id="setting_' . $settingName . '_' . $radioOption . '" />' .
'<label for="setting_' . $settingName . '_' . $radioOption . '">' . $optionText . '</label> &nbsp; ';
'<label for="setting_' . $settingName . '_' . $radioOption . '">' . $optionText . '</label><br />';
}
}

View File

@ -0,0 +1,19 @@
<?php
function kompass_print_textbox($settingName, $settingValue, $style = '') {
echo '<input style="' . $style . '" type="text" name="' . $settingName . '" value="' . $settingValue. '" />';
if (defined('WP_DEBUG') && WP_DEBUG == true) {
echo '<br />' . $settingName;
}
}
function _kompass_limit_logins_settings_callback(array $args) {
$setting = get_option($args['setting'], null);
$style = isset($args['style']) ? $args['style'] : '';
$value = esc_attr($setting);
if (isset($args['unit_division'])) {
$value = (int)$value / (int)$args['unit_division'];
}
kompass_print_textbox($args['setting'], $value, $style);
}

View File

@ -25,6 +25,13 @@ class WpConfigEditor extends \WP_Filesystem_Direct
public function writeConfig($value): bool
{
$value = str_replace('<?php', '', $value);
$value = str_replace('<?', '', $value);
$value = str_replace('?>', '', $value);
$value = str_replace(PHP_EOL . PHP_EOL, PHP_EOL, $value);
$value = '<?php' . PHP_EOL . $value;
$this->put_contents(ABSPATH . self::WP_CONFIG_FILE, $value);
return true;
}
@ -35,7 +42,7 @@ class WpConfigEditor extends \WP_Filesystem_Direct
$configContent = $wfs->readConfig();
if (null === self::getConfigValue($key)) {
$configContent .= "define( '$key', $value );";
$configContent .= "define( '$key', $value );" . PHP_EOL;
}
preg_match("/define\([ ]?'($key)'\,[ ]?(.*)[ ]?\);/",$configContent, $matches);

View File

@ -8,7 +8,7 @@ add_action('wp_login_failed', [$loginHandler, 'onFailedLogin']);
add_filter('wp_authenticate_user', [$loginHandler, 'onSuccessFullLogin'], 99999, 2);
add_filter( 'admin_enqueue_scripts', 'enqueue_custom_password_js',10 );
add_action('admin_init', 'admin_init');
add_action('admin_init', 'kompass_admin_init');
if (get_option('kompass_cookies', false)) {
$loginHandler->handleCookies();
@ -21,3 +21,5 @@ if (isset($_POST['save_kompass_balist_list_type'])) {
}
add_action('wp_head', 'kompass_seo_add_verfications');

View File

@ -16,47 +16,40 @@ function bdp_update_dashboard_style() {
function bdp_add_menu_security() {
$moduleLoad = get_admin_url() . 'admin.php?page=' . BDP_LV_PLUGIN_SLUG . '/modules/index.php&loadmodule=';
}
function bdp_add_menu_contents() {
add_menu_page(
'Beiträge',
add_menu_page('Seiten',
'Inhalte',
'edit_posts',
'edit.php',
'edit.php?post_type=page',
'',
'dashicons-format-aside',
4
);
add_submenu_page('edit.php',
add_submenu_page('edit.php?post_type=page',
'media',
'Medienverwaltung',
'edit_posts',
'upload.php'
);
add_submenu_page('edit.php',
'media',
'Statische Seiten',
'edit_posts',
'edit.php?post_type=page'
);
add_submenu_page('edit.php',
add_submenu_page('edit.php?post_type=page',
'comments',
'Kommentare',
'edit_posts',
'edit-comments.php'
);
add_submenu_page('edit.php?post_type=page',
'Beiträge',
'Beiträge',
'edit_posts',
'edit.php'
);
}
function bdp_add_menu_mein_lv() {
@ -74,12 +67,12 @@ function bdp_add_menu_mein_lv() {
3
);
add_submenu_page($mainSlug,
/*add_submenu_page($mainSlug,
'calendar_settings',
'Kalender-Einstellungen',
'manage_options',
$moduleLoad . 'calendar'
);
);*/
add_submenu_page($mainSlug,
'calendar_settings',
@ -90,31 +83,35 @@ function bdp_add_menu_mein_lv() {
}
function bdp_add_menu_setup() {
add_menu_page(
'Benutzer',
'Benutzer-Verwaltung',
'manage_options',
'users.php',
'',
'dashicons-admin-users',
6
);
add_menu_page(
'Allgemeine Einstellungen',
'Webseiten-Setup',
'manage_options',
'users.php',
'options-general.php',
'',
'dashicons-admin-generic',
6
);
add_submenu_page('users.php',
'Allgemeine Einstellungen',
'Allgemeine Einstellungen',
'manage_options',
'options-general.php'
);
add_submenu_page('users.php',
add_submenu_page('options-general.php',
'Design-Einstellungen',
'Template bearbeiten',
'manage_options',
'customize.php?return=/wp-admin/'
);
add_submenu_page('users.php',
add_submenu_page('options-general.php',
'plugins',
'Erweiterungen',
'manage_options',
@ -122,28 +119,21 @@ function bdp_add_menu_setup() {
);
add_submenu_page('users.php',
add_submenu_page('options-general.php',
'themes',
'Designs',
'manage_options',
'themes.php'
);
add_submenu_page('users.php',
add_submenu_page('options-general.php',
'Sicherheit',
'Webseiten-Sicherheit',
'manage_options',
'site-health.php'
);
$loginOption = new \Bdp\Modules\LimitLoginAttempts\Controllers\OptionsPage();
add_submenu_page('users.php',
'Login-Sicherheit',
'Login-Sicherheit',
'manage_options',
BDP_LV_PLUGIN_SLUG . '-limit-login-attempts',
[$loginOption, 'limit_login_option_page']
);
}
function bdp_cleanup_menu()
@ -165,15 +155,13 @@ function bdp_cleanup_menu()
bdp_add_menu_security();
remove_submenu_page('edit.php?post_type=page','post-new.php?post_type=page');
remove_submenu_page('users.php','user-new.php');
remove_submenu_page('users.php','profile.php');
remove_submenu_page('edit.php','post-new.php');
remove_submenu_page('edit.php','edit-tags.php?taxonomy=category');
remove_submenu_page('edit.php','edit-tags.php?taxonomy=post_tag');
}
function bdp_create_menu_structure()

View File

@ -3,4 +3,6 @@ require_once (ABSPATH . '/wp-admin/includes/plugin.php');
require_once (ABSPATH . '/wp-admin/includes/class-wp-filesystem-base.php');
require_once (ABSPATH . '/wp-admin/includes/class-wp-filesystem-direct.php');
require_once (ABSPATH . '/wp-includes/pluggable.php');
require_once (ABSPATH . '/wp-includes/capabilities.php');
require_once (ABSPATH . '/wp-admin/includes/template.php');
require_once (ABSPATH . '/wp-admin/includes/file.php');

102
includes/roles.php Normal file
View File

@ -0,0 +1,102 @@
<?php
function setup_site_roles()
{
remove_role( 'subscriber' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
remove_role( 'contributor' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
remove_role( 'author' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
remove_role( 'editor' ); // Hier 'custom_role_slug' durch den tatsächlichen Slug der zu löschenden Rolle ersetzen
$capabilities = array(
'read' => true, // Die Rolle kann Beiträge lesen
'edit_posts' => true, // Die Rolle kann Beiträge bearbeiten
'delete_posts' => true, // Die Rolle kann Beiträge löschen
'publish_posts' => true, // Die Rolle kann Beiträge veröffentlichen
// Weitere Berechtigungen können nach Bedarf hinzugefügt werden
);
// Rolle hinzufügen
add_role( 'stafue', 'Stammesführung', kompass_get_capa_stafue() );
add_role( 'grufue', 'Gruppenführung', kompass_get_capa_grufue() );
add_role( 'aktionsleitung', 'Aktionsleitung', kompass_get_capa_aktionsleitung() );
add_role( 'author', 'Redakteur', kompass_get_capa_editor() );
$role = get_role( 'administrator' );
foreach (kompass_get_capa_stafue() as $capability => $value) {
$role->add_cap( $capability );
}
}
function kompass_get_capa_stafue() : array
{
return array_merge(
[
'create_groups' => true,
'delete_groups' => true,
'edit_groups' => true,
'delete_teilis' => true,
'move_teilis' => true,
'create_events' => true,
], kompass_get_capa_aktionsleitung(), kompass_get_capa_grufue(), kompass_get_capa_editor());
}
function kompass_get_capa_aktionsleitung() : array
{
return [
'create_event_teilis' => true,
'edit_event_teilis' => true,
'delete_event_teilis' => true,
'send_event_mails' => true,
];
}
function kompass_get_capa_grufue() : array
{
return [
'create_teilis' => true,
'edit_teilis' => true,
'send_mails' => true
];
}
function kompass_get_capa_editor() : array
{
return [
'moderate_comments' => true,
'manage_categories' => true,
'manage_links' => true,
'upload_files' => true,
'unfiltered_html' => true,
'edit_posts' => true,
'edit_others_posts' => true,
'edit_published_posts' => true,
'publish_posts' => true,
'edit_pages' => true,
'read' => true,
'level_7' => true,
'level_6' => true,
'level_5' => true,
'level_4' => true,
'level_3' => true,
'level_2' => true,
'level_1' => true,
'level_0' => true,
'edit_others_pages' => true,
'edit_published_pages' => true,
'publish_pages' => true,
'delete_pages' => true,
'delete_others_pages' => true,
'delete_published_pages' => true,
'delete_posts' => true,
'delete_others_posts' => true,
'delete_published_posts' => true,
'delete_private_posts' => true,
'edit_private_posts' => true,
'read_private_posts' => true,
'delete_private_pages' => true,
'edit_private_pages' => true,
'read_private_pages' => true,
];
}

View File

@ -13,17 +13,21 @@ require_once dirname(__FILE__) . '/update.class.php';
require_once BDP_LV_PLUGIN_DIR . 'includes/FileAccess.class.php';
require_once BDP_LV_PLUGIN_DIR . 'includes/WpConfigEditor.class.php';
require_once (BDP_LV_PLUGIN_DIR . '/includes/roles.php');
require_once (BDP_LV_PLUGIN_DIR . '/includes/filters.php');
require_once (BDP_LV_PLUGIN_DIR . '/lib/ics-parser/Event.php');
require_once (BDP_LV_PLUGIN_DIR . '/lib/ics-parser/ICal.php');
require_once (BDP_LV_PLUGIN_DIR . '/modules/seo/seo.php');
require_once (BDP_LV_PLUGIN_DIR . '/modules/calendar/calendar.php');
require_once (BDP_LV_PLUGIN_DIR . '/includes/frontend-functions.php');
require_once (BDP_LV_PLUGIN_DIR . '/modules/calendar/Views/settings-form.php');
require_once (BDP_LV_PLUGIN_DIR . '/modules/security/security.php');
function admin_init()
function kompass_admin_init()
{
kompass_settings_validators();
}
@ -32,10 +36,16 @@ bdp_create_menu_structure();
function bdp_kompass_load_plugin_textdomain() {
load_textdomain( BDP_LV_PLUGIN_SLUG, BDP_LV_PLUGIN_DIR . '/lang/' . BDP_LV_PLUGIN_SLUG . '_' . get_locale() . '.mo' );
load_textdomain( BDP_LV_PLUGIN_SLUG, BDP_LV_PLUGIN_DIR . '/lang/' . BDP_LV_PLUGIN_SLUG . '-' . get_locale() . '.mo' );
}
function kompass_after_setup_theme()
{
setup_site_roles();
#register_custom_theme_directory();
}
$loginHandler = new LoginHandler();

View File

@ -19,7 +19,15 @@ spl_autoload_register(function ($className) {
require_once $fileName;
});
$modules = ['LimitLoginAttempts', 'PasswordStrength'];
$directoryPath = BDP_LV_PLUGIN_DIR . 'components/partials/';
foreach (glob($directoryPath . '*.php') as $file) {
require_once $file;
}
$modules = ['KompassSettings', 'LimitLoginAttempts', 'PasswordStrength', 'seo'];
$subdirs = ['includes', 'Controllers', 'Views'];
foreach ($modules as $curModule) {

View File

@ -12,7 +12,7 @@ class BdpVersionChecker
{
$plugin_data = get_plugin_data( BDP_LV_STARTUP_FILE );
$this->plugin_slug = BDP_LV_PLUGIN_SLUG;
$this->updateUrl = $plugin_data['UpdateURI'] . '/info_development.json';
$this->updateUrl = $plugin_data['UpdateURI'] . '/info.json';
$this->version = $plugin_data['Version'];
$this->cache_key = 'bdp-kompass-upd';
$this->cache_allowed = false;

BIN
lang/bdp-kompass-de_DE.mo Normal file

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,24 @@
msgid "kompass"
msgstr "kompass"
msgid "Calendar settings"
msgstr "Kalender-Einstellungen"
msgid "Calendar URL"
msgstr "Kalender-Adresse"
msgid "SEO-Options"
msgstr "Suchmaschinen-Einstellungen"
msgid "Google Site verification"
msgstr "Google Seiten-Verifikation"
msgid "Bing Site verification"
msgstr "Bing Seiten-Verifikation"
msgid "Calendar Settings"
msgstr "Kalender-Einstellungen"
msgid "Extended Security"
msgstr "Erweiterte Sicherheit"
@ -109,3 +130,150 @@ msgstr "Login-URL ändern"
msgid "Changing the default login URL of WordPress is advisable to enhance the security of your website. By default, WordPress login URLs is /wp-admin or /wp-login.php, which are easily guessed by hackers and facilitate attacks such as brute-force attacks. Changing the login URL to something unique and difficult to guess increases security since potential attackers will struggle to find the correct URL. This can help protect your website from unauthorized access and other malicious activities."
msgstr "Es ist ratsam, die Standard-Login-URL von WordPress zu ändern, um die Sicherheit deiner Website zu erhöhen. Standardmäßig lautet die Login-URL von WordPress /wp-admin oder /wp-login.php, was für Hacker leicht zu erraten ist und Angriffe wie Brute-Force-Attacken erleichtern kann. Durch Ändern der Login-URL auf etwas Einzigartiges und schwer zu erraten, erhöhst du die Sicherheit, da potenzielle Angreifer Schwierigkeiten haben werden, die richtige URL zu finden. Dies kann helfen, deine Website vor unautorisiertem Zugriff und anderen böswilligen Aktivitäten zu schützen."
msgid "Login-Protection"
msgstr "Login-Sicherheit"
msgid "Settings"
msgstr "Einstellungen"
msgid "There are no ip addresses blocked."
msgstr "Derzeit sind keine Adressen gesperrt."
msgid "IP address"
msgstr "IP-Adresse"
msgid "Blocked until"
msgstr "Gesperrt bis"
msgid "Actions"
msgstr "Aktionen"
msgid "The settings were saved."
msgstr "Die Einstellungen wurden gespeichert."
msgid "The ip address was released."
msgstr "Die IP-Adresse wurde freigegeben."
msgid "The list was saved."
msgstr "Die Liste wurde gespeichert."
msgid "An error occured."
msgstr "Es ist ein Fehler aufgetreten"
msgid "Options"
msgstr "Optionen"
msgid "Blocklist"
msgstr "Blocklist"
msgid "Allowlist"
msgstr "Allowlist"
msgid "Blocked IP addresses"
msgstr "Gesperrte IP-Adressen"
msgid "Too many failed login attempts."
msgstr "Zu vile fehlerhafte Login-Versuche."
msgid "Please try again later."
msgstr "Bitte versuche es später erneut."
msgid "%d hour"
msgid_plural "%d hours"
msgstr[0] "%d Stunde"
msgstr[1] "%d Stunden"
msgid "Please try again in %d hour."
msgid_plural "Please try again in %d hours."
msgstr[0] "Bitte versuche es in %d Stunde noch einmal."
msgstr[1] "Bitte versuche es in %d Stunden noch einmal."
msgid "Please try again in %d minute."
msgid_plural "Please try again in %d minutes."
msgstr[0] "Bitte versuche es in %d Minute noch einmal."
msgstr[1] "Bitte versuche es in %d Minuten noch einmal."
msgid "%d minute"
msgid_plural "%d minutes"
msgstr[0] "%d Minute"
msgstr[1] "%d Minuten"
msgid "Leave blank for delete"
msgstr "Zum Löschen frei lassen"
msgid "Add ip address"
msgstr "IP-Adresse hinzufügen"
msgid "Please use line breaks to enter multiple ip addresses"
msgstr "Bitte Zeilenumbruch verwenden, um mehrere IP-Adressen einzutragen"
msgid "Maximum reps until lockout"
msgstr "Maximale Wiederholungen bis zur Sperrung"
msgid "Duration of lockout (in minutes)"
msgstr "Dauer der Sperre (in Minuten)"
msgid "Maximum number of lockouts"
msgstr "Maximale Anzahl an Sperrungen"
msgid "Long-term duration (in hours)"
msgstr "Langzeitsperre (in Stunden)"
msgid "Minimum password strength"
msgstr "Minimale Passwort-Stärke"
msgid "Page accessible via"
msgstr "Seite erreichbar über"
msgid "Handle cookies"
msgstr "Cookies verarbeiten"
msgid "Notify if blocked"
msgstr "Bei Sperrung benachrichtigen"
msgid "Failed attempts until notification"
msgstr "Fehlversuche bis zur Benachrichtigung"
msgid "E-Mail to site admin"
msgstr "E-Mail an den Webseiten-Administrator"
msgid "Direct connection"
msgstr "Direkte Verbindung"
msgid "Behind a proxy"
msgstr "Hinter einem Proxy"
msgid "Yes"
msgstr "Ja"
msgid "No"
msgstr "Nein"
msgid "Allow all password strengths"
msgstr "Alle Passwort-Stärken erlauben"
msgid "At least passwords with medium strength"
msgstr "Mindestens Passwortstärke normal"
msgid "Only allow strong passwords"
msgstr "Nur starke Passwörter erlauben"
msgid "The password does not correspond to the requirements."
msgstr "Dass Passwort entspricht nicht den Anforderungen."
msgid "Release ip address"
msgstr "IP-Adresse freigeben"
msgid "Add ip address to blocklist"
msgstr "IP-Adresse auf Blocklist setzen"
msgid "Add ip address to allowlist and release"
msgstr "IP-Adresse auf Allowlist setzen und freigeben"
msgid "Search for ip address"
msgstr "Nach IP-Adresse suchen"
msgid "Delete"
msgstr "Löschen"

View File

@ -154,21 +154,20 @@ class Event
{
foreach ($data as $key => $value) {
if ($key == 'DTSTART_array' || $key == 'DTEND_array') {
$dateString = $value[1];
$dateTime = \DateTime::createFromFormat('Ymd\THis', $dateString);
if (false === $dateTime) {
$this->wholeDay = true;
$dateTime = \DateTime::createFromFormat('Ymd', $dateString);
}
$timeZone = 'Europe/Berlin';
if (isset($value[0]['TZID'])) {
$timeZone = $value[0]['TZID'];
}
$dateTime->setTimezone(new \DateTimeZone($timeZone));
$dateString = $value[1];
$dateTime = \DateTime::createFromFormat('Ymd\THis', $dateString, new \DateTimeZone($timeZone));
if (false === $dateTime) {
$this->wholeDay = true;
$dateTime = \DateTime::createFromFormat('Ymd', $dateString, new \DateTimeZone($timeZone));
}
$dateTime->setTimezone(new \DateTimeZone('UTC'));
if ($key == 'DTSTART_array') {
$this->start = $dateTime->format('d.m.Y H:i:s');
$this->startInt = $dateTime->getTimestamp();
@ -176,9 +175,7 @@ class Event
$this->end = $dateTime->format('d.m.Y H:i:s');
$this->endInt = $dateTime->getTimestamp();
}
} else {
$variable = self::snakeCase($key);
if (property_exists($this, $variable)) {
$this->{$variable} = $this->prepareData($value);

View File

@ -2223,7 +2223,6 @@ class ICal
if ($ignoreUtc && strtoupper($timeZone) === self::TIME_ZONE_UTC) {
return null;
}
return $timeZone;
}

View File

@ -0,0 +1,79 @@
<?php
namespace Bdp\Modules\KompassSettings\Controllers;
class SettingsPage
{
public function __construct()
{
add_options_page(
__('kompass', BDP_LV_PLUGIN_SLUG) . ' - ' . __('Settings', BDP_LV_PLUGIN_SLUG),
__('kompass', BDP_LV_PLUGIN_SLUG) . ' - ' . __('Settings', BDP_LV_PLUGIN_SLUG),
'manage_options',
BDP_LV_PLUGIN_SLUG . '-Kompass-settings',
[$this, 'option_page'],2048);
}
public function option_page() {
bdp_kompass_load_plugin_textdomain();
$showMessage = null;
$tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'tab1';
if (isset($_REQUEST['update_options']) && $_REQUEST['update_options'] == true) {
switch ($tab) {
case 'tab1':
update_option('bdp_calendar_categories', json_encode($_POST['category']));
update_option('bdp_calendar_source_url', $_POST['ical_url']);
$showMessage = __('The settings were saved.', BDP_LV_PLUGIN_SLUG);
break;
case 'tab2':
update_option('kompass_seo_google_verification', $_POST['kompass_seo_google_verification']);
update_option('kompass_seo_bing_verification', $_POST['kompass_seo_bing_verification']);
$showMessage = __('The settings were saved.', BDP_LV_PLUGIN_SLUG);
break;
}
if (null !== $showMessage) {
echo '<div class="notice notice-success" style="padding: 5px 10px;">';
echo $showMessage;
echo '</div>';
}
}
bdp_kompass_load_plugin_textdomain();
?>
<div class="wrap">
<h1 class="wp-heading-inline">
<?= __('kompass', BDP_LV_PLUGIN_SLUG); ?> - <?= __('Settings', BDP_LV_PLUGIN_SLUG); ?></h1>
<hr class="wp-header-end">
<?= kompass_settings_print_tab_header($tab); ?>
<div class="tab-content">
<?php
switch ($tab) {
case 'tab1':
echo '<form action="admin.php?page=bdp-kompass-Kompass-settings&tab=tab1" method="post">';
do_settings_sections(BDP_LV_PLUGIN_SLUG . '-calendar-settings');
require_once BDP_LV_PLUGIN_DIR . '/modules/calendar/Views/categories-partial.php';
echo '<input type="hidden" name="tab" value="tab1" />';
submit_button();
echo '</form>';
break;
case 'tab2':
echo '<form action="admin.php?page=bdp-kompass-Kompass-settings" method="post">';
do_settings_sections(BDP_LV_PLUGIN_SLUG . '-seo-settings');
submit_button();
echo '<input type="hidden" name="tab" value="tab2" />';
echo '</form>';
break;
}
?>
</div>
</div>
<?php
}
}

View File

@ -0,0 +1,13 @@
<?php
function kompass_settings_print_tab_header(string $activeTab = 'tab1')
{
$baseUrl = 'admin.php?page=bdp-kompass-Kompass-settings&tab=';
return '<h2 class="nav-tab-wrapper">'.
'<a href="' . $baseUrl . 'tab1" class="nav-tab ' . ($activeTab == 'tab1' ? 'nav-tab-active' : '') . '">' .
__('Calendar Settings', BDP_LV_PLUGIN_SLUG) .
'</a>'.
'<a href="' . $baseUrl . 'tab2" class="nav-tab ' . ($activeTab == 'tab2' ? 'nav-tab-active' : '') .'">' .
__('SEO', BDP_LV_PLUGIN_SLUG) .
'</a>'.
'</h2>';
}

View File

@ -117,25 +117,24 @@ class LoginHandler {
}
}
}
private function composeErrorMessage() {
$ip = $this->getAddress();
$lockouts = get_option('kompass_limit_login_lockouts');
$lockouts = get_option('protect_login_limit_login_lockouts');
$msg = __('<strong>ERROR</strong>: Too many failed login attempts.', 'limit-login-attempts') . ' ';
$msg = __('Too many failed login attempts.', BDP_LV_PLUGIN_SLUG) . ' ';
if (!is_array($lockouts) || !isset($lockouts[$ip]) || time() >= $lockouts[$ip]) {
/* Huh? No timeout active? */
$msg .= __('Please try again later.', 'limit-login-attempts');
$msg .= __('Please try again later.', BDP_LV_PLUGIN_SLUG);
return $msg;
}
$when = ceil(($lockouts[$ip] - time()) / 60);
if ($when > 60) {
$when = ceil($when / 60);
$msg .= sprintf(_n('Please try again in %d hour.', 'Please try again in %d hours.', $when, 'limit-login-attempts'), $when);
$msg .= sprintf(_n('Please try again in %d hour.', 'Please try again in %d hours.', $when, BDP_LV_PLUGIN_SLUG), $when);
} else {
$msg .= sprintf(_n('Please try again in %d minute.', 'Please try again in %d minutes.', $when, 'limit-login-attempts'), $when);
$msg .= sprintf(_n('Please try again in %d minute.', 'Please try again in %d minutes.', $when, BDP_LV_PLUGIN_SLUG), $when);
}
return $msg;

View File

@ -2,14 +2,14 @@
namespace Bdp\Modules\LimitLoginAttempts\Controllers;
class OptionsPage
{
public function __construct()
{
add_options_page(BDP_LV_PLUGIN_SLUG . '-limit-login-attempts',
'Protect Login',
'site-health.php',
add_options_page(
__('Login-Protection', BDP_LV_PLUGIN_SLUG),
__('Login-Protection', BDP_LV_PLUGIN_SLUG),
'manage_options',
BDP_LV_PLUGIN_SLUG . '-limit-login-attempts',
[$this, 'limit_login_option_page'],2048);
}
@ -21,37 +21,71 @@ class OptionsPage
update_option('kompass_limit_login_lockouts', $allIps);
}
public static function addToBlocklist(string $ip)
{
$blockedIps = get_option('kompass_limit_login_blocklist', []);
$blockedIps[] = $ip;
update_option('kompass_limit_login_blocklist', $blockedIps);
}
public static function addToAllowlist(string $ip)
{
$allowedIps = get_option('kompass_limit_login_allowlist', []);
$allowedIps[] = $ip;
update_option('kompass_limit_login_allowlist', $allowedIps);
self::releaseIp($ip);
}
public function removeFromList(string $listType, string $ip){
update_option(
'kompass_limit_login_' . $listType,
array_diff(get_option('kompass_limit_login_' . $listType, []), [$ip])
);
}
public function getBlockedIps()
{
bdp_kompass_load_plugin_textdomain();
$ips = '';
foreach (get_option('kompass_limit_login_lockouts', []) as $ip => $blockedUntil) {
$ips .= '<tr>' .
'<td style="padding-right: 10px;">' . $ip . '</td>' .
'<td style="padding-right: 10px;">' . date('d.m.Y H:i', $blockedUntil) . ' Uhr</td>' .
$ips .= '<tr style="vertical-align: top;">' .
'<td style="padding-right: 50px;">' . $ip . '</td>';
if (in_array($ip, get_option('protect_login_limit_login_blocklist', []))) {
$ips .= '<td style="padding-right: 50px;">Dauerhaft blockiert</td>' .
'<td>' .
'Keine Aktion möglich' .
'</td></tr>';
} else {
$ips .= '<td style="padding-right: 50px;">' . date('d.m.Y', $blockedUntil) . '<br />' . date('H:i', $blockedUntil) . ' Uhr</td>' .
'<td>
<a href="admin.php?page=bdp-kompass-limit-login-attempts&tab=tab4&action=release&ip=' .
base64_encode($ip) . '">Freigeben</a></td>' .
'</tr>';
base64_encode($ip) . '">' . __('Release ip address', BDP_LV_PLUGIN_SLUG) . '</a><br />
<a href="admin.php?page=bdp-kompass-limit-login-attempts&tab=tab4&action=toBlock&ip=' .
base64_encode($ip) . '">' . __('Add ip address to blocklist', BDP_LV_PLUGIN_SLUG) . '</a><br />
<a href="admin.php?page=bdp-kompass-limit-login-attempts&tab=tab4&action=toAllow&ip=' .
base64_encode($ip) . '">' . __('Add ip address to allowlist and release', BDP_LV_PLUGIN_SLUG) . '</a><br /> ' .
'</td></tr>';
};
}
return $ips;
}
public function limit_login_option_page() {
global $errors;
bdp_kompass_load_plugin_textdomain();
$showMessage = null;
if (isset($_POST['update_options'])) {
update_settings($_POST);
$showMessage = 'Die Einstellungen wurden gespeichert';
$showMessage = __('The settings were saved.', BDP_LV_PLUGIN_SLUG);
}
if (isset($_GET['action']) && $_GET['action'] == 'release') {
$showMessage = 'Die IP-Adresse wurde freigegeben.';
$showMessage = __('The ip address was released.', BDP_LV_PLUGIN_SLUG);
}
if(isset($_POST['save_kompass_balist_list_type'])) {
$showMessage = 'Die Liste wurde gespeichert.';
$showMessage = __('The list was saved.', BDP_LV_PLUGIN_SLUG);
}
if (null !== $showMessage && $errors === false) {
@ -62,15 +96,27 @@ class OptionsPage
if ($errors) {
echo '<div class="notice notice-error" style="padding: 5px 10px;">';
echo 'Beim Durchführen der Aktion ist ein Fehler aufgetreten.';
echo __('An error occured.', BDP_LV_PLUGIN_SLUG);
echo '</div>';
}
$tab = isset($_GET['tab']) ? $_GET['tab'] : 'tab1';
if (isset($_GET['action']) && $_GET['action'] == 'removeFromList') {
$this->removeFromList($_GET['list'], base64_decode($_GET['ip']));
if ($_GET['list'] == 'blocklist') {
$tab = 'tab2';
} else {
$tab = 'tab3';
}
}
bdp_kompass_load_plugin_textdomain();
?>
<div class="wrap">
<h1 class="wp-heading-inline">Protect Login - Einstellungen</h1>
<h1 class="wp-heading-inline">
<?= __('Login-Protection', BDP_LV_PLUGIN_SLUG); ?> - <?= __('Settings', BDP_LV_PLUGIN_SLUG); ?></h1>
<hr class="wp-header-end">
<?= kompass_print_tab_header($tab); ?>
@ -101,22 +147,39 @@ class OptionsPage
if (isset($_GET['action']) && $_GET['action'] == 'release') {
$this->releaseIp(base64_decode($_GET['ip']));
}
if (isset($_GET['action']) && $_GET['action'] == 'toBlock') {
$this->addToBlocklist(base64_decode($_GET['ip']));
}
if (isset($_GET['action']) && $_GET['action'] == 'toAllow') {
$this->addToAllowlist(base64_decode($_GET['ip']));
}
$blockedIps = $this->getBlockedIps();
?>
<h3>Gesperrte IPs</h3>
<?php
echo '<h2>'. __('Blocked IP addresses', BDP_LV_PLUGIN_SLUG) .'</h2>';
if (strlen($blockedIps) == 0) {
echo '<div class="protect-login-no-blocked-ips">';
echo 'Derzeit sind keine Adressen gesperrt.';
echo '<div class="bdp-kompass-no-blocked-ips">';
echo __('There are no ip addresses blocked.', BDP_LV_PLUGIN_SLUG);
echo '</div>';
} else { ?>
<table>
<p style="width: 100%; text-align: right">
<input type="text" id="searchInput"
onkeyup="searchTable('myTable', this)"
placeholder="<?=__('Search for ip address', BDP_LV_PLUGIN_SLUG); ?>">
</p>
<table class="wp-list-table widefat fixed striped table-view-list" id="myTable">
<thead>
<tr>
<th>IP</th>
<th>Gesperrt bis</th>
<th>Aktion</th>
<th scope="col" class="manage-column column-name"><?= __('IP address', BDP_LV_PLUGIN_SLUG); ?></th>
<th class="manage-column column-name"><?= __('Blocked until', BDP_LV_PLUGIN_SLUG); ?></th>
<th class="manage-column column-name"><?= __('Actions', BDP_LV_PLUGIN_SLUG); ?></th>
</tr>
</thead>
<tbody>
<?= $blockedIps ?>
</tbody>
</table>
<?php
}

View File

@ -1,18 +1,18 @@
<?php
function kompass_print_tab_header($activeTab = 'tab1')
function kompass_print_tab_header(string $activeTab = 'tab1')
{
$baseUrl = 'admin.php?page=bdp-kompass-limit-login-attempts&tab=';
return '<h2 class="nav-tab-wrapper">'.
'<a href="' . $baseUrl . 'tab1" class="nav-tab ' . ($activeTab == 'tab1' ? 'nav-tab-active' : '') . '">
Optionen
</a>'.
'<a href="' . $baseUrl . 'tab2" class="nav-tab ' . ($activeTab == 'tab2' ? 'nav-tab-active' : '') .'">
Blocklist
</a>'.
'<a href="' . $baseUrl . 'tab3" class="nav-tab ' . ($activeTab == 'tab3' ? 'nav-tab-active' : '') .'">
Allowlist
</a>'.
'<a href="' . $baseUrl . 'tab4" class="nav-tab ' . ($activeTab == 'tab4' ? 'nav-tab-active' : '') .'">
Gesperrte IPs
</a></h2>';
'<a href="' . $baseUrl . 'tab1" class="nav-tab ' . ($activeTab == 'tab1' ? 'nav-tab-active' : '') . '">' .
__('Options', BDP_LV_PLUGIN_SLUG) .
'</a>'.
'<a href="' . $baseUrl . 'tab2" class="nav-tab ' . ($activeTab == 'tab2' ? 'nav-tab-active' : '') .'">' .
__('Blocklist', BDP_LV_PLUGIN_SLUG) .
'</a>'.
'<a href="' . $baseUrl . 'tab3" class="nav-tab ' . ($activeTab == 'tab3' ? 'nav-tab-active' : '') .'">' .
__('Allowlist', BDP_LV_PLUGIN_SLUG) .
'</a>'.
'<a href="' . $baseUrl . 'tab4" class="nav-tab ' . ($activeTab == 'tab4' ? 'nav-tab-active' : '') .'">' .
__('Blocked IP addresses', BDP_LV_PLUGIN_SLUG) .
'</a></h2>';
}

View File

@ -1,7 +0,0 @@
<?php
function kompass_print_textbox($settingName, $settingValue) {
echo '<input type="text" name="' . $settingName . '" value="' . $settingValue. '" />';
if (defined('WP_DEBUG') && WP_DEBUG == true) {
echo '<br />' . $settingName;
}
}

View File

@ -1,47 +1,56 @@
<?php
function updateBlockOrAllowList($postVars)
use Bdp\Modules\LimitLoginAttempts\Controllers\OptionsPage as LimitLoginAttemptsOptions;
function updateBlockOrAllowList(array $postVars)
{
$listType = $postVars['save_kompass_balist_list_type'];
$saveIPList = [];
if (isset($postVars['listElements'])) {
foreach ($postVars['listElements'] as $curIp) {
$curIp = trim($curIp);
if ($curIp !== '') {
$saveIPList[] = $curIp;
}
}
}
if (count($postVars['new_ips']) == 1) {
foreach (explode(PHP_EOL, $postVars['new_ips'][0]) as $newIp) {
$newIp = trim($newIp);
if ('' !== $newIp) {
$saveIPList[] = $newIp;
if ($listType == 'blocklist') {
LimitLoginAttemptsOptions::addToBlocklist($newIp);
} else {
LimitLoginAttemptsOptions::addToAllowlist($newIp);
}
}
}
}
}
update_option('kompass_limit_login_' . $listType, $saveIPList);
}
function kompass_print_block_allow_form($listType) {
function kompass_print_block_allow_form(string $listType) {
$elements = get_option('kompass_limit_login_' . $listType, []);
?>
<input type="hidden" name="save_kompass_balist_list_type" value="<?= $listType; ?>" />
<p style="width: 100%; text-align: right">
<input type="text" id="searchInput"
onkeyup="searchTable('myTable', this)"
placeholder="<?=__('Search for ip address', BDP_LV_PLUGIN_SLUG); ?>">
</p>
<table class="wp-list-table widefat fixed striped table-view-list" id="myTable">
<thead>
<tr>
<th scope="col" class="manage-column column-name"><?= __('IP address', BDP_LV_PLUGIN_SLUG); ?></th>
<th style="width: 100px;" class="manage-column column-name"><?= __('Actions', BDP_LV_PLUGIN_SLUG); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($elements as $currentIp) {
?>
<p>
<input type="text" name="listElements[]" value="<?= $currentIp ?>" style="width: 350px;" /><br />
<label style="cursor: default; color: #a0a0a0; fot-size: 9pt; font-style: italic"><?= __('Zum Löschen frei lassen', BDP_LV_PLUGIN_SLUG); ?></label>
</p>
<?php
echo '<tr>';
echo '<td>' . $currentIp .'</td>';
echo '<td><a href="admin.php?page=bdp-kompass-limit-login-attempts&action=removeFromList' .
'&list=' . $listType . '&ip=' . base64_encode($currentIp) . '">'
. __('Delete', BDP_LV_PLUGIN_SLUG) . '</a></td>';
echo '</tr>';
}
?>
</tbody>
</table>
</div>
<div class="kompass_setting_box">
<h3><?= __('IP-Adresse hinzufügen', BDP_LV_PLUGIN_SLUG); ?></h3>

View File

@ -1,51 +1,39 @@
<?php
// Callback-Funktion für die Einstellungsseite
function custom_settings_section_callback() {
echo '<input type="hidden" name="update_options" value="true" />';
}
function _kompass_limit_logins_settings_callback($args) {
$setting = get_option($args['setting'], null);
if (null === $setting) {
$setting = '';
}
$value = esc_attr($setting);
if (isset($args['unit_division'])) {
$value = (int)$value / (int)$args['unit_division'];
}
kompass_print_textbox($args['setting'], $value);
}
function _kompass_limit_logins_settings_radio_callback($args)
function _kompass_limit_logins_settings_radio_callback(array $args)
{
kompass_print_radio($args['setting']);
}
function _kompass_limit_logins_settings_checkbox_callback($args) {
function _kompass_limit_logins_settings_checkbox_callback(array $args) {
kompass_print_checkbox($args['setting']);
}
bdp_kompass_load_plugin_textdomain();
add_settings_section(
'custom_settings_section',
'Optionen',
__('Options', BDP_LV_PLUGIN_SLUG),
'custom_settings_section_callback',
BDP_LV_PLUGIN_SLUG . '-limit-login-attempts'
);
$settings_page = BDP_LV_PLUGIN_SLUG . '-limit-login-attempts';
add_settings_field(
'kompass_lla_1',
'Maximale Wiederholungen',
__('Maximum reps until lockout', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$settings_page,
'custom_settings_section',
@ -53,7 +41,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_2',
'Dauer der Sperre (in Minuten)',
__('Duration of lockout (in minutes)', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$settings_page,
'custom_settings_section',
@ -61,7 +49,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_3',
'Maximale Anzahl an Sperrungen',
__('Maximum number of lockouts', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$settings_page,
'custom_settings_section',
@ -69,7 +57,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_4',
'Langzeitsperre in Stunden',
__('Long-term duration (in hours)', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$settings_page,
'custom_settings_section',
@ -77,7 +65,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_5',
'Mininmale Passwort-Stärke:',
__('Minimum password strength', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_radio_callback',
$settings_page,
'custom_settings_section',
@ -85,7 +73,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_6',
'Seite erreichbar über:',
__('Page accessible via', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_radio_callback',
$settings_page,
'custom_settings_section',
@ -93,7 +81,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_7',
'Cookies verarbeiten',
__('Handle cookies', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_radio_callback',
$settings_page,
'custom_settings_section',
@ -101,7 +89,7 @@ add_settings_field(
add_settings_field(
'kompass_lla_8',
'Bei Sperrung benachrichtigen',
__('Notify if blocked', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_checkbox_callback',
$settings_page,
'custom_settings_section',
@ -109,8 +97,9 @@ add_settings_field(
add_settings_field(
'kompass_lla_9',
'Fehlversuche bis zur Benachrichtigung',
__('Failed attempts until notification', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$settings_page,
'custom_settings_section',
['setting' => 'kompass_limit_login_notify_email_after']);

View File

@ -1,20 +1,16 @@
<?php
function check_for_integer($input) {
if (!is_numeric($input)) {
wp_die('Bitte nur Zahlen, Danke!');
}
function check_for_integer(int $input) {
return $input;
}
function hours_to_seconds_converter($input) {
function hours_to_seconds_converter(int $input) {
// Hier kannst du die Eingabe validieren, z.B. sicherstellen, dass es sich um eine gültige E-Mail-Adresse handelt.
return minutes_to_seconds_converter($input) * 60;
}
function minutes_to_seconds_converter($input) {
function minutes_to_seconds_converter(int $input) {
// Hier kannst du die Eingabe validieren, z.B. sicherstellen, dass es sich um eine gültige E-Mail-Adresse handelt.
return check_for_integer($input) * 60;
}
@ -43,7 +39,7 @@ function kompass_settings_validators()
'check_for_integer');
}
function update_settings($postParams) {
function update_settings(array $postParams) {
$settings = ['kompass_limit_login_lockout_duration',
'kompass_limit_login_allowed_retries',
'kompass_limit_login_allowed_lockouts',

View File

@ -0,0 +1,66 @@
<?php
$categories = get_option('bdp_calendar_categories', null);
if (null !== $categories) {
$categories = json_decode($categories, true);
} else {
$categories = [
'yellow' => 'Meute',
'blue' => 'Sippe',
'red' => 'Runde',
'green' => 'Stammesführung',
'fuchsia' => '',
'orange' => ''
];
}
?>
<table class="form-table">
<tr>
<th style="width: 200px" scope="row"></th>
<th></th>
<td style="width: 50px;"></td>
<td></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Gelb:</th>
<th><input type="text" name="category[yellow]" value="<?php echo $categories['yellow']; ?>" /></th>
<td style="width: 50px;" class="bdp_cal_event_yellow"></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Blau:</th>
<th><input type="text" name="category[blue]" value="<?php echo $categories['blue']; ?>" /></th>
<td class="bdp_cal_event_blue"></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Rot:</th>
<th><input type="text" name="category[red]" value="<?php echo $categories['red']; ?>" /></th>
<td class="bdp_cal_event_red"></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Grün:</th>
<th><input type="text" name="category[green]" value="<?php echo $categories['green']; ?>" /></th>
<td class="bdp_cal_event_green"></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Fuchsia:</th>
<th><input type="text" name="category[fuchsia]" value="<?php echo $categories['fuchsia']; ?>" /></th>
<td class="bdp_cal_event_fuchsia"></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Orange:</th>
<th><input type="text" name="category[orange]" value="<?php echo $categories['orange']; ?>" /></th>
<td class="bdp_cal_event_orange"></td>
</tr>
<tr>
<th style="width: 210px;" scope="row">Grau:</th>
<th>Standard</th>
<td class="bdp_cal_event_grey"></td>
</tr>
</table>

View File

@ -0,0 +1,18 @@
<?php
add_settings_section(
'custom_settings_section',
__('Calendar settings', BDP_LV_PLUGIN_SLUG),
'custom_settings_section_callback',
BDP_LV_PLUGIN_SLUG . '-calendar-settings'
);
$seo_settings_page = BDP_LV_PLUGIN_SLUG . '-calendar-settings';
add_settings_field(
'kompass_cal_1',
__('Calendar URL', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$seo_settings_page,
'custom_settings_section',
['setting' => 'bdp_calendar_source_url', 'style' => 'width: 1024px']);

View File

@ -1,86 +0,0 @@
<?php
echo '<h1>Kalender-Einstellungen</h1>';
if (isset($_POST['submit'])) {
echo '<div id="bdp_success">Die Einstellungen wurden gespeichert.</div>';
update_option('bdp_calendar_categories', json_encode($_POST['category']));
update_option('bdp_calendar_source_url', $_POST['ical_url']);
}
$categories = get_option('bdp_calendar_categories', null);
if (null !== $categories) {
$categories = json_decode($categories, true);
} else {
$categories = [
'yellow' => 'Meute',
'blue' => 'Sippe',
'red' => 'Runde',
'green' => 'Stammesführung',
'fuchsia' => '',
'orange' => ''
];
}
?>
<form method="post" action="admin.php?page=bdp-kompass%2Fmodules%2Findex.php&loadmodule=calendar">
<fieldset class="bdp_cal_inner">
<legend>Datenabfrage</legend>
<table>
<tr style="vertical-align: top;">
<td>Kalender-URL:</td>
<td><input class="long_text" type="text" name="ical_url" id="ical_url" required
value = "<?php echo get_option('bdp_calendar_source_url', ''); ?>"
><br />
<label style="font-weight: normal; color: #a0a0a0; font-style: italic">
Bitte gib hier die URL zur .ics - Datei eures Kalenbders im Wiki ein.
</label>
</td>
</tr>
</table>
</fieldset>
<fieldset class="bdp_cal_inner">
<legend>Labels</legend>
<table>
<tr>
<td>Gelb:</td>
<td><input type="text" name="category[yellow]" value="<?php echo $categories['yellow']; ?>" /></td>
<td class="bdp_cal_event_yellow"></td>
</tr>
<tr>
<td>Blau:</td>
<td><input type="text" name="category[blue]" value="<?php echo $categories['blue']; ?>" /></td>
<td class="bdp_cal_event_blue"></td>
</tr>
<tr>
<td>Rot:</td>
<td><input type="text" name="category[red]" value="<?php echo $categories['red']; ?>" /></td>
<td class="bdp_cal_event_red"></td>
</tr>
<tr>
<td>Grün:</td>
<td><input type="text" name="category[green]" value="<?php echo $categories['green']; ?>" /></td>
<td class="bdp_cal_event_green"></td>
</tr>
<tr>
<td>Fuchsia:</td>
<td><input type="text" name="category[fuchsia]" value="<?php echo $categories['fuchsia']; ?>" /></td>
<td class="bdp_cal_event_fuchsia"></td>
</tr>
<tr>
<td>Orange:</td>
<td><input type="text" name="category[orange]" value="<?php echo $categories['orange']; ?>" /></td>
<td class="bdp_cal_event_orange"></td>
</tr>
<tr>
<td>Grau:</td>
<td>Standard</td>
<td class="bdp_cal_event_grey"></td>
</tr>
</table>
<input class="button" type="submit" name="submit" value="Einstellungen speichern">
</form>

View File

@ -105,6 +105,9 @@ class Security
if ( str_contains( $_SERVER['REQUEST_URI'], $hideLogin ) !== false ) {
$user_login = '';
if (!isset($error)) {
$error = '';
}
$_REQUEST['redirect_to'] = 'interner-bereich';
require_once 'wp-login.php';
die();

View File

@ -0,0 +1,28 @@
<?php
add_settings_section(
'custom_settings_section',
__('SEO-Options', BDP_LV_PLUGIN_SLUG),
'custom_settings_section_callback',
BDP_LV_PLUGIN_SLUG . '-seo-settings'
);
$seo_settings_page = BDP_LV_PLUGIN_SLUG . '-seo-settings';
add_settings_field(
'kompass_seo_1',
__('Google Site verification', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$seo_settings_page,
'custom_settings_section',
['setting' => 'kompass_seo_google_verification', 'style' => 'width: 500px']);
add_settings_field(
'kompass_seo_2',
__('Bing Site verification', BDP_LV_PLUGIN_SLUG),
'_kompass_limit_logins_settings_callback',
$seo_settings_page,
'custom_settings_section',
['setting' => 'kompass_seo_bing_verification', 'style' => 'width: 500px']);

View File

@ -3,8 +3,34 @@
namespace Bdp\Modules\Seo;
class Seo
{
public static function importVerificationKeys() {
$aioseoSetting = get_option('aioseo_options', null);
if (null === $aioseoSetting) {
return;
}
if ('' !== $aioseoSetting && !is_object($aioseoSetting) && !is_array($aioseoSetting)){
$aioseoSetting = json_decode( $aioseoSetting );
}
if (!is_object($aioseoSetting) ||!isset($aioseoSetting->webmasterTools) ||!is_object($aioseoSetting->webmasterTools)) {
return;
}
$webmasterTools = $aioseoSetting->webmasterTools;
if ('' !== get_option('kompass_seo_google_verification', '')) {
update_option('kompass_seo_google_verification', $webmasterTools->google);
}
if ('' !== get_option('kompass_seo_bing_verification', '')) {
update_option('kompass_seo_bing_verification', $webmasterTools->bing);
}
}
public static function setup()
{
if (get_option('permalink_structure') === '') {
update_option('permalink_structure', '/%postname%/');
flush_rewrite_rules();

View File

@ -0,0 +1,12 @@
<?php
function kompass_seo_add_verfications() {
$googleVerification = get_option('kompass_seo_google_verification', '');
if ('' !== $googleVerification) {
echo '<meta name="google-site-verification" content="' . $googleVerification . '" />' . "\n";
}
$bingVerification = get_option('kompass_seo_bing_verification', '');
if ('' !== $bingVerification) {
echo '<meta name="msvalidate.01="' . $bingVerification . '" />' . "\n";
}
}

View File

@ -1,104 +0,0 @@
@charset "UTF-8";
@import url("font/ihs.css");
html, body { border: 0 none; padding: 0; margin: 0; min-height: 100%; position: static; }
html { font-family: Sans-Serif; background: url("img/holz.jpg") #dbb97b; position: relative; }
body { margin: 1em; padding: 1em; max-width: 710px; background: #fff; font-size: 81.3% !important; }
body.post-type-gallery { background: transparent; }
header, hgroup, nav, footer, article { display: block; }
.h, h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { margin: 0; font-family: IHS, Serif; font-size: 1em; font-weight: normal; font-style: normal; }
button, input, select, optgroup, option { margin: 0; font: inherit; color: inherit; }
button, input[type="button"], input[type="submit"], input[type="reset"] { cursor: pointer; }
p, ul, ol, dt { line-height: 1.5; }
abbr { border-bottom: 1px dotted; }
a { color: #1d4899; }
figure, .wp-caption { margin: 0; max-width: 100%; }
figcaption, .wp-caption-text { font-style: italic; padding: 0.5em 0; }
.screen-reader-text { display: none; }
.aligncenter { margin: 0 auto; }
.alignleft { float: left; margin: 0 1em 0 0; }
.alignright { float: right; margin: 0 0 0 1em; }
::-moz-selection { background: #1d4899; color: #ffcb04; text-shadow: none; outline: 2px solid #1d4899; }
::selection { background: #1d4899; color: #ffcb04; text-shadow: none; outline: 2px solid #1d4899; }
/* Media object */
.media { margin: 1em 0; }
.media, .bd { overflow: hidden; _overflow: visible; }
/*.media img { display: block; }*/
/* Clearfix */
.clearfix::after,
.clearfix::before,
.media::after,
.media::before { content: " "; display: table; }
.clearfix::after,
.media::after { clear: both; }
/* Überschriften mit Bild darunter */
.h-box { position: relative; display: block; margin-bottom: 1em; text-decoration: none; }
.h-box > img { position: absolute; top: 0; left: 0; height: 100%; width: 100%; }
.h-box > .wrap { position: absolute; max-width: 100%; left: 0; }
.h-box > .wrap > * { display: inline; -o-box-decoration-break: clone; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.h-box-teaser { box-shadow: 0 5px 5px rgba(0, 0, 0, 0.3); margin-left: -240px; line-height: 1; display: inline-block; width: 1300px; max-width: 100%; }
.h-box-teaser > img { position: static; }
.h-box-teaser > .wrap { bottom: 1em; padding-left: 240px; }
.h-box-teaser > .wrap > * { background: rgba(56, 46, 35, 0.7); color: #ffcb04; padding: 2px 13px 4px; font-size: 52px; line-height: 78px; }
@media (max-width: 720px) {
.h-box-teaser { margin-top: 1em; margin-left: 0; }
.h-box-teaser > .wrap { padding-left: 1em; }
.h-box-teaser > .wrap > * { font-size: 2em; line-height: 39px; }
}
.h-box-blaugelb { padding-top: 47.1428571%; }
.h-box-blaugelb > .wrap { bottom: 0; font-size: 18px; }
.h-box-blaugelb > .wrap > * { color: #1d4899; background: #ffcb04; padding: 3px 5px; line-height: 26px; }
.h-box-blaugelb-bildlos { padding: 0; }
.h-box-blaugelb-bildlos > .wrap { position: static; }
/**/
.container { max-width: 1020px; }
.page .container,
.single-post:not(.single-format-gallery) .container { max-width: 710px; }
.content-singular .format-gallery { background: transparent; padding: 0; margin: 0; position: relative; }
.content-singular .format-gallery .gallery { display: flex; flex-wrap: wrap; align-content: space-between; align-items: flex-start; }
.content-singular .format-gallery .gallery-item { background: #fff; padding: 1em; margin: 0 1em 1em 0; }
.gallery-columns-1 .gallery-item { flex: 1 0 50%; }
.gallery-columns-2 .gallery-item { flex: 1 0 34%; }
.gallery-columns-3 .gallery-item { flex: 1 0 25%; }
.gallery-columns-4 .gallery-item { flex: 1 0 20%; }
.content-gallery { display: flex; position: relative; z-index: 10; flex-wrap: wrap; overflow: hidden; }
.content-gallery > article { flex: 1 1 25%; }
body > :first-child { margin-top: 0; }
body > :last-child { margin-bottom: 0; }
.content-singular > article:not(.format-gallery),
.content-gallery > article,
.commentlist article,
.comment-form { min-width: 20em; background: #fff; box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1); }
.content-gallery > article { max-width: calc(33.333% - 1em); }
@media (max-width: 800px) { .content-gallery > article { max-width: 100%; } }
/* WordPress-Wünsche */
.sticky {}
img { max-width: 100%; height: auto; border: 0 none; vertical-align: middle; }
ul, ol { padding-left: 2em; }
dl, ul, ol, h1, h2, h3, h4, h5, h6, blockquote, p, table { margin: 0.5em 0; }
dd, li > ol, li > ul { margin: 0; }
dt { font-weight: bold; }
blockquote, dd { padding-left: 2em; }
body > p:empty:last-child { margin: -0.5em 0 0.5em; }
h3, .h3, h4, .h4, h5, .h5, h6, .h6 { display: inline-block; background: #ffcb04; color: #1d4899; margin-bottom: 0; padding: 2px 4px; }
h3, .h3 { font-size: 18px; padding: 3px 5px; }
h4, .h4 { font-size: 16px; }
h5, .h5 { font-size: 14px; }
.gallery-caption {}
.bypostauthor {}
.twitter-tweet {}
h1, .h1, h2, .h2 { font-size: 20px; }
h1::after, h2::after { color: red; background: black; display: block; padding: 5px; content: "Bitte Überschriften ab 3. Ordnung benutzen."; }

View File

@ -1,11 +0,0 @@
@font-face {
font-family: IHS;
src: url('ihs.eot');
src: url('ihs.eot?#iefix') format('embedded-opentype'),
url('ihs.woff2') format('woff2'),
url('ihs.woff') format('woff'),
url('ihs.ttf') format('truetype'),
url('ihs.svg#immenhausenregular') format('svg');
font-weight: normal;
font-style: normal;
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 2400 2400" width="14" height="14"><path style="fill:#fff;stroke:none" d="m 975,25 q 129,0 252,34 123,34 227,95.5 104,61.5 191.5,149 87.5,87.5 149,192 61.5,104.5 95.5,227.5 34,123 34,251 0,278 -152,514 l 588,588 q 15,14 15,35 0,21 -15,36 l -213,213 q -15,15 -36,15 -21,0 -35,-15 l -588,-588 q -235,152 -513,152 -129,0 -252,-34 Q 600,1856 496,1794.5 392,1733 304,1645.5 216,1558 155,1453.5 94,1349 59.5,1226 25,1103 25,974.5 25,846 59.5,723 94,600 155,495.5 216,391 304,303.5 392,216 496,154.5 600,93 723,59 846,25 975,25 Z m -0.5,302 Q 843,327 723,378 603,429 516.5,516 430,603 378.5,723 327,843 327,974.5 q 0,131.5 51.5,251.5 51.5,120 138,207 86.5,87 206.5,138 120,51 251.5,51 131.5,0 251.5,-51 120,-51 207,-138 87,-87 138.5,-207 Q 1623,1106 1623,974.5 1623,843 1571.5,723 1520,603 1433,516 1346,429 1226,378 1106,327 974.5,327 Z" /></svg>

Before

Width:  |  Height:  |  Size: 907 B

View File

@ -1 +0,0 @@
<svg xmlns='http://www.w3.org/2000/svg' height='300' width='470' viewBox='0 0 300 425' preserveAspectRatio='xMinYMin meet'><defs><linearGradient id='v' x1='0' y1='0' x2='0' y2='140%'><stop offset='0' stop-color='#000' stop-opacity='0.7' /><stop offset='50%' stop-color='#000' stop-opacity='0.4' /><stop offset='80%' stop-color='#000' stop-opacity='0.1' /><stop offset='100%' stop-color="#000" stop-opacity='0' /></linearGradient></defs><path d='M10,200 C150,170 450,180 615,190 L608,00 L15,0 Z' style='stroke:none;' fill='url(#v)'></path></svg>

Before

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1,103 +0,0 @@
Buena
=======
Das WordPress-Theme zum neuen Corporate Design des BdP.
Änderungswünsche? Kritik?
philipp.cordes@pfadfinden.de
Anderthalb Hinweise zur Benutzung
-----------------------------------
Das Theme ist noch nicht ganz fertig, an einigen Stellen wird noch gehobelt.
In Beiträgen mögt ihr bitte erst Überschriften ab 3. Ordnung verwenden,
die erster Ordnung sind für den Header und die zweiter Ordnung sind für
die Titel der Beiträge. Es gibt dafür auch fette Hinweise beim Bearbeiten.
Eine kleine Änderungshistorie
-------------------------------
v1.0 - TODO
- Das Abschalten des Posterbilds für ist Seiten und Beiträge ohne Bild möglich.
- Beitragsarten und deren unterschiedliche Darstellung ist auch für Seiten verfügbar.
- Schmale Beitragsbilder (<1300px Breite) zerlegen das Layout nicht mehr.
- Login-Formular im Widgetbereich unterstützen.
v0.99.7 - 21.09.2015
- Safari bricht jetzt Artikelauflistungen richtig um. Die anderen machen es auch etwas besser.
- Safari zeigt jetzt Suchfelder richtig an.
- Safari malt die Trennline in der Navigation nicht mehr zu dick.
- Wenn das Ajax-Login-Formular benutzt wird, verschwindet das Hamburgermenü nicht mehr.
v0.99.6 - 19.09.2015
- Weitere Blau- und Gelbtöne einheitlich umgesetzt, v.a. im Editor.
- Update für Milu: Zusatz „Kategorie“ wird im Titel auf abendlager.pfadfinden.de nicht mehr angezeigt.
- Der linke Rand wird jetzt immer eingehalten, egal wie lang der Navigationsbereich ist.
- Anpassung an WordPress 4.3: Favicon kommt nur aus dem Theme, wenn kein eigenes gesetzt ist.
- Der Hinweis, dass Kommentare nicht möglich sind, wird standardmäßig ausgeblendet.
- Links in der Navigation färben sich jetzt anhand der Hierarchie im Menü ein, nicht derer der Seiten.
v0.99.5 - 19.08.2015
- Seitentitel beschreiben jetzt besser, was tatsächlich angezeigt wird.
- Farben aus dem Handbuch einheitlich umgesetzt.
v0.99.4 - 13.08.2015
- Das Menü wird automatisch wieder eingeblendet, wenn die Fensterbreite über 720px steigt.
- Fehlerkorrektur: Es werden keine Urls mehr unter dem Editorfeld ausgegeben.
- Das Theme ist nicht mehr auf das Plugin angewiesen. Die benötigte Bilbiothek shy-wordpress wird direkt mitgeliefert.
v0.99.3 - 01.08.2015
- Der Editor sollte jetzt in den meisten Fällen eine realistische Vorschau bieten.
- Überschriften sind jetzt blau auf gelb.
Überschriften erster und zweiter Ordnung in Beiträgen und Seiten werden durch Überschriften dritter Ordnung ersetzt.
- Schrift „Immenhausen“ durch verbesserte Variante ausgetauscht.
- Kleinere Korrekturen an Abständen.
v0.99.2 - 27.07.2015
- Kleinere Textanpassungen.
v0.99.1 - 27.07.2015
- Auf großen Displays wird das Beitragsbild nicht mehr verzerrt.
v0.99 - 26.07.2015
- Erster Kandidat zur Veröffentlichung als Version 1.0.
- Die Überschriften erstrahlen in vollem Glanz.
- Kommentare sehen besser aus.
- Das Theme ist responsive bis runter auf 300px.
- Fußleiste überarbeitet und zweigeteilt.
v0.9.1 - 07.07.2015
- Fehlerkorrektur: Der Titel wird nicht mehr doppelt angezeigt.
v0.9 - 03.07.2015
- Kommentare werden jetzt angezeigt.
- Etwas mehr responsive: Mindestbreite 700px für ordentliche Anzeige.
v0.8 - 21.06.2015
- Standardwidgets sehen jetzt in der Leiste gut aus.
- Die Fußzeile sitzt jetzt fester an ihrem Platz.
v0.7 - 18.06.2015
- Große Posterbilder hinzugefügt, die auch auf der Bundeswebseite zu sehen sind.
- Erhebliche Verbesserungen der Darstellung.
v0.6 - 16.06.2015
- Mehr Unterstützung für HTML5.
v0.5 - 16.06.2015
- Fehler behoben, der die WordPress-Installation unbrauchbar machen könnte.
v0.4 - 11.06.2015
- Navigation überarbeitet.
v0.3 - 10.06.2015
- Webfont Immenhausen für Überschriften.
v0.2 - 04.06.2015
- Grafiken eingebaut.
v0.1 - 20.04.2015
- Erste Veröffentlichung.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

View File

@ -1,24 +0,0 @@
<?php
namespace plugins\buena\src\Pfadfinden\WordPress;
use Pfadfinden\WordPress\wordpress;
use wordpress\src\Shy\WordPress\CompositeOption;
class BuenaSettings extends wordpress\src\Shy\WordPress\CompositeOption
{
public function __construct()
{
parent::__construct( 'buena-theme' );
}
public function getDefaults()
{
return [
'use_cdn' => false,
'always_show_poster' => true,
];
}
}

View File

@ -1,32 +0,0 @@
<?php
namespace plugins\buena\src\Pfadfinden\WordPress;
use Shy\WordPress\Administration\SettingsPage;
use Shy\WordPress\Administration\CheckboxField;
class BuenaSettingsPage extends SettingsPage
{
public function getFields()
{
$this->addSection( '', 'buena' );
return array(
'use_cdn' => new CheckboxField(),
'always_show_poster' => new CheckboxField(),
);
}
public function getParentSlug()
{
return 'themes.php';
}
public function getTitle()
{
return __( 'Buena-Einstellungen', 'buena-theme' );
}
}

View File

@ -1,320 +0,0 @@
<?php
namespace plugins\buena\src\Pfadfinden\WordPress;
use Pfadfinden\WordPress\wordpress;
use plugins\buena\src\Pfadfinden\WordPress\BuenaSettings;
use plugins\buena\src\Pfadfinden\WordPress\BuenaSettingsPage;
use wordpress\src\Shy\WordPress\Theme;
class BuenaTheme extends wordpress\src\Shy\WordPress\Theme
{
/**
* @var BuenaSettings
*/
protected $settings;
public function getContentWidth()
{
return 684;
}
public function __construct()
{
parent::__construct();
$this->settings = new BuenaSettings();
$this->addHookMethod( 'after_setup_theme', 'afterSetupTheme' );
$this->addHookMethod( 'wp_enqueue_scripts', 'enqueueScriptsStyles' );
$this->addHookMethod( 'buena_search_form', 'printSearchForm' );
$this->addHookMethod( 'admin_init', 'initAdministration' );
$this->addHookMethod( 'mce_css', 'filterEditorStylesheets' );
$this->addHookMethod( 'wp_page_menu', 'filterPageMenu' );
$this->addHookMethod( 'widgets_init', 'registerSidebars' );
$this->addHookMethod( 'the_content', 'filterContent' );
$this->addHookMethod( 'image_size_names_choose', 'filterImageSizeNames' );
$this->addHookMethod( 'media_upload_tabs', 'filterMediaTabs' );
$this->addHookMethod( 'media_view_settings', 'filterMediaViewSettings' );
$this->addHookMethod( 'media_view_strings', 'filterMediaViewSettings' );
$this->addHookMethod( 'print_media_templates', 'printMediaTemplates' );
}
public function afterSetupTheme()
{
add_theme_support( 'title-tag' );
add_theme_support( 'automatic-feed-links' );
register_nav_menu( 'primary', __( 'Hauptmenü', 'buena-theme' ) );
register_nav_menu( 'footer', __( 'Fußzeile', 'buena-theme' ) );
add_theme_support( 'html5', [
'comment-list', 'comment-form', 'search-form', 'gallery', 'caption',
] );
add_theme_support( 'post-thumbnails' );
$custom_header = [
'width' => apply_filters( 'buena_header_image_width', 1300 ),
'height' => apply_filters( 'buena_header_image_height', 635 ),
'flex-width' => true,
'flex-height' => true,
'default-image' => get_template_directory_uri() . '/img/leitbild_aktionen_low.jpg',
'uploads' => true,
'header-text' => false,
];
add_theme_support( 'custom-header', $custom_header );
set_post_thumbnail_size( $custom_header['width'], $custom_header['height'], true );
add_image_size( 'gallery-thumb', 350, 165, true );
register_default_headers( [
'aktionen' => [
'url' => '%s/img/leitbild_aktionen_low.jpg',
'thumbnail_url' => '%s/img/leitbild_aktionen_low_klein.jpg',
'description' => __( 'Leitbild Aktionen', 'buena-theme' ),
],
'bund' => [
'url' => '%s/img/leitbild_bund_crop.jpg',
'thumbnail_url' => '%s/img/leitbild_bund_crop_klein.jpg',
'description' => __( 'Leitbild Bund', 'buena-theme' ),
],
'ihs' => [
'url' => '%s/img/leitbild_ihs.jpg',
'thumbnail_url' => '%s/img/leitbild_ihs_klein.jpg',
'description' => __( 'Leitbild Immenhausen', 'buena-theme' ),
],
'international' => [
'url' => '%s/img/leitbild_int2_low.jpg',
'thumbnail_url' => '%s/img/leitbild_int2_low_klein.jpg',
'description' => __( 'Leitbild International', 'buena-theme' ),
],
'kontakt' => [
'url' => '%s/img/leitbild_Kontakt_low.jpg',
'thumbnail_url' => '%s/img/leitbild_Kontakt_low_klein.jpg',
'description' => __( 'Leitbild Kontakt', 'buena-theme' ),
],
'pfadfinden' => [
'url' => '%s/img/leitbild_pfadfinden_low.jpg',
'thumbnail_url' => '%s/img/leitbild_pfadfinden_low_klein.jpg',
'description' => __( 'Leitbild Pfadfinden', 'buena-theme' ),
],
] );
}
public function getTeaserImage()
{
if ( is_page() || have_posts() && is_single() ) { // FIXME: is_singular()?
the_post();
$thumb = get_the_post_thumbnail( null, 'post-thumbnail', [ 'alt' => '' ] );
rewind_posts();
if ( $thumb ) {
return $thumb;
}
}
if ( is_home() || $this->settings['always_show_poster'] ) {
return sprintf(
'<img src="%s" height="%d" width="%d" alt="" />',
get_header_image(),
get_custom_header()->height,
get_custom_header()->width
);
}
return '';
}
/**
* Gibt einen Titel für die aktuelle Seite aus.
*/
public function printTitle()
{
if ( is_singular() ) {
the_title();
} elseif ( is_category() && strpos( $_SERVER['HTTP_HOST'], 'abendlager.pfadfinden.de' ) !== false ) {
// FIXME: Workaround mit 1.0 entfernen.
single_cat_title( '', true );
} elseif ( is_archive() ) {
the_archive_title();
} elseif ( is_search() ) {
esc_html_e( sprintf(
__( 'Suche nach „%s“', 'buena-theme' ),
get_search_query( false )
) );
} else {
bloginfo( 'description' );
}
}
public function enqueueScriptsStyles()
{
wp_enqueue_style( 'immenhausen-font', get_template_directory_uri() . '/font/ihs.css' );
wp_enqueue_style( 'buena-style', get_stylesheet_uri() );
}
/**
* Gibt das Suchformular aus. Nötig, damit im Kopf anderer Code stehen kann als anderswo.
*/
public function printSearchForm()
{
get_search_form( true );
}
/**
* Tut, was dransteht.
*/
public function registerSidebars()
{
register_sidebar( [
'id' => 'below-navigation',
'name' => __( 'Unter Navigation', 'buena-theme' ),
'description' => __( 'Ziemlich schmal.', 'buena-theme' ),
'before_title' => '<h4 class="h-widget">',
'after_title' => '</h4>',
] );
register_sidebar( [
'id' => 'footer',
'name' => __( 'Fußleiste', 'buena-theme' ),
'description' => __( 'Rechte Spalte des Briefumschlags. Recht flach. Füllt die ganze Breite aus, wenn kein Navigationsmenü zugewiesen ist.', 'buena-theme' ),
'before_title' => '<h4 class="h-widget">',
'after_title' => '</h4>',
] );
}
/**
* Ausgabe von wp_page_menu() filtern, dass sie wie wp_nav_menu() aussieht.
*
* @param string $menu
* @param array $args
* @return string
*/
public function filterPageMenu( $menu, array $args )
{
if ( ! isset( $args['fallback_cb'] ) || $args['fallback_cb'] !== 'wp_page_menu' ) {
return $menu;
}
$vorher = '<div class="' . esc_attr( $args['menu_class'] ) . '">';
$danach = '<' . $args['container'];
if ( $args['container_class'] ) {
// In diesem Fall doch optional…
$danach .= ' class="' . esc_attr( $args['container_class'] ) . '"';
}
if ( $args['container_id'] ) {
$danach .= ' id="' . esc_attr( $args['container_id'] ) . '"';
}
$danach .= '>';
if ( strpos( $menu, '<ul>' ) !== false ) {
// Wenn das Menü leer ist, enthält es den <ul>-Teil nicht.
$vorher .= '<ul>';
$danach .= '<ul class="' . esc_attr( $args['menu_class'] ) . '">';
}
$menu = str_replace( $vorher, $danach, $menu );
$menu = substr( $menu, 0, -5 ) . $args['container'] . ">\n";
$menu = str_replace( "class='children'", 'class="sub-menu"', $menu );
$menu = str_replace( 'current_page_item', 'current_page_item current-menu-item', $menu );
$menu = str_replace( 'current_page_ancestor', 'current_page_ancestor current-menu-ancestor', $menu );
return $menu;
}
/**
* Zusatzfunktionen für das Backend laden.
*/
public function initAdministration()
{
if ( isset( $_GET['exp'] ) && class_exists( 'plugins\buena\src\Pfadfinden\WordPress\BuenaSettingsPage' ) ) {
new BuenaSettingsPage( $this->settings );
}
add_editor_style();
}
/**
* Standard-Skin des Editors rauswerfen.
*
* @param string $stylesheets
* @return string
*/
public function filterEditorStylesheets( $stylesheets )
{
$stylesheets = explode( ',', $stylesheets );
$stylesheets = array_filter( $stylesheets, function ( $url ) {
return strpos( $url, 'tinymce' ) === false;
} );
return implode( ',', $stylesheets );
}
/**
* Überschriften <h1> und <h2> durch <h3> ersetzen.
*
* @param string $content
* @return string
*/
public function filterContent( $content )
{
$content = preg_replace( '/\\<h[12]([^>]*)>(.*?)\\<\\/h[12]>/', '<h3$1>$2</h3>', $content );
return $content;
}
/**
* @param array $names
* @return array
*/
public function filterImageSizeNames( array $names )
{
return $names;
}
/**
* @param array $tabs
* @return array
*/
public function filterMediaTabs( $tabs )
{
return $tabs;
return $tabs + [
'insert-poster' => __( 'Posterbilder', 'buena-theme' ),
];
// Erzeugt einen <iframe> von wp-admin/media-upload.php?chromeless=1&post_id=123456&tab=insert-poster
}
public function filterMediaViewSettings( $settings )
{
//var_dump( $settings );
return $settings;
}
/**
* Weitere Templates für Medienbrowser ausgeben.
*/
public function printMediaTemplates()
{
global $_wp_default_headers;
?>
<script type="text/html" id="tmpl-insert-poster">
<ul>
<?php foreach ( $_wp_default_headers as $k => $header ) : ?>
<img alt="<?php esc_attr_e( $header['description'] ); ?>" src="<?php echo esc_url( sprintf( $header['thumbnail_url'], get_template_directory_uri() ) ); ?>" />
<?php endforeach; ?>
</ul>
</script>
<?php
}
}

View File

@ -1,250 +0,0 @@
@charset "UTF-8";
/**
Theme Name: Buena
Version: 0.99.7
Theme URI: http://lab.hanseaten-bremen.de/themes/buena/
Author: Philipp Cordes <philipp.cordes@pfadfinden.de>
Description: Das neue Corporate Design, jetzt auch für WordPress.
License: Proprietary
Tags: one-column, three-columns, responsive-layout, automatic-feed-links, post-thumbnails, featured-images, custom-menu, blue, white, yellow, editor-style
*/
/*
Farben:
- gelb: #ffcb04 (Handbuch, manchmal T3), #ffca28 (T3)
- Verlauf: #9f7515 bis #e1af22, #e0cb84 bis #fff (IE-Fallback)
- blass: #fff5d9 (T3-Zebra)
- blau: #1d4899 (Handbuch, manchmal T3), #0d52a5 (T3)
- Markierung (T3): #b3d4fc
*/
html, body { border: 0 none; padding: 0; margin: 0; min-height: 100%; position: static; }
html { font-family: Sans-Serif; font-size: 81.3%; background: url("img/holz.jpg") #dbb97b; position: relative; }
header, hgroup, nav, footer, article { display: block; }
.h, h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { margin: 0; font-family: IHS, Serif; font-size: 1em; font-weight: normal; font-style: normal; }
button, input, select, optgroup, option { margin: 0; font: inherit; color: inherit; }
button, input[type="button"], input[type="submit"], input[type="reset"] { cursor: pointer; }
input[type="search"] { -webkit-appearance: textfield; }
p, ul, ol, dt { line-height: 1.5; }
abbr { border-bottom: 1px dotted; }
a { color: #1d4899; }
figure, .wp-caption { margin: 0; max-width: 100%; }
figcaption, .wp-caption-text { font-style: italic; padding: 0.5em 0; }
.screen-reader-text { display: none; }
.aligncenter { margin: 0 auto; }
.alignleft { float: left; margin: 0 1em 0 0; }
.alignright { float: right; margin: 0 0 0 1em; }
::-moz-selection { background: #1d4899; color: #ffcb04; text-shadow: none; outline: 2px solid #1d4899; }
::selection { background: #1d4899; color: #ffcb04; text-shadow: none; outline: 2px solid #1d4899; }
/* Media object */
.media { margin: 1em 0; }
.media, .bd { overflow: hidden; _overflow: visible; }
/*.media img { display: block; }*/
/* Clearfix */
.clearfix::after,
.clearfix::before,
.media::after,
.media::before { content: " "; display: table; }
.clearfix::after,
.media::after { clear: both; }
/* Layout */
#wrap { background: url("img/klufthemd.png") no-repeat; padding: 0 0 2em; }
#footer { background: url("img/loeffel-topf.png") no-repeat 100% 100%; position: absolute; width: 100%; bottom: 0; }
#footer .wrapper { background: url("img/briefumschlag.png") no-repeat; margin: 0 0 0 240px; padding: 112px 7px 0 21px; height: 286px; width: 700px; box-sizing: border-box; }
#footer header { color: #ffcb04; text-align: center; font-size: 25px; margin: -111px 0 13px; line-height: 111px; }
#footer .widgets { padding: 0 2em 0 0; }
#left { margin: -18px -200px 0 40px; width: 160px; z-index: 30; float: left; position: relative; }
#main { overflow: hidden; padding: 0 0 286px 240px; }
@media (max-width: 960px) {
/* Umschlag unter die Navigation umbrechen */
#left { margin-bottom: 300px; }
#footer .wrapper { margin-left: 0; }
}
@media (max-width: 720px) {
#main { padding-left: 0; }
#left { margin-right: 0; }
}
/* FIXME: Positionierung des Schattens weiter vereinfachen, auch Untertitel verlinken. */
/* FIXME: Branding umbenennen, siehe https://github.com/pfadfinden/wordpress-theme-updater/issues/13 */
#branding { min-height: 145px; padding: 0 33px 20px 240px; text-align: center; position: relative; width: 425px; margin-bottom: -27px; }
#branding::after { content: ""; display: block; position: absolute; bottom: 0; right: 0; z-index: 15; height: 143px; width: 457px; background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIGhlaWdodD0nMzAwJyB3aWR0aD0nNDcwJyB2aWV3Qm94PScwIDAgMzAwIDQyNScgcHJlc2VydmVBc3BlY3RSYXRpbz0neE1pbllNaW4gbWVldCc+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSd2JyB4MT0nMCcgeTE9JzAnIHgyPScwJyB5Mj0nMTQwJSc+PHN0b3Agb2Zmc2V0PScwJyBzdG9wLWNvbG9yPScjMDAwJyBzdG9wLW9wYWNpdHk9JzAuNycgLz48c3RvcCBvZmZzZXQ9JzUwJScgc3RvcC1jb2xvcj0nIzAwMCcgc3RvcC1vcGFjaXR5PScwLjQnIC8+PHN0b3Agb2Zmc2V0PSc4MCUnIHN0b3AtY29sb3I9JyMwMDAnIHN0b3Atb3BhY2l0eT0nMC4xJyAvPjxzdG9wIG9mZnNldD0nMTAwJScgc3RvcC1jb2xvcj0iIzAwMCIgc3RvcC1vcGFjaXR5PScwJyAvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxwYXRoIGQ9J00xMCwyMDAgQzE1MCwxNzAgNDUwLDE4MCA2MTUsMTkwIEw2MDgsMDAgTDE1LDAgWicgc3R5bGU9J3N0cm9rZTpub25lOycgZmlsbD0ndXJsKCN2KSc+PC9wYXRoPjwvc3ZnPg0K") no-repeat 50% 0; }
#branding > * { margin: 0; position: relative; z-index: 20; }
.site-title { font-size: 20px; background: #ffcb04; color: #0d53a5; margin-top: auto; line-height: 115px; }
.site-title a { display: block; vertical-align: bottom; }
.site-title img { vertical-align: bottom; padding-bottom: 16px; }
.site-description { font-size: 18px; background: #0d53a5; color: #ffcb04; line-height: 30px; font-family: IHS, Serif; letter-spacing: 1px; word-spacing: 2px; }
#header .search-form { background: url("img/streichholzschachtel.png") no-repeat; position: absolute; height: 89px; left: 750px; top: 1.5em; width: 98px; padding: 25px 47px 0 35px; }
#header .search-form label { display: block; position: relative; margin: 25px 0 -50px; text-align: left; }
#header .search-field { background: transparent; border: 2px solid #ffcb04; padding: 2px; color: #fff; display: block; max-width: 100%; box-sizing: border-box; }
#header .search-submit { background: transparent; color: #ffcb04; border: 0 none; font-family: IHS, Serif; font-size: 1.4em; padding: 0; display: block; box-sizing: border-box; }
#header > nav { position: absolute; top: 0; right: 0; z-index: 9999; display: none; }/* FIXME: Workaround Branding-Doppelung */
#responsiveMenu { border: 0 none; background: transparent; height: 51px; margin: 1em; }
@media (max-width: 960px) { /* Suche ausblenden */
#header .search-form { display: none; }
}
.nav-menu ul { list-style: none; padding: 0; margin: 0; }
.nav-menu-primary > ul { font-family: IHS, Serif; }
.nav-menu-primary > ul > .current-menu-ancestor,
.nav-menu-primary > ul > .current-menu-item { background: #e1af22 no-repeat; background-image: linear-gradient(#9f7515 0%, #e1af22 100%); border-bottom: 1px solid #9f7515; border-top: 1px solid #9f7515; margin: 0.5em 0; padding: 0.5em 0; }
.nav-menu-primary .sub-menu { display: none; }
.nav-menu-primary a { padding: 0.4em 0.5em 0.4em 1em; display: block; text-decoration: none; color: #6b5742; font-size: 1.4em; }
.nav-menu-primary li ul a { font-family: Georgia, Serif; font-size: 12px; font-style: italic; padding: 5px 5px 5px 25px; color: #000; }
.nav-menu-primary .current-menu-ancestor .sub-menu,
.nav-menu-primary .current-menu-item .sub-menu { display: block; }
.nav-menu-primary .current-menu-ancestor a { color: #000; }
.nav-menu-primary .current-menu-item > a { color: #fff; }
.nav-menu-primary a:hover,
.nav-menu-primary a:focus { color: #000; }
.nav-menu .current-menu-ancestor a:hover,
.nav-menu .current-menu-ancestor a:focus,
.nav-menu .sub-menu a:hover,
.nav-menu .sub-menu a:focus,
.nav-menu-footer a:hover,
.nav-menu-footer a:focus { text-decoration: underline; }
.nav-menu-footer { font-family: Georgia, Serif; font-style: italic; padding-left: 2em; }
.nav-menu-footer > ul { width: 323px; height: 174px; position: relative; display: flex; -webkit-flex-flow: column; flex-flow: column; -webkit-justify-content: center; justify-content: center; -webkit-align-items: stretch; align-items: stretch; }
.nav-menu-footer li { margin-bottom: 0.75em; }
.nav-menu-footer a { padding: 4px 4px 4px 25px; text-decoration: none; }
.widget_recent_entries > ul,
.widget_recent_comments > ul,
.widget_archive > ul,
.widget_categories > ul,
.widget_meta > ul { list-style: none; padding: 0; margin: 0; }
#left > .nav-menu { background: #ffcb04; color: #6b5742; padding: 10px 0 2em; }
#left > .widgets { background: rgba(56, 46, 35, 0.7); color: #ffcb04; padding: 1em 15px 15px 20px; font-size: 13px; font-style: italic; }
#left > .widgets a { color: #fff; text-decoration: none; }
#left > .widgets a:hover,
#left > .widgets a:focus { text-decoration: underline; }
/* Widgets: Basisdarstellung */
.widgets { list-style: none; padding: 0; margin: 0; font-family: Georgia, Serif; font-style: italic; }
.widget_calendar table { text-align: center; }
/* Widgets: Korrekturen für unsere Seitenleiste */
#left .widget_search form { display: flex; }
#left .widget_search form > * { border: 2px solid #ffcb04; }
#left .widget_search input { box-sizing: border-box; width: 100%; border: 0 none; background: transparent; color: #fff; text-align: center; padding: 3px 0.25em 4px; }
#left .widget_search button { color: transparent; background: url("res/lupe.svg") 50% 50% no-repeat #ffcb04; width: 31px; }
#left .widget_calendar > div { margin: 0 -15px 0 -20px; }
#left .widget_calendar > div > table { text-align: center; margin: 0 auto; }
#left .widget_pages ul { padding-left: 2em; }
#left .widget_pages > ul { list-style: none; padding: 0; }
#left > .widgets .widget { margin: 0; padding: 1em 0; }
.widgets .h-widget { color: #ffcb04; font-size: 16px; }
#left > .widgets .menu,
.widgets .widget_categories ul { list-style: none; padding: 0; }
/* Überschriften mit Bild darunter */
.h-box { position: relative; display: block; margin-bottom: 1em; text-decoration: none; }
.h-box > img { position: absolute; top: 0; left: 0; height: 100%; width: 100%; }
.h-box > .wrap { position: absolute; max-width: 100%; left: 0; }
.h-box > .wrap > * { display: inline; -o-box-decoration-break: clone; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.h-box-teaser { box-shadow: 0 5px 5px rgba(0, 0, 0, 0.3); line-height: 1; display: inline-block; width: 1300px; max-width: 100%; }
.h-box-teaser > img { position: static; }
.h-box-teaser > .wrap { bottom: 1em; padding-left: 240px; }
.h-box-teaser > .wrap > * { background: rgba(56, 46, 35, 0.7); color: #ffcb04; padding: 2px 13px 4px; font-size: 52px; line-height: 78px; }
@media (max-width: 720px) {
.h-box-teaser { margin-top: 1em; margin-left: 0; }
.h-box-teaser > .wrap { padding-left: 1em; }
.h-box-teaser > .wrap > * { font-size: 2em; line-height: 39px; }
}
.h-box-blaugelb { padding-top: 47.1428571%; }
.h-box-blaugelb > .wrap { bottom: 0; font-size: 18px; }
.h-box-blaugelb > .wrap > * { color: #1d4899; background: #ffcb04; padding: 3px 5px; line-height: 26px; }
.h-box-blaugelb-bildlos { padding: 0; }
.h-box-blaugelb-bildlos > .wrap { position: static; }
/**/
.container { max-width: 1020px; }
.page .container,
.single-post:not(.single-format-gallery) .container { max-width: 710px; }
.content-singular .format-gallery { background: transparent; padding: 0; margin: 0; position: relative; }
.content-singular .format-gallery .gallery { display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-align-content: space-between; align-content: space-between; -webkit-align-items: flex-start; align-items: flex-start; }
.content-singular .format-gallery .gallery-item { background: #fff; padding: 1em; margin: 0 1em 1em 0; }
.gallery-columns-1 .gallery-item { flex: 1 0 50%; }
.gallery-columns-2 .gallery-item { flex: 1 0 34%; }
.gallery-columns-3 .gallery-item { flex: 1 0 25%; }
.gallery-columns-4 .gallery-item { flex: 1 0 20%; }
.content-gallery { display: flex; position: relative; z-index: 10; -webkit-flex-wrap: wrap; flex-wrap: wrap; overflow: hidden; }
.container article,
.commentlist article,
.comment-form { padding: 1em; margin: 0 1em 1em 0; transition: width 0.5s, height 0.5s; box-sizing: border-box; }
.container article > :first-child,
.comment-form > :first-child { margin-top: 0; }
.container article > :last-child,
.comment-form > .form-submit { margin-bottom: 0; }
.content-singular > article:not(.format-gallery),
.content-gallery > article,
.commentlist article,
.comment-form { min-width: 20em; background: #fff; box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1); }
.content-gallery > article { flex: 1 1 25%; max-width: calc(33.333% - 1em); }
@media (max-width: 1070px) { .content-gallery > article { flex: 1 1 34%; max-width: calc(50% - 1em); } }
@media (max-width: 800px) { .content-gallery > article { flex: 1 1 50%; max-width: 100%; } }
.container > .pagination { margin-right: 1em; }
/* WordPress-Wünsche */
.sticky {}
img { max-width: 100%; height: auto; border: 0 none; vertical-align: middle; }
ul, ol { padding-left: 2em; }
dl, ul, ol, h1, h2, h3, h4, h5, h6, blockquote, p, table { margin: 0.5em 0; }
dd, li > ol, li > ul { margin: 0; }
dt { font-weight: bold; }
blockquote, dd { padding-left: 2em; }
article > p:empty:last-child { margin: -0.5em 0 0.5em; }
article h3, article .h3, article h4, article .h4, article h5, article .h5, article h6, article .h6 { display: inline-block; background: #ffcb04; color: #1d4899; margin-bottom: 0; padding: 2px 4px; }
article h3, article .h3 { font-size: 18px; padding: 3px 5px; }
article h4, article .h4 { font-size: 16px; }
article h5, article .h5 { font-size: 14px; }
.gallery-caption {}
.bypostauthor {}
.twitter-tweet {}
/* Kommentare */
#comments, #reply-title { font-size: 2.5em; color: #fff; margin: 0.5em 0 0.25em; }
.commentlist { list-style: none; padding: 0; }
.commentlist .children { list-style: none; padding-left: 1em; }
.comment-form > p > * { vertical-align: top; }
.comment-form > p > label::after { content: ": "; }
.comment-body { position: relative; }
.comment-metadata { position: absolute; top: 1em; right: 1em; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-justify-content: flex-end; justify-content: flex-end; }
.comment-form textarea { resize: vertical; display: block; box-sizing: border-box; width: 100%; }
/* Responsive: Der komplizierte Kram. Hurra! */
@media (max-width: 720px) { /* Gestapelt anordnen */
#main { padding-bottom: 0; }
#wrap, #footer .wrapper { background-image: none; }
#branding { text-align: left; width: auto; padding: 0; margin: 0; min-height: 0; }
#branding::after { display: none; background-image: none; }
#branding h1 { line-height: 51px; }
#branding h2 { padding: 0 1em; }
.site-title a { display: inline-block; }
.site-title img { height: 51px; width: auto; padding: 13px; }
#header > nav { display: block; }
#left { float: none; transition: 0.5s height; margin: 0; width: auto; }
#left, #left .widgets { display: none; }
.show-responsive-menu #left { display: block; }
#content, .comments { margin-left: 1em; }
#footer { background: #c4a164; position: static; }
#footer .wrapper { padding: 1em; height: auto; width: auto; }
#footer header { color: #000; margin: 0; line-height: 1.5; }
.nav-menu-footer, #footer .widgets { float: none; margin: 1em 0 0; padding: 1em; }
.nav-menu-footer > ul { height: auto; }
}

View File

@ -1,7 +0,0 @@
# Eclipse project files
.buildpath
.project
.settings
# Local PHPUnit configuration
phpunit.xml

View File

@ -1,7 +0,0 @@
<phpunit boostrap="tests/bootstrap.php">
<testsuites>
<testsuite>
<directory suffix="Test.php" phpVersion="5.4.0">tests</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@ -1,97 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: pfadfinden-theme-updater\n"
"POT-Creation-Date: 2015-08-26 01:49+0100\n"
"PO-Revision-Date: 2015-08-26 02:02+0100\n"
"Last-Translator: Philipp Cordes <philipp.cordes@pfadfinden.de>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_x;esc_html_e;esc_html__;esc_attr_e;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2;\n"
"X-Poedit-SearchPath-0: .\n"
#: pfadfinden-theme-updater.php:70
msgid ""
"Couldnt load required library “shy-wordpress”. Reinstalling the plugin may "
"solve this problem."
msgstr ""
"Konnte die erforderliche Bibliothek „shy-wordpress“ nicht laden. "
"Neuinstallation des Plugins sollte das Problem beheben."
#: pfadfinden-theme-updater.php:81
msgid "The plugin is incomplete. Reinstalling it may solve this problem."
msgstr ""
"Das Plugin ist unvollständig. Neuinstallation sollte das Problem beheben."
#: pfadfinden-theme-updater.php:96
#, php-format
msgid ""
"You need at least PHP 5.4 to use Pfadfinden Theme Updater. Your are using %s."
msgstr ""
"Du brauchst mindestens PHP 5.4, um den Pfadfinden-Theme-Updater zu benutzen. "
"Aktuell benutzt du PHP %s."
#: pfadfinden-theme-updater.php:104
msgid "Pfadfinden Theme Updater"
msgstr "Pfadfinden-Theme-Updater"
#: pfadfinden-theme-updater.php:105
msgid ""
"Adds the Pfadfinden theme repository to your choice of themes. Requires an "
"API key."
msgstr ""
"Fügt den Pfadfinden-Theme-Katalog zu Deiner Auswahl an Themes hinzu. "
"Benötigt einen API-Schlüssel."
#: src/Pfadfinden/WordPress/ThemeRepository.php:81
msgid "Your theme repository query is too long."
msgstr "Deine Anfrage an den Theme-Katalog ist zu lang."
#: src/Pfadfinden/WordPress/ThemeRepository.php:114
msgid "Unknown theme repository server error, no message attached."
msgstr ""
"Unbekannter Theme-Katalog-Serverfehler, keine Fehlerbeschreibung "
"mitgeschickt."
#: src/Pfadfinden/WordPress/ThemeRepository.php:186
msgid "Ambiguous result for single theme information call."
msgstr "Mehrere Ergebnisse für Abfrage nach Informationen zu einem Theme."
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:69
msgid "Pfadfinden Theme Updater Settings"
msgstr "Pfadfinden-Theme-Updater-Einstellungen"
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:74
msgid "Pfadfinden Updater"
msgstr "Pfadfinden-Updater"
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:84
msgid "API Key"
msgstr "API-Schlüssel"
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:89
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:116
msgid "An API key consists of 10 alphanumeric characters."
msgstr "Ein API-Schlüssel besteht aus zehn alphanumerischen Zeichen."
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:96
msgid "Keep Settings"
msgstr "Einstellungen merken"
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:97
msgid "Dont delete settings when uninstalling the plugin."
msgstr "Einstellungen nicht löschen, wenn das Plugin deinstalliert wird."
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:107
msgid "Just testing? Try APITESTKEY."
msgstr ""
"Nur Ausprobieren? Nimm APITESTKEY. Aber BdP-Themes gibt es damit nicht…"
#~ msgid "Activated Features"
#~ msgstr "Aktivierte Funktionen"

View File

@ -1,84 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: pfadfinden-theme-updater\n"
"POT-Creation-Date: 2015-08-26 01:49+0100\n"
"PO-Revision-Date: 2015-08-26 01:50+0100\n"
"Last-Translator: Philipp Cordes <philipp.cordes@pfadfinden.de>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_x;esc_html_e;esc_html__;esc_attr_e;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2;\n"
"X-Poedit-SearchPath-0: .\n"
#: pfadfinden-theme-updater.php:70
msgid ""
"Couldnt load required library “shy-wordpress”. Reinstalling the plugin may "
"solve this problem."
msgstr ""
#: pfadfinden-theme-updater.php:81
msgid "The plugin is incomplete. Reinstalling it may solve this problem."
msgstr ""
#: pfadfinden-theme-updater.php:96
#, php-format
msgid ""
"You need at least PHP 5.4 to use Pfadfinden Theme Updater. Your are using %s."
msgstr ""
#: pfadfinden-theme-updater.php:104
msgid "Pfadfinden Theme Updater"
msgstr ""
#: pfadfinden-theme-updater.php:105
msgid ""
"Adds the Pfadfinden theme repository to your choice of themes. Requires an "
"API key."
msgstr ""
#: src/Pfadfinden/WordPress/ThemeRepository.php:81
msgid "Your theme repository query is too long."
msgstr ""
#: src/Pfadfinden/WordPress/ThemeRepository.php:114
msgid "Unknown theme repository server error, no message attached."
msgstr ""
#: src/Pfadfinden/WordPress/ThemeRepository.php:186
msgid "Ambiguous result for single theme information call."
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:69
msgid "Pfadfinden Theme Updater Settings"
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:74
msgid "Pfadfinden Updater"
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:84
msgid "API Key"
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:89
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:116
msgid "An API key consists of 10 alphanumeric characters."
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:96
msgid "Keep Settings"
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:97
msgid "Dont delete settings when uninstalling the plugin."
msgstr ""
#: src/Pfadfinden/WordPress/ThemeUpdaterSettings.php:107
msgid "Just testing? Try APITESTKEY."
msgstr ""

View File

@ -1,149 +0,0 @@
<?php
/*
Plugin Name: Pfadfinden Theme Updater
Plugin URI: http://lab.hanseaten-bremen.de/themes/
Description: Adds the Pfadfinden theme repository to your choice of themes. Requires an API key.
Version: 0.2
Author: Philipp Cordes
Text Domain: pfadfinden-theme-updater
Domain Path: /languages/
License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
die( 'Im a plugin.' );
}
/**
* Load localized strings for the plugin.
*
* @see http://geertdedeckere.be/article/loading-wordpress-language-files-the-right-way
*/
function pfadfinden_theme_updater_load_textdomain()
{
remove_action( 'init', __FUNCTION__ );
$domain = 'pfadfinden-theme-updater';
// Filter known from load_plugin_textdomain().
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
load_textdomain( $domain, WP_LANG_DIR . "/pfadfinden-theme-updater/$domain-$locale.mo" );
load_plugin_textdomain( $domain, false, basename( __DIR__ ) . '/languages/' );
}
add_action( 'init', 'pfadfinden_theme_updater_load_textdomain' );
if ( ! function_exists( 'trigger_pfadfinden_plugin_error' ) ) {
/**
* Show an error message.
*
* @see http://www.squarepenguin.com/wordpress/?p=6 Inspiration
*
* @param string $message
* @param int $type optional
* @return bool
*/
function trigger_pfadfinden_plugin_error( $message, $type = 0 )
{
if ( isset( $_GET['action'] ) && 'error_scrape' === $_GET['action'] ) {
echo $message;
return true;
}
if ( ! $type ) {
$type = E_USER_WARNING;
}
return trigger_error( $message, $type );
}
}
// Check for suitable environment
if ( defined( 'PHP_VERSION_ID' ) && PHP_VERSION_ID >= 50400 ) {
// If were the first user of the library, use the bundled one
if ( ! class_exists( 'plugins\buena\use\shy-wordpress\src\Shy\WordPress\Plugin' ) ) {
pfadfinden_theme_updater_load_textdomain();
if ( ! include_once __DIR__ . '/use/shy-wordpress/src/autoloader.php' ) {
trigger_pfadfinden_plugin_error(
__( 'Couldnt load required library “shy-wordpress”. Reinstalling the plugin may solve this problem.', 'pfadfinden-theme-updater' ),
E_USER_ERROR
);
return;
}
}
// Register our autoloader
if ( ! include_once __DIR__ . '/src/autoloader.php' ) {
pfadfinden_theme_updater_load_textdomain();
trigger_pfadfinden_plugin_error(
__( 'The plugin is incomplete. Reinstalling it may solve this problem.', 'pfadfinden-theme-updater' ),
E_USER_ERROR
);
return;
}
// PHP < 5.3 issues a parse error if we instance the class here
return require_once __DIR__ . '/startup.php';
}
// Display error message
pfadfinden_theme_updater_load_textdomain();
trigger_pfadfinden_plugin_error(
sprintf(
__( 'You need at least PHP 5.4 to use Pfadfinden Theme Updater. Your are using %s.', 'pfadfinden-theme-updater' ),
PHP_VERSION
),
E_USER_ERROR
);
if ( false ) {
// Dummy calls for translation to include metadata in translation files
__( 'Pfadfinden Theme Updater', 'pfadfinden-theme-updater' );
__( 'Adds the Pfadfinden theme repository to your choice of themes. Requires an API key.', 'pfadfinden-theme-updater' );
}
class Nginx {
private $plugin = 'nginx-helper/nginx-helper.php';
private $pluginPath = ABSPATH . 'wp-content/plugins/nginx-helper/nginx-helper.php';
public function __construct() {
if(is_readable($this->pluginPath)) {
require_once(ABSPATH .'/wp-admin/includes/plugin.php');
$this->activatePlugin();
$this->loadCss();
}
}
private function activatePlugin() {
if( is_plugin_active( $this->plugin ) && get_option('cloudpit_nginx_activated_once') == 1 ) {
//if the plugin is active already and our option is set, do nothing
return;
}
if( !is_plugin_active( $this->plugin ) && get_option('cloudpit_nginx_activated_once') == 1 ) {
//if the plugin is deactivated on purpuse after installation, do nothing
return;
}
activate_plugin($this->pluginPath);
$options = 'a:23:{s:12:"enable_purge";s:1:"1";s:12:"cache_method";s:14:"enable_fastcgi";s:12:"purge_method";s:11:"get_request";s:10:"enable_map";N;s:10:"enable_log";N;s:9:"log_level";s:4:"INFO";s:12:"log_filesize";s:1:"5";s:12:"enable_stamp";N;s:22:"purge_homepage_on_edit";s:1:"1";s:21:"purge_homepage_on_del";s:1:"1";s:21:"purge_archive_on_edit";s:1:"1";s:20:"purge_archive_on_del";s:1:"1";s:28:"purge_archive_on_new_comment";N;s:32:"purge_archive_on_deleted_comment";N;s:17:"purge_page_on_mod";s:1:"1";s:25:"purge_page_on_new_comment";s:1:"1";s:29:"purge_page_on_deleted_comment";s:1:"1";s:14:"redis_hostname";s:9:"127.0.0.1";s:10:"redis_port";s:4:"6379";s:12:"redis_prefix";s:12:"nginx-cache:";s:9:"purge_url";s:0:"";s:25:"redis_enabled_by_constant";i:0;s:28:"smart_http_expire_form_nonce";s:10:"87a3b2c240";}';
add_option('rt_wp_nginx_helper_options', unserialize($options));
if(!get_option('cloudpit_nginx_activated_once')) {
add_option('cloudpit_nginx_activated_once', 1);
}
}
private function loadCss() {
if( !is_plugin_active( $this->plugin ) ) {
return;
}
wp_enqueue_style('cloudpit-css', plugin_dir_url( __FILE__ ) . 'assets/style.css',array(), filemtime(plugin_dir_path( __FILE__ ) . 'assets/style.css'));
}
}

View File

@ -1,7 +0,0 @@
<phpunit bootstrap="tests/bootstrap.php">
<testsuites>
<testsuite>
<directory suffix="Test.php" phpVersion="5.4.0">tests</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@ -1,31 +0,0 @@
=== Pfadfinden Theme Updater ===
Contributors: Corphi
Tags: themes
Requires at least: 4.0
Tested up to: 4.3
Stable tag: trunk
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
This plugin allows for easy installation of BdP e.V. corporate design themes. If you <a href="http://lab.hanseaten-bremen.de/register/">have an API key</a>.
== Description ==
This plugins makes all corporate design themes of the BdP e.V. available to your WordPress installation.
== Installation ==
1. Install the plugin from the plugin repository.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. Get an API key from http://lab.hanseaten-bremen.de/register/.
1. Enter the API key in the setting section.
1. Browse the additional featured themes.
== Changelog ==
= 0.2 =
* Users of PHP versions below 5.3 should now get reasonable error messages.
= 0.1 =
* Initial release.

View File

@ -1,207 +0,0 @@
<?php
namespace Pfadfinden\WordPress;
/**
* A theme repository.
*
* Its a simple wrapper around a web service mimicking the wordpress.org theme repository.
*
* @author Philipp Cordes <philipp.cordes@pfadfinden.de>
*/
class ThemeRepository
{
const URL = 'http://lab.hanseaten-bremen.de/themes/api/';
/**
* Slugs of managed themes.
*
* FIXME: Move to a transient.
*
* @var array<string>
*/
private $known_themes = [ 'bdp-reloaded', 'bdp-test', 'buena' ];
/**
* @var ThemeUpdaterSettings
*/
protected $settings;
public function __construct( ThemeUpdaterSettings $settings )
{
$this->settings = $settings;
}
/**
* Whether theme information is available.
*
* @param string $theme_slug
* @return bool
*/
public function isKnownTheme( $theme_slug )
{
return in_array( $theme_slug, $this->known_themes, true );
}
/**
* Wrapper around HTTP calls, always returns an array of theme information.
*
* @param string $action One of the supported actions of the repository
* @param array $params Parameters for the action
* @param string $locale
* @return array<object>|\WP_Error
*/
protected function doApiQuery( $action, array $params = [], $locale = '' )
{
$url_params = [
'key' => $this->settings['key'],
'action' => $action,
];
if ( $params ) {
if ( function_exists( 'gzcompress' ) ) {
$url_params['gzparams'] = gzcompress( json_encode( $params ), 9 );
} else {
$url_params['params'] = json_encode( $params );
}
}
$url_params = array_map( 'rawurlencode', $url_params );
$url = add_query_arg( $url_params, self::URL );
if ( strlen( $url ) > 2000 ) {
// Lengths beyond 2000 seem unhealthy.
return new \WP_Error(
815,
__( 'Your theme repository query is too long.', 'pfadfinden-theme-updater' )
);
}
$headers = [];
if ( ! strlen( $locale ) ) {
$locale = get_locale();
}
if ( strlen( $locale ) ) {
$locale = str_replace( '_', '-', $locale );
$headers['Accept-Language'] = "$locale, en; q=0.6, *; q=0.1";
}
// A GET request allows for caching
$response = wp_remote_get( $url, [
'headers' => $headers,
] );
if ( is_wp_error( $response ) ) {
return $response;
}
$body = json_decode( wp_remote_retrieve_body( $response ), true );
if ( isset( $body['type'] ) && 'success' === $body['type'] ) {
return array_map( function ( array $theme ) {
return (object) $theme;
}, $body['themes'] );
}
if ( WP_DEBUG ) {
trigger_error( wp_remote_retrieve_body( $response ), E_USER_ERROR );
}
$error = new \WP_Error(
wp_remote_retrieve_response_code( $response ),
isset( $body['message'] ) ? $body['message'] : __( 'Unknown theme repository server error, no message attached.', 'pfadfinden-theme-updater' )
);
if ( isset( $body['exception'] ) ) {
$error->add_data( $body['exception'] );
}
return $error;
}
/**
* @param array<bool> $fields to explicitly include or exclude
* @param string $locale
* @return array<object {
* @type string $name
* @type string $slug lowercase, hyphenated
* @type string $version
* @type string $author
* @type string $preview_url
* @type string $screenshot_url
* @type float $rating between 0 and 100
* @type int $num_ratings
* @type int $downloaded
* @type string $last_updated Y-m-d
* @type string $homepage
* @type string $description
* @type array $tags
* }>
*/
public function queryFeaturedThemes( array $fields = [], $locale = '' )
{
return $this->doApiQuery( 'featured', [ 'fields' => $fields ], $locale );
}
/**
* Query information about a specific theme.
*
* @param string|array $slugs theme slug(s)
* @param array<bool> $fields to explicitly include or exclude
* @param string $locale
* @return object {
* @type string $name
* @type string $slug
* @type string $version
* @type string $author
* @type string $preview_url
* @type string $screenshot_url
* @type float $rating between 0.0 and 100.0
* @type int $num_ratings
* @type int $downloaded
* @type string $last_updated
* @type string $homepage
* @type array $sections {
* @type string $description
* }
* @type string $description empty string when having sections
* @type string $download_link
* @type array<string> $tags keys are tag slugs, values also lowercase. strange.
* }
*/
public function queryThemeInformation( $slugs, array $fields = [], $locale = '' )
{
$themes = $this->doApiQuery( 'information', [
'slugs' => (array) $slugs,
'fields' => $fields,
], $locale );
if ( is_wp_error( $themes ) ) {
return $themes;
}
if ( is_string( $slugs ) ) {
if ( count( $themes ) !== 1 ) {
return new \WP_Error( __( 'Ambiguous result for single theme information call.', 'pfadfinden-theme-updater' ) );
}
return reset( $themes );
}
return $themes;
}
/**
* Query information about updates for installed themes.
*
* @param array<bool> $fields to explicitly include or exclude
* @param string $locale
* @return array<object>
*/
public function queryUpdates( array $fields = [], $locale = '' )
{
// FIXME: Only include installed themes
return $this->queryThemeInformation( $this->known_themes, $fields, $locale );
}
}

View File

@ -1,231 +0,0 @@
<?php
namespace Pfadfinden\WordPress;
use wordpress\src\Shy\WordPress\Plugin;
/**
* A plugin that hooks the Pfadfinden theme repository into the Theme Updater.
*
* It knows about the way that WordPress handles and stores theme information.
*
* @author Philipp Cordes <philipp.cordes@pfadfinden.de>
*/
class ThemeUpdaterPlugin extends wordpress\src\Shy\WordPress\Plugin
{
const ACTION_QUERY_THEMES = 'query_themes';
const ACTION_FEATURE_LIST = 'feature_list';
const ACTION_THEME_INFORMATION = 'theme_information';
/**
* @var ThemeUpdaterSettings
*/
protected $settings;
/**
* @var ThemeRepository
*/
protected $repository;
public function __construct()
{
$this->settings = new ThemeUpdaterSettings();
if ( ! $this->settings['key'] ) {
// Bail out if there is no key.
return;
}
$this->repository = new ThemeRepository( $this->settings );
$this->addHookMethod( 'themes_api', 'filterApiCall' );
$this->addHookMethod( 'themes_api_result', 'filterApiResult' );
$this->addHookMethod( 'themes_update_check_locales', 'filterThemeUpdateLocales' );
}
/**
* Replace a Theme API call.
*
* Actually, only the call for theme information in special cases.
*
* @param \WP_Error|object|false $result
* @param string $action 'theme_information', 'feature_list' or 'query_themes'
* @param object $args
* @return \WP_Error|object|array|false
*/
public function filterApiCall( $result, $action, $args )
{
if ( is_wp_error( $result ) ) {
return $result;
}
if ( self::ACTION_THEME_INFORMATION === $action
&& $this->repository->isKnownTheme( $args->slug )
) {
// Only handle our theme information calls
return $this->repository->queryThemeInformation( $args->slug, $args->fields, $args->locale );
}
return $result;
}
/**
* Filter a Theme API result.
*
* Inject our themes at appropriate places.
*
* @param object|\WP_Error $result
* @param string $action 'theme_information', 'feature_list', 'query_themes'
* @param object|array $args An array after using built-in API, object otherwise.
* @return object
*/
public function filterApiResult( $result, $action, $args )
{
if ( is_wp_error( $result ) ) {
return $result;
}
// FIXME: Workaround to be removed on 2015-10-23
if ( is_array( $args ) && isset( $args['body']['request'] ) ) {
// See https://core.trac.wordpress.org/ticket/29079, fixed in 4.2
$args = unserialize( $args['body']['request'] ); // Unpack original args
}
if ( self::ACTION_QUERY_THEMES !== $action || ! isset( $args->browse ) || 'featured' !== $args->browse ) {
return $result;
}
if ( ! $result || ! is_object( $result ) ) {
// Construct empty result
// FIXME: Maybe unneccessary
$result = (object) [
'info' => [
'page' => 1,
'pages' => 0,
'results' => false,
],
'themes' => [],
];
}
$themes = $this->repository->queryFeaturedThemes( $args->fields, $args->locale );
if ( ! is_wp_error( $themes ) ) {
$this->spliceThemes( $result, $themes );
}
return $result;
}
/**
* Splice additional themes into an existing Theme API result.
*
* Put them in front.
*
* @param object $result {
* @type object $info {
* @type integer|false $results have browser count if false
* @type integer|string $page
* @type integer $pages may be 0
* }
* @type array $themes
* }
* @param array $themes
* @return void
*/
public function spliceThemes( $result, array $themes )
{
$add = function ( $number, $increment ) {
return is_integer( $number ) ? $number + $increment : $number;
};
if ( is_array( $result->info ) ) {
$result->info['results'] = $add( $result->info['results'], count( $themes ) );
} elseif ( is_object( $result->info ) ) {
// Seemed to be an object once…
$result->info->results = $add( $result->info->results, count( $themes ) );
}
array_splice( $result->themes, 0, 0, $themes );
}
/**
* Filter locales queried for a theme update.
*
* Just in time to wait for the theme updates HTTP request…
*
* @param array $locales
* @return array
*/
public function filterThemeUpdateLocales( $locales )
{
$this->addHookMethod( 'http_response', 'filterThemeUpdateResponse' );
return $locales;
}
/**
* @param string $url
* @return bool
*/
protected function isThemeUpdateUrl( $url )
{
return (bool) preg_match( '@^https?://api.wordpress.org/themes/update-check/1.1/$@', $url );
}
/**
* Add our updates to the list.
*
* @param array $response
* @param array $args Original args to request
* @param string $url
*/
public function filterThemeUpdateResponse( array $response, array $args, $url )
{
if ( ! $this->isThemeUpdateUrl( $url ) ) {
return;
}
$this->removeHookMethod( 'http_response', __FUNCTION__ );
$themes = $this->repository->queryUpdates( [
// Eliminate worst offenders
'author' => false,
'description' => false,
'preview_url' => false,
'screenshot_url' => false,
] );
if ( is_wp_error( $themes ) ) {
// Silently fail.
return $response;
}
$updates = json_decode( wp_remote_retrieve_body( $response ), true );
foreach ( $themes as $theme ) {
$installed_theme = wp_get_theme( $theme->slug );
if ( ! $installed_theme->exists() || version_compare( $theme->version, $installed_theme->version, '<=' ) ) {
continue;
}
// Because thats why: Rename all the fields.
$updates['themes'][ $theme->slug ] = [
'theme' => $theme->slug,
'new_version' => $theme->version,
'url' => $theme->homepage,
'package' => $theme->download_link,
];
}
$response['body'] = json_encode( $updates );
return $response;
}
}

View File

@ -1,131 +0,0 @@
<?php
namespace Pfadfinden\WordPress;
use wordpress\src\Shy\WordPress\SettingsPage;
/**
* The code managing the plugin settings.
*
* @author Philipp Cordes <philipp.cordes@pfadfinden.de>
*/
class ThemeUpdaterSettings extends wordpress\src\Shy\WordPress\SettingsPage
{
/**
* Full path of plugin main file.
*
* @return string
*/
protected function getPluginFilename()
{
return preg_replace( '/src\\/.*?$/', 'pfadfinden-theme-updater.php', __DIR__ );
}
public function __construct()
{
parent::__construct( 'pfadfinden-theme-updater' );
$this->addHookMethod( 'plugin_action_links', 'filterPluginActions' );
}
/**
* Add our settings entry to the plugin actions.
*
* @param array<string> $actions
* @param string $plugin_file
* @param array $plugin_data
* @param string $context
* @return array<string>
*/
public function filterPluginActions( array $actions, $plugin_file, array $plugin_data, $context )
{
// Dereference possible symlink
$plugin_file = realpath( WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . $plugin_file );
if ( $this->getPluginFilename() !== $plugin_file ) {
return $actions;
}
return array(
'settings' => sprintf(
'<a href="themes.php?page=%s">%s</a>',
esc_attr( urlencode( $this->slug ) ),
esc_html__( 'Settings' )
),
) + $actions;
}
protected function getParentSlug()
{
return 'themes.php';
}
protected function getPageTitle()
{
return __( 'Pfadfinden Theme Updater Settings', 'pfadfinden-theme-updater' );
}
protected function getMenuTitle()
{
return __( 'Pfadfinden Updater', 'pfadfinden-theme-updater' );
}
public function registerSettings()
{
$this->addSection( '', 'plugin' );
$this->addTextField(
'key',
__( 'API Key', 'pfadfinden-theme-updater' ),
[ 'attr' => [
'minlength' => '10',
'maxlength' => '10',
'pattern' => '^[A-Za-z0-9]{10}$',
'title' => __( 'An API key consists of 10 alphanumeric characters.', 'pfadfinden-theme-updater' ),
] ],
[ $this, 'renderApiKeyField' ]
);
$this->addCheckboxField(
'keep-settings',
__( 'Keep Settings', 'pfadfinden-theme-updater' ),
__( 'Dont delete settings when uninstalling the plugin.', 'pfadfinden-theme-updater' )
);
parent::registerSettings();
}
public function renderApiKeyField( array $args )
{
$this->renderTextField( $args );
echo '<p class="description">' . __( 'Just testing? Try APITESTKEY.', 'pfadfinden-theme-updater' ) . '</p>';
}
public function sanitizeOptions( array $options )
{
if ( isset( $options['key'] ) ) {
$key = preg_replace( '/[^A-Za-z0-9]+/', '', $options['key'] );
$keylen = strlen( $key );
if ( 0 !== $keylen && 10 !== $keylen ) {
$this->addError( 'key', __( 'An API key consists of 10 alphanumeric characters.', 'pfadfinden-theme-updater' ) );
}
$options['key'] = $key;
}
return $options + $this->getDefaults();
}
public function getDefaults()
{
return [
'key' => '',
'keep-settings' => false,
];
}
}

View File

@ -1,19 +0,0 @@
<?php
/**
* Try to load a Pfadfinden WordPress class.
*
* @param string $name
* @return bool
*/
function pfadfinden_wordpress_autoloader( $name )
{
if ( substr( $name, 0, 21 ) !== 'Pfadfinden\\WordPress\\' ) {
return false;
}
$name = __DIR__ . '/' . str_replace( '\\', DIRECTORY_SEPARATOR, $name ) . '.php';
return is_file( $name ) && include( $name );
}
spl_autoload_register( 'pfadfinden_wordpress_autoloader' );

View File

@ -1,3 +0,0 @@
<?php
return new \Pfadfinden\WordPress\ThemeUpdaterPlugin();

View File

@ -1,10 +0,0 @@
<?php
namespace Pfadfinden\WordPress\Tests;
class ThemeRepositoryTest extends \WP_UnitTestCase
{
}

Some files were not shown because too many files have changed in this diff Show More