• Skip to primary navigation
  • Skip to main content
  • Skip to footer
  • Store
  • Support
  • Theme Documentation
  • My Account
  • Cart

9seeds

Building Custom WordPress Solutions | Plugin Development

 
  • Custom Development
  • Themes
  • Plugins
  • About
  • Contact
  • Blog

Jon Brown

The tools you use, the way you want. Wrapping Help Scout in Nativefier

Posted on July 15, 2016

One of the things we love about WordPress is that it lets us affordably build custom functionality into business’ websites that not long ago would have required tens if not hundreds of thousands of dollars invested in custom software development costs. Which is to say we think people should be able to have software their way.

Wrapping Slack “Making WordPress” in Nativefier

wp-core-slack-900x900In that vein I was delighted when Jason Cosper wrote last week about using Nativefier to create a mini app for the Making WordPress Core Slack Team.

Like so many businesses these days we use and have quickly come to rely heavily on Slack for our internal team communications. Increasingly however we’re also using it for external communications to keep in touch with specific groups, largely in the tech space but outside it as well.  I’ve heard of families starting their own Slack Team just to keep in touch.

Personally I belong to 14 Slack Teams: 5 WordPress groups, 7 non-WordPress technology and local community groups, 2! groups dedicated to just to coffee and a few others. It’s crazy.

One of those WordPress groups is “Making WordPress”, which is a massively huge group of over 10,000 members. It’s a vital communication channel though for everyone involved in the broader WordPress Community. Everything from Core development to organizing WordCamp events to updates to the WordPress.org website to securirty alerts gets discussed there.

Less to it’s core mission it’s both a great way to keep in touch with friends made at WordCamps as well as a great back channel between agencies working in the WordPress space.

Jason Cosper discovered the cause of something that had been driving me crazy the last few months with the native Slack app though.  It had become extremely unstable It was frequently crashing and taking up 100% cpu. That’s really frustrating when it’s something you rely on nearly every minute of your work day.

It turns out a big cause of that was including “Making WordPress” and it’s 10,000+ members in the native app. Jason removed that channel and wrapped it up in it’s own desktop web app using a new tool called Nativefier. It’s much like Fluid and what we called an SSB (Site Specific Browser) apps if you ever used those back in the day.  Since removing Making WordPress from my native Slack app, like Jason, I’ve found it to be much snappier and hasn’t crashed once.

The now isolated Nativefier app version of Making WordPress still gives me critical desktop notifications of direct messages, plus has the added benefit of staying out of my way most of the day. As you might imagine with 10,000+ members it can be a bit noisey.  It’s a win win.

Wrapping Helpscout Making WordPress in Nativefier

Nativefier-Help-ScoutIt occurred to me I could do the same thing with a few websites I like to keep open all the time. Starting with Help Scout which we use for tracking and responding to plugin support requests.

Steps for Mac OS X

Step 1:
Install Nativefier.

Ok, it’s a bit more complicated. You need to have Node NPM installed first, but if you’re a developer of any kind you probably already do have that. Then just at the command line:
npm install nativefier -g

Step 2:

Wrap up a web page in Nativefier, I did this in ~/Applications and then moved it to /Applications.

nativefier --name "Help Scout" "https://secure.helpscout.net"

Step 3 (optional):

It’ll grab the favicon by default, but his is often low res and ugly.  Replace it with a nicer icon.

I used https://iconverticons.com/online/ to convert a Help Scout PNG I scrped from their site into the ICNS format I needed for the dekstop app.  You can grab them here for Help Scout if you want: https://iconverticons.com/icons/93a786b5f69feea3/ or create your own.

Final Step:

Right click on the new app and select Open. You’re going to need to right click open on it the first time because it’s not an officially signed by Apple app, but you created it so you can probably decide trust it when the pop-up warning about it being untrusted comes up.

Now if the < 5 minutes it takes to go through those steps yourself is too much, or you don’t have NPM installed, or if your command line shy.  You can download my Nativefier wrapped up app of the Help Scout website here: Nativefier – Help Scout.

 

I can imagine others using this for Gmail, Calendars, all sort of things…  Let us know what you’ve used it for in the comments!

Continue Reading

