Skip to content

Instantly share code, notes, and snippets.

View Zodiac1978's full-sized avatar
🤔
Overthinking things since 1978

Torsten Landsiedel Zodiac1978

🤔
Overthinking things since 1978
View GitHub Profile
@Zodiac1978
Zodiac1978 / style.css
Last active June 17, 2024 13:58
Supreme Modules Lite (https://wordpress.org/plugins/supreme-modules-for-divi/) plugin has some minor issues which are easily fixed with some CSS
/*
Submit button aligment "center" does not work correctly:
https://stackoverflow.com/questions/72353817/contact-form-7-submit-button-alignment-issue
*/
.wpcf7-spinner {
display: block;
top: 15px;
left: 45%;
}
@Zodiac1978
Zodiac1978 / functions.php
Created June 11, 2024 07:33
Add two more user roles only for viewing and managing Koko Analytics
<?php
/* Add two more user roles for viewing and managing Koko Analytics */
/* See: https://www.kokoanalytics.com/kb/how-to-give-other-wordpress-users-access-to-the-koko-analytics-dashboard-page/ */
add_role( 'koko_analytics_viewer', 'Koko Analytics Viewer', array( 'read' => true, 'view_koko_analytics' => true ) );
add_role( 'koko_analytics_manager', 'Koko Analytics Manager', array( 'read' => true, 'view_koko_analytics' => true, 'manage_koko_analytics' => true ) );
@Zodiac1978
Zodiac1978 / wceu2024.md
Last active June 17, 2024 14:06
Hello WCEU2024! You want more details about the internal, native search? Here are my thoughts and links ...
@Zodiac1978
Zodiac1978 / repair-ajax-comments.php
Last active January 7, 2024 13:33
Repair AJAX comments for Antispam Bee in Streamtube theme (and maybe many more) - work in progress
<?php
/**
* Plugin Name: Repair AJAX comments for Antispam Bee
* Description: Add honeypot check and enable AJAX for Antispam Bee.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / wp-config.php
Created November 28, 2023 15:48
Disable the fatal error handler from WordPress
define( 'WP_DISABLE_FATAL_ERROR_HANDLER', true );
@Zodiac1978
Zodiac1978 / plugin-preview.html
Created October 10, 2023 15:09
WordPress plugin preview for from Roy Tanck modified to support Enter key for submit
<!DOCTYPE html>
<html lang="en">
<head>
<title>WordPress plugin preview</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
@Zodiac1978
Zodiac1978 / double-translation-strings.php
Created August 25, 2023 20:43
Double every translation string for a given text domain for testing purpose.
<?php
/**
* Plugin Name: Double every translation
* Description: Double every translation string for testing purpose.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: https://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / disallow-gptbot.php
Created August 10, 2023 14:46
Add line in robots.txt to disallow GPTBot. (WordPress plugin)
<?php
/**
* Plugin Name: Disallow GPTBot
* Description: Add line in robots.txt to disallow GPTBot.
* Plugin URI: https://torstenlandsiedel.de
* Version: 1.0
* Author: Torsten Landsiedel
* Author URI: http://torstenlandsiedel.de
* Licence: GPL 2
* License URI: http://opensource.org/licenses/GPL-2.0
@Zodiac1978
Zodiac1978 / .htaccess
Created October 10, 2022 11:03
Protecting the wp-login.php interferes with the page/post password protection. We need to exclude this page.
# Protect wp-login.php without interfering with post/page password protection
<files wp-login.php>
<If "%{QUERY_STRING} != 'action=postpass'">
# Protect wp-login.php
AuthName "Login erforderlich"
AuthType Basic
AuthUserFile /path/to/password-file/.htpasswd
require valid-user
</If>
</files>
@Zodiac1978
Zodiac1978 / strings.md
Last active May 17, 2024 13:41
Strings in WordPress which are settings and should not be translated
Context Possibe values
default GMT offset or timezone string Must be either a valid offset (-12 to 14) or a valid timezone string (America/New_York)
start of week 0 = Sunday, 1 = Monday (0 or 1)
Events widget offset prefix Used as part of a string like GMT+5 in the Events Widget. (?)
draft_length Maximum number of words used in a preview of a draft on the dashboard. (number)
Comment number declension: on or off If comment number in your language requires declension, translate this to ‘on’. (on or off)
decline months names: on or off If months in your language require a genitive case, translate this to ‘on’. (on or off)
Word count type. Do not translate! If your word count is based on single characters (e.g. East Asian characters), enter ‘characters_excluding_spaces’ or ‘characters_including_spaces’. Otherwise, enter ‘words’.
Google Font Name and Variants Use this to specify the proper Google Font name and variants to load that is supporte