# PrivateContent - Multilevel Content Plugin

By: | LCweb
Website: | https://lcweb.it
Support: | http://support.lcweb.it

Thank you for purchasing my plugin. If you have any questions that are beyond the scope of this help file, please feel free to open a ticket on my support platform. Thanks so much!

### Prior Notes

- Be careful using CACHE PLUGINS. PrivateContent is based on dynamic content changes, then you MUST NOT use static cache systems.
  On LCweb's website Cloudflare + LC Scripts Optimizer are used. In the past was used W3 Total Cache, but avoiding any static cache

- On multisite Wordpress installation the plugin must be activated individually on any subsite and every subsite will have its own users database

### Installation

### Categories and users management

### Wordpress users sync

##### Prior notes

This system will create mirror wordpress users to let privateContent ones to use frontend WP systems.
Users will still be managed from the privateContent interface.

- To be synced, a privateContent user must have a valid and unique e-mail
- Username and e-mail must not match with ones already used for existing WP users
- You must not edit or delete synced wordpress users or you will lose the sync.
- Once synced, you can't edit a privateContent username or e-mail. You must detach him before
- For the same reason also User Data add-on custom forms won't have e-mail field if this system is enabled
- Of course you can't be logged as WP admininstrator and as synced pvtContent user at the same time
- Synced users will be able to log in/out also through wordpress forms

FYI: mirror wordpress users have got pvtcontent role and can't enter wordpress admin area.

Additional user roles

  Introduced in v5 - you can simulate additional roles for synced users. Is useful to integrate PrivateContent users into specific systems (BBpress for example)

### Users registration

Paginated forms

  From v6.0 is possible to split forms into sections. In the form builder there's an element called "paginator", using it, users will be prompted to fill one section per time
  Really useful in case of complex forms.

HTML5 fields validation

  From v6.0 PrivateContent has got an HTML5 form validation engine acting on client-side. This offers detailed error reports to user and avoid multiple server calls.
  It also integrates with form sections. If fields aren't correct, user can't move to next form's section.

Custom form styling

  From v4.0 you can also set a fluid layout for the registration form and create your color combination.
  To enable custom theme, you must choose "custom" under "Frontend style" option

Password strength

  From v4.0 the plugin implements security improvements with password strength. Remember that now minimum width is 4 characters

Anti-spam systems

  By default PrivateContent has got an invisible "honey pot" system. It is almost secure as reCAPTCHA, anyway you can always choose to use this latter one

  From v6.1 PrivateContent integrates Google invisible reCAPTCHA. You are now asked to register on Google's site and insert site + secret keys.

### Import & export users

#### Import:

PRIOR NOTE: The import system is available only if your server has the "allow_url_fopen" enabled.

CSV structure

  The import system requires a CSV file with 6 columns. This is the fields order:

  name | surname | username | password | e-mail | telephone

Fields notes
  - Username and password must be inserted
  - Password must comply with strength settings
  - Username must be unique
  - E-mail must valid

#### Export:

Select the users status, the file format and finally the user categories you want to export.
The file will be downloaded on your desktop.

Note:exported CSV file is cannot be imported because of IDs change in Wordpress database. The two systems are NOT complementary.

### Users private page

Private Comments

  Using Wordpress user sync system, privateContent gives you the ability to communicate with users directly on their private page.
  It must be synced and comments must be enabled on its private page.

### Lightbox engine

Since v6, PrivateContent has got a powerful lightbox engine you can use to pop up forms or notifications or whatever you need.
Just one note about contents: they are AJAX loaded, then using javascript-based elements, be sure they are ok.

In settings you'll find the related lightbox wizard. Once added, you'll note two classes in the upper-right corner: trigger class and lightbox class.

Lightbox class

  Wrapper class used in the lightbox, useful for CSS or javascript customizations

Trigger class

  Is the class needed to launch lightboxes. In fact lightbox instances can be linked to warning box buttons, but only through these classes you'll be able to use them everywhere in your website.

Let's see implementation examples:

Trigger lightbox from WP editor (or any HTML code)

  Use the editor in TEXT mode and add the CLASS attribute to the element you wanna use as trigger

