Unserializer for Calculated Fields Form

Compatible with CFF: Free Professional Developer Platinum

Unserializer

The "Unserializer for Calculated Fields Form" plugin implements a new operation "PHPUNSERIALIZE" to be used from the forms, preferably with the equations associated with the calculated fields.


The "Unserializer for Calculated Fields Form" plugin implements a new operation "PHPUNSERIALIZE" to be used from the forms, preferably with the equations associated with the calculated fields.

The PHPUNSERIALIZE operation receives a string with a serialized PHP variable and returns a valid javascript object to be used with the form, or false if error.

Describing the PHPUNSERIALIZE operation in this way can seem abstract. It would be more useful to explain its use with a concrete example (this example uses the RecordSet DS field distributed with the Developer and Platinum version of the plugin).

Assuming you have implemented the form with id 1, and this form includes the number field "fieldname1". Now, you need the sum of all submitted values into the fieldname1

First, you should insert a RecordSet DS field in the form (I'll call it fieldname2) with a query to read all data submitted previously:

SELECT paypal_post as data FROM {wpdb.prefix}cp_calculated_fields_form_posts WHERE formid=1

Now, insert a calculated field in the form for the sum with the equation:


(function(){
	let records = fieldname2, result = 0;
	for(let record of records) result += PHPUNSERIALIZE(record['data'])[fieldname1|n]*1;
	return result;
})()

The installation process of the "Unserializer for Calculated Fields Form" is similar to other plugins in WordPress. It requires to download the zip file with the plugin's code to your computer (visiting the download link provided after purchasing), and follow the steps below:

  1. Go to the Plugins section on your WordPress.
  2. Press the "Add New" button at the top of the section.
  3. Press the "Upload Plugin" button, and then select the zipped file downloaded previously.
  4. Finally, install and activate the plugin.

The plugin generates the menu option "Calculate Fields Form > Unserializer". The new page allows you to register your copy of the plugin to receive the updates directly on your WordPress, instead of download and install them manually. Furthermore, this page allows deactivating the plugin completely, deleting its data.

To register the plugin go to the menu option: "Calculated Fields Form > Unserializer", enter the email address used to purchase the plugin, and then press the "Register" button.

Registration Page
Plugin Registration.

Screenshots

Plugin Registration
Plugin Registration.

5.99€

One time purchase

Details

Version 1.0.0
Last updated 2020/10/14
Category Operations

Compatibility

free All versions
CFF Professional All versions
CFF Developer All versions
CFF Platinum All versions