Skip to content

Instantly share code, notes, and snippets.

View szepeviktor's full-sized avatar
🍓
Guess I'm the lone ranger keeping it all running.

Viktor Szépe szepeviktor

🍓
Guess I'm the lone ranger keeping it all running.
View GitHub Profile
@szepeviktor
szepeviktor / geo-important-factors.txt
Last active August 16, 2026 11:57
Important GEO factors
Important GEO factors according to zubair-trabzada/geo-seo-claude:
- AI Citability & Visibility: 25%
- Brand Authority Signals: 20%
- Content Quality & E-E-A-T: 20% (Experience, Expertise, Authoritativeness, and Trustworthiness)
- Technical Foundations: 15%
- Structured Data: 10%
- Platform Optimization: 10%
- Content blocks that are easy for AI systems to quote and understand independently
- Question-and-answer style headings and direct answers
@szepeviktor
szepeviktor / restore-wcsatt-cart-plan-selector.php
Created August 8, 2026 06:10
Restore WCSATT Cart Plan Selector
<?php
/*
* Plugin Name: Restore WCSATT Cart Plan Selector
* Description: Restores the classic-cart one-time/subscription plan selector removed from WooCommerce Subscriptions 9.0.1.
* Author: Viktor Szépe
*/
namespace Roboviktor\WcsattCartPlanSelector;
# Ubuntu 24.04
apt install apache2 apache2-dev geoipupdate libmaxminddb-dev
# Add license key
editor /etc/GeoIP.conf
wget https://github.com/maxmind/mod_maxminddb/releases/download/1.3.0/mod_maxminddb-1.3.0.tar.gz
tar -xf mod_maxminddb-1.3.0.tar.gz
cd mod_maxminddb-1.3.0/
./configure
make install
@szepeviktor
szepeviktor / science-songs.md
Created July 20, 2026 22:34
Miért ritkák a tudományos ténydalok? - Why Are Songs About Scientific Facts So Rare?

Szerintem nem azért ritka, mert ne lehetne jó, hanem mert a dalírás és a tudományos pontosság eltérő irányba húz.

A fő okok

1. A dal általában érzelmet akar kiváltani, nem információt átadni. A legtöbb hallgató kapcsolatokról, veszteségről, vágyról, identitásról akar dalt hallani. Egy plagioklász összetétele önmagában kevés embernek személyesen fontos.

2. A tudományos állítások rosszul tűrik a dalszöveges tömörítést. Egy szerelmes mondatot húszféleképpen át lehet fogalmazni. Egy ásvány képletét vagy egy fizikai törvényt nem. Ha a rím vagy a ritmus kedvéért módosítják, könnyen hamis lesz.

@szepeviktor
szepeviktor / fix-rest-batch.php
Last active July 25, 2026 00:46
Temporary mitigation for chained RCE in WordPress core: CVE-2026-60137 and CVE-2026-63030
<?php
/*
* Plugin Name: Fix REST Batch
* Description: Rejects malformed REST batch paths before affected WordPress core versions process them.
*/
declare(strict_types=1);
namespace SzepeViktor\FixRestBatch;
@szepeviktor
szepeviktor / lsb-base-logging.sh
Last active July 18, 2026 04:08
PHP-FPM: Suppress the normal "Reopening PHP FastCGI Process Manager logs" message
# /etc/lsb-base-logging.sh
log_daemon_msg_pre()
{
# Suppress the normal "Reopening PHP FastCGI Process Manager logs" message
case "${1:-}:${2:-}" in
Reopening*logs:php-fpm*)
/usr/bin/logger -p daemon.notice -t "$2" -- "$1"
exec >/dev/null
;;
esac
@szepeviktor
szepeviktor / cf7-robot-trap.php
Last active May 15, 2026 11:42
Contact Form 7 Robot Trap
<?php
/*
* Plugin Name: Contact Form 7 Robot Trap
* Description: Adds a hidden trap field to Contact Form 7.
* Version: 0.6.0
* Plugin URI: https://wdmarket.com/
* Author: WD Market
* Requires PHP: 7.4
* Requires at least: 6.7
@szepeviktor
szepeviktor / apache.conf
Created May 1, 2026 22:13
WordPress deserves no CSP policy
# CSP policy
<LocationMatch "^/olm/wp-admin/">
Header always set Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self'; img-src 'self' data: blob: https://ps.w.org https://secure.gravatar.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; form-action 'self'; object-src 'none'; base-uri 'self'; frame-ancestors 'self'; report-uri /csp-report.php"
</LocationMatch>
@szepeviktor
szepeviktor / shortcoder.php
Last active March 29, 2026 21:58
Indent WordPress shortcodes - useful for inspecting page builder post_content
#!/usr/bin/env php
<?php
$skeletonOnly = in_array('--skeleton', $argv, true);
$input = stream_get_contents(STDIN);
preg_match_all('/\[(\/?)([a-zA-Z_][\w-]*)([^\]]*?)(\/?)\]/', $input, $shortcodeMatches, PREG_OFFSET_CAPTURE);
function extractAttributeNames($attributeText) {
preg_match_all('/([a-zA-Z_][\w:-]*)\s*=\s*(?:"[^"]*"|\'[^\']*\'|[^\s\]]+)|([a-zA-Z_][\w:-]*)/', $attributeText, $attributeMatches);
@szepeviktor
szepeviktor / billingo-attacher.py
Created March 11, 2026 12:42
Attach Billingo.hu PDF invoices, to be used in an email pipe
#!/usr/bin/env python3
import sys
import re
import copy
import syslog
import gzip
import zlib
import subprocess
import urllib.request