• Stars
    star
    203
  • Rank 192,352 (Top 4 %)
  • Language
    PHP
  • License
    GNU General Publi...
  • Created almost 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A step by step setup wizard that runs after a ThemeForest theme has been activated.

Envato WordPress Theme Setup Wizard

A step by step setup wizard that runs after a ThemeForest theme has been activated.

Video Demo:

Best to watch this video demo to see exactly what this plugin does: ScreenShot

Setup Instructions

  • Copy the api folder onto your web server ( e.g. yoursite.com/envato/api/ ) - it's best if this is hosted on SSL
  • This API folder will handle oAuth login for automatic theme updates in the (new) Envato Market plugin.
  • Register a new App at http://build.envato.com ( tick the "Download the users purchased items", and "View the users purchases of the app creators items" permissions). Put in the full URL to server-script.php as the confirmation URL.
  • At the top of api/server-script.php fill in the values from your Envato app and the full URL to server-script.php :
define('_ENVATO_APP_ID','put-your-envato-app-id-here');
define('_ENVATO_APP_SECRET','put-your-envato-app-secret-here');
define('_ENVATO_APP_URL','http://yoursite.com/envato/api/server-script.php');
  • Copy the envato_setup folder into your private $envato_usernameheme folder.
  • In your theme's functions.php set your Envato username and the full url to your server-script.php file via filters:,
// Please don't forgot to change filters tag.
// It must start from your theme's name.
add_filter('twentyfifteen_theme_setup_wizard_username', 'twentyfifteen_set_theme_setup_wizard_username', 10);
if( ! function_exists('twentyfifteen_set_theme_setup_wizard_username') ){
    function twentyfifteen_set_theme_setup_wizard_username($username){
        return 'dtbaker';
    }
}

add_filter('twentyfifteen_theme_setup_wizard_oauth_script', 'twentyfifteen_set_theme_setup_wizard_oauth_script', 10);
if( ! function_exists('twentyfifteen_set_theme_setup_wizard_oauth_script') ){
    function twentyfifteen_set_theme_setup_wizard_oauth_script($oauth_url){
        return 'http://yoursite.com/envato/api/server-script.php';
    }
}
  • Make sure TGMPA is enabled, configured and working correctly in your theme ( see http://tgmpluginactivation.com/ ). This wizard integrates with the latest version of TGM to find which plugins needs to be installed.
  • Make sure the Envato Market plugin is added to the required plugin list in TGM, it can be added like this:
        array(
            'name' => 'Envato Market',
            'slug' => 'envato-market',
            'source' => 'https://envato.github.io/wp-envato-market/dist/envato-market.zip',
            'required' => true,
            'recommended' => true,
            'force_activation' => true,
        ),
  • envato_setup/js/envato-setup.js is the script which handles the "Loading Button" animation (pretty simple and cool hey?) along with processing the ajax requests for each default installation action.
  • The ajax requests happen in two queries. The first ajax query from javascript will get the "Loading" text to display (e.g. "Installing Pages") along with the URL and data to perform the actual ajax task. Javascript then executes the second ajax task to actually perform the action. And then a third ajax request to confirm it worked.
  • envato_setup/content/ contains the default content that will be loaded during the wizard. e.g. envato_setup/content/default.json contains all posts and custom post types.
  • If you add &export=true to the URL of the first page setup wizard it will output the required json data into the envato_setup/content/ folder, it will also put media files into a local images/stock/ folder.
  • If you're looking to change what meta fields get exported have a look here: https://github.com/dtbaker/envato-wp-theme-setup-wizard/blob/master/envato_setup/envato-setup-export.php#L54
  • If you need to replace post ids, urls or shortcode content that is stored in a post meta field, look at the _elementor_id_import function here: https://github.com/dtbaker/envato-wp-theme-setup-wizard/blob/master/envato_setup/envato_setup.php#L1890
  • The _parse_gallery_shortcode_content function is what replaces URL's, gallery shortcode id's and contact-form-7 id's. This function is run on some meta fields as well (e.g. Elementor can store shortcodes and section content in meta fields, need to replace content in here)

Site Styles

ScreenShot

You can setup multiple styles for your site. This lets you export different content/images/options/posts/etc.. and the user can pick which one they want during the setup wizard.

The installer reads the dtbwp_site_style theme mod value like this:

get_theme_mod( 'dtbwp_site_style', $this->get_default_theme_style() );

Change the available styles in envato_setup.php here:

$this->site_styles = array(
    'style1' => 'Style 1',
    'style2' => 'Style 2',
);

If you only have 1 style you can set this to an empty array.

Place the logo/thumbnail for each style into the envato_setup/images/styleX/ folders.

Envato Market Plugin

The Envato Market plugin is very new. Details here: https://github.com/envato/wp-envato-market By default the Envato Market plugin requires users generate a personal token for the API. This can be time consuming and confusing for first time buyers. This envato-setup.php script combined with the code in /api/ adds a few hooks to the Envato Market plugin to enable single click oAuth login for updates. It's by far from perfect but the only way to get oAuth login working with updates.

Feel free to pull my oAuth code apart. You'll see this is a method of getting a purchase code back into the WordPress theme. So if you just need a purchase code for some other purpose then you can use this oAuth bounce to get one easily.

Warning

This script integrates heavily into my current theme (beautiful watercolor) by pulling in configuration variables and running some other hooks/functions that are defined in my theme. This wizard will not work completely straight out of the box. But hopefully it gives you some ideas :)

