YLDist: Websites for essential oil business owners.

After months of development time, YLDist launched to thousands of business entrepreneurs who were looking for a website solution. This project started on GoDaddy, though moved to LiquidWeb after we outgrew GoDaddy's support packages.
Tools
WordPress
WP Multisite
Genesis Framework
Formidible Forms
Yeost SEO
Photoshop
Illustrator
InDesign
JavaScript
CSS
MySQL
HTML5
PHP
WooCommerce
ProSites
Stripe
PayPal
Image

Overview

On our first month, we had 158 sign-ups--most of them for the $119.88 yearly package.

On the second month, we had over 400 member sites running smoothly.

By late 2020, we were servicing over 7,000 clients with more than 9,000 subsites, all created on the WordPress Multisite and hosting custom modified ProSites elements.

During my time working hard to see this business as a success I coded in PHP and integrated a membership section with secure login. In this area, we began offering tutorials and a complex internal wiki which would help problem solve. The Support Department saw a large reduction in trouble calls while sales numbers reflected the value addition.

All sign-ups were automated, and each site was customized by the end-user, which meant SEO was not impacted in the Google Penguin era.

Full Website
Subsites
Brand Identity
Niche Markets
Lead Generation
SEO Optimization
Technical SEO
Booking Calendar
Custom PHP
Responsive Design
PCI Compliance
Yearly Sales Routines
Catalog Updating

Subsites

Using the same technology as Edublogs.org, YLDist brought advanced websites to business owners who were authorized resellers for Young Living Essential Oils. Every new sign-up could choose from any of the following domain structures:

  • client.yldist.com
  • yldist.com/client
  • Their own custom domain name. (Addtl $2/mo)

This custom domain hosting solution was built using a ProSites plugin which was modified to suit our needs better and cut out bloat.

An increase in sales and happier customers came from this solution.

WooCommerce

Using WooCommerce, I created a 5,000+ product catalogue (4 versions) which changed based on user settings between USA, CAN, AUS, or NZE versions.

Users changed their region within personal settings and depending on that, the custom PHP plugin would inject the right <iframe> instance of the catalogue. This was an elegant solution to scaling the catalogue to all 7000+ client websites without adding a huge amount of data to every site.

Member Options

Using PHP and best WordPress practices, I coded (without LLMs or IDEs) a robust options plugin which catered to our needs, allowing for our clients to customize their websites without any complex code or WordPress knowledge.

Referral Afflilates

I integrated a plugin from the ProSites suite to fit our needs, forking the project as it was outdated but perfect for what we needed. After optimizing it, we launched our Affiliates Center, which allowed members to 'opt in' to adding a link to their website 'Get A Website Just Like Mine and a personalized link which would keep track of conversions. We offered our clients a small percentage of those referrals in the form of coupons and prize incentives.

Custom Colors

Words on graphics for client sites were made .png transparent while the client's custom choice of color would be applied to the background css, adding a layer of branding to the imagery on their site.
Image
Image

Affiliates

This plugin adds a shortcode called [affiliate-footer] that outputs a “Get a Website Just Like Mine!” link/button, but it changes what it shows based on whether the site’s admin user is marked as an enabled affiliate. If the admin user has the enable_affiliate user meta set to yes, it builds a referral URL using that user’s stored affiliate_reference value and prints it as a styled button (via another shortcode). If they’re not enabled as an affiliate, it just prints a normal link that goes straight to http://yldist.com without any referral tracking.
affiliate-footer.php

<?php
/**
 * Plugin Name: If Affiliate, Then Link
 * Plugin URI: http://YLDIST.COM
 * Description: Shortcode.
 * Author: JPowersFreelancing
 * Author URI: http://YLDIST.COM
 * Version: 1.0
 */
 
// =============================================================================
// Affiliate Referral Link Footer Shortcode
// =============================================================================

