Avondale Type Co. Brand Refresh 2016

Avondale Type Co. Banner

Established in 2013, Avondale Type Co. is a design-oriented type foundry based in the Avondale neighborhood of Chicago. ATC’s main goal is to create a community where creatives who share a passion for typography can find the tools they need to solve design problems.

The new brand identity represents a step forward for ATC as they prepare for a busy year of creating and promoting a host of new typefaces and begin work on redesigning their website and e-commerce experience for 2016.

This brand will extend into the new digital experience set to launch June 1 of this year.

Visit Avondale Type Co. or see the new logomark and style in action on Avondale Type Co.’s Instagram.


Posted By
Jason Schwartz

How to Log MySQL Errors in WordPress

MySQL query errors can be difficult to diagnose and correct.

For performance reasons, most MySQL installations fail to retain an error log for posterity; instead, if an error occurs, the reason is passed back to the application during runtime. If that error isn’t captured then and there, it is lost forever.

Development Environments

WordPress contains a special development mode that can be enabled by adding WP_DEBUG, WP_DEBUG_LOG, and/or WP_DEBUG_DISPLAY constants to your configuration. When enabled, PHP errors/warnings/notices and MySQL errors will be logged to wp-content/debug.log and/or printed to the screen.

WordPress’s $wpdb object also provides some debugging functions in case you wanted to debug MySQL issues independently of PHP ones:

  1. $wpdb->show_errors(): this causes MySQL error information to be printed to the screen as it happens. You would call this function before the queries you are looking to debug.
  2. $wpdb->hide_errors(): this reverses the behavior of show_errors() and returns WordPress to its default configuration. You can call this function anytime after executing the questionable queries.
  3. $wpdb->print_error(): this prints the error, if any, from the most recent query.

Production Environments

These tools are probably all you need when developing a new theme or plugin, but you shouldn’t use these under production environments. For one thing, printing random, technical-looking strings in the middle of a document will break the layout and confuse your users. It can also provide interesting information to any bad actors who might be poking around your site. But even if you’re just logging the information, WP_DEBUG_LOG isn’t a great idea: it degrades your site performance and, under most server configurations, exposes way too much information to anyone who knows where to look.

Of course, by the time a site is live, you should have thoroughly debugged everything, so there’s no need to log query failures, right? Well… maybe.

There are a lot of ways to mess up a MySQL query. Chances are, no matter how many times you tested your code during development, you’ll have missed some highly obscure edge case. Even if you didn’t, and everything was coded perfectly, sometimes an update to the WordPress core can subtly change the way a query is structured.

Such a change occurred recently with the release of WordPress 4.4. In prior versions, Null values passed via $wpdb->insert() or the like were typecast according to the type specified. %s would convert a Null value to '', %d to 0, etc. Now, however, Null values are passed as-is to MySQL. For columns with NOT NULL attributes, this can create problems where previously none existed.

So what to do?

Though we were unable to find any documentation, investigation into the WordPress source code revealed that MySQL errors from the current page request are collected in an obscure global variable during runtime, $EZSQL_ERROR.

We can access this variable in a custom PHP function that we then trigger through one of WordPress’ action hooks. Since we want to capture all errors for a given page request, the shutdown action is the best candidate as it triggers just before PHP terminates.

The following example code block does just that. At the end of every WordPress page execution, the function looks to see if any MySQL errors were encountered. If there were any, it combines some basic runtime information (date, page, etc.) with the error details and emails it to the site administrator.

// Database logging - query errors
// email database query errors to the contact
// specified
// @param n/a
// @return n/a

