Questions for interview

1. You’re the lead developer on a new project that requires a CMS (content management system).  What tech stack would you use and why?

Generally I would make sure that whatever stack I chose didn’t create issues with updates in the future. Who will be doing future updates? What technologies do those employees already know? I would get an overview of what they are doing now and where they want to be in the future technology wise. So I’d first follow the direction of the current environment around me.

Otherwise because I know the LAMP stack, I’d be choosing this option since I can follow in more detail.

There are two major CMS I would choose from: Drupal or WordPress

If the project needs to have a customized website that needs to handle a lot of data I’d choose this as WordPress we are usually installing ACF to deal with fields. Drupal has a better method built into their CMS.

WordPress I’d choose for most other websites as you can still customize everything and there is a lot of documentation online and many people who know how to develop in WordPress.

For retail websites I may choose Shopify since they focus on ecommerce only.

2. (scenario) : We’re creating a blogging platform for teams in government departments who want to publish articles on a regular basis. We are using a WordPress multisite installation so that we can create a new instance per team and let them self-administer. We want to improve the flow for adding new users. The following questions relate to the end-to-end developer experience of creating a new flow for adding users (eg, user roles, database structure, data input, testing changes). They are oriented towards WordPress but are generic enough to be relevant to any CMS framework.

3. (scenario): We have a small web application which is missing functionality and has some bugs.  We need your help. The current page looks like https://codesandbox.io/s/pedantic-fast-2pcw9

Figure out the database structure of multisites

Do unit tests for WordPress and React

Child Themes and Theme Structure

How to create a child theme

  • Create a folder in your themes directory giving it the name of new theme.
  • Create style.css file and print this inside where template references the name of the parent theme that’s referenced in enqueue:
Theme Name:   Theme Name Here
Theme URI:    https://www.themeurl.com/
Description:  A Parent child theme 
Author:       Christine Wilson
Author URI:   https://www.christinewilson.ca
Template:     twentytwentyone
Version:      1.0.0
Text Domain:  themenamehere
  • Create a file called functions.php and add enqueue scripts info:
/* enqueue scripts and style from parent theme */
    
function main_scripts() {
    wp_enqueue_style( 'themenamehere', get_stylesheet_uri(),
    array( 'twenty-twenty-one-style' ), wp_get_theme()->get('Version') );
}
add_action( 'wp_enqueue_scripts', 'main_scripts');

Theme structure

Here’s all the possibilities inside your theme:

Possible folder structure (taken from WordPress)

assets (dir)
      - css (dir)
      - images (dir)
      - js (dir)
inc (dir)
template-parts (dir)
      - footer (dir)
      - header (dir)
      - navigation (dir)
      - page (dir)
      - post (dir)
404.php
archive.php
comments.php
footer.php
front-page.php
functions.php
header.php
index.php
page.php
README.txt
rtl.css
screenshot.png
search.php
searchform.php
sidebar.php
single.php
style.css

Why host images on a separate subdomain?

  • A separate domain prevents your domain’s cookies from being sent for every image request, where they’re not needed. Reduces the bandwidth overhead for each request.
  • Most browsers will only make a certain number of HTTP requests at one time to a particular domain, so serving images and other static content off a second domain potentially doubles the number of HTTP requests at one time.
  • You can conceivably use a different, lighter weight webserver like nginx/lighttpd to serve the static content.

How to optimize WordPress site performance?

  • Use a CDN
  • Use a caching plugin or edit .htaccess to cache different file types for different lengths of time and use gzip, etc
  • Use a simple theme/framework
  • Split comments, products and long posts into smaller pages
  • Use less plugins and only use well established ones
  • Keep WordPress updated
  • Host images on a subdomain

  • A separate domain prevents your domain's cookies from being sent for every image request, where they're not needed. Reduces the bandwidth overhead for each request.
  • Most browsers will only make a certain number of HTTP requests at one time to a particular domain, so serving images and other static content off a second domain potentially doubles the number of HTTP requests at one time.
  • You can conceivably use a different, lighter weight webserver like nginx/lighttpd to serve the static content.

Add a User to a Group

Add an Existing User Account to a Group

usermod -a -G examplegroup exampleusername

Change a User’s Primary Group

usermod -g groupname username

View current user’s groups

groups

To view the numerical IDs associated with each group, run the id  command instead:

id

View groups of another user:

View groups of another user:

groups exampleusername
id exampleusername

View all groups of the system:

getent group