WPML Coding API
http://wpml.org/documentation/support/wpml-coding-api/
| SNIPPET | COMMENTS |
/*globals wpml_browser_redirect_params */ | |
jQuery(document).ready(function () { | |
if (jQuery.cookie !== undefined) { | |
// Check if cookie are enabled | |
jQuery.cookie('wpml_browser_redirect_test', '1'); | |
var cookie_enabled = jQuery.cookie('wpml_browser_redirect_test') === '1'; | |
jQuery.removeCookie('wpml_browser_redirect_test'); | |
if (cookie_enabled) { |
# 6G FIREWALL/BLACKLIST | |
# @ https://perishablepress.com/6g/ | |
# 6G:[QUERY STRINGS] | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{QUERY_STRING} (eval\() [NC,OR] | |
RewriteCond %{QUERY_STRING} (127\.0\.0\.1) [NC,OR] | |
RewriteCond %{QUERY_STRING} ([a-z0-9]{2000}) [NC,OR] | |
RewriteCond %{QUERY_STRING} (javascript:)(.*)(;) [NC,OR] |
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{HTTP_HOST} ^local.site\.com$ | |
RewriteRule ^wp-content/uploads/(.*)$ https://production.site.com/wp-content/uploads/$1 [NC,L] |
#!/bin/bash | |
# | |
# Use WPScan to scan sites running Wordpress | |
# and Store the output somewhere | |
# | |
domains='domain1.com example2.com example.com' | |
# Where do you want output to go? Better without trailing slash |
WPML Coding API
http://wpml.org/documentation/support/wpml-coding-api/
| SNIPPET | COMMENTS |
To work on this project locally, you'll need to do the following:
<?php | |
// Script to update any js-file | |
// Credits go to: Matthew Horne | |
// Remote file to download | |
$remoteFile = 'https://www.google-analytics.com/analytics.js'; | |
$localFile = '/path/to/your/webroot/analytics.js'; | |
// Check if directory exists, otherwise create it. | |
$uploadDir = '/path/to/your/webroot/'; |
<?php | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-all-fields-template.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // All Fields Template | |
* | |
* Modify the {all_fields} merge tag output via a template file. |
<!-- | |
How to load Font Awesome asynchronously | |
Use: Just put this script on the bottom/footer of your web | |
--> | |
<script type="text/javascript"> | |
(function() { | |
var css = document.createElement('link'); | |
css.href = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css'; |
add_filter( 'woocommerce_background_image_regeneration', '__return_false' ); |