I just pushed a new version of the GT Customizer Preview plugin that enables guests to preview your theme’s live customizer without logging in.
In the new version I’ve added a new “Theme Options Preview” role to help identify the Guest account.
Tell you what, here’s some lists. You like lists right? Though so. Here we go…
- Short-code to link to the preview customizer (You could copy and past the link to use wherever once you have it.)
- Auto “Guest” Account Creation – After installing the plugin and clicking on the short-code link, you may get a single blank page while the account is built. Afterwards, you’re cool from then on.
- “Guest” account cannot access wp-admin, profile settings, etc.
- “Guest” account cannot save changes through the customizer
- WP Admin bar is hidden from users logged in as the “Guest” account
- “Guest” account cannot upload logos, or other files via the customizer, if you are using wordpress standards to upload files. (Shame on those who don’t)
- Install like normal plugin. (If you develop wordpress themes, I think you’ve got a handle on that)
- Use the [ GTCustomizer ]Click here to preview theme options[ /GTCustomizer ] shortcode to get the end user link.
- Using that link, your end users will NOT have to log in to use the customizer.
- The “Customizer Preview” link in the top left in the will be there for you to see the Customizer Preview, without being logged in as a “Guest” user.
My advice is to ignore it for now. (This actually has more plans down the road)
Troubleshooting/If you get stuck:
- Blank page following the shortcode. (Press F5, Refresh, or Reload. This is a one time thing.)
- If you cannot access your dashboard anymore, you can visit the /wp-login.php and relogin, or empty your cookies and refresh the site, or disable the plugin manually.
- If your guests are being required to login, make sure you are using the link from the shortcode. You don’t have to use the shortcode, but you do need the link from it.
- Please make sure you don’t actually have an account named “Guest” if you do, you can either delete it, or rename the account in the plugin. (Line #40 – $gt_user_login = ‘Guest’;)
That’s enough lists for me. Issues? Comments? Love? Hate? Leave them in the comments!
Still curious? If you’re wondering why I’ve executed this plug in this way, read on!
The blank page, redirect method I’m employing is the result of not creating the guest account via Plugin Activation. I chose not to because every time a new guest hits the site, we need to login as the guest user. In case you delete or rename that user, we have to check if that user exists. If it doesn’t exist, then what? We create the user and then move on to the customizer. On most configurations, we cannot do the redirect if we are creating the user account. So instead of relying on Activating and deactivating the plugin to create or delete users, we only create a “Guest” user if it doesn’t exist. We wouldn’t want to delete anyone’s account and with that in mind, if you remove this plugin, you should delete the Guest account. After removing the plugin, the guest account would still have access to make changes to your theme options. That would be bad! The default password is really long, and you can change it as soon as you install the plugin. It won’t change the password unless the account is missing and gets recreated.
The guest account has access to read posts, and the real customizer, but the GT Customizer Preview plugin blocks access to the real customizer. That’s the total amount of access “Guest” has. If you remove the plugin, then the Guest account wouldn’t have any restrictions to editing the customizer of your demo site.