Jon Brown

    More by Jon Brown

    Creating a WordPress User when you don’t have an existing admin login to use

    Posted on August 3, 2015

    A long time ago we wrote a post on how to insert yourself into WordPress as an admin that has been very popular.

    Just to be clear, this won’t help you hack a WordPress site. You have to have some kind of server level access to make use of any of these, but in our work we often have scenarios where we only have access to a server.

    There are 3 quick ways to create a WordPress user from outside the WordPress dashboard.

    Creating a WordPress user with WP CLI USER CREATE

    My new favorite way is using WP CLI.  This requires that WP CLI is installed on the server, but recently WP Engine started rolling out WP-CLI Support to Select Partners for Beta Testing.  

    It’s not just a WP Engine thing though, a few other hosts provide WP CLI support via shell access and if you’re running on your own server you can install it.  You’re not likely to be able to install this yourself on shared hosting.

    Assuming you do have access to WP CLI it’s as easy as SSH’ing into your server or using the WP Engine portal, and typing

    wp user create name [email protected] --role=administrator

    You can specify a password with –user_pass=”Password!” or if you don’t it’ll create a random and very secure password for you!

    Create-User-WP-CLI

    Create a WordPress user via MySQL

    If you don’t have SSH access and WP CLI already installed the next quickest way is to insert a user via MySQL.

    Here is the code snippet you can use, hopefully it’s obvious that you should replace the login, pass and email on the first 3 lines with your own. Otherwise, you’ll be giving us, and everyone that reads his post access to your site.

    SET @user_login := '9seeds';
    SET @user_pass  := 'muDAy2CUcTcuPnyCBXfqJysD';
    SET @user_email := '[email protected]';
    
    INSERT INTO `wp_users` 
    (`user_login`, `user_pass`, `user_email`, `user_registered`) 
    VALUES 
    (@user_login, MD5(@user_pass), @user_email, now());
    SELECT @user_id := LAST_INSERT_ID();
    INSERT INTO `wp_usermeta` 
    (`user_id`, `meta_key`, `meta_value`) 
    VALUES 
    (@user_id, 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}');
    INSERT INTO `wp_usermeta` 
    (`user_id`, `meta_key`, `meta_value`) 
    VALUES 
    (@user_id, 'wp_user_level', '10');
    

    Most hosts include PHPMyAdmin so you can just jump into there, select the database you want to insert a user into, then go to the SQL tab and paste this code in. Don’t forget to edit the values on the first three lines before clicking the Go button to run the SQL query.

    Create-User-MySQL

    Create a WordPress user via FTP

    This used to be my favorite way because often all the access I was given to a site was FTP access and I was less comfortable with MySQL then I am these days. Still it’s easy and reliable, especially if running running MySQL commands scares you.

    You simply FTP to root directory of the site you need access to and create a new empty PHP file (or just “duplicate” an existing file and clear it out, that’s fine too).

    Open up the file and insert the PHP code below. Again be sure you change the user, pass, and email values and save the edits to the file. Then, visit the file in web browser.  You should get a ‘Success!’ message.

    Once you’ve run the file once you should delete the file just to be safe.

    <?php
    /**
     * Script to create administrator user in WordPress
     *
     * @package none
     * @link https://9seeds.com/creating-a-wordpress-user-when-you-dont-have-an-existing-admin-login-to-use/
     */
    
    $s9_password = 'PASSWORD';
    $s9_username = '9seeds';
    $s9_email    = '[email protected]';
    
    if ( 'PASSWORD' === $s9_password ) {
    	die;
    }
    
    require_once 'wp-blog-header.php';
    
    if ( ! username_exists( $s9_username ) && ! email_exists( $s9_email ) ) {
    
    	$user_id = wp_create_user( $s9_username, $s9_password, $s9_email );
    
    	if ( is_int( $user_id ) ) {
    		$wp_user_object = new WP_User( $user_id );
    		$wp_user_object->set_role( 'administrator' );
    		echo 'Success!';
    	} else {
    		echo 'Error with wp_insert_user. No users were created.';
    	}
    } else {
    
    	echo 'This user or email already exists. Nothing was done.';
    
    }
    
    

    That is it!  3 fairly easy ways to create a WordPress user when you don’t already have administrator level access to the WP dashboard.

    Continue Reading

    Jon Brown

      More by Jon Brown

      Pretty PHP Date Ranges

      Posted on December 28, 2013

      Pretty PHP Date Ranges

      Last week I needed to come up with a way to display a pretty date range based on a starting and ending date in PHP. It’s simple enough use PHP’s date function to convert a unix timestamp into a pretty date format, but PHP doesn’t have a built in function to format date ranges.

      The goal was to take two unix time stamps and output a range that looks like this:

      January 25 – 26th, 2014

      This sounds and is simple until you take into account that sometimes it crosses months and needs to look like this:

      January 25 – February 2nd, 2014

      or could cross years like this:

      December 25th, 2013 – January 3rd, 2014

      So here is the code to build those prettified date ranges:

      
       * @since 1.0
       */
      
      function jb_verbose_date_range($start_date = '',$end_date = '') {
      
          $date_range = '';
      
          // If only one date, or dates are the same set to FULL verbose date
          if ( empty($start_date) || empty($end_date) || ( date('FjY',$start_date) == date('FjY',$end_date) ) ) { // FjY == accounts for same day, different time
              $start_date_pretty = date( 'F jS, Y', $start_date );
              $end_date_pretty = date( 'F jS, Y', $end_date );
          } else {
               // Setup basic dates
              $start_date_pretty = date( 'F j', $start_date );
              $end_date_pretty = date( 'jS, Y', $end_date );
              // If years differ add suffix and year to start_date
              if ( date('Y',$start_date) != date('Y',$end_date) ) {
                  $start_date_pretty .= date( 'S, Y', $start_date );
              }
      
              // If months differ add suffix and year to end_date
              if ( date('F',$start_date) != date('F',$end_date) ) {
                  $end_date_pretty = date( 'F ', $end_date) . $end_date_pretty;
              }
          }
      
          // build date_range return string
          if( ! empty( $start_date ) ) {
                $date_range .= $start_date_pretty;
          }
      
          // check if there is an end date and append if not identical
          if( ! empty( $end_date ) ) {
              if( $end_date_pretty != $start_date_pretty ) {
                    $date_range .= ' - ' . $end_date_pretty;
                }
           }
          return $date_range;
      }
      

      Also available on GitHub/Gist here.

      To actually use that in WordPress you’d just add something like this in your template file where you wanted to output the date, here based on two custom field values.

      ';
           echo jb_verbose_date_range( $start_date , $end_date );
           echo '';
      }
      
      Continue Reading

      Jon Brown

        More by Jon Brown
        • Prev
        • Page 1
        • Interim pages omitted …
        • Page 3
        • Page 4
        • Page 5

        Footer

        Get in Touch

        • New Project Inquiry
        • Product Support and General Inquiry
        • Store Purchase Terms and Conditions
        • Store FAQ
        • Cookie Policy
        • Privacy Policy

        Our Services

        • Custom WP Development
        • Theme Store
        • Plugin Store

        WordPress Plugins for Sale

        • Time Tracker
        • Authorize.net SIM Gateway

        WordPress Plugins for Free

        • Simple Calendar
        • WP Chargify
        • Facebook
        • Twitter
        • LinkedIn
        • WordPress
        • GitHub

        Copyright 2025 | 9seeds, LLC

        Like nearly all websites this one uses cookies too. Like most users we think consent banners like these are a dumb solution, but it's what we've got until new laws are passed. We use cookies on our website for remembering your preferences, for example if you're logged in or what is in your cart. We also use 3rd party cookies for analytics so we know what pages on the site are most popular. By clicking “Accept”, you consent to the use of ALL the cookies.
        Do not sell my personal information.
        Cookie SettingsAccept
        Manage consent

        Privacy Overview

        This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience and may even preclude you being able to login to the website.
        Necessary
        Always Enabled
        Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
        CookieDurationDescription
        __stripe_mid1 yearThis cookie is set by Stripe payment gateway. This cookie is used to enable payment on the website without storing any patment information on a server.
        __stripe_sid30 minutesThis cookie is set by Stripe payment gateway. This cookie is used to enable payment on the website without storing any patment information on a server.
        cookielawinfo-checkbox-advertisement1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category .
        cookielawinfo-checkbox-analytics1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Analytics" category .
        cookielawinfo-checkbox-necessary1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Necessary" category .
        cookielawinfo-checkbox-others1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to store the user consent for cookies in the category "Others".
        cookielawinfo-checkbox-performance1 yearSet by the GDPR Cookie Consent plugin, this cookie is used to store the user consent for cookies in the category "Performance".
        Functional
        Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
        Performance
        Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
        Analytics
        Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
        CookieDurationDescription
        _ga2 yearsThe _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors.
        _gid1 dayInstalled by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously.
        CONSENT2 yearsYouTube sets this cookie via embedded youtube-videos and registers anonymous statistical data.
        Advertisement
        Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
        CookieDurationDescription
        VISITOR_INFO1_LIVE5 months 27 daysA cookie set by YouTube to measure bandwidth that determines whether the user gets the new or old player interface.
        YSCsessionYSC cookie is set by Youtube and is used to track the views of embedded videos on Youtube pages.
        yt-remote-connected-devicesneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
        yt-remote-device-idneverYouTube sets this cookie to store the video preferences of the user using embedded YouTube video.
        Others
        Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
        CookieDurationDescription
        cookielawinfo-checkbox-functional1 yearThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
        SAVE & ACCEPT
        Powered by CookieYes Logo