Implementing lightbox in Visual Composer elements

  In this screenshot a button has been taken into considereation, but almost any Visual Composer's element has got an extra class field.
  If you are using Elementor, just do the same in the related "element class" field.

Trigger lightbox using a wordpress menu item

  Simply add a "Custom link" menu using an hash as URL and any text you need. Then, once added, expand the menu item and add the class.
  FYI: if you don't see the class field, enable it through "Screen Options" flap, on top of the page.

### Shortcodes wizard

PrivateContent is also natively integrated with Visual Composer, Elementor and Cornerstone.
If you have them installed you can skip the standard shortcode wizard and use the related PrivateContent tool.

Shortcodes summary:

[pc-pvt-content allow="all" block="" warning="1" message="1" login_lb="" registr_lb=""][/pc-pvt-content]

  Used to hide specific page contents. Might show a warning box or just nothing

  - allow - allows specific user categories (using IDs split by comma) or any user using all
  - block - blocks specific user categories. Acts only if you are allowing specific user categories (optional parameter)
  - warning - boolean flag to display/hide the yellow warning box (by default is shown) (optional parameter)
  - message - custom message to show in the warning box (by default is the one specified in the settings) (optional parameter)
  - login_lb - lightbox instance ID attached to "login" button. By default follows global option (optional parameter)
  - registr_lb - lightbox instance ID attached to "registration" button. By default follows global option (optional parameter)
[pc-login-form redirect="" align="center"]

  Used to display the login form (is shown only if user is not logged)

  - redirect - defines a forced custom redirect for this specific form (optional parameter)
  - align - defines form alignment. Possible values: center, left, right (optional parameter)
[pc-logout-box redirect=""]

  Used to display the logout box (is shown only if user is logged)

  - redirect - defines a forced custom redirect for this specific button (optional parameter)
  - NOTE: is possible to directly logout an user adding ?pc_logout to any site's URL. Example: http://www.mysite.com/?pc_logout
[pc-registration-form id="" layout="" custom_categories="" redirect=""]

  Used to display the registration form

  - id - regisrtation form id (if not specified, first registration form will be used)
  - layout - set form layout between one_col and fluid (by default is used what set in settings) (optional parameter)
  - custom_categories - defines a forced custom category or multiple categories (comma split) for registered users. It's discarded if you have categories field into the form (use categories ID) (optional parameter)
  - redirect - defines a forced custom redirect for this specific form (optional parameter)
  - align - defines form alignment. Possible values: center, left, right (optional parameter)

### Restrict Contents

#### IMPORTANT NOTE

By default any wordpress user can access any restricted content except users private pages. You can change this behavior in the plugin settings:

Limiting it to specific user roles with the "Minimum role to use the plugin" option

Deactivating it enabling "testing mode" option. In this way also WP users have to log into PrivateContent

#### Understanding the restriction engine

PrivateContent restrictions are essentially based on user categories.
Advanced users might extend this behavior using plugin's API and introducing new checks though.

In any restriction block you will be asked to specify who can access specific contents. Leaving restriction options empty, no restriction will be applied.

A user can access restricted elements if he belongs to AT LEAST one condition.
For example if you allow "user category 1" and "user category 2", users belonging to "user category 1" OR "user category 2" will be able to access them.

You might be able to also block specific users, among allowed ones.
For example if you allowed "any logged user" and blocked "user category 1" and "user category 2", users belonging to "user category 1" OR "user category 2" won't be able to access contents.

#### Shortcode - restrict targeted contents

Through "Private Block" shortcode you can restrict targeted contents inside any page or post.
Is useful to create dynamic switches. For example: show content X to unlogged and show content Y to logged.

#### Restrictions wizard

Is the main PrivateContent tool to manage your restrictions. It is shown in any linked post type and taxonomy: by default for posts, categories and pages.
Remember you can extend this to custom post types and taxonomies by selecting them in settings!

An essential concept to understand is inheritance. These restrictions are inherited starting from categories, passing to parent post and ending with child post.
Then you can easily restrict multiple subjects by restricting a category or a common parent page.

Let's analyze its systems:

| Contents Hiding This system acts uniquely on contents, leaving posts searchable, indexable by search engines. Contents can be replaced with different options, to be chosen in settings: a warning box / no contents / the excerpt / excerpt + warning box / custom contents. If contents are hidden, also comments will. Comments Simply set comments visibility. Optionally you can also replace them with a warning box. This system is usable only if WP user sync is enabled (otherwise pvtContent users won't be able to interact with comments) Redirect The most powerful privateContent restriction: totally hides elements making them unreachable and redirecting blocked users to a predefined page. It will be totally removed from wordpress queries: won't be searchable nor indexable and will be also removed from menus. Be careful setting main redirect target in settings: it MUST BE NOT restricted through this system or browser will fall into an infinite loop. Lightbox on page's opening FYI: This is a javascript-based system, then IS NOT a safe system to hide page contents. An advanced user could block javascript execution and reach contents underneath This system will apply a persistent modal lightbox on page's opening. Contents will be shown but covered by a lightbox that might contain anything (check the related documentation's chapter)

#### Custom Restrictions:

From v5.2, in settings, you can also specify custom restrictions, based on pages URL.

You can use a full URL or a regular expression, allowing you to control multiple pages at once.
In this image, for example, first restriction targets a single page while second one restricts any page having "category-y" in URL.

#### Menu items restriction and Complete site lock:

#### Widgets restriction:

From v5 PrivateContent integrates in widget management area, allowing you to restrict every widget, specifying which user categories will be able to see it.

### Google Analytics integration

Since v6 you can track every step a logged user makes on your website. This thanks to native Google Analytics implementation.
You just have to inset your tracking ID code and the plugin will start tracking users.

Implementation is done on PHP side, privateContent DOES NOT add the javascript tracking code into your website since almost any theme has got this feature or customers already use specific plugins for this.

IMPORTANT: as written under the field, you must create a new view to enable users tracking.
Is an analytics requirement and this new view will report ONLY logged users activity

### Public API - Extend it!

PrivateContent is a dev-oriented plugin, ready to be extended and tweaked in any way you need.
Check the Public API documentation and knowledge base to understand how.

Want a new and easy income source? Create your own add-on on Codecanyon. Counting thousands of customers all around the world, PrivateContent guarantees certain sales to your product!
Approved add-ons will be featured on LCweb site and mentioned in PrivateContent description.

Want to join add-ons creation but need an idea to start from? Get in touch at support@lcweb.it to know what customers need right now!

### Localizations

PrivateContent is 100% multilanguage both for the front and the back-end. If a translation of your language has been created, Wordpress will automatically switch between languages.

Create a translation

If you have WPML + String Translation add-on or Polylang you can simply scan the plugin and translate via its UI all the plugin strings.

Otherwise: going in the plugin folder, there are two folders called "languages" and "lang_admin". Inside them you'll find the default.pot file. It contains all the english elements that have to be translated. If you want to create one in your language follow this steps:

- Open the default.po file with POedit
- Modify the Catalog by inserting your data and the translation language
- Save the file with the i18n identifier of your language and the prefix "pc_ml-" (the italian example is pc_ml-it_IT)
- Go to the plugin folder ".. wp-content/plugins/private-content/languages" or ".. wp-content/plugins/private-content/lang_admin" and paste the .po and .mo files that POedit has created

If everything goes right, you will be able to use your translation.

If you create new translations, please, contact me at support@lcweb.it sending the .PO and .MO files.
I will put it in the new releases and mention you in the changelog. Thanks

To translate custom messages and custom redirects you need to use WPML + String Translation add-on

Existing Localizations (frontend):

Afrikaans (South Africa)
  To be completed
Argentine
  To be completed
Czech
  To be completed
Danish
  To be completed
German
  To be completed
Spanish
  To be completed
Persian (Iran)
  To be completed
French
  100% translated
Croatian
  To be completed
Italian
  100% translated
Georgian
  To be completed
Dutch
  100% translated
Brazilian
  To be completed
Russian
  To be completed
Swedish
  To be completed
Finnish
  To be completed
Turkish
  To be completed
Polish
  To be completed
Slovak
  To be completed
Romanian
  To be completed
Norwegian
  To be completed
Estonian
  To be completed