Skip to content

Instantly share code, notes, and snippets.

View heldervilela's full-sized avatar

Helder Vilela heldervilela

View GitHub Profile
@heldervilela
heldervilela / jail.local
Created April 5, 2018 22:39 — forked from rutger1140/jail.local
Fail2Ban - block WordPress brute force hack attempts - Plesk 12
# Create a new jail via Plesk
# generated in /etc/fail2ban/jail.local
[wp-auth]
enabled = true
filter = wp-auth
action = iptables-multiport[name=NoAuthFailures, port="http,https"]
logpath = /var/www/vhosts/system/*/logs/*access*log
/var/log/httpd/*access_log
maxretry = 15
@heldervilela
heldervilela / admin-page-framework-custom-text-after-form-submission.php
Created November 6, 2016 15:34 — forked from michaeluno/admin-page-framework-custom-text-after-form-submission.php
Displays custom text after the form is submitted with Admin Page Framework, a wordpress plugin/theme framework.
<?php
/*
Plugin Name: Admin Page Framework - Custom Text After Form Submission
Plugin URI: http://en.michaeluno.jp/admin-page-framework
Description: Displays custom text after the form is submitted.
Author: Michael Uno
*/
// Include the library file. Set your file path here.
include( dirname( dirname( __FILE__ ) ) . '/admin-page-framework/library/apf/admin-page-framework.php' );
@heldervilela
heldervilela / admin-page-framework-demo-dynami-dropdown-in-repeatable-sections.php Demonstrates how a drop-down list can be updated dynamically in repeatable sections using Admin Page Framework.
<?php
/**
* Plugin Name: Admin Page Framework Demo - Dynamic Drop-down in Repeatable Sections
* Plugin URI: http://en.michaeluno.jp/admin-page-framework
* Description: Demonstrates how a drop-down list can be updated dynamically in repeatable sections.
* Author: Michael Uno
* Author URI: http://michaeluno.jp
* Version: 1.0.0
*/
@heldervilela
heldervilela / nav-menu-item-custom-fields.php
Created April 16, 2016 19:32 — forked from kucrut/nav-menu-item-custom-fields.php
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(