Category Archives: Technology

The Making of a WordPress Event

Planning a large event or series of smaller events is a lot of work. I learned this by experience recently. More on that later.

But all that work is totally worth it. WordPress is WordPress because of the community that builds it, builds with it, designs, supports, promotes, and does everything else with it. This community has been mostly ad hoc, but this year we are focusing in a big way on organizing the organizing of the community. We are putting together a ton of stuff to help out organizers.

If you are an organizer, and would like to help other organizers, the place to go is: http://make.wordpress.org/events/. The time is now. We need you, and deep down inside, you know that you need us too. ūüôā

A Simpler Semantic Assertions Data Model

I have been thinking about Semantic Assertions for several years. It is easy to let things get complex fast.

Currently, I am looking at a very simple data module. With what could have been additional fields being additional rows instead. Hopefully this will work out to make querying faster.

First, every tag instance must have an instance_id, a tag, and a tagged_instance. The tagged_instance itself points to another tag instance that the first instance is modifying/clarifying/defining/grouping or it points to a tag instance with an tagged_instance of zero which is a terminal tag at least within that system. It could however be a link to tags stored in other systems.

So the default mode becomes tagging of tagging instances. The exception, a tagged_instance of 0 covers traditional tagging and tagging of tags. For traditional tagging, the target (typically a url) gets assigned a number first on a row with a tagged_instance of 0 and the target url in the tag field, then that instance is tagged. Tags also are defined with a tag instance that has a tagged_instance of zero, but are combined with plain text in the tag field. Taggers are simply a select set of tags that are tagged with a specially designated tag.

There are a lot pieces that I left out for this round. Hope to write about this again soon.

MAMP, Xdebug, PEAR and a Few Other Acronyms

MAMP is seriously awesome, it comes preinstalled with just about everything you could need for PHP development. But a lot of the power of MAMP is hidden under a thin layer of nearly incomprehensible options files.

To help myself next time I have to setup a dev environment, and to help you if you happen to find yourself in the same situation, here are a few helpful hints.

First, a handy article on what xdebug is and how to use it. http://tanc.me/blog/2011/your-typical-xdebug-primer-osx

If you are running MAMP Pro, which I kinda like, then you have to go to different place to edit that php.ini file he talks about. This article will help with that http://geek.michaelgrace.org/2011/08/xdebug-cachegrind-and-mamp-on-mac-osx/.

Next to get PHPUnit up and running I discovered here https://bigdiver.wordpress.com/2011/11/10/mamp-2-0-pear-and-phpunit-installation/ and http://stackoverflow.com/questions/5510734/install-pear-on-mamp that I needed to install PEAR.

I tried http://www.lullabot.com/articles/installing-php-pear-and-pecl-extensions-on-mamp-mac-os-x-107-lion first, but I got a little stuck at this point. Got the error: Could not get contents of package “/Applications/MAMP/bin/php/php5.4.4/bin/pear”. Invalid tgz file.

This article, by a friend actually, suggested running all the commands from the root folder. http://jaco.by/2012/02/14/phpunit-mamp-pro-2-0-netbeans-7-1-os-x/ I had been typing each command from inside /Applications/MAMP/bin/php/php5.4.4/bin/

That seemed to do the trick but I also did pear config-set auto_discover 1 as suggested here http://www.webcomm.com.au/blog/2012/09/how-to-setup-php-5-4-with-pear-pecl-phpunit-on-mac-os-x-10-8-mountain-lion-with-mamp-mamp-pro. Between the two, I now have PHPUnit installed.

List of Hooks in WordPress Core JavaScript

As promised quite a while ago (better late than never), here is a list of all trigger style hooks in WordPress core JavaScript.

