Skip to content

Instantly share code, notes, and snippets.

View dominicvogl's full-sized avatar
🏠
Working from home

Dominic Vogl dominicvogl

🏠
Working from home
View GitHub Profile
@dominicvogl
dominicvogl / wp-config.php
Created April 15, 2023 07:20
Example wp-config.php for new projects
<?php
// Database credentials
define('DB_NAME', 'datenbankname_hier_einfuegen');
define('DB_USER', 'benutzername_hier_einfuegen');
define('DB_PASSWORD', 'passwort_hier_einfuegen');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
@dominicvogl
dominicvogl / show_registered_styles_scripts.php
Created April 13, 2023 05:36
Show me a Table view of all registered and active styles and scripts of a Wordpress Installation
function list_registered_scripts_and_styles() {
global $wp_scripts, $wp_styles;
// Tabellarische Ausgabe für registrierte Skripte
echo "<h2>Registrierte Skripte:</h2>";
echo "<table><thead><tr><th>Name</th><th>URL</th><th>Version</th><th>Abhängigkeiten</th></tr></thead><tbody>";
foreach( $wp_scripts->registered as $script ) {
echo "<tr><td>{$script->handle}</td>";
echo "<td>{$script->src}</td>";
echo "<td>{$script->ver}</td>";
@dominicvogl
dominicvogl / .bash_profile
Created November 9, 2015 09:04
bash profile settings
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
// im Seitenbaum die SeitenIDs anzeigen:
options.pageTree.showPageIdWithTitle = 1
mod.web_list {
// allein durch anklicken kann ein Datensatz editiert werden
clickTitleMode = edit
// ListenZeilen bekommen im BE alternierende Farben
alternateBgColors = 1
}
@dominicvogl
dominicvogl / .htaccess
Last active April 15, 2023 05:18
Security & Performance .htaccess for Wordpress Installations
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY
# ----------------------------------------------------------------------
# @Version 2.0.7 - 12/2022
# @Contributor: Dominic Vogl
# @Author URI: https://dominicvogl.de
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
# Source URI: https://seoagentur-hamburg.com/die-perfekte-htaccess-fuer-wordpress/
########################################################################
@dominicvogl
dominicvogl / .gitignore
Last active August 29, 2015 14:18 — forked from salcode/.gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@dominicvogl
dominicvogl / functions.php
Last active August 29, 2015 14:00
Wordpress Thumbnail Upscaling
<?php
/* Thumbnail upscale
/* ------------------------------------ */
function alx_thumbnail_upscale( $default, $orig_w, $orig_h, $new_w, $new_h, $crop ){
if ( !$crop ) return null; // let the wordpress default function handle this
$aspect_ratio = $orig_w / $orig_h;
$size_ratio = max($new_w / $orig_w, $new_h / $orig_h);
<Files wp-login.php>
AuthName "Intern"
AuthType Basic
AuthUserFile /var/customers/webs/web58/www.world-of-textiles.com/wp-content/themes/tmpl_wot/.htpasswd
require valid-user
</Files>
@dominicvogl
dominicvogl / disable_wp_core_updates.php
Created October 29, 2013 07:26
Put this snippet into the wp_config.php when you want to disable wp 3.7+ auto core updates
<?php
// Put this snippet into the wp_config.php when you want to disable wp 3.7+ auto core updates
define( 'AUTOMATIC_UPDATER_DISABLED', true );