function affiliate_footer() {
	
		$blog_id = get_current_blog_id();
		$user_ID = get_user_id_from_string( get_blog_option($blog_id, 'admin_email'));
		$reference = get_user_meta($user_ID, 'affiliate_reference', true);
		$referrer = get_user_meta($user_ID, 'affiliate_referrer', true);
		$validreferrer = get_user_meta($user_ID, 'affiliate_referrer_validated', true);
		$siteurl = get_blog_option(1,'home');
		$affiliatelinkurl = aff_get_option( 'affiliatelinkurl', $siteurl );
		$link = sprintf(__('http://yldist.com?%?ref=%s', 'affiliate'), $affiliatelinkurl, $reference );
		$button = 'Get a Website Just Like Mine!';
		$noaffbutton = '<a href="http://yldist.com">Get a Website Just Like Mine!</a>';

		if (get_user_meta($user_ID, 'enable_affiliate', true) == 'yes') {

		return do_shortcode( $button );

		} else {
		return $noaffbutton;
		}
}

add_shortcode( 'affiliate-footer', 'affiliate_footer' );

?>

Custom Form

This plugin adds a [contact-form] shortcode that prints a simple contact form (name, email, subject, message) on any page you drop it into, and when someone submits it, it sends the message to the site’s admin email using wp_mail(). It also repopulates the fields after submission (so you don’t lose what you typed), sets the email headers so replies go back to the visitor’s email, and shows either a “thanks, message sent” notice or an error if the mail fails.
contact-form.php

<?php
/**
 * Plugin Name: Contact Form
 * Plugin URI: http://YLDIST.COM
 * Description: Shortcode.
 * Author: JPowersFreelancing
 * Author URI: http://YLDIST.COM
 * Version: 1.0
 */
 
function html_form_code() {
    echo '<div class="contact-form">';
	echo '<form action="' . esc_url( $_SERVER['REQUEST_URI'] ) . '" method="post">';
    echo '<p>';
    echo 'Your Name (required) <br/>';
    echo '<input type="text" name="cf-name" pattern="[a-zA-Z0-9 ]+" value="' . ( isset( $_POST["cf-name"] ) ? esc_attr( $_POST["cf-name"] ) : '' ) . '" size="40" />';
    echo '</p>';
    echo '<p>';
    echo 'Your Email (required) <br/>';
    echo '<input type="email" name="cf-email" value="' . ( isset( $_POST["cf-email"] ) ? esc_attr( $_POST["cf-email"] ) : '' ) . '" size="40" />';
    echo '</p>';
    echo '<p>';
    echo 'Subject (required) <br/>';
    echo '<input type="text" name="cf-subject" value="' . ( isset( $_POST["cf-subject"] ) ? esc_attr( $_POST["cf-subject"] ) : '' ) . '" size="40" />';
    echo '</p>';
    echo '<p>';
    echo 'Your Message (required) <br/>';
    echo '<textarea rows="10" cols="35" name="cf-message">' . ( isset( $_POST["cf-message"] ) ? esc_attr( $_POST["cf-message"] ) : '' ) . '</textarea>';
    echo '</p>';
    echo '<p><input type="submit" name="cf-submitted" value="Send"></p>';
    echo '</form>';
	echo '</div>';
}
 
function deliver_mail() {
    
	$admin_email = get_settings('admin_email');
	$user_info = get_user_by( 'email', $admin_email );
	$emails = $user_info->emails;
	
	if(!isset($emails) || trim($emails) == '') {
		$eml = $user_info->user_email;
    } else {
		$eml = $user_info->emails;
    }

    if ( isset( $_POST['cf-submitted'] ) ) {
		$to = $eml;
        $name    = sanitize_text_field( $_POST["cf-name"] );
        $from   = sanitize_email( $_POST["cf-email"] );
        $subject = sanitize_text_field( $_POST["cf-subject"] );
        $message = $name . ' ' .'('.$from.')'. ' has sent you this message:' . "<br /><br />" . stripslashes(esc_textarea( $_POST["cf-message"] )) . "<br /><br />" . 'You can reply to this message by using the Reply button.';
        
		$headers .= "From: Contact Form < no-reply@yldist.com >" . "\r\n";
		$headers .= "Return-Path: no-reply@yldist.com" . "\r\n";
		$headers .= "Reply-To: $name < $from >" . "\r\n";
		$headers .= "Subject: $subject" . "\r\n";
		$headers .= "MIME-Version: 1.0" . "\r\n";
		$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";

        if ( wp_mail( $to, $subject, $message, $headers ) ) {
            echo '<div class="contact-thanks">';
            echo '<p>Thanks for the message! It has been sent off and will arrive shortly.</p>';
            echo '</div>';
        } else {
            echo 'An unexpected error occurred, please check your information and try again.';
        }
    }
}
 
