Skip to content

Instantly share code, notes, and snippets.

@Adirael
Adirael / fix-wordpress-permissions.sh
Created August 17, 2012 23:16
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@grtaylor2
grtaylor2 / Change Read More Text Genesis WordPress
Last active August 11, 2021 19:53
Change the [Read More] Text in Genesis WordPress Child Theme
/** Customize Read More Text */
add_filter( 'excerpt_more', 'child_read_more_link' );
add_filter( 'get_the_content_more_link', 'child_read_more_link' );
add_filter( 'the_content_more_link', 'child_read_more_link' );
function child_read_more_link() {
return '<a href="' . get_permalink() . '" rel="nofollow">CUSTOMIZE YOUR TEXT HERE</a>';
}
@dejanmarkovic
dejanmarkovic / new_gist_file.php
Created January 5, 2014 20:11
10 wp-config Tweaks That You Should Know About
In this tutorial, we’ll show you 10 wp-config tweaks that you may not know yet.
Let’s go through them one by one.
Move Your Configurations File:
Moving wp-config outside the web root directory is one of the best security practices. Doing so keeps your important information, like your authentication keys and database login details, away from malicious scripts and hackers who can try to access your site’s database using default location of wp-config file.
Generally, WordPress looks for wp-config file in its web root. If it’s not available there, then it will automatically look one level above. So, just move this file one folder above the web-root folder. In this way, nobody will be able to access it without SSH or FTP access.
If you’re moving your wp-config file, it is recommended to create another wp-config file in the root folder that will point to the “real” wp-config.
@matthewarkin
matthewarkin / prettyStripe.html
Last active August 14, 2017 20:46
Stripe Checkout Custom Button CSS
<link rel="stylesheet" href="https://checkout.stripe.com/v3/checkout/button.css"></link>
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton" class="stripe-button-el">
<span style="display: block; min-height: 30px;">Pay with Card</span>
</button>
@MindyPostoff
MindyPostoff / gist:a10148daa110119b262f
Last active November 14, 2019 19:05
Change "Proceed to PayPal" Text on Checkout Button in WooCommerce
/* Change the "Proceed to PayPal" button text in the WooCommerce checkout screen
* Add this to your theme's functions.php file
*/
add_filter( 'gettext', 'custom_paypal_button_text', 20, 3 );
function custom_paypal_button_text( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Proceed to PayPal' :
$translated_text = __( 'NEW BUTTON TEXT', 'woocommerce' );
break;
}
@anthanh
anthanh / table-emmet
Created February 20, 2015 19:36
Emmet table example
table[name="pepe"]>thead>tr>th*3^^+tbody>tr*7>td{Basico}*3
@salcode
salcode / .gitignore
Last active July 10, 2024 14:28
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@Nilpo
Nilpo / Using Git to Manage a Live Web Site.md
Last active April 26, 2024 19:09
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@rveitch
rveitch / sass-7-1-pattern.scss
Last active July 4, 2024 17:36
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@frosit
frosit / infectedFiles.md
Created May 5, 2016 22:40
Some commands for finding and clearing infected PHP files

Finding infected files with following bash commands

** Command to list all infected files:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot
  • grep -lr --include=*.php "eval" .
  • grep -lr --include=*.php "base64" .

Command to remove malicious code:

  • grep -lr --include=*.php "eval(base64_decode" /path/to/webroot | xargs sed -i.bak 's/<?php eval(base64_decode[^;]*;/<?php\n/g'