More Details.

Feel free to do a pull request with improvements.

Feel free to ask questions on the forum ( https://forums.envato.com/t/fully-automatic-plugin-install-default-content-oauth-theme-updates-in-a-wizard/20504 ) or create issues here on github.

More Repositories

1

wordpress-mce-view-and-shortcode-editor

Custom WordPress MCE View and shortcode editor
PHP
119
star
2

elementor-custom-element

Basic plugin showing how you can add a custom widget to Elementor
PHP
55
star
3

envato-scraper

Simple PHP class to get your Envato statement and ratings
PHP
42
star
4

support-hub

SupportHub is a free WordPress plugin that helps you provide support for your products and businesses.
PHP
40
star
5

stylepress

StylePress is a WordPress plugin that lets you design your entire website quickly and easily.
PHP
33
star
6

php-gmail-auto-reply

This script will connect to your POP3/IMAP server, look for new unread emails that match a search string and send an autoreply to them. This is designed to work with Google Apps/Gmail but will work with any POP3/IMAP account.
PHP
22
star
7

envato-live-sales-gif

A live sales notification GIF you can place on item pages.
PHP
18
star
8

ucm

Ultimate Client Manager
PHP
16
star
9

kerberos-dashboard

A basic web interface to show information from multiple Kerberos.io camera stream.
JavaScript
14
star
10

dashboard-plus

Dashboard Plus by @revaxarts
JavaScript
13
star
11

android-arduino-usb-serial

A basic Android application to read serial input from an Arduino that is connected over USB (via a USB on-the-go cable on Android 3.1+).
Java
11
star
12

ucm-wordpress

Some WordPress plugins for integration with UCM
PHP
5
star
13

envato-php-class

PHP Class for accessing the Envato API
PHP
4
star
14

ucm_plugin_demo_widget

A sample plugin showing how to create your own data linked to a Customer.
PHP
4
star
15

dynamic-wordpress-widgets

Dynamic WordPress Widgets
PHP
3
star
16

ucm_plugin_whcms_login

Provide an AutoLogin link to the left menu (upload this to includes/plugin_whcms_login/)
PHP
3
star
17

wordpress-webicons

A WordPress plugin which allows you to insert easy Social Webicons to your blog or widget area.
CSS
3
star
18

envato-discourse

Envato discourse theme
JavaScript
3
star
19

techspace-door-php

PHP
3
star
20

envato-theme-and-plugin-updates

Ideas for Theme and Plugin updates on the Envato Market
PHP
3
star
21

wordpress-grunt

A quick Gruntfile and package.json file for WordPress theme development (and custom theme plugins)
JavaScript
3
star
22

MLX90614

Playing with MLX90614 on Arduino / NodeMCU / ESP8266
C++
2
star
23

wizvato

A WordPress plugin to help buyers find the perfect item to purchase on the Envato market.
CSS
2
star
24

envato_arduino_dmd

Code to run on an Arduino with DMD display to monitor Envato marketplace sales
Arduino
2
star
25

envato-greasemonkey

scripts for the envato marketplace
Arduino
2
star
26

wp-envato-affiliate

Basic WordPress plugin for Envato Affiliates
PHP
2
star
27

slack-post-to-social

A plugin that allows Slack to create blog posts in WordPress
PHP
2
star
28

envato_mods

Some simple browser extensions for mods
JavaScript
2
star
29

ucm_demo_plugin

A very simple example plugin for the UCM
PHP
2
star
30

react-wordpress-plugin

A very basic example of loading React using a WordPress shortcode
PHP
2
star
31

arduino-laser-timer

Arduino
2
star
32

self-hosted-WP-plugin-updates

This old plugin allows you to self host WordPress plugin/theme updates. So you don't need to have them on the WP repo. Doesn't work in multisite, haven't tested it in latest version of WP.
PHP
2
star
33

envato_forum_spam

Envato Forum Spam - automatically disable flagged forum threads
PHP
1
star
34

lockdown-wp

Basic plugin to lock down the WordPress front end
PHP
1
star
35

envato-api-examples

Sample Envato API queries for affiliates
PHP
1
star
36

ldap-search

LDAP Search WordPress Plugin
PHP
1
star
37

wordpress-p3p-plugin

A quick plugin to append a valid P3P header to WordPress sites
PHP
1
star
38

envato_studio_wp_plugin

A quick WordPress plugin to pull the available Envato Studio categories and services into my WordPress blog using a shortcode.
PHP
1
star
39

pi-web

Web interface and python scripts for FollowBot
Python
1
star
40

envato-live-referral-banner

A banner that can be displayed on your website that shows popular Envato items. Used for getting referrals.
JavaScript
1
star
41

netbank_api

A PHP scraper for the netbank website (since they do not have a public API)
1
star