function db_debug_log(){

	//WP already stores query errors in this obscure
	//global variable, so we can see what we've ended
	//up with just before shutdown
	global $EZSQL_ERROR;

	try {
		//proceed if there were MySQL errors during runtime
		if(is_array($EZSQL_ERROR) && count($EZSQL_ERROR)) {
			//build a log entry
			$xout = array();

			//let's start with some environmental information
			$xout[] = "DATE: " . current_time('r');
			$xout[] = "SITE: " . site_url();
			$xout[] = "IP: " . $_SERVER['REMOTE_ADDR'];
			$xout[] = "UA: " . $_SERVER['HTTP_USER_AGENT'];
			$xout[] = "SCRIPT: " . $_SERVER['SCRIPT_NAME'];
			$xout[] = "REQUEST: " . $_SERVER['REQUEST_URI'];
			$xout[] = "\n\n\n\n";

			//and lastly, add the error messages with some line separations for readability
			foreach($EZSQL_ERROR AS $e) {
				$xout[] = str_repeat('-', 50) . "\n" . implode("\n", $e) . "\n" . str_repeat('-', 50);
				$xout[] = "\n\n\n\n";

			//email it!
			//if a plugin overrides the content-type header for outbound emails, change the message body
			//below to nl2br(esc_html(implode("\n", $xout)))
			wp_mail(get_bloginfo('admin_email'), '[' . get_bloginfo('name') . '] DB Error', implode(“\n”, $xout));
	} catch(Exception $e){ }

add_action('shutdown', 'db_debug_log');

If email isn’t desirable, whether for reasons of security or practicality, the general idea could be altered to push data via error_log() or write the contents to any arbitrary log file (preferably in a non-web-accessible location).

These techniques can help make hunting down elusive MySQL errors easier. With a proper record in place, developers can see what went wrong and where, and find a solution more quickly.

Posted By
Josh Stoik

Bright Bright Great Creative Director Jason Schwartz Named One of Newcity’s Design 50 for 2016


Bright Bright Great is excited to announce that our founder and Creative Director Jason Schwartz has been selected as one of Newcity’s Design 50 for 2016.

We’re thrilled to have Jason mentioned among so many other brilliant people who are helping to continually redefine and grow Chicago’s design community, like Theaster Gates and Jeanne Gang, and we’re proud to see what Newcity had to say:

Bright Bright Great is many, many things. The eight-plus-year-old design house founded by Jason Schwartz is known for working with high-profile brands from McDonald’s to the Museum of Science and Industry, but also serves as the umbrella for a variety of artist-driven projects and initiatives intended to, as Schwartz says, “produce beautiful creative.” Among these include the Avondale Type Co., a type foundry that produces custom in-house typefaces and its Avondale Typeface Co. Artist Series, and MLMTR.co, BBG’s in-house photography studio.

Yet it might be TSH—BBG’s traveling conference that connects design professionals to students and aspiring professionals—that undergirds Schwartz’s belief most in using BBG as a platform to “help people create and produce beautiful things.

Read the whole article on Newcity’s website, here.

Posted By
Jason Schwartz

Recommended WordPress Plugins

We’ve worked on hundreds of WordPress sites, and with that we’ve had experience with a great number of WP plugins, as well as written our own.

Over the years we’ve come to trust certain plugins and we end up using them on almost every installation.  This is a list of our go-to plugins that we can wholeheartedly recommend to others:


Apocalypse Meow
Written by our own security expert, Josh Stoik, this plugin is a powerhouse. It has brute-force login protection, minimum password requirements, a history of log-in attempts, email notifications for logins from new locations, and a slew of other security-minded features. It’s the first plugin we install when we set up WordPress.

Look-See Security Scanner
Another plugin by the inestimable Josh Stoik. This plugin acts as a scanner over your WordPress installation to try and detect any malicious or unexpected code. It also analyzes your site and alerts you to measures you can take to batten down your WP installation even further.

Sock’Em SPAMbots
Yet another from Josh Stoik, this plugin gives you a variety of options for blocking SPAM comments, such as honeypots, speed tests, maximum number of links in a comment, and more. SPAMbots plays well with Akismet for even more SPAM fighting power.


W3 Total Cache
This plugin is a must-have for a blazing fast WP site. It has both object, page, and data cache, as well as options for minification and CDNs.


Post Thumbnail Editor
Sometimes the automatically cropped images that WordPress generates are just not quite right. This plugin let’s you manually recrop any image for any particular image size. A godsend for anyone with a particular sense of art direction.

Force Regenerate Thumbnails
If you’re working on an existing installation and add new image sizes, WordPress doesn’t automatically go back through old images to crop them accordingly. This plugin forces all image sizes to be regenerated, so you can be sure all your images, old and new, are properly cropped.

It also deletes image sizes that no longer exist, clearing up some space on your server. One thing to note is that it will blow away any manual crops made with Post Thumbnail Editor. For that reason, we don’t recommend running Force Regenerate Thumbnails on a production environment, only during the development phase when specific art direction crops aren’t likely to have been set up yet.

Content Management

Advanced Custom Fields Pro
THE WordPress plugin that makes leveraging WordPress as a robust and flexible CMS easy as pie. Add custom fields to posts, pages, taxonomy, attachments, almost anything you can imagine. Add that to the variety of field types, as well as all conditional rules you can establish and you have an indispensable plugin. More than anything else, ACF Pro is our desert island plugin.

Simple Page Re-Ordering
If you’re using menu_order to order any of your post types, this plugin allows you to re-order those posts by simply dragging and dropping the posts in the desired order. Super simple and incredibly useful.

Admin Area

Admin Menu Editor
Admin Menu Editor gives you tools to customize the admin dashboard menu. You can add custom links, or hide existing ones. We find it useful for hiding development-related menu items from clients and cleaning up the menus of unecessary clutter.

Admin Columns
This plugin lets you customize columns to post listings in the backend. You can hide existing columns or add new ones, with options like featured image, word count, custom fields, and more. It also has an ACF Pro add on so you can easily map ACF fields to the columns.

Admin Collapse Subpages
If you have a lot of subpages, this plugin is a must. As the name might imply, it provides the ability to collapse subpages so only top-level pages are immediately visible. It makes it much easier to navigate a subpage-heavy backend.


Search Everything
Improves the WordPress search by allowing you to customize exactly where a search looks for matches. You can add search support for custom fields, custom taxonomies, attachments, and more.

While we use other plugins as necessary, we try to keep plugin use to a minimum on any given project to avoid conflicts and instability. The plugins listed here always make the cut because of how useful and reliable they are.

Posted By
Tiffany Stoik

Bright Bright Great Creative Director Jason Schwartz to Keynote AIGA Cleveland 32nd Annual Conference

AIGA Cleveland Annual Conference

Come join the conversation between design professionals and students at our 32nd Annual Conference.

Students, bring your best work and show us what you can do! Network and grow through valuable advice and constructive feedback from industry professionals. Take part in breakout sessions designed to advance your knowledge as you launch into internships and careers. Students of all levels will find something valuable at this event. Register today to add your voice to the dialogue!

Who & What:

All professionals and students are welcome to join us for the Keynote address with Jason Schwartz of Bright Bright Great. Jason crafts engaging experiences intersecting human interaction with technology.

In 2007, Jason founded the Chicago-based brand and strategy agency Bright Bright Great, where he currently acts as Creative Director. Since, Jason has added Avondale Type Co. and Mlmtr to his roster of active brands, acting as Founder/CD.

For over 10 years, Jason has been speaking with young designers, educating to help bridge the gap from education to professional life. In 2014 & 2015 he threw 3 TSH conferences for young designers in San Francisco, Chicago and New York City.

Friday, April 22, 2016

9:00 am – 4:00 pm

Keynote Address
12:00 pm – 12:50 pm

Cleveland State University Wolstein Center
2000 Prospect Ave East,
Cleveland, OH 44115

Early-bird registration ends on April 4, 2016.

Additional information & Tickets

Posted By
Jason Schwartz

BBG Adds Margaux Delapierre to Chicago Office as Brand Strategist

Bright Bright Great is pleased to announce the addition of Margaux Delapierre from Paris, France to our Chicago office for a brand-strategy apprenticeship.

Margaux Delapierre

Margaux will be primarily working with our Research & Strategy team coordinating social media and working with the Avondale Type Co. Artist Series.

“We’re thrilled to have Margaux in the office, having her to help with branding strategy with our brands like Avondale Type Co. and Mlmtr will be a huge help. I look forward to seeing what she can do!”

Nick Lush, Director of Marketing

Margaux loves to travel, having been to Australia, Thailand and Europe during the last year, and we’re happy to have her here in Chicago. Her other interests include skiing, art, indie/folk music and, most of all, her cat Vanille. Welcome her to the team and say hi on Twitter at @margauxdelap.

Posted By
Jason Schwartz