Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
dienste:wp_tkev [31.12.2020 11:27] – Jetpack-JSON-API deaktiviert bernd | dienste:wp_tkev [28.12.2021 21:24] (aktuell) – [Tabelle] mape2k | ||
---|---|---|---|
Zeile 4: | Zeile 4: | ||
Die Serverkonfiguration ist in [[dienste: | Die Serverkonfiguration ist in [[dienste: | ||
+ | ===== Wordpress User Enumeration ===== | ||
+ | |||
+ | In WordPress gibt es mehrere Stellen, an denen der Benutzername eines Kontos ausgelesen werden kann. Möchte man dies verhindern, müssen in der **functions.php** mehrere Filter ergänzt werden. Eine Anleitung dazu findet man auf [[https:// | ||
+ | |||
+ | **Im aktiven Weblog sind die Änderungen noch nicht eingebaut.** | ||
+ | |||
+ | |||
+ | ===== wp-config.php ===== | ||
+ | |||
+ | ==== Cache aktivieren ==== | ||
+ | |||
+ | Die nachfolgende Zeile muss vor '' | ||
+ | |||
+ | <code php> | ||
+ | |||
+ | |||
+ | ===== functions.php ===== | ||
+ | |||
+ | ==== erlaubte Dateitypen für Medien-Upload anpassen ==== | ||
+ | |||
+ | WordPress erlaubt im Standard nur eine begrenzte Auswahl an Dateitypen, welche in die Mediathek hochgeladen werden dürfen (siehe [[https:// | ||
+ | |||
+ | <code php> | ||
+ | | ||
+ | // unset($mime_types[' | ||
+ | | ||
+ | } | ||
+ | add_filter(' | ||
===== Template ===== | ===== Template ===== | ||
- | Das endgültige Template steht noch nicht fest. | + | ==== User CSS ==== |
+ | Verwendet wird aktuell das Template " | ||
- | ===== verwendete Plugins ===== | + | <code css># |
- | ^ Plugin | + | #stc-subscribe-btn,#stc-unsubscribe-btn {border: 2px solid # |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
- | | [[https:// | + | |
+ | .posts .entry {padding-left: | ||
+ | |||
+ | .sidebar .widget {padding: 1em;} | ||
+ | |||
+ | .intro-title { | ||
+ | font-size: 3rem; | ||
+ | padding: 4% 0; | ||
+ | } | ||
+ | |||
+ | .sidebar .widget input, .footer-widgets .widget input, .sidebar .widget select, .footer-widgets .widget select, .sidebar .widget textarea, .footer-widgets .widget textarea { | ||
+ | | ||
+ | } | ||
+ | |||
+ | .entry-content-container, | ||
+ | padding-bottom: | ||
+ | } | ||
+ | |||
+ | .attachment .entry-media, | ||
+ | padding-top: | ||
+ | } | ||
+ | |||
+ | .posts .entry-media { | ||
+ | margin-left: | ||
+ | margin-right: | ||
+ | margin-bottom: | ||
+ | }</ | ||
+ | |||
+ | ==== Vorschaubilder ==== | ||
+ | |||
+ | Damit die Vorschaubilder zum Template passen, müssen unter Einstellungen/ | ||
+ | |||
+ | * Vorschaubilder: | ||
+ | * Mittelgroß: | ||
+ | * Groß: 1200 x 0 | ||
+ | |||
+ | ===== verwendete Plugins ===== | ||
+ | |||
+ | ^ Plugin | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
+ | | [[https:// | ||
===== Plugin-Konfiguration ===== | ===== Plugin-Konfiguration ===== | ||
- | ==== Jetpack ==== | + | ==== ICS Calendar ==== |
+ | |||
+ | Die meisten Funktionen bzw. die Ausgabe des Plugins lassen sich über Parameter im ShortCode der Seite steuern. Nachfolgend beispielhaft die Einbindung mit unseren beiden öffentlichen NextCloud-Kalendern von Bytespeicher und Makerspace. | ||
+ | |||
+ | [ics_calendar url=" | ||
+ | |||
+ | **Wichtig: | ||
+ | |||
+ | > Why isn’t my calendar loading? | ||
+ | > | ||
+ | > This may be due to your server’s configuration. This plugin requires either the PHP cURL extensions, or the allow_url_fopen PHP setting to be turned on. Check your PHP configuration or your server administrator if you think this may be the issue. | ||
+ | |||
+ | ==== Two Factor ==== | ||
+ | |||
+ | Damit sich bei aktivierter 2FA Apps über die XMLRPC-API einloggen können, muss folgender Code in die functions.php gefügt werden: | ||
+ | |||
+ | add_filter( ' | ||
+ | // Allow API login when using an application password even with 2fa enabled. | ||
+ | if ( did_action( ' | ||
+ | return true; | ||
+ | } | ||
+ | |||
+ | return $enable; | ||
+ | } ); | ||
+ | |||
+ | Um das Theme nicht anpassen zu müssen, wird der Code als Snippet im Plugin "Code Snippets" | ||
+ | |||
+ | ==== Kontaktformular ==== | ||
+ | |||
+ | Das Kontaktformular wird von " | ||
+ | |||
+ | === Vorlage für Formular === | ||
+ | |||
+ | Das Kontaktformular entspricht im Wesentlichen der Standardeinstellung, | ||
+ | |||
+ | < | ||
+ | [text* your-name] </ | ||
+ | |||
+ | < | ||
+ | [email* your-email] </ | ||
+ | |||
+ | < | ||
+ | [text* your-subject] </ | ||
+ | |||
+ | < | ||
+ | [textarea your-message] </ | ||
+ | |||
+ | [quiz quiz-515 "In welcher Stadt befindet sich unser Verein? | ||
+ | |||
+ | [submit " | ||
+ | |||
+ | === Honeypot gegen Spam === | ||
+ | |||
+ | Sollte die Sicherheitsfrage zur Abwehr von Spammern nicht ausreichen, kann ggf. noch zusätzlich/ | ||
+ | |||
+ | ==== Übersichtsseite aller Artikel ==== | ||
+ | |||
+ | Das Archiv wird von " | ||
+ | |||
+ | ==== Cache Enabler ==== | ||
+ | |||
+ | * Zwischengespeicherte Seiten mit gzip vorkomprimieren. **aktiviert** | ||
+ | |||
+ | Alle anderen Einstellungen sind deaktiviert bzw. leer. | ||
+ | |||
+ | ==== Subscribe to Comments Reloaded ==== | ||
+ | |||
+ | * StCR Checkbox... **Ja** | ||
+ | * Sicher deinstallieren **Ja** | ||
+ | * Anfragen automatisch löschen **30** Tage | ||
+ | * Datumsformat **d M Y** | ||
+ | * StCR Position **Nein** | ||
+ | * Double Opt-In aktivieren **Ja** | ||
+ | * Autoren abonnieren **Nein** | ||
+ | * Aktiviere HTML E-Mails **Nein** | ||
+ | * Trackbacks senden **Nein** | ||
+ | * Verfolge alle Benachrichtigungen **Nein** | ||
+ | * Admin-Abonnement erlauben **Nein** | ||
+ | * BCC Admin bei Benachrichtigungen **Nein** | ||
+ | * "Font Awesome" | ||
+ | * Nur für Blog-Beiträge aktivieren **Ja** | ||
+ | * Nur für angemeldete Benutzer aktivieren **Nein** | ||
+ | * Cookies aktivieren **Ja** | ||
+ | * Challenge-Frage aktivieren **Nein** | ||
+ | * Challenge-Frage //egal// | ||
+ | * Challenge-Frage //egal// | ||
+ | * Eindeutiger StCR Schlüssel // | ||
+ | |||
+ | ==== XML-Sitemap ==== | ||
+ | |||
+ | Die Sitemap wird vom Plugin "XML Sitemap & Google News" erzeugt. In den Einstellungen unter "Post Types" ist "Split by" auf " | ||
+ | |||
+ | In den Wordpress-Einstellungen für " | ||
+ | |||
+ | ==== Raumstatus ==== | ||
+ | |||
+ | Für die Darstellung des Raumstatus in der Seitenleiste wird das Plugin " | ||
+ | |||
+ | Der Code für den Status sieht wie folgt aus. | ||
+ | Die Größe der Logos lässt sich durch Änderung der Variable $cssMaxWidth anpassen. | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | // Spaces | ||
+ | $spaces = [ | ||
+ | ' | ||
+ | ' | ||
+ | ]; | ||
+ | |||
+ | // Max width of icon (small = 100, large = 200) | ||
+ | $cssMaxWidth = 100; | ||
+ | |||
+ | // JSON path for URI | ||
+ | $statusJsonPath = '/ | ||
+ | |||
+ | // Create stream context with low timeout | ||
+ | $context = stream_context_create([ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ]); | ||
+ | |||
+ | // Check every space | ||
+ | // No output on errors | ||
+ | foreach ($spaces as $spaceName => $statusUrl) { | ||
+ | // Get minimal status from spacestatus webpage | ||
+ | $jsonContent = file_get_contents($statusUrl . $statusJsonPath, | ||
+ | if ($jsonContent === false) { | ||
+ | // Status could not be received, skip it | ||
+ | continue; | ||
+ | } | ||
+ | |||
+ | // Decode JSON with max depth of 2 | ||
+ | $jsonContent = json_decode($jsonContent, | ||
+ | if (is_null($jsonContent) || !isset($jsonContent-> | ||
+ | // JSON could not be decoded or entries missing | ||
+ | continue; | ||
+ | } | ||
+ | |||
+ | // Output spaces | ||
+ | $text = 'Der ' . $spaceName . ' ist ' . ($jsonContent-> | ||
+ | echo '<a href=\'' | ||
+ | echo '< | ||
+ | echo '</ | ||
+ | } | ||
+ | |||
+ | ?></ | ||
+ | |||
+ | ==== Jetpack | ||
Wir verwenden nur die kostenlose Variante von Jetpack, daher sind nicht alle Funktionen nutzbar. | Wir verwenden nur die kostenlose Variante von Jetpack, daher sind nicht alle Funktionen nutzbar. | ||
Zeile 59: | Zeile 288: | ||
* CSS-Anpassungsbereich optimieren **deaktiviert** | * CSS-Anpassungsbereich optimieren **deaktiviert** | ||
* Widgets | * Widgets | ||
- | * Stelle zusätzliche Widgets wie Abonnementformulare und Twitter-Streams auf deiner Website zur Verfügung **aktiviert** | + | * Stelle zusätzliche Widgets wie Abonnementformulare und Twitter-Streams auf deiner Website zur Verfügung **deaktiviert** |
* Aktiviere Steuerelemente zur Sichtbarkeit von Widgets... **deaktiviert** | * Aktiviere Steuerelemente zur Sichtbarkeit von Widgets... **deaktiviert** | ||
* Per E-Mail veröffentlichen **deaktiviert** | * Per E-Mail veröffentlichen **deaktiviert** | ||
Zeile 73: | Zeile 302: | ||
* Kommentare **alles deaktiviert** | * Kommentare **alles deaktiviert** | ||
- | * Abonnements **alles | + | * Abonnements **alles |
=== Traffic === | === Traffic === | ||
- | * Ähnliche Beiträge **alles | + | * Ähnliche Beiträge **alles |
* WP.me-Kurzlinks **deaktiviert** | * WP.me-Kurzlinks **deaktiviert** | ||
- | * Sitemaps **aktiviert** | + | * Sitemaps **deaktiviert** |
* Website-Verifizierung **deaktiviert** | * Website-Verifizierung **deaktiviert** | ||
Zeile 92: | Zeile 321: | ||
* JSON-API **deaktiviert** | * JSON-API **deaktiviert** | ||
- | ===== Kontaktformular ===== | ||
- | |||
- | Das Kontaktformular wird von " | ||
- | |||
- | ===== Übersichtsseite aller Artikel ===== | ||
- | |||
- | Das Archiv wird von " | ||
- | |||
- | |||
- | ===== Raumstatus ===== | ||
- | |||
- | Für die Darstellung des Raumstatus in der Seitenleiste wird das Plugin " | ||
- | |||
- | Der Code für den Status sieht wie folgt aus: | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | |||
- | $ctx = stream_context_create(array( | ||
- | ' | ||
- | ' | ||
- | ) | ||
- | ) | ||
- | ); | ||
- | $obj = json_decode(file_get_contents(' | ||
- | |||
- | if (isset($obj-> | ||
- | $f = $obj-> | ||
- | $text = "Der Bytespeicher ist offen!"; | ||
- | } else { | ||
- | $f = $obj-> | ||
- | $text = "Der Bytespeicher ist geschlossen!"; | ||
- | } | ||
- | |||
- | $f = str_replace(' | ||
- | |||
- | echo "<p style=' | ||
- | echo '< | ||
- | |||
- | |||
- | $ctx = stream_context_create(array( | ||
- | ' | ||
- | ' | ||
- | ) | ||
- | ) | ||
- | ); | ||
- | $obj = json_decode(file_get_contents(' | ||
- | |||
- | if (isset($obj-> | ||
- | $f = $obj-> | ||
- | $text = "Der Makerspace ist offen!"; | ||
- | } else { | ||
- | $f = $obj-> | ||
- | $text = "Der Makerspace ist geschlossen!"; | ||
- | } | ||
- | |||
- | $f = str_replace(' | ||
- | |||
- | echo "<p style=' | ||
- | echo $text."</ | ||
- | |||
- | ?></ | ||
- | |||
- | Alternativ-Code ohne Textausgabe und mit kleineren Icons: | ||
- | |||
- | <code php> | ||
- | <?php | ||
- | |||
- | $ctx = stream_context_create(array( | ||
- | ' | ||
- | ' | ||
- | ) | ||
- | ) | ||
- | ); | ||
- | $obj = json_decode(file_get_contents(' | ||
- | |||
- | if (isset($obj-> | ||
- | $f = $obj-> | ||
- | $text = "Der Bytespeicher ist offen!"; | ||
- | } else { | ||
- | $f = $obj-> | ||
- | $text = "Der Bytespeicher ist geschlossen!"; | ||
- | } | ||
- | |||
- | $f = str_replace(' | ||
- | |||
- | echo "<a target=' | ||
- | |||
- | $ctx = stream_context_create(array( | ||
- | ' | ||
- | ' | ||
- | ) | ||
- | ) | ||
- | ); | ||
- | $obj = json_decode(file_get_contents(' | ||
- | |||
- | if (isset($obj-> | ||
- | $f = $obj-> | ||
- | $text = "Der Makerspace ist offen!"; | ||
- | } else { | ||
- | $f = $obj-> | ||
- | $text = "Der Makerspace ist geschlossen!"; | ||
- | } | ||
- | |||
- | $f = str_replace(' | ||
- | |||
- | echo "<a target=' | ||
- | |||
- | ?></ |