Download the PHP package juvo/wp-secure-actions without Composer

On this page you can find all versions of the php package juvo/wp-secure-actions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-secure-actions

PHP Test/Analyse

WordPress Secure Actions

This library allows you to create verifiable actions with an expiration date and an execution limit. Possible use cases:

Secure Actions uses its own database table to avoid further pollution and cleans up after itself.

Installation

Simply instantiate the Manager class as early as possible by adding the following snippet to your functions.php or an early executed plugin file:

Secure Actions will take care it is only loaded once. It will automatically register the cleanup cron job and default URL handling process.

Usage

Parameter Type Description
$name string Required Unique name to identify the action e.g. in filters
$callback string array Required Callback action to execution whenever the action is triggered.
$args array Optional The parameters to be passed to the callback, as an indexed array. Defaults to array().
$expiration int Optional Action expiration interval in seconds. Defaults to -1.
$limit int Optional Action execution limit. Defaults to -1.
$persistent bool Optional Determines if an action should be deleted when expired or limit reached. Defaults to false.
key string Optional Sets the given password instead if choosing a random one

Example

Create and execute Action

This example creates an action that sends an email to users who updated their profile. In this example, the action is executed immediately, but you can execute it any time later within its expiration interval.

Use action in URL

In the following example, we are going to inform a WordPress user if his profile was updated. The user will receive an email containing a login link that automatically redirects him to the profile page. Since the callback function has no return value, the is code is not able to detect a successful execution and cannot automatically increment the counter. Therefore, we have to do it manually.

Advanced usages

Cleanup

In some cases, you want to change the cleanup functions behaviour. The following examples demonstrate how to use the secure_action_cleanup filter.

Action URL redirect

If you use the secure action URL feature, the user will be redirected to the front page after the execution. It is possible to change that behaviour by hooking into the following filter.

Parameter Type Description
$url string Required URL to redirect to. Defaults to get_site_url()
$action \juvo\WordPressSecureActions\Action|WP_Error Optional Action lookup result from the db. If your action exceeded some limits and is not using the "persistent" flag, this parameter will most likely be an WP_Error instance because the deletion workflow is triggered during the action execution.
$result mixed Optional The action´s execution result. Will most likely be an instance of WP_Error if the action exceeded some limits.

Security

1. Key Generation and Storage:

2. Action Execution Verifications:

3. Error Handling:

4. Recommendations:

Composer


All versions of wp-secure-actions with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
berlindb/core Version ^2.0
woocommerce/action-scheduler Version ^3.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juvo/wp-secure-actions contains the following files

Loading the files please wait ....