function cf_shortcode() {
    ob_start();
    deliver_mail();
    html_form_code();
 
    return ob_get_clean();
}
 
add_shortcode( 'contact-form', 'cf_shortcode' );
 
?>

Dashboard Features

This plugin does two simple “dashboard info” things: it adds a [server-notice] shortcode that prints a basic “Server Status: STABLE” message in green, and it also injects a notice box at the top of the WordPress admin area (via admin_notices). That admin notice shows the same server status plus either the admin user’s affiliate referral link (if their enable_affiliate user meta is set to yes) or a prompt/link to activate their affiliate account; there’s also a commented-out spot for an “urgent notice” link if you ever want to turn that on.
dashboard-notice.php

<?php
/**
 * Plugin Name: Dashboard Items
 * Plugin URI: http://YLDIST.COM
 * Description: Shortcode.
 * Author: JPowersFreelancing
 * Author URI: http://YLDIST.COM
 * Version: 1.0
 */

// =============================================================================
// Server Notice Items
// =============================================================================
function server_notice() {
	// RED=#f12525 | GREEN=#9AB930 | ORANGE=#f27832
	$color = '#9AB930';
	$status = 'STABLE';
	$urgnot = '';
	/*$urgnot = '<div class="urgnot">Urgent (USA) FDA Compliance Notice: <a target="_blank" href="http://eepurl.com/b3Edur"><span style="color:red;"><strong>See Notice Here</strong></span></a></div>';*/
	
	$servnot = '<span style="color:' . $color . ';">Server Status: <strong>' . $status . '</strong> </span>' . $urgnot;
	
    return do_shortcode( $servnot );
}
add_shortcode( 'server-notice', 'server_notice' );
// =============================================================================
//ADMIN HEADER NOTICES AND FUNCTIONS
// =============================================================================
function my_admin_notice() {
    ?>
    <div class="updated">
    <p>
	<?php 
	
	global $current_user;
	$blog_id = get_current_blog_id();
	$user_ID = get_user_id_from_string( get_blog_option($blog_id, 'admin_email'));
	$reference = get_user_meta($user_ID, 'affiliate_reference', true);
	$referrer = get_user_meta($user_ID, 'affiliate_referrer', true);
	$validreferrer = get_user_meta($user_ID, 'affiliate_referrer_validated', true);
	$siteurl = get_blog_option(1,'home');
	$affiliatelinkurl = aff_get_option( 'affiliatelinkurl', $siteurl );
	$link = sprintf(__('http://yldist.com?%?ref=%s', 'affiliate'), $affiliatelinkurl, $reference );
	$dash = 'Your Affiliate Link: ' . sprintf(__('<strong>http://yldist.com?%?ref=%s</strong>', 'affiliate'), $affiliatelinkurl, $reference) . ' (<a target="_blank" href="http://yldist.com/affiliate-referrals/">Learn More</a>)';
	$noaffbutton = '<a target="_blank" href="http://yldist.com/affiliate-referrals/">Activate Your Affiliate Account</a>';
	//SERVER NOTICE RED=#f12525 | GREEN=#9AB930 | ORANGE=#f27832
	$color = '#9AB930';
	$status = 'STABLE';
	$servnot = '<span style="color:' . $color . ';">Server Status: <strong>' . $status . '</span>';
	$urgnot = '';
	/*$urgnot = '<div class="urgnot">Urgent (USA) FDA Compliance Notice: <a target="_blank" href="http://eepurl.com/b3Edur"><span style="color:red;"><strong>See Notice Here</strong></span></a></div>';*/
	  
	if (get_user_meta($user_ID, 'enable_affiliate', true) == 'yes') {
		echo $servnot . '<br/>' . do_shortcode( $dash ) . '<br/>' . $urgnot ;
	} else {
		echo $servnot . '<br/>' . $noaffbutton . '<br/>' . $urgnot ;
	}
	
	?></p>
    </div>
    <?php
}
add_action( 'admin_notices', 'my_admin_notice' );

