Skip to content

Instantly share code, notes, and snippets.

@esedic
esedic / sql.txt
Created February 5, 2026 15:34
Restore MySQL database backup in Laragon (when upgrading MySQL)
mysql -u root -p < C:\laragon\backup\mysql\xxx.sql
@esedic
esedic / cli.bat
Created February 5, 2026 15:32
Add WP CLI to Laragon on Windows
cd C:\laragon\usr\bin && curl -L -O https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && echo @ECHO OFF > wp.bat && echo php "%~dp0wp-cli.phar" %* >> wp.bat
@esedic
esedic / wp_admin.sql
Created January 29, 2026 09:36
Create WP admin user with SQL
-- WordPress Admin User Creation Script
-- Instructions:
-- 1. Open phpMyAdmin and select your WordPress database
-- 2. Go to the SQL tab
-- 3. Copy and paste this entire script
-- 4. Modify the values in the SET statements below as needed
-- 5. Click "Go" to execute
-- ====================================
-- CONFIGURATION - Modify these values
@esedic
esedic / .htaccess
Created January 25, 2026 15:46
Solution for missing images in YOOtheme Pro 5
# Joomla
RewriteCond %{REQUEST_URI} ^/media/yootheme
# WordPress
RewriteCond %{REQUEST_URI} ^/wp-content/uploads/yootheme
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L,NC]
@esedic
esedic / wpdebug.md
Last active December 18, 2025 17:05
WordPress debugging with XDebug and Visual Studio Code on Windows

Xdebug Setup for WordPress and VS Code on Windows

Step 1: Install Xdebug

  1. Copy phpinfo() output and paste it into Xdebug Wizard.
  2. Download xdebug.dll.
  3. Copy the DLL to your PHP ext folder.
  4. Add the following configuration to your php.ini:
@esedic
esedic / jdebug.md
Last active December 16, 2025 21:26
Joomla debugging with XDebug and Visual Studio Code on Windows

Xdebug Setup for Joomla and VS Code on Windows

Step 1: Install Xdebug

  1. Copy phpinfo() output and paste it into Xdebug Wizard.
  2. Download xdebug.dll.
  3. Copy the DLL to your PHP ext folder.
  4. Add the following configuration to your php.ini:
@esedic
esedic / .htaccess
Created November 28, 2025 18:24
Browser caching in .htaccess in 2025
## BEGIN EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive on
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 year"
# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
@esedic
esedic / scroll.js
Created October 10, 2025 09:38
Add an offset to scrolling anchor links
// Method 1
window.addEventListener('load', function() {
var theHash = location.hash;
// add offset only for specific hashes
var hashes = ['#project-togo', '#project-colombia-visajes', '#project-colombia-izquierdo', '#project-yemen', '#project-tansania'];
if (hashes.includes(theHash)) {
window.scrollBy(0, -100);
}
});
@esedic
esedic / wcgeo.php
Created September 30, 2025 16:35
Uses WooCommerce geolocation method
<?php
// Get current user's location
$geo_data = WC_Geolocation::geolocate_ip();
$country = $geo_data['country'];
$state = $geo_data['state'];
// Use a specific IP address
$location = WC_Geolocation::geolocate_ip( '8.8.8.8' );
@esedic
esedic / url.php
Created September 25, 2025 09:05
Get Current URL in Joomla 3 with PHP
<?php
// Method 1: Using JUri (Recommended)
// Get the full current URL
$currentUrl = JUri::getInstance()->toString();
// Get only the base URL (without query parameters)
$baseUrl = JUri::base();
// Get the current URI path