These demonstrate a wide variety of approaches to adding hook in JavaScript. A few of these may not really fit well into the list but I include them in for completeness.

  • [autosave.dev.js:325] jQuery(document).triggerHandler(‘wpcountwords’, [ post_data[“content”] ]);
  • [controls.js:731] triggerCallback: function(cbName, arg) {
  • [customize-base.dev.js:296] this.trigger( ‘add’, value );
  • [customize-base.dev.js:321] this.trigger( ‘remove’, value );
  • [customize-base.dev.js:377] this.parent.trigger( ‘change’, this );
  • [customize-base.dev.js:547] this.trigger( message.id, message.data );
  • [customize-controls.dev.js:714] api.trigger( ‘save’, request );
  • [customize-controls.dev.js:739] api.trigger( ‘saved’ );
  • [customize-controls.dev.js:811] api.trigger( ‘activated’ );
  • [customize-controls.dev.js:952] api.trigger( ‘ready’ );
  • [customize-loader.dev.js:42] this.window.triggerHandler( ‘hashchange’ );
  • [customize-loader.dev.js:114] this.trigger( ‘open’ );
  • [customize-loader.dev.js:126] this.trigger( ‘close’ );
  • [customize-preview.dev.js:75] preview.trigger( ‘settings’, api.settings.values );
  • [customize-preview.dev.js:88] preview.trigger( event, args );
  • [editor.dev.js:220] jQuery(‘body’).trigger(‘beforePreWpautop’, [o]);
  • [editor.dev.js:223] jQuery(‘body’).trigger(‘afterPreWpautop’, [o]);
  • [editor.dev.js:233] jQuery(‘body’).trigger(‘beforeWpautop’, [o]);
  • [editor.dev.js:236] jQuery(‘body’).trigger(‘afterWpautop’, [o]);
  • [post.dev.js:622] $(document).triggerHandler(‘wpcountwords’, [ co.val() ]);
  • [post.dev.js:631] $(document).triggerHandler(‘wpcountwords’, [ co.val() ]);
  • [thickbox.js:165] if ( ! jQuery(document).triggerHandler( ‘wp_CloseOnEscape’, [{ event: e, what: ‘thickbox’, cb: tb_remove }] ) )
  • [thickbox.js:256] if ( ! jQuery(document).triggerHandler( ‘wp_CloseOnEscape’, [{ event: e, what: ‘thickbox’, cb: tb_remove }] ) )
  • [thickbox.js:278] jQuery(“#TB_window”).fadeOut(“fast”,function(){jQuery(‘#TB_window,#TB_overlay,#TB_HideSelect’).trigger(“tb_unload”).unbind().remove();});
  • [wp-fullscreen.dev.js:245] $(document).triggerHandler(‘wpcountwords’, [ content ]);
  • [wp-fullscreen.dev.js:563] if ( ! jQuery(document).triggerHandler( ‘wp_CloseOnEscape’, [data] ) )
  • [wp-fullscreen.dev.js:589] $(document).triggerHandler(‘wpcountwords’, [ txtarea.val() ]);
  • [wp-lists.dev.js:132] $(list).trigger( ‘wpListAddEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:187] $(list).trigger( ‘wpListDelEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:191] $(list).trigger( ‘wpListDelEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:271] $(list).trigger( ‘wpListDimEnd’, [ s, list.wpList ] );
  • [wp-lists.dev.js:275] $(list).trigger( ‘wpListDimEnd’, [ s, list.wpList ] );
  • [wplink.dev.js:348] if ( ! $(document).triggerHandler( ‘wp_CloseOnEscape’, [{ event: event, what: ‘wplink’, cb: wpLink.close }] ) )
  • [wplink.dev.js:466] this.element.trigger(‘river-select’, [ li, event, this ]);

Open-Source Universal Data and Power Interface

The open-source universal data and power interface (OSUDAPI) is a small magnetically coupled connection type that uses fiber-optics at the point of transfer for data and also has two dedicated pins for ac or dc power transfer that is negotiated by the data channel before power tranfer begins.

This connection type replaces all home and auto power outlets coming in two household sizes and a third¬†industrial¬†size to accomodate higher power transfer rates. The same protocol can also be used for gasoline pumps at fuel stations to ensure that only the correct fuel type is dispensed. It can also be used¬†in medical facilities for IV’s and in any other situation where ensuring the right connection is essential.

The data specifications remain the same for all sizes. This data connection type replaces USB, Thunderbolt, audio jacks, VGA, HDMI, RCA, and essentially all other data cables, including SCSI and other cables that are typically internal to the computer.

This enables using the same cable for serial, parallel, analog and power, but could easily lead to confusion with multiple wires in use all with identical heads. So these cord have a matching serial number printed at each end as well as two to four multi-colored strips of varying widths that provide over 1000 different easily distinguishable patterns so you can easily trace cords.

For each cord that is plugged in the devices perform a handshaking routine through the data channel to determine the capabilities of the device at the other end. For example, a phone is plugged into a power-source the phone sends info that it is able to both send and receive power at certain specs, but that it is currently low on power. The power source then responds that it can provide power. Later a headset is plugged into the same port and the phone send the same info, but the headset responds that it requires power but can provide audio input and output.

The physical make-up of the connector is such that magnetic portion is male on the left and female on the right. So that either end of a cord can be plugged into any port simply by rotating correctly, and any two devices can be connected.

The data and power transfers that any pairing is capable of is determined by the handshaking process. For devices that are not powered or have fully drained batteries. The handshaking protocol specifies that a small amount of power should be provided if no response is made to initial requests. This enables even non-powered devices to handshake.

As part of the roll-out of this connection type, adapters for every type of connection will be sold. The more popular ones will be sold in kits. Adoption will be accelerated by using the profits from the sale of adapters to subsidize the switching costs for manufacturers.