Download the PHP package benjaminmedia/wp-cxense without Composer
On this page you can find all versions of the php package benjaminmedia/wp-cxense. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download benjaminmedia/wp-cxense
More information about benjaminmedia/wp-cxense
Files in benjaminmedia/wp-cxense
Package wp-cxense
Short Description This plugin integrates your site with cXense by adding meta tags and calling the cXense api
License MIT
Homepage https://github.com/BenjaminMedia/wp-cxense
Informations about the package wp-cxense
Bonnier Publications - WordPress cXense plugin
This plugin enables your WordPress site to integrate with cXense. It adds the meta tags and scripts needed by cXense in order to scan your site. It also calls cXense whenever you make changes to your content. Finally it adds the possibility to save a cXense recommendation widget per content type and provides hooks to call them in your view/theme.
Requirements
- WordPress 4.3 or higher
- Language support (Optional) Polylang plugin must installed and activated version 1.8.4 or higher
- PHP 7.1 or higher
Installation/Configuration
Install through composer:
Download lastest release from: https://github.com/BenjaminMedia/wp-cxense/releases And unzip and place in your /wp-content/plugins directory.
Settings
Once you have installed and activated the plugin then make sure that you have a set of api credentials for the cXense API. Once you have your credentials you may go to the settings page labeled cXense. Here you must enter your , , and finally your .
Remember the plugin will not work until you check the switch in the settings page
Widgets
The plugin will generate a settings field for each post type you have available on your WordPress Installation. Here you must enter the cXense recommendation widget ID that you would like represented on your content type.
For debug purpose you can enable or disable the query cache. It is recommended to be enabled in production.
SortBy Widget ID will be only used for widgets sortby options in wp-base.
Rendering widgets
In order to render the widgets available for your post you should make sure that you have filled out the field in the plugin settings page.
When rendering the widgets the plugin provides you with two options:
- Let cXense render the HTML of the widgets
- Get the data and for the widget and build the HMTL yourself
Once you have picked the method you want to use you should go to the theme file that represents the single view of your post_type from this file you may call the following methods to get the widget data:
Let cXense render the HTML of the widgets
The sample output of this function could look like:
Get the data and for the widget and build the HMTL yourself
The sample output of this function could look like:
Documents
Searching documents
If the key 'query' is missing from the search array then a DocumentSearchMissingSearch exception is thrown.
Search
Searching documents will return an object of the following format:
The 'matches' key contains an array of objects that have the 'fields' value accessible directly through the magic method __get(). This means that you can call any field from the 'fields' with the direct pointer:
A complete document result looks like:
Widget documents
If the key 'widget_id' is missing from the input array then a WidgetMissingId exception is thrown.
Example how to fetch cxense data
Recently viewed by user 'TAX_RECENT'
This type of taxonomy requires user browser cookie. In order to fetch it from the browser console you can use
All versions of wp-cxense with dependencies
bordoni/phpass Version ^0.3
bonnier/willow-mu-plugins Version ^2.0
illuminate/support Version ^8.83