Web Technology

  • A Brief Reunion with WooCommerce

    For the past weeks I got the chance to work with WooCommerce (WC) again. Although the plugin has grown so much, including it’s seamless integration with Stripe, I just noticed one (small) thing. Orders shouldn’t be under WC in the admin menu.

    Current menu structure is this:

     

    In my mind it should introduce order as it’s own parent menu and separate all WC configuration related items:

    I wouldn’t mind few menus popping out there when WC is installed. It’s all about the accessibility of managing my eCommerce store anyway.

  • DDI x WordPress Davao

    To kickoff my year, our local WordPress group was invited to give a talk-workshop to #teamDDI folks at Davao Digital Influencers Inc. It’s a half day event choke-full of user-facing WordPress know-hows directed to those who aspire to blog with WordPress. There will be a blog post coming up in the official WordPress Davao blog.

    Here’s my slide to my talk Supercharge Your Blog with WordPress:

    (adding the slides URL here soon)

    References

    Here are the things I mentioned in the talk that reference to plugins and sites:

  • Welcome to WordPress

    One of our local WordPress group members asked how to begin and where to start learning WordPress. I thought it was just a simple question. But somehow I looked around and as someone who has a bit of experience with this platform, where would I direct those who are starting out?

    If you have a bit of budget for trainings:

    My personal bookmarks:

    Lastly…

    And by the way, welcome to WordPress ❤

  • Purge Varnish Cache on Save

    In case, someone out there trying to figure out how to purge varnish (3.x) cache in your WordPress site when updating a post/page — I’ve dealt with it this week and it’s pretty easy to accomplish it.

    Now that we’re talking about purging the cache, I presumed you have varnish configured and all your setup works. To start off, if there’s no definition of purging in your vcl file, you might want to add them — https://www.varnish-cache.org/docs/3.0/tutorial/purging.html. Remember to sudo service varnish restart after modifying the file so the changes will take effect.

    Now in your ever lovely WordPress:


    /** * Purge Varnish cache on save * * @param int $post_id Post ID. */ function awesome_save_post( $post_id ) { wp_remote_request( esc_url( get_permalink( $post_id ) ), array( 'method' => 'PURGE' ) ); // Or store the response if you'd like to verify it further. } add_action( 'save_post', 'awesome_save_post' );

    You can pop that in in your code if you only need to invalidate cache for content. For a verbose invalidation such as commenting or deleting an item and when changing themes, checkout Varnish HTTP Purge that is readily available in WordPress plugin repo.

  • First WordCamp

    I’m finally going for my first ever WordCamp. Not only I am attending, but I’ll give a talk as well. In WordCamp Singapore, you will hear me talk about the advantages of utilizing WordPress hooks. How they can massively help pushing features into a large codebase/theme become almost a cinch. When is the best time to add a hook and where you can usually best place a hook. Ultimately, I hope to give you an idea on how actions and filters work in the WordPress ecosystem.

    Please checkout the WordCamp Singapore site for other amazing talks and schedule — https://2016.singapore.wordcamp.org/

  • Watch #WCEU 2016

    For those who missed the live-stream of WordCamp Europe 2016 or missed several talks, you can watch the recorded videos right in the #WCEU 2016 official website.

    http://2016.europe.wordcamp.org/schedule/track-1-livestream/

    First time I joined the event, although virtually, but I had a ton of learning out of watching several speakers talks. It’s amazing to know how these super talented people collaborate for this beautiful thing called WordPress to grow.

    If you can’t watch all the videos, I suggest these topics a.k.a the ones I’ve watched:

    Honestly, I think almost all the talks are worth watching. I’d definitely go back and watch those that I missed.

  • Updated ACF Enhanced Message Field

    I’m not sure when was the last time I touched this WordPress plugin but nonetheless, i’ve finally got some time to work on several updates. And below are the list of changes that you’ll find in 1.1.0:

    • Compatible with ACF 4.4.6 and ACF Pro 5.3.7
    • Prevent class conflict if this plugin is already added directly in your plugin/theme.
    • Fix: Prevent style being printed in JSON export

    You know the drill when an update is available 🙂

  • WordPress 4.5 is coming up

    WordPress 4.5 is coming up! Peruse this guide for the developer-focused changes  https://make.wordpress.org/core/2016/03/30/wordpress-4-5-field-guide/.

    Pay attention to Backbone and Underscore being updated. Might break your scripts (e.g Add button in media library #35853), so make sure to test your code. While you’re at it, it’s even better to test other parts of your plugins and themes with the rest of the changes included in this release. 🍷

  • Golden `–no-ff` rule

    There’s a huge difference between merging master into feature and merging feature into master. So please for those who’s starting learning git – don’t ever make the mistake I made. Don’t disregard the use of --no-ff. In my case, I didn’t disregard it completely, though. I missed adding the flag as I perform git in terminal.

    One easy way so you’ll never have to type it again and run the risk of missing it is update your global git config:

    git config --global merge.ff false
    

    When merge.ff is set to false, this always creates an extra merge commit, thus it is equivalent to adding --no-ff flag.

    One golden use case:

    When you revert to your merged IN master, this commit reference is the one you revert to to pull out the changes from your feature.

  • Downgraded

    Following the guide How To Downgrade Droplets, I have successfully downgraded my server in Digital Ocean. As every other guide, the scenario is almost always not exactly the same so I did my part of researching to resolve issues that have arised along the way.

    I’d like to note important things tailored to my needs that the guide never mentioned.

    • Export the database manually. The guide only covers copying of the files, not the database. When you have the exported file, use it to bring back the database into the new/smaller droplet.
    • Re-install openssh-server if you encounter close connection.
    • Purged and re-install mysql when couldn’t connect to local MySQL server.
    • Indeed, pay attention to warnings when reading!!
    • Overused command ssh-keygen -R [hostname]:port

    My expertise isn’t lie on system or server administration but I certainly enjoy doing this stuff every once in awhile. But man, it’s hot. Don’t play with it unless you’re ready to get burned!