?>

Custom Functions

This plugin is a grab-bag of “lock down and customize WordPress” tweaks for a YLDist multisite setup: it changes how user bio/description fields are sanitized (allowing richer HTML), hides the default “Personal Options” section on the user profile screen with a bit of admin-side jQuery, and forces all outgoing WordPress emails to come from no-reply@yldist.com with the name “YLDist.” It also adds a “Confirm Email” field to the multisite signup form, tries to bypass/alter the normal blog signup email verification by activating the signup immediately and redirecting the user to a specific YLDist distributor page, and limits what non–super admins can do in the Customizer (removing widgets/menus/themes panels). Finally, for non–super admins it attempts to suppress core/plugin/theme update notifications so regular site owners don’t see update prompts.
my-custom-functions.php

<?php
/**
 * Plugin Name: Dashboard Items
 * Plugin URI: http://YLDIST.COM
 * Description: Shortcode.
 * Author: JPowersFreelancing
 * Author URI: http://YLDIST.COM
 * Version: 1.0
 */

// =============================================================================
// Server Notice Items
// =============================================================================
function server_notice() {
	// RED=#f12525 | GREEN=#9AB930 | ORANGE=#f27832
	$color = '#9AB930';
	$status = 'STABLE';
	$urgnot = '';
	/*$urgnot = '<div class="urgnot">Urgent (USA) FDA Compliance Notice: <a target="_blank" href="http://eepurl.com/b3Edur"><span style="color:red;"><strong>See Notice Here</strong></span></a></div>';*/
	
	$servnot = '<span style="color:' . $color . ';">Server Status: <strong>' . $status . '</strong> </span>' . $urgnot;
	
    return do_shortcode( $servnot );
}
add_shortcode( 'server-notice', 'server_notice' );
// =============================================================================
//ADMIN HEADER NOTICES AND FUNCTIONS
// =============================================================================
function my_admin_notice() {
    ?>
    <div class="updated">
    <p>
	<?php 
	
	global $current_user;
	$blog_id = get_current_blog_id();
	$user_ID = get_user_id_from_string( get_blog_option($blog_id, 'admin_email'));
	$reference = get_user_meta($user_ID, 'affiliate_reference', true);
	$referrer = get_user_meta($user_ID, 'affiliate_referrer', true);
	$validreferrer = get_user_meta($user_ID, 'affiliate_referrer_validated', true);
	$siteurl = get_blog_option(1,'home');
	$affiliatelinkurl = aff_get_option( 'affiliatelinkurl', $siteurl );
	$link = sprintf(__('http://yldist.com?%?ref=%s', 'affiliate'), $affiliatelinkurl, $reference );
	$dash = 'Your Affiliate Link: ' . sprintf(__('<strong>http://yldist.com?%?ref=%s</strong>', 'affiliate'), $affiliatelinkurl, $reference) . ' (<a target="_blank" href="http://yldist.com/affiliate-referrals/">Learn More</a>)';
	$noaffbutton = '<a target="_blank" href="http://yldist.com/affiliate-referrals/">Activate Your Affiliate Account</a>';
	//SERVER NOTICE RED=#f12525 | GREEN=#9AB930 | ORANGE=#f27832
	$color = '#9AB930';
	$status = 'STABLE';
	$servnot = '<span style="color:' . $color . ';">Server Status: <strong>' . $status . '</span>';
	$urgnot = '';
	/*$urgnot = '<div class="urgnot">Urgent (USA) FDA Compliance Notice: <a target="_blank" href="http://eepurl.com/b3Edur"><span style="color:red;"><strong>See Notice Here</strong></span></a></div>';*/
	  
	if (get_user_meta($user_ID, 'enable_affiliate', true) == 'yes') {
		echo $servnot . '<br/>' . do_shortcode( $dash ) . '<br/>' . $urgnot ;
	} else {
		echo $servnot . '<br/>' . $noaffbutton . '<br/>' . $urgnot ;
	}
	
	?></p>
    </div>
    <?php
}
add_action( 'admin_notices', 'my_admin_notice' );

?>