Because sometimes we all need a little help.
The Wordapp Plugin connects your site to the Wordapp Platform to allow you to create, translate and optimize online content easily and seamlessly. The Wordapp Plugin is published to the WordPress Plugin Directory and can be installed from: https://wordpress.org/plugins/wordapp/
For an automatic installation through WordPress:
For a manual installation via FTP:
To upload the plugin through WordPress, instead of FTP:
The Wordapp Plugin does not have a settings page within WordPress. All settings and configuration are done directly from within the Wordapp Platform. Plugin source code is available through public Subversion (SVN) repository at: https://plugins.svn.wordpress.org/wordapp
Developers can customize default operations by extending the plugin’s functionality according to their required business needs. The plugin communicates with the Wordapp platform through HTTP based API. Operations are always initiated from the Wordapp API. Each operation is a HTTP POST request.
Plugin responses in JSON format as:
success | Operation result:
– true, if operation was completed successfully and operation results are given in data field. – false, if operation failed and error message given in error field. |
data | Response data, the exact structure depends on the operation type |
error | Error message in text format |
Wordapp plugin version 1.0.2 supports following operations:
Operation Code | Description |
PDX_OP_WP_CONFIG_CHECK | Checks if plugin has configured to securely communicate with Wordapp Platform. |
PDX_OP_WP_CONFIG_SET | Starts a plugin configuration process. Used internally by Wordapp Platform. |
PDX_OP_WP_POST_LIST | Retrieves list of posts by query criteria. |
PDX_OP_WP_POST_ADD | Adds a new post |
PDX_OP_WP_POST_GET | Gets post by url or id |
PDX_OP_WP_POST_UPDATE | Updates post |
PDX_OP_WP_MEDIA_LIST | Retrieves list of items in media library by query criteria. |
PDX_OP_WP_MEDIA_ADD | Adds a new item to the media library |
PDX_OP_WP_MEDIA_ADD_FROM_URL | Downloads a new item (image) to the media library from external url |
PDX_OP_WP_POST_META_UPDATE | Updates post meta |
PDX_OP_WP_POST_META_GET | Gets post meta |
PDX_OP_WP_POST_TYPE_LIST | Retrieves registered types for posts |
PDX_OP_WP_POST_STATUS_LIST | Retrieves registered statuses for posts |
PDX_OP_WP_POST_TEMPLATE_LIST | Retrieves template names |
PDX_OP_WP_MEDIA_UPDATE | Updates meta |
PDX_OP_WP_PREPARE_PREVIEW | Prepares unpublished post for preview and returns temporary preview url |
├── includes
│ ├── common.php
│ ├── config.php
│ ├── constants.php
│ ├── hello.php
│ ├── index.php
│ ├── integrations.php
│ ├── media.php
│ ├── meta.php
│ ├── pdx.php
│ ├── post.php
│ └── preview.php
├── LICENSE
├── LICENSE.txt
├── README.txt
├── index.php
├── uninstall.php
└── wordapp.php
Function | Description |
ajax_wa_pdx()
File: includes/pdx.php | The AJAX entry point. Parses AJAX requests and calls appropriate functions. Used internally by plugin. Parameters: $_POST HTTP POST parameters passed from Wordapp Platform. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_config_set ($params)
File: includes/config.php | PDX API Operation : PDX_OP_WP_CONFIG_SET
Sets plugin configuration. This operation is initiated from Wordapp Platform to configure plugin for further data exchange operations. Parameters: array $params The operation parameters passed from Wordapp Platform. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_config_clear()
File: includes/config.php | Internal function.
Clears configuration data. Removes Wordapp plugin related configuration data from the WordPress option storage. Called internally when plugin activated, deactivated or uninstalled. |
wa_pdx_hello()
File: includes/hello.php | Processes HTTP HEAD ‘Hello’ message.
This message is used by Wordapp Platform to discover if Wordapp plugin is installed Parameters: HTTP REQUEST HEADER: X_WA_PDX_HELLO Hello Message Identifier Returns: HTTP RESPONSE HEADER: X-WA-PDX-VERSION Plugin version HTTP RESPONSE HEADER: X-WA-PDX-AJAX-URL Plugin AJAX entry point url HTTP RESPONSE HEADER: X-WA-PDX-WP-VERSION WordPress Version |
wa_pdx_find_post_by_url($post_url)
File: includes/post.php | Internal function.
Finds post by url. Parameters: string $post_url The url to find. Returns: integer|null The post id found. |
wa_pdx_post_add ($params)
File: includes/post.php | Internal function.
Adds a new post. post parameters. post id of the added post |
wa_pdx_post_update ($params)
File: includes/post.php | Internal function.
Updates a post by post id or url. post parameters. post id of the updated post |
wa_pdx_op_post_add ($params)
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_ADD Adds new post. Parameters: array $params The parameters passed from Wordapp. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_post_update ($params)
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_UPDATE
Updates post by post id or url. Parameters: array $params Parameters passed from Wordapp. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_post_get ($params)
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_GET
Gets a post by id. Parameters: array $params Parameters passed from Wordapp. The post id must be given in ‘id’ field. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_post_list ($params)
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_LIST
Retrieves list of posts by query criteria. Parameters: array $params Parameters passed from Wordapp. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_post_type_list()
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_TYPE_LIST
Retrieves list of all post types. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_post_status_list()
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_STATUS_LIST
Retrieves list of all post statuses. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_post_template_list()
File: includes/post.php | PDX API Operation : PDX_OP_WP_POST_TEMPLATE_LIST
Retrieves list of all templates of active theme. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_post_update_template($post_id, $name)
File: includes/post.php | Internal function.
Updates post template option. string $name The template name to assign. The post id to assign. |
wa_pdx_post_process_params ($post, $params, $add = false)
File: includes/post.php | Internal function.
Processes post parameters. Parameters: array $post post Initial post parameters. Parameters to parse. Add defaults for missed parameters. The altered post parameters. |
wa_pdx_op_media_add($params)
File: includes/media.php | PDX API Operation : PDX_OP_WP_MEDIA_ADD
Adds media file to the media library. Parameters: array $params Parameters passed from Wordapp. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_media_add_from_url ($params)
File: includes/media.php | PDX API Operation : PDX_OP_WP_MEDIA_ADD_FROM_URL
Downloads media file from url and add to the media library. Parameters: array $params Parameters passed from Wordapp. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_media_list($params)
File: includes/media.php | PDX API Operation : PDX_OP_WP_MEDIA_LIST
Retrieves list of items in media library by query criteria. Parameters array $params The query criteria. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_meta_get ($params)
File: includes/meta.php | PDX API Operation : PDX_OP_WP_POST_META_GET
Post meta get operation. Parameters: array $params Operation parameters passed from Wordapp Platform. Returns: mixed JSON that indicates success/failure status of the operation in ‘success’ field, and an appropriate ‘data’ or ‘error’ fields. |
wa_pdx_op_meta_update ($params)
File: includes/meta.php | PDX API Operation : PDX_OP_WP_POST_META_UPDATE
Post meta update operation. Parameters: array $params Operation parameters passed from Wordapp Platform. Returns: mixed JSON that indicates success/failure of the operation, or JSON that indicates an error occurred. |
wa_pdx_op_prepare_preview ($params)
File: includes/preview.php | PDX API Operation : PDX_OP_WP_PREPARE_PREVIEW
Prepares unpublished post for preview Parameters: array $params Operation parameters passed from Wordapp Platform. Returns: string Preview URL. |
wa_pdx_filter_pre_get_posts( $query )
File: includes/preview.php | Internal function.
Filter function for preview hook. Parameters: Object $query The WP_Query object by reference. Object Returns the passed query object. |
wa_pdx_filter_posts_results( $posts )
File: includes/preview.php | Internal function.
Filter function for preview hook. Parameters: The post results array. Array The altered posts array. |
wa_pdx_generate_preview_access_token ($post_id, $preview_token)
File: includes/preview.php | Internal function.
Generates preview access token. Parameters: The post id to generate preview access token. The security token for preview. This token sets up by configuration process. string Generated preview access token. |
wa_pdx_check_preview_access_token ($post_id, $wa_pat, $preview_token)
File: includes/preview.php | Internal function.
Checks if provided token gives access for preview. int $post_id The post id to check access for preview. The preview access token. The security token for preview. This token sets up by configuration process. bool Whether preview access is allowed. |
wa_pdx_generate_preview_url ($post_id)
File: includes/preview.php | Internal function.
Generates preview url. Parameters: The post id to generate preview url. string Preview url. |
wa_pdx_seo_plugins_integrate ($post_id, $title, $description, $focus_keyword)
File: includes/integrations.php | Internal function.
Integration with SEO related plugins. Supported plugins: Yoast SEO, All in One SEO Pack Parameters: integer $post_id Post id. string $title Meta title. string $description Meta description. string $focus_keyword Focus keyword. |
wa_pdx_random_hex_string ($len)
File: includes/common.php | Internal function.
Generates random hex string by given length. Parameters: integer $len Required random string length. Returns: string Random hex string. |
wa_pdx_send_response ($msg, $success = false)
File: includes/common.php | Internal function.
Sends JSON response and closes HTTP request. Parameters: mixed $msg Value of the ‘data’ or ‘error’ fields in JSON response. When $success = true then ‘data’ = $msg. When $success = false then ‘error’ = $msg. boolean $success The ‘success’ field in JSON response. |