Skip to content

Instantly share code, notes, and snippets.

☕️
somone said this would be easy. someone LIED.

Norcross norcross

☕️
somone said this would be easy. someone LIED.
Block or report user

Report or block norcross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@norcross
norcross / WooUpgradeTestSuiteCest.php
Last active Mar 7, 2019
Run various acceptance tests for WooCommerce
View WooUpgradeTestSuiteCest.php
<?php
/**
* WooCommerce Upgrade Test Suite
*
* A set of acceptance tests for a standard WooCommerce store.
*
* https://gist.github.com/norcross/4d45f1902bfb2f1f4cf79997a47d9d03
*/
// It'll error out sometimes without this ¯\_(ツ)_/¯ .
@norcross
norcross / debug.log
Created Aug 9, 2018
example debug log file
View debug.log
[04-Sep-2014 20:28:22 UTC] WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2 for query
SELECT *
FROM
made by require_once('wp-admin/admin.php'), do_action('download_page_edd-external-log'), call_user_func_array, EDD_External_Purchase_API_Admin->admin_page, EDD_External_Purchase_API_Log::load_log_entries
[04-Sep-2014 20:28:57 UTC] PHP Warning: Missing argument 2 for wpdb::prepare(), called in /srv/www/genesisdesignpro/htdocs/wp-content/plugins/edd-external-purchase-api/lib/edd-external-api-log.php on line 156 and defined in /srv/www/genesisdesignpro/htdocs/wp-includes/wp-db.php on line 1154
[04-Sep-2014 20:28:57 UTC] PHP Notice: wpdb::prepare was called <strong>incorrectly</strong>. The query argument of wpdb::prepare() must have a placeholder. Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more infor
@norcross
norcross / admin-notice-class.php
Created Jul 27, 2017 — forked from monkeymonk/Notice.php
WordPress Admin Notice Helper Class
View admin-notice-class.php
<?php
/**
* Helper to work with Wordpress admin notices
*
* @example
* Notice::success('All is good!');
*
* @example
* Notice::warning('Do something please.', true);
@norcross
norcross / admin-bar-debug-display.php
Last active Jul 7, 2017
Add a "view debug log" link in the WP admin bar
View admin-bar-debug-display.php
<?php
/**
* If we requested the log file, grabit and spit it out.
*
* @return HTML
*/
function rkv_adminbar_display_debug_log() {
// Bail without the query string or not on admin.
if ( ! is_admin() || empty( $_GET['viewlog'] ) ) {
@norcross
norcross / dpp-add-nunito.php
Created Apr 21, 2017
add a new font to the Google Fonts array
View dpp-add-nunito.php
<?php
add_filter( 'gppro_webfont_stacks', 'dpp_add_nunito_font', 50 );
/**
* Add the Nunito font to the webfont data stack.
*
* @param array $webfonts The existing data array.
*
* @return array $webfonts The modified data array.
*/
@norcross
norcross / disable-username-login.php
Last active Jul 11, 2017
Force a redirect if a certain username is attempted.
View disable-username-login.php
<?php
add_filter( 'authenticate', 'rkv_disable_username_logins', 20, 3 );
/**
* Disable admin username and redirect to Google (or another site).
*
* @param object $user The WP_User object.
* @param string $username The entered username.
* @param string $password The entered password.
*
@norcross
norcross / remove-avatar-user-table.php
Created Mar 28, 2016
Remove user avatars from the admin user table
View remove-avatar-user-table.php
<?php
add_filter( 'pre_get_avatar', 'rkv_remove_avatar_from_list', 10, 3 );
/**
* Remove the avatars from just the admin user list table.
*
* @param string $avatar HTML for the user's avatar. Default null.
* @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash,
* user email, WP_User object, WP_Post object, or WP_Comment object.
* @param array $args Arguments passed to get_avatar_url(), after processing.
*
@norcross
norcross / social-link-array.php
Last active Feb 25, 2016
Use custom social links
View social-link-array.php
@norcross
norcross / rkv-admin-links.php
Last active Jul 9, 2017
create links in the WP admin bar for development
View rkv-admin-links.php
@norcross
norcross / csv-export-example.php
Created Aug 9, 2015
a basic CSV export example
View csv-export-example.php
<?php
/**
* Devin CSV Export
*
* Contains our export processing
*/
/*
Copyright 2015 Reaktiv Studios
This program is free software; you can redistribute it and/or modify
You can’t perform that action at this time.