Develop an Android App with React Native & Publish on Google Play

Original Source:

Long-scroll mobile illustration

This article was originally published on the Okta developer blog. Thank you for supporting the partners who make SitePoint possible.

As mobile app usage is expected to continue to grow, now is as good a time as any to get into the market. Android is by far the most popular OS worldwide and the dominant way to get Android apps to phone users is the Google Play Store. In this tutorial, you’ll build a React Native app and I’ll walk you through everything from how to pick a design, as well as setting up your React Native environment, tips for getting the most out of your editor, and publishing it on Google Play.

This is what the eventual app will look like:

Final Result

For this tutorial, I checked out Karan Goel’s Mega Project List for project inspiration. You’ll be building the Prime Factorization problem which takes a number and returns its prime factors.

Determine Interface Theming for Your React Native App

Outside of application logic, UI and theming decisions are some of the most important that you’ll make for your app This includes the controls like dropdowns and buttons, as well as the layout on the screen. Since we are using a React-based technology, we’re going to use Styled Components which is a popular, light-weight approach to theming React applications (and it also works great on React Native). There’s an entire page listing components and component-systems based on Styled Components. In this tutorial, you’ll be using Styled Components to build up components yourself.

Set Up Your Android Production Environment

In order to build the eventual APK (the format of the app you’ll upload to the store), you need to install Android Studio. Once done make sure you have SDK version 27 as this is what React Native uses.

Install the JDK

You also need to make sure you have a recent Java Development Kit installed (like version 8). The installation differs depending on your platform. You can use Oracle’s Java SDK or use SDKMAN to install other options, like OpenJDK.

Add the React Native CLI and Initialize the Skeleton

Next, you should install the React Native Command Line Interface. For this, you should make sure you have Node installed which varies depending on your operating system. (I am using version 8.12.0).

npm install -g react-native-cli@2.0.1

You should have a command react-native available to you, which includes the init option.

react-native init prime_components

This will create the prime_components directory and put a React Native project inside, with a runnable skeleton. Change to the directory, connect your Android phone or run an emulator (after having installed Android Studio), and run the project.

NOTE: If Android Studio prompts you to open a project before you can create an emulator, you can point to the prime_components/android directory.

cd prime_components
react-native run-android

Welcome to React Native

To see the output you’ll upload to the Play Store, go to android/app/build/outputs/apk/debug. You should see an app-debug.apk that is around 8MB in size.

Reduce the Output Size of Your Android App

You want to make sure your users have the smallest download possible. It’s already quite small (around 8MB) because you’re using the command line (something like Expo produces 25MB for even basic apps) but we can reduce it further. Go to android/app/build.gradle and change the following variables to be true:

def enableSeparateBuildPerCPUArchitecture = true
def enableProguardInReleaseBuilds = true

You’ll also have to remove the ndk section of defaultConfig to removing the conflicting configuration in ndk abiFilters error:

ndk {
abiFilters “armeabi-v7a”, “x86”

Now after re-running react-native run-android you should see two (much smaller – between 4MB and 5MB) APKs in the output directory.

Add Linting to Your React Native App

Writing any JavaScript (like React) requires tools to ensure you haven’t made any obvious mistakes which can be a big help for beginners. The most common of these is ESLint which can be plugged right into your project and editor.

First, add the linter using NPM:

npm install -D eslint@5.9.0 babel-eslint@10.0.1

One common set of plugins is Airbnb’s configuration so add those too:

npm install -D eslint-config-airbnb@17.1.0 eslint-plugin-jsx-a11y@6.1.2 eslint-plugin-react@7.11.1 eslint-plugin-import@2.14.0

Now put the following into .eslintrc.js (you’ll need to create this file):

module.exports = {
‘extends’: ‘airbnb’,
‘parser’: ‘babel-eslint’,
‘env’: {
‘jest’: true,
‘rules’: {
‘no-use-before-define’: ‘off’,
‘react/jsx-filename-extension’: ‘off’,
‘react/prop-types’: ‘off’,
‘comma-dangle’: ‘off’
‘globals’: {
“fetch”: false

Now you just need to add the plugins to your editor. For Sublime there’s ESLint which gives you an output of errors (or issues) with CTRL + ALT + e (Cmd + Option + e on Mac). There also one for VSCode.


A lot of these errors can be fixed automatically using the eslint –fix command which you can run from your editor with the ESLint Fix package.

Add Styled Components for React Native

React and React Native build interfaces using web technologies, i.e. HTML, CSS, and JavaScript. One very popular library to use with React (and React Native) is Styled Components which clean up how one adds CSS to your components.

For example, take a look at the following code, taken from the React Native sample app (which is what you get with react-init):

export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: ‘center’,
alignItems: ‘center’,
backgroundColor: ‘#F5FCFF’,
welcome: {
fontSize: 20,
textAlign: ‘center’,
margin: 10,
instructions: {
textAlign: ‘center’,
color: ‘#333333’,
marginBottom: 5,

You declare your DOM elements (View, Text), linking them to styles, and then create the stylesheet later.

With Styled Components you would do the following:

const Container = styled.View`
flex: 1;
justify-content: center;
align-items: center;
background-color: #F5FCFF;

const Welcome = styled.Text`
fontSize: 20;
text-align: center;
margin: 10;

const Instructions = styled.Text`
text-align: center;
color: #333333;
margin-bottom: 5;

export default class App extends Component<Props> {
render() {
return (
<Welcome>Welcome to React Native!</Welcome>
<Instructions>To get started, edit App.js</Instructions>

It’s both cleaner and more portable (CSS names don’t clash, etc.).

To install it, run npm install styled-components@4.1.1 from the root directory.

Add Custom Fonts to Your React Native App

To get a custom font like Racing Sans One into your application you first need to download the ttf and put it into assets/fonts (you will need to create this directory). Then add the following to your package.json:

“rnpm”: {
“assets”: [

Finally run react-native link from the command line. You should now see your font inside of android/app/src/main/assets/fonts. You should be able to use it now. Create a components folder and put the following inside of components/Header.js:

import styled from ‘styled-components/native’;

export default styled.Text`
color: black;
font-family: RacingSansOne-Regular;
font-size: 32px;
margin-top: 120px;
background-color: transparent;
text-align: center;

Then, import this into your App.js and add <Heading>Welcome</Heading> above the Text nodes:

import Header from ‘./components/Header’;

export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>

And you should get a nicely formatted header:

Custom fonts

Adjust Your App to be Fullscreen on Android

To get your app to not show the title bar, go to android/app/src/main/res/values/styled.xml and add the following inside the <styles> element:

<item name=”android:windowFullscreen”>true</item>

Now when you re-run you should see the navigation bar is gone.

Create the Android App Components

It can take a long time to decide on a final design, with layout, colors, and fonts. This is often an iterative process. Here you’ll go through how to build up the final result you saw at the start – which was inspired by related online tutorials and styling examples – but remember that it takes time to get to something you like.

Change App.js to the following:

import React from ‘react’;
import { Container, Header, Input, Keypad, ButtonRow } from ‘./components’;

const App = () => (
<Header>Prime Components</Header>
<ButtonRow keys={[‘1′,’2′,’3’]} />
<ButtonRow keys={[‘4′,’5′,’6’]} />
<ButtonRow keys={[‘7′,’8′,’9’]} />
<ButtonRow keys={[‘0′,’Clear’,’Go’]} />

export default App;

You can see here how clean things are with Styled Components. We have a header, an input and a keypad (all names you choose) all surrounded by a container. No superfluous information. The styling happens in the components.

Create the components directory. Inside components/index.js put the following:

export { default as Input } from ‘./Input’;
export { default as Container } from ‘./Container’;
export { default as Header } from ‘./Header’;
export { default as Keypad } from ‘./Keypad’;
export { default as Button } from ‘./Button’;
export { default as ButtonRow } from ‘./ButtonRow’;

This is just a convenience module that allows for the importing as in App.js, i.e. ` import { Container, Header, Input, Keypad, ButtonRow } from ‘./components’;`. Otherwise, you’d have to import each component on a separate line.

Put this into components/Container.js: (Note: you must use capital letters for your components in React Native!)

import styled from ‘styled-components/native’;

export default Container = styled.View`
flex: 1;

Very simple: you are extending a View component and assigning a flex value of one (which in this context means “take up everything”).


import styled from ‘styled-components/native’;

export default Header = styled.Text`
flex: 1.5;
font-size: 80px;
font-family: Chathura-ExtraBold;
background-color: rgb(29, 31, 33);
color: gold;
text-align: center;

Also, a styled text component, with large, centered fonts, a gold color, and grey background. Make sure you install the Chathura font from Google Fonts as before!


import styled from ‘styled-components/native’;

export default Input = styled.Text`
flex: 2;
text-align: right;
font-family: Audiowide-Regular;
text-align-vertical: center;
font-size: 70;
color: firebrick;
background-color: gold;

Similar to before except now with the Audiowide-Regular font (also available from Google Fonts).


import styled from ‘styled-components/native’;

export default Keypad = styled.View`
flex: 6;
background-color: rgb(29, 31, 33);
padding-top: 10px;
padding-bottom: 10px;

Also just a styled view (essentially a container like a <div> in HTML).


import React from ‘react’;
import styled from ‘styled-components/native’;
import { Button } from ‘.’;

const RowBox = styled.View`
flex: 1;
flex-direction: row;

export default ButtonRow = ({keys}) => (
{ /* */ }
{ => (
<Button text={key} key={key} />

Here, things get complicated. You are importing a Button from the current directory (which you’ll create in a second), creating a component called RowBox which is not exported, and then ButtonRow is defined having a React property called keys.

Then you are mapping each key to a button component. This is a clean way of looping through an array as with for each and using the value to set both the text and key attributes (you must set a key attribute to make the DOM object unique!). You’ll be using the text to render the button.


import React from ‘react’;
import styled from ‘styled-components/native’;

/* */

/* */
const ButtonBox = styled.TouchableHighlight.attrs({
underlayColor: ‘#193441’,
flex: 1;
align-items: center;
justify-content: center;
background-color: rgb(39, 41, 43);
border-radius: 10px;
margin: 5px;

const ButtonText = styled.Text`
font-size: 30;
font-family: Orbitron-Bold;
color: ${props => props.text==”Go” ? “green” : “orange”};

handleButtonPress = (value) => {


export default Button = ({text}) => (
<ButtonBox onPress={() => handleButtonPress()}>
<ButtonText text={text}>{text}</ButtonText>

This is the last component. You start by creating a ButtonBox which just acts as a container over the whole button. It is using TouchableHighlight which is a React Native component that will change color when touched. The styling is normal except for the underlay color (the color you see when touching) since this needs to be hacked to work in Styled Components.

The post Develop an Android App with React Native & Publish on Google Play appeared first on SitePoint.

94% off Modern Copywriting Course: Writing Copy That Sells in 2019

Original Source:

Raise your hands if this sounds familiar. You are too busy that you don’t have time to site and write. You know you have a story to tell, but you’re not a great writer. You’ve spent countless hours on your visuals. By the time you get around to writing copy for your website, your words […]

The post 94% off Modern Copywriting Course: Writing Copy That Sells in 2019 appeared first on

The best drawing tablet: our pick of the best graphics tablets in 2019

Original Source:

Forget the days when you only had one or two drawing tablets to choose from – now, designers and creatives are spoilt for choice, with a huge range of different types of tablets and displays that covers all imaginable needs and wants. 

From dedicated graphic specialists like Wacom and Huion to tech giants like Apple and Samsung, loads of companies are getting in on the action – and that means that when it comes to choice, creatives have never had it so good. So what's the best drawing tablet you can get? We're here to help.

Right now, the very best drawing tablet you can buy is the Wacom Cintiq 22HD touch pen display. But it also has serious competition in the form of Apple’s latest iPad Pro 12.9, released in November 2018 and boasting some serious processing power. 

Of course, both of these tablets involve a significant cash outlay, so if you’re on a stricter budget then it’s worth looking at some of the more wallet-friendly options out there such as the Huion H430P. Ultimately though, determining the right drawing tablet for you is going to depend entirely on how you intend to use it. (Scroll down to see our full list of recommendations.

If you're new to drawing tablets, it's worth pointing out that there are three different categories to be aware of. Each takes a different approach to the central challenge of helping you draw on your Windows PC or Mac as if you were drawing on paper. 

Graphics tablets, which you draw directly onto with a stylusPressure-sensitive pen displays, which are hooked up to a monitorTablet computers, which can be adapted for drawing with an app

You can read a more detailed explanation below.

With this covered, let's look at the options. Read on to find the best drawing tablet for your specific needs and budget – and the best prices.

The best drawing tablet in 2019  

Probably the most desirable drawing tablet on the market, the Wacom Cintiq 22HD touch enables you to draw direct onto its screen. It's generously sized so you can go large with your brush strokes, but the stylus is sensitive enough to cope with your most subtle expressions, too. The stand takes some getting used to, but enables you to switch between a near-flat configuration for drawing and an upright position for when you want to use the Cintiq 22HD touch as a regular monitor.

The best cheap drawing tablet 

All the basics you could want from a pen display are covered by the XP-Pen Artist 15.6: a reasonably sized drawing area, a comfortable pen with plenty of sensitivity levels, and a good screen. You don’t get quite the attention to detail or the advanced ecosystem of extras that Wacom provides, and the offset between the stylus tip and the on-screen cursor takes some getting used to, but this remains a pen display that can transform your digital creativity without breaking the bank.

The best graphics tablets

When you’re creating artwork, you want room to sketch freely and a pen that feels as close as possible to the paper equivalent. You’ll find both in the Wacom Intuos Pro graphics tablet: it's one of the purest drawing experiences you can get from a digital device. The pen provides over 8,000 levels of pressure sensitivity and a drawing area that – while it’s not the biggest available – gives you more than the area of a magazine to play inside. All this is supported by Wacom’s broad ecosystem of alternative pens and Texture Sheets to give your drawing surface a distinctive feel.

Designers don’t typically require the range of movement that illustrators demand, making this smaller edition of the Wacom Intuos Pro graphics tablet just the job. As well as the drawing area, eight shortcut keys and a Touch Ring give you access to your most-used commands and tools, so you don’t have to keep flipping between your tablet and your keyboard while you’re focusing on iterating a concept. The Intuos Pro also supports multi-touch fingertip gestures, making it easy for you pan and zoom around your current document.

The best drawing tablet for beginners

If you’re not sure whether a drawing tablet is something you’ll use regularly enough to justify the cost, the H430P gives you all the basics without requiring an big investment. The drawing area is small, yes, but the pen is sensitive enough to give you a true sense of the creative benefits drawing tablets can bring. It may not take long before you outgrow this tablet, but it’s a very affordable way to get started.

XP-Pen's Deco tablets blend style with functionality. This matt black, ultra-sleek model doesn't only look good, but also feels good to use, thanks to its well-made pen and generous drawing area. It's well-designed in a workflow sense too, with customisable Express keys and a multi-functional dial in the top corner that allows you to set things up exactly how you want them, so you can spend less time fiddling and more time drawing. Drawbacks? Well, you could be justified in worrying that at 8mm, the Deco 03 is a little too slim, to the point where a moment's carelessness might cause damage to it. If that doesn't worry you, this is a great buy for a good price.

The second Huion drawing tablet on our list is the H640P, which boasts a comfortable drawing experience in a convenient size for travel. If you work between studios or like to draw from a laptop on the move, you’ll need a drawing tablet like this that packs away handily – but still lets you draw with expression. The Huion H640P measures just 10.2 x 5.8 inches and is no thicker than a smartphone, but offers a set of shortcut keys as well as its drawing area.

The best tablet PC for drawing

If you have the budget, the MobileStudio offers everything you could want in a drawing tablet. With a choice of Intel Core processors and solid-state drive storage capacities, it’s a fully fledged Windows computer. But it also benefits from the same technology Wacom brings to its Cintiq pen display range, making the MobileStudio a pleasure to draw with. And if you want, you can even tether it to the more powerful PC or Mac in your studio with the optional Wacom Link. A 16in MobileStudio is also available.

Also read: Wacom MobileStudio Pro review

The best Windows tablet for drawing

The Surface Book 2 delivers true versatility for the designer on the go. You can use it as a regular laptop, then twist the screen to turn it into a flat tablet with a touch-sensitive screen. For drawing, you need to add the optional Surface Pen, which provides a respectable 4,096 levels of pressure sensitivity. You don’t get the deep drawing experience of the Wacom MobileStudio, but you do get a device that keeps up with your needs wherever you are and whatever you’re doing.

Also read: Microsoft Surface Book 2 review

The best iOS tablet for drawing

The latest in Apple’s series of high-performance tablets, the iPad Pro 12.9 offers a significant performance upgrade over its predecessor, as well as a reduced bezel (screen-to-edge distance) and the removal of the home button – the device is practically all screen. That luxurious LCD Liquid Retina, True Tone screen offers ‘Xbox One S-level graphics’, making it a beautiful surface on which to draw your projects, a process that has become easier than ever thanks to the reworked Apple Pencil 2 released alongside the tablet. The Pencil now offers magnetic docking and new workflow-improving shortcuts, such as double-tapping to switch modes. The new internal processors also mean the iPad Pro is faster than ever before, and even the high-storage versions offer fast read/write speeds for smooth file transfers.

The best Android tablet for drawing

It's always a treat when you don't have to pay extra for the stylus, and the Samsung Galaxy Tab S4 comes with its pen already in the box – an extremely welcome touch, especially given that this is the most expensive Android tablet yet, at a price on par with the iPad Pro. Just as with Samsung's previous tablets, the drawing experience is smooth and satisfying; you'll find yourself gliding away in no time. There is a decent range of drawing apps and programs available for Android as well, though iOS still has the slight edge in this regard. Samsung's Dex software, designed to emulate a computer desktop, means the tablet is also useful for general productivity. A great all-purpose option, albeit an expensive one.

Also read: TechRadar’s Samsung Galaxy Tab S4 review

It's hard to know what's more exciting about the GAOMON PD1560, the gloriously large 16:9 drawing surface or the intelligent pen with 8,192 levels of pressure sensitivity. If you can't think of a better way to spend a day than holed up in the studio creating gorgeous digital paintings then this is a terrific buy. It's easy to set up just the way you want it, with 10 shortcut keys that can be customised to streamline your workflow. However, if you like to create on the move then this isn't the one for you, given that it weighs more than 1.5kg and lacks the wireless functionality of some of the sleeker tablets available.

The best drawing tablet accessories
What are the different types of drawing tablet? 

Broadly speaking, there are three main types of drawing tablet…

Need a recap? Here are the best drawing tablets, graphics tablets and tablet computers of 2018…

Don't miss:

The best laptops for photo editingThe best Wacom tablet deals60 amazing Adobe Illustrator tutorials

Learn how to use WordPress for just $49.99

Original Source:

WordPress is an incredibly popular CMS – and with good reason. You might think that to get the best out of WordPress, you need to need to spend thousands of dollars on coding classes. But with WordPress Build & Host Bundle: Lifetime Subscription, you'll quickly learn how to navigate the platform and build custom WordPress websites without ever having to write a single line of code.

Plus, with this bundle, you'll also enjoy hosting for life with cPanel support, email, and a lot of other useful features you'll need if you run your own websites.

This bundle can be yours for the low price of just $49.99 – that's a massive 94 per cent off the regular price.

Related articles:

40 brilliant WordPress tutorialsHow to choose the right CMS10 great WordPress plugins for designers

A Guide to Writing Your First Software Documentation

Original Source:

A Guide to Writing Your First Software Documentation

As a developer, your pride and joy is your code. It’s readable, it meets DRY principles, it reflects best practices, and the end product is a great tool that solves some kind of problem for its target users. However, no matter how much work you’ve put into your code, if your software comes with no documentation, or you write documentation as an afterthought and treat it with little importance, it’s likely users will find little joy in working with it, and eventually opt for a different, more user-friendly product.

In this article, you’ll find a number of practical guiding principles to get you up and running with writing your first software documentation.

Why Documentation Is Important

In reference to your software, Mike Pope has a fitting saying that goes like this: If it isn’t documented, it doesn’t exist.

Why’s that? Well, just to take my personal experience as an example, I was browsing the Web looking for new JavaScript animation libraries to try out and I came across one with a description of its features that I really liked. However, there was no documentation, not even a Getting Started section, but just a bare-bones API page with almost no explanations or examples. Do you think I ended up using that library? Of course, I didn’t. I got so frustrated with it that I moved on to something that made more sense to me.

To the question of why good JavaScript libraries fail, Nicholos Zakas gives the following answer:

Lack of documentation. No matter how wonderful your library is and how intelligent its design, if you’re the only one who understands it, it doesn’t do any good. Documentation means not just autogenerated API references, but also annotated examples and in-depth tutorials. You need all three to make sure your library can be easily adopted.

Another important reason why your software docs are crucially important is that they serve as a communication tool between your present self and your future self, and also between your present self and other developers who eventually might find themselves working on your software. Even if you write readable and commented code, this doesn’t necessarily mean it will still be clear to you in six months’ time why you wrote a function, or any other piece of your code for that matter, the way you did.

Documentation allows you to transfer the why behind code. Much in the same way code comments explain the why, and not the how, documentation serves the same purpose. — A Beginner’s Guide to Writing Documentation

Surely, you want people to use your code and also to be able eventually to update it and improve on it. These are all contributing factors to the growth of a supporting community behind your product, which is important for it to gain robustness, maturity, and success.

It’ll be mighty hard to accomplish all this if your software doesn’t have great docs to go with it.

Who Software Documentation Is For

When writing anything, make sure it’s clear in your mind who your audience is. Docs are no exception to this rule. Doing so clarifies in your head the problems your audience is likely to face, the familiarity it’s likely to have with your product or the prerequisites for using your product. This information is crucial to the way you create the content and the language you use.

There are two kinds of documentation this article is not concerned with:

User manuals. For instance, my sister might decide to use WordPress for publishing her own blog. She’s not a developer, but she’s heard that non-devs can get their blog up and running in no time with WordPress. Now she’ll be needing instructions on how to download and configure the software on her server, how to write, publish, and update her posts, how to add images to a post, etc. In other words, she’ll need a user manual.
Project documentation. This kind of documentation has more to do with the project than with the software itself, although some of its content could go in a project’s Readme file. To continue with the WordPress example, after getting lots of practice with WordPress, I might decide I’d like to add a feature to the software or fix a bug or two. In this case I’ll need to know things like changelogs, conventions and best practices, contribution policies, how to participate in team discussions relevant to the task at hand, etc.

The kind of documentation I’ve got in mind here is mainly aimed at developers who have different levels of familiarity with your software and need to use it in their projects. For instance, if I’m creating a WordPress theme, then I’ll need to know how to get started, how to include style sheets and JavaScript documents, how to communicate with the database to display posts, etc.

What to Include in Your Documentation

A popular approach is Readme Driven Development, championed by Tom Preston-Werner. It consists of writing the Readme document before you even start writing any code. This document is an introduction to your software and usually includes:

an explanation of what your software does and what problem it solves
an example illustrating the circumstances in which your code would normally be used
links to the code and bugs tracker
FAQs and ways to ask for support
instructions on how to install your software
license information

However, in my view, having a solid documentation that can really help developers who use your software/library should go well beyond the classical Readme file. Following Daniele Procida, I suggest you include the following items in your documentation material for a great user experience.

The post A Guide to Writing Your First Software Documentation appeared first on SitePoint.

Simple Ways to Keep Your WordPress Site Secure

Original Source:

When we think of web security, we often envision a giant server farm teeming with IT professionals along with developers who pore over every bit of code. Then too, we think of high-profile breaches that leak private data and negatively impact the economy.

Yet, web security should be of concern to everyone who works on or owns a site. That’s especially so when you’re using a popular platform such as WordPress. Why? Because we are all sitting targets.

Whether your site boasts millions of visitors or only a handful, bots and other malicious actors are hammering away. They’re attempting brute force attacks on logins, adding poisonous code to legitimate files and other assorted mayhem.

And, while we can’t necessarily account for every possibility, there are things we can do to mitigate the risk. Even better is that it’s not hard to do!

With that, here are some simple steps you can take to make your WordPress website more secure.

Understand WordPress User Roles and Capabilities

If you build sites for clients, it’s important to realize that not everyone needs the same level of access to the back end. Administrator accounts are great in that they provide total control over settings and plugins. But in the wrong hands they can be dangerous.

The developers behind WordPress understand this, and that’s why they’ve created various user roles. Each role (Administrator, Editor, Author, Contributor and Subscriber are the defaults) comes with their own set of capabilities. The lower the user role, the fewer capabilities that user will have.

So, for clients who won’t necessarily need to install plugins or touch other sensitive settings, an Editor account is perfect for them. They have all the power they need to manage content, while still being walled-off from potentially harmful items. Even if they do need occasional access to other things, they can use an administrator account when appropriate.

Just to be clear, we’re not necessarily worried about our clients doing harmful things (although, an adventurous one could do some unintended damage). Rather, it’s the possibility of that user’s account being compromised. If that were to happen, a lower user role won’t have the same impact as an administrator.

If the default roles don’t quite match up with your needs, you also have the option to create your own. This could be used to, for example, allow users access to only a specific post type. It allows for more fine-grain control of who can access what.

As an aside, it’s also a good idea to create separate user accounts for each person who needs to access the back end. This simplifies account maintenance, as you can just remove individual accounts as people come and go from the organization. Plus, the less you share your passwords, the better!

A key going into a lock.

Install a Security Plugin

Sure, you may spend a ton of time online. But you can’t be there to watch over your website 24/7. Therefore, it makes sense to employ tools that will keep a look out on your behalf.

There are a number of security plugins that can handle the job. The free versions of Wordfence, iThemes Security or All In One WP Security & Firewall can offer huge benefits. They can do things like lock out IP addresses, stop brute force login attempts and scan your site for existing malware or security holes. Some will even email you when a problem is found or your install is outdated.

If you manage several websites, a security plugin offers a great way to stay on top of these issues. However, they’re also useful for those times when you hand off a site to your clients as well. Clients who aren’t very security-conscious will have that extra set of eyes that will keep them well-informed.

It’s worth mentioning that there are more plugins available than mentioned above. And each one has its own strengths. The one you choose should fit your basic security needs and refrain from slowing down your site too much. Performance is especially an issue on lower end hosting platforms and should be a consideration.

Of course, these plugins aren’t cure-alls for security. You still need to employ other best practices. But they are great at catching the low-hanging fruit that make up the majority of threats to your site.

Security menu item within WordPress.

Use Common Sense

By now, everyone should know that they should be using unique, hard-to-guess passwords. But still, so many of us take shortcuts because it’s easier.

So much of security is actually using your own common sense and encouraging others to do the same. Sometimes, that requires a tiny bit of extra work – but it’s well worth the effort. Here are a few examples:

Install an SSL Certificate

Having SSL enabled will encrypt user communications with your site (on the front and back ends). With web browsers now calling out sites that don’t use SSL, having a certificate is also darn-near mandatory to defend your reputation. And with many hosts offering either free or cheap options, you have zero excuse for not adding one.

Be Cautious with Plugins

Not all plugins are created equally. Before you install and activate one, be sure to do some research. Look at its release history, support forums and user reviews. You’ll get a better sense of how well-maintained it is and whether it’s worth using. And, look for installed plugins that haven’t been updated in a while. They could be a weak point in your security.

Stay Current

Not only should your entire WordPress install (including plugins and themes) be kept up-to-date, but your hosting environment should do the same. Ensure that you’re running a supported version of PHP and other required software. If you’re unsure, ask your host for more information.

Maintain Current Backups

We all cross our fingers and hope something bad doesn’t happen. But if it does, it’s much easier to restore a safe backup! You’ll especially want to have multiple current copies of your site’s database and the /wp-content/ folder.

Lightbulb on a desk.

Stay Alert

If it seems like security threats are only getting more numerous and complex, it’s because they are! While WordPress itself is well-written and secure, it does have the biggest target on its back of any CMS. That means we need to remain alert and develop good habits.

It doesn’t need to be so difficult. The steps outlined above won’t take much time, but can literally make the difference between your website being hacked or not. That in itself is reason enough to put in the extra effort.

30+ Tumblr Tips Tricks, and Tools (2019)

Original Source:

Tumblr has been one of the most famous social media platforms and the 450 million blogs and 167 billion posts (Dec, 2018 stats) will vouch for its popularity. You can either create your own blog on…

Visit for full content.

40+ Photoshop Tutorials to Put Your Skills to The Test

Original Source:

Either you’re looking to brush up your Photoshop skills or there are some new image manipulating techniques in Photoshop you want to learn, there is an abundance of tutorials available online….

Visit for full content.

Monthly Web Development Update 1/2019: Rethinking Habits And Finding Custom Solutions

Original Source:

Monthly Web Development Update 1/2019: Rethinking Habits And Finding Custom Solutions

Monthly Web Development Update 1/2019: Rethinking Habits And Finding Custom Solutions

Anselm Hannemann


What could be better than starting the new year with some new experiments? Today I figured it was time to rethink JavaScript tooling in one of my projects. And since we wrote everything in plain ECMAScript modules already, I thought it would be easy to serve them natively now and remove all the build and transpilation steps. Until I realized that — although we wrote most code ourselves — we have a couple of third-party dependencies in there and, of course, not all of them are ECMAScript modules. So for now, I have to give up my plans to remove all the build steps and continue to bundle and transpile things, but I’ll try to figure out a better solution to modernize and simplify our tooling setup while providing a smaller bundle to our users.

Another experiment: Just a few weeks ago I had to build a simple “go to the top of the page” button for a website. I used requestAnimationFrame and similar stuff to optimize event handling, but today I found a way nicer and more efficient solution that uses IntersectionObserver to toggle the button on the viewport. You will find that article in the JavaScript section below. The reason I wanted to share these little stories is because I believe that the most important thing is that we review our habits and current solutions and see whether there are better, newer, simpler ideas that could improve a product. Keep playing, keep researching, and be sure to rethink existing systems from time to time.


Joseph Medley shows us the deprecations and removals in Chrome 72, which include blocking popups during page unload via, HTTP-Based Public Key Pinning, and deprecation of TLS 1.0 and TLS 1.1.


What Jesse Weaver is writing about here doesn’t sound like big news, but he shows how quickly we’re tempted to adopt a product strategy that works for others for our own products. Jesse shares why that’s not a good idea and why you should always try to find your own, custom solutions.

Web Performance

Jack Lenox explores how heavily website performance affects our planet’s climate and the effect which performance has for your visitors — beyond better load times.
Tim Kadlec explains why performance is an ethical point as it can include or exclude people, increase or reduce waste of energy, network traffic, and time.


How do we provide a “back to top” button? Well, here’s a very performance-oriented, efficient approach that uses an Intersection Observer to show and hide the button.
Ackermann Yuriy describes how we can use FIDO2 and the Web Authentication API to log in users without passwords.
Chrome is currently working on an API called getInstalledRelatedApps that lets you detect if a user has your native app installed. This could be useful to not show them the app banners by default anymore or to let them open a specific product feature in the app directly from your website.
Harry Wolff shows how we can use React.lazy and suspense to split up the code in JavaScript apps. This is important to reduce the original load size of the application bundle and can make a huge difference for the performance and UX of a website.

Infographic showing how authentication and verification work without a password

Passwordless authentication? The WebAuthn API makes it possible. (Image credit)


Una Kravets wrote a great piece on using Houdini and the Paint API for CSS. She demonstrates it at the example of a customized text-decoration underline style that isn’t available in standard CSS.
Eric Portis explains the concept of the intrinsicsize HTML attribute that will — hopefully soon — help us provide jank-free image loads in browsers by hinting the expected dimensions of the images to the browser before it has parsed them.
Scott Jehl updated the open-source custom appearance select module, and in this blog post he describes how we can style select today.
Chris Coyier summarized how to style a web component and decide whether we want it to inherit global styles or start from scratch.

An example text with randomly generated underlines.

Una Kravet’s “super underline” example uses randomly generated underlines for each element. Made possible with Houdini and the Paint API. (Image credit)

Work & Life

“Feeling a sense of accomplishment is an important part of our sense of self-worth. Beating up on yourself because you think you could have accomplished more can dent your confidence and self-esteem and leave you feeling depleted at the end of the day.” Lisa Evans shares what we can do to avoid falling into that trap.
Itamar Turner-Trauring shares his thoughts on how to get a job with a good work-life balance when you’re competing against people who are willing to work long hours.
Is it a good idea to provide healthcare and treatment based on digital products like apps? And if so, what are the requirements, the standards for this? How can we ensure this is done ethically correct? How do we set the limits, the privacy boundaries, how far do we allow companies to go with experiments here? Would personalized content be fine? Is it okay to share data collected from our devices with healthcare providers or insurances? These are questions we will have to ask ourselves and find an individual answer for.
This article about how Millenials became the burnout generation hit me hard this week. I see myself in this group of people described as “Millenials” (I do think it affects way more people than just the 20-year-olds) and I could relate to so many of the struggles mentioned in there that I now think that these problems are bigger than I ever imagined. They will affect society, politics, each individual on our planet. Given that fact, it’s crazy to hear that most people today will answer that they don’t have a friend they could talk to about their fears and anything else that disturbs them while two decades ago the average answer was still around five. Let’s assure our friends that we’re there for them and that they can talk to us about tough things. 2019 should be a year in which we — in our circle of influence — make it great to live in a human community where we can think with excitement and happiness about our friends, neighbors, and people we work with or talk to on the Internet.
We all try to accommodate so many things at the same time: being successful and productive at work, at home, with our children, in our relationships, doing sports, mastering our finances, and some hobbies. But we blindly ignore that it’s impossible to manage all that on the same level at the same time. We feel regret when we don’t get everything done in a specific timeframe such as at the end of a calendar year. Shawn Blanc argues that we should celebrate what we did do instead of feeling guilty for what we didn’t do.

Going Beyond…

There are words, and then there are words. Many of us know how harmful “just” can be as a word, how prescriptive, how passively aggressive it is. Tobias Tom challenges whether “should” is a useful word by examining the implicit and the result of using it in our daily language. Why “should” can be harmful to you and to what you want to achieve.
“We all know what we stand for. The trick is to state our values clearly — and to stand by them,” says Ben Werdmuller and points out how important it is to think about your very own red line that you don’t want to cross regardless of external pressure you might face or money you might get for it.
Exciting news for climate improvement this week: A team of arborists has successfully cloned and grown saplings from the stumps of some of the world’s oldest and largest coast redwoods, some of which were 3,000 years old and measured 35 feet in diameter when they were cut down in the 19th and 20th centuries. Earlier this month, 75 of the cloned saplings were planted at the Presidio National Park in San Francisco. What makes this so special is the fact that these ancient trees can sequester 250 tons of carbon dioxide from the atmosphere over their lives, compared to 1 ton for an average tree.
The ongoing technological development and strive to build new services that automate more and more things make it even more critical to emphasize human connection. Companies that show no effort in improving things for their clients, their employees, or the environment will begin to struggle soon, Ryan Paugh says.
We usually don’t expect much nice news about technology inventions from the car industry and their willingness to share it with others. But Toyota now has decided to share their automated safety system ‘Guardian’ with competitors. It uses self-driving technology to keep cars from crashing. “We will not keep it proprietary to ourselves only. But we will offer it in some way to others, whether that’s through licensing or actual whole systems,” says Gill Pratt from the company.

Thank you for reading! I’m happy to be back with this new edition of my Web Development Update in 2019 and grateful for all your ongoing support. It makes me happy to hear that so many people find this resource helpful. So if you enjoyed it, please feel free to share it with people you know, give me feedback, or support it with a small amount of money. —Anselm

Smashing Editorial

How to Migrate to Gulp.js 4.0

Original Source:

Despite competition from webpack and Parcel, Gulp.js remains one of the most popular JavaScript task runners. Gulp.js is configured using code which makes it a versatile, general-purpose option. As well as the usual transpiling, bundling and live reloading, Gulp.js could analyze a database, render a static site, push a Git commit, and post a Slack message with a single command.

For an introduction to Gulp, take a look at the following:

An Introduction to Gulp.js
How to Use Gulp.js to Automate Your CSS Tasks
Develop WordPress Themes Faster with Gulp

Gulp.js 4.0

Gulp.js 3.x has been the default for around half a decade. Until recently, npm install gulp would have installed 3.9.1 — the version referenced in the tutorials above.

Gulp.js 4.0 has been available throughout that time, but had to be explicitly installed with npm install gulp@next. This was partly owing to ongoing development and because Gulp.js 4 gulpfile.js configuration files are not compatible with those developed for version 3.

On December 10, 2018, Gulp.js 4.0 was announced as the default and published to npm. Anyone using npm install gulp on a new project will receive version 4.

Is it Necessary to Migrate to Gulp.js 4?

No. Gulp.js 3 has been deprecated and is unlikely to receive further updates, but it can still be used. Existing projects won’t update unless the version is explicitly changed in the dependencies section of package.json. For example:

“dependencies”: {
“gulp”: “^4.0.0”

You an also install Gulp.js 3 in new projects using:

npm install gulp@^3.9.1

It’s possibly best to stick with Gulp.js 3.x if you have a particularly complex, mission-critical build system.

However, existing Gulp.js plugins should be compatible and most gulpfile.js configurations can be migrated in an hour or two. There are several benefits to upgrading, which will become apparent throughout this tutorial.

Upgrade to Gulp.js 4.0

Update your package.json dependencies as shown above, then run npm install to upgrade. You can also update the command-line interface using npm i gulp-cli -g, although this hasn’t changed at the time of writing.

To check the installation, enter gulp -v at the command line:

$ gulp -v
[15:15:04] CLI version 2.0.1
[15:15:04] Local version 4.0.0

Migrating gulpfile.js

Running any task is now likely to raise scary-looking errors. For example:

AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (/node_modules/undertaker/lib/set-task.js:10:3)
at Gulp.task (/node_modules/undertaker/lib/task.js:13:8)
at /gulpfile.js:102:8
at Object.<anonymous> (/gulpfile.js:146:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at execute (/gulp-cli/lib/versioned/^4.0.0/index.js:36:18)
at Liftoff.handleArguments (/gulp-cli/index.js:175:63)
at Liftoff.execute (/gulp-cli/node_modules/liftoff/index.js:203:12)
at module.exports (/gulp-cli/node_modules/flagged-respawn/index.js:51:3)
at Liftoff.<anonymous> (/gulp-cli/node_modules/liftoff/index.js:195:5)

It’s daunting, but you can ignore everything except the first reference of gulpfile.js, which shows the line where an error was encountered (102 in this example).

Fortunately, most of these errors are caused by the same type of problem. The following sections use the CSS tasks tutorial code as an example. The code is available on GitHub and provides the original Gulp.js 3 gulpfile.js and the migrated Gulp.js 4 equivalent.

The post How to Migrate to Gulp.js 4.0 appeared first on SitePoint.