Skip to content

Instantly share code, notes, and snippets.

View carl-alberto's full-sized avatar

Carl Alberto carl-alberto

View GitHub Profile
@carl-alberto
carl-alberto / plugin-filter.php
Last active May 10, 2021 05:36 — forked from carlodaniele/plugin-filter.php
A Must-use plugin to filter active plugins in on a per-page basis. selectively load plugin per page
<?php
/**
* @package active-plugins
* @version 1.0
*
* Plugin Name: Active Plugins
* Plugin URI: http://wordpress.org/extend/plugins/#
* Description: This is a development plugin
* Author: Carlo Daniele
* Version: 1.0
@carl-alberto
carl-alberto / plugin.php
Created February 26, 2018 14:45 — forked from joncave/plugin.php
An intentionally vulnerable plugin developed for WordPress plugin author education. http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
<?php
/* Plugin Name: Damn Vulnerable WordPress Plugin
* Description: Intentionally vulnerable plugin for plugin author education
* Version: 0.1
* Plugin URI: http://make.wordpress.org/plugins/2013/04/09/intentionally-vulnerable-plugin/
* Author: Jon Cave
* Author URI: http://joncave.co.uk
* License: GPLv2+
*
* DO NOT RUN THIS PLUGIN ON AN INTERNET ACCESSIBLE SITE
@carl-alberto
carl-alberto / laravel-ums.markdown
Created November 23, 2016 10:27 — forked from anchetaWern/laravel-ums.markdown
Building a User Management System in Laravel

There's no shortage of good resources for learning laravel. So instead of the usual introductory tutorial were just gonna learn Laravel by building a project from scratch and that's gonna be a User Management System.

I don't know if my definition of a User Management System is correct but here's my idea of what's it's capable of doing:

  • Register Roles
  • Register Users
  • Update Users
@carl-alberto
carl-alberto / CreateWordpressUser.php
Created May 31, 2016 03:07 — forked from jawinn/CreateWordpressUser.php
Create WordPress Admin User from PHP
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
// ----------------------------------------------------
@carl-alberto
carl-alberto / wc-auth-net-cim-save-payment-method-default-checked.php
Last active August 27, 2015 06:19 — forked from maxrice/wc-auth-net-cim-save-payment-method-default-checked.php
WC Authorize.net CIM: On the payment form, default "securely save to account" checkbox to checked
<?php
// force the "securely save to account" checkbox to default to checked
function wc_auth_net_cim_save_payment_method_default_checked( $html, $form ) {
if ( empty( $html ) || $form->tokenization_forced() ) {
return $html;
}
return str_replace( 'type="checkbox"', 'type="checkbox" checked="checked"', $html );
}
@carl-alberto
carl-alberto / wordpress-create-user.php
Last active August 29, 2015 14:26
Create a user in WordPress from a php page/script outside of the WordPress system.
<?php
// [wp insert user « WordPress Codex](http://codex.wordpress.org/Function_Reference/wp_insert_user)
require_once "wordpress/wp-load.php";
$user_info = array(
"user_pass" => "test123",
"user_login" => "username",
"user_nicename" => "username",
"user_email" => "email@example.com",