Skip to main content

GF_Upgrade

Source: includes/class-gf-upgrade.php:12

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
maybe_display_wizard()Determines if the installation wizard or upgrade wizard should be displayed and renders the appropriate screen.
maybe_upgrade()Decides to execute a fresh install of Gravity Forms, upgrade an existing installation, or do nothing if versions are up-to-date.
is_downgrading()Is currently downgrading?
upgrade()Performs an upgrade of Gravity Forms.
set_license_network_option()Ensures the network option for the license key is set.
sync_auto_updates()Updates the WP auto_update_plugins option to match the background updates setting.
install()Performs initial install of Gravity Forms.
is_upgrading()Checks whether an upgrade is already in progress.
is_auto_increment_enabled()Determines if the especified table has auto_increment enabled for the id column.
upgrade_schema()Sets up the database for Gravity Forms
post_background_upgrade()Performs any final tasks after the background upgrade tasks have finished.
update_upgrade_status()Updates the status of the upgrade process
gf_upgrade_block_submissions()Upgrade task to block submissions.
gf_upgrade_release_submissions_block()Upgrade task to release the submissions block.
gf_upgrade_230_migrate_forms()Upgrade forms to 2.3
gf_upgrade_230_migrate_leads()Upgrade leads to 2.3
migrate_230_lead_properties()Migrates the rg_lead table.
migrate_230_lead_details()Migrates the rg_lead_detail table, if it exists.
migrate_230_lead_meta()Migrates the rg_lead_meta table, if it exists.
gf_upgrade_230_migrate_incomplete_submissions()Upgrade incomplete submissions
gf_upgrade_230_migrate_lead_notes()Upgrade lead notes to 2.3
maybe_import_theme_forms()Imports theme-specific forms, if needed.
get_wp_option()Gets the value of an option directly from the wp_options table. This is useful for double checking the value of
dbdelta_fix_case()Fixes case for database queries.
drop_index()Drops a table index.
validate_upgrade()Validates that Gravity Forms is doing the database upgrade, and has permissions to do so.
has_database_permission()Checks if Gravity Forms has permissions to make changes to the database.
get_versions()Returns the version numbers for the codebase, the current
flush_versions()Flushes cached versions.
requires_install()Returns true if Gravity Forms need to be installed. False otherwise.
requires_upgrade()Returns true if Gravity Forms need to be upgraded. False otherwise.
requires_install_wizard()Returns true if the install wizard should be displayed. False otherwise.
requires_upgrade_wizard()Returns true if the upgrade wizard should be displayed. False otherwise.
update_db_version()Update DB version to current.
maybe_clear_previous_upgrade()Checks whether the previous upgrade can be cleared and then clears it.
clear_previous_upgrade()Clears the previous upgrade.
clear_upgrade_lock()Clears the upgrade lock.
get_upgrade_lock()Returns the upgrade lock.
set_submissions_block()Blocks submissions.
clear_submissions_block()Clears the submissions block.
get_submissions_block()Returns the timestamp of the submissions block or null if not locked.
remove_obsolete_admin_notices()Removes notices from previous versions that are no longer relevant.
add_post_upgrade_admin_notices()Adds dismissible admin notices.
get_min_addon_requirements()Returns an array of add-ons with the minimum version required for this version of Gravity Forms.

Method Reference

maybe_display_wizard()

public function maybe_display_wizard()

Determines if the installation wizard or upgrade wizard should be displayed and renders the appropriate screen.

Returns

  • bool — Returns true if a wizard is displayed, false otherwise?

Since: 2.2

Source: includes/class-gf-upgrade.php:43

maybe_upgrade()

public function maybe_upgrade()

Decides to execute a fresh install of Gravity Forms, upgrade an existing installation, or do nothing if versions are up-to-date.

Since: 2.2

Source: includes/class-gf-upgrade.php:63

is_downgrading()

public function is_downgrading()

Is currently downgrading?

Returns

  • mixed

Since: 2.2

Source: includes/class-gf-upgrade.php:103

upgrade()

public function upgrade( $from_db_version=null, $force_upgrade=false )

Performs an upgrade of Gravity Forms.

Parameters

NameTypeDefaultDescription
$from_db_versionbool | nullnull
$force_upgradeboolfalse

Returns

  • bool

Since: 2.2

Source: includes/class-gf-upgrade.php:127

set_license_network_option()

public function set_license_network_option()

Ensures the network option for the license key is set.

Returns

  • void

Since: 2.8.17

Source: includes/class-gf-upgrade.php:176

sync_auto_updates()

public function sync_auto_updates( $previous_version )

Updates the WP auto_update_plugins option to match the background updates setting.

Parameters

NameTypeDefaultDescription
$previous_versionstringThe previous version.

Returns

  • void

Since: 2.7.2

Source: includes/class-gf-upgrade.php:210

install()

public function install()

Performs initial install of Gravity Forms.

Since:

  • 2.2
  • 2.10.0 (Enabled background notifications by default for new installs.)

Source: includes/class-gf-upgrade.php:224

is_upgrading()

public function is_upgrading()

Checks whether an upgrade is already in progress.

Returns

  • bool

Since: 2.2

Source: includes/class-gf-upgrade.php:271

is_auto_increment_enabled()

public function is_auto_increment_enabled( $table_name, $extra=null )

Determines if the especified table has auto_increment enabled for the id column.

Parameters

NameTypeDefaultDescription
$table_namestringThe table name.
$extrastringnullThe "extra" column of the information_schema.colums table. If not specified, will lookup the value.

Returns

  • bool — Returns true if the specified table has auto_increment enabled. Returns false otherwise.

Since: 2.6.4

Source: includes/class-gf-upgrade.php:414

upgrade_schema()

public function upgrade_schema()

Sets up the database for Gravity Forms

Returns

  • void

Since: 2.2

Source: includes/class-gf-upgrade.php:561

post_background_upgrade()

public function post_background_upgrade()

Performs any final tasks after the background upgrade tasks have finished.

Returns

  • false — Return false to remove this final task from the queue.

Source: includes/class-gf-upgrade.php:837

update_upgrade_status()

public function update_upgrade_status( $new_status )

Updates the status of the upgrade process

Parameters

NameTypeDefaultDescription
$new_status

Source: includes/class-gf-upgrade.php:853

gf_upgrade_block_submissions()

public function gf_upgrade_block_submissions()

Upgrade task to block submissions.

Returns

  • bool

Source: includes/class-gf-upgrade.php:862

gf_upgrade_release_submissions_block()

public function gf_upgrade_release_submissions_block()

Upgrade task to release the submissions block.

Returns

  • bool

Source: includes/class-gf-upgrade.php:872

gf_upgrade_230_migrate_forms()

public function gf_upgrade_230_migrate_forms()

Upgrade forms to 2.3

Returns

  • bool

Source: includes/class-gf-upgrade.php:882

gf_upgrade_230_migrate_leads()

public function gf_upgrade_230_migrate_leads()

Upgrade leads to 2.3

Returns

  • bool — Indicates if the background upgrader needs more time to complete the upgrade.

Source: includes/class-gf-upgrade.php:952

migrate_230_lead_properties()

public function migrate_230_lead_properties( $lead_table, $limit, $time_start )

Migrates the rg_lead table.

Parameters

NameTypeDefaultDescription
$lead_tablestringThe name of the table to be migrated.
$limitintThe migration batch size.
$time_startfloatThe time the migration started, in seconds.

Returns

  • bool | void

Since: 2.6.7

Source: includes/class-gf-upgrade.php:990

migrate_230_lead_details()

public function migrate_230_lead_details( $limit, $time_start )

Migrates the rg_lead_detail table, if it exists.

Parameters

NameTypeDefaultDescription
$limitintThe migration batch size.
$time_startfloatThe time the migration started, in seconds.

Returns

  • bool | void

Since: 2.6.7

Source: includes/class-gf-upgrade.php:1085

migrate_230_lead_meta()

public function migrate_230_lead_meta( $limit, $time_start )

Migrates the rg_lead_meta table, if it exists.

Parameters

NameTypeDefaultDescription
$limitintThe migration batch size.
$time_startfloatThe time the migration started, in seconds.

Returns

  • bool | void

Since: 2.6.7

Source: includes/class-gf-upgrade.php:1166

gf_upgrade_230_migrate_incomplete_submissions()

public function gf_upgrade_230_migrate_incomplete_submissions()

Upgrade incomplete submissions

Returns

  • bool

Source: includes/class-gf-upgrade.php:1247

gf_upgrade_230_migrate_lead_notes()

public function gf_upgrade_230_migrate_lead_notes()

Upgrade lead notes to 2.3

Returns

  • bool

Source: includes/class-gf-upgrade.php:1289

maybe_import_theme_forms()

public function maybe_import_theme_forms()

Imports theme-specific forms, if needed.

Returns

  • void

Since: Unknown

Source: includes/class-gf-upgrade.php:1380

get_wp_option()

public function get_wp_option( $option_name )

Gets the value of an option directly from the wp_options table. This is useful for double checking the value of

autoload options returned by get_option().

The result is cached by wpdb so this is only really useful once per request.

Parameters

NameTypeDefaultDescription
$option_namestringThe option to find.

Returns

  • string | null — The option value, if found.

Since: Unknown

Source: includes/class-gf-upgrade.php:1420

dbdelta_fix_case()

public function dbdelta_fix_case( $cqueries )

Fixes case for database queries.

Parameters

NameTypeDefaultDescription
$cqueriesarrayQueries to be fixed.

Returns

  • array — $queries Queries after processing.

Since: Unknown

Source: includes/class-gf-upgrade.php:1490

drop_index()

public function drop_index( $table, $index )

Drops a table index.

Parameters

NameTypeDefaultDescription
$tablestringThe table that the index will be dropped from.
$indexstringThe index to be dropped.

Returns

  • void

Since: Unknown

Source: includes/class-gf-upgrade.php:1614

validate_upgrade()

public function validate_upgrade( $do_upgrade, $hook_extra )

Validates that Gravity Forms is doing the database upgrade, and has permissions to do so.

Parameters

NameTypeDefaultDescription
$do_upgradenullNot used.
$hook_extrastringThe plugin triggering the upgrade.

Returns

  • bool | WP_Error — True if successful. Otherwise WP_Error object.

Since: Unknown

Source: includes/class-gf-upgrade.php:1681

has_database_permission()

public function has_database_permission( &$error )

Checks if Gravity Forms has permissions to make changes to the database.

Parameters

NameTypeDefaultDescription
&$errorstringError, if there was a problem somewhere.

Returns

  • bool — $has_permissions True if permissions are fine. False otherwise.

Since: Unknown

Source: includes/class-gf-upgrade.php:1703

get_versions()

public function get_versions()

Returns the version numbers for the codebase, the current

Returns

  • array | null

Source: includes/class-gf-upgrade.php:1908

flush_versions()

public function flush_versions()

Flushes cached versions.

Source: includes/class-gf-upgrade.php:1930

requires_install()

public function requires_install()

Returns true if Gravity Forms need to be installed. False otherwise.

Returns

  • bool

Since: 2.2

Source: includes/class-gf-upgrade.php:1941

requires_upgrade()

public function requires_upgrade()

Returns true if Gravity Forms need to be upgraded. False otherwise.

Returns

  • bool

Since: 2.2

Source: includes/class-gf-upgrade.php:1957

requires_install_wizard()

public function requires_install_wizard()

Returns true if the install wizard should be displayed. False otherwise.

Returns

  • bool

Since: 2.2

Source: includes/class-gf-upgrade.php:1984

requires_upgrade_wizard()

public function requires_upgrade_wizard()

Returns true if the upgrade wizard should be displayed. False otherwise.

Returns

  • bool

Since: 2.2

Source: includes/class-gf-upgrade.php:2005

update_db_version()

public function update_db_version( $version=null )

Update DB version to current.

Parameters

NameTypeDefaultDescription
$versionstringnull

Since: 2.2

Source: includes/class-gf-upgrade.php:2032

maybe_clear_previous_upgrade()

public function maybe_clear_previous_upgrade()

Checks whether the previous upgrade can be cleared and then clears it.

Since: 2.3

Source: includes/class-gf-upgrade.php:2042

clear_previous_upgrade()

public function clear_previous_upgrade()

Clears the previous upgrade.

Since: 2.3

Source: includes/class-gf-upgrade.php:2063

clear_upgrade_lock()

public function clear_upgrade_lock()

Clears the upgrade lock.

Returns

  • bool — False if value was not updated and true if value was updated.

Since: 2.3

Source: includes/class-gf-upgrade.php:2092

get_upgrade_lock()

public function get_upgrade_lock()

Returns the upgrade lock.

Returns

  • array | null

Since: 2.3

Source: includes/class-gf-upgrade.php:2104

set_submissions_block()

public function set_submissions_block()

Blocks submissions.

Returns

  • bool — False if value was not updated and true if value was updated.

Since: 2.3

Source: includes/class-gf-upgrade.php:2121

clear_submissions_block()

public function clear_submissions_block()

Clears the submissions block.

Returns

  • bool — False if value was not updated and true if value was updated.

Since: 2.3

Source: includes/class-gf-upgrade.php:2133

get_submissions_block()

public function get_submissions_block()

Returns the timestamp of the submissions block or null if not locked.

Returns

  • string | null

Since: 2.3

Source: includes/class-gf-upgrade.php:2145

remove_obsolete_admin_notices()

public function remove_obsolete_admin_notices()

Removes notices from previous versions that are no longer relevant.

Since: 2.6

Source: includes/class-gf-upgrade.php:2158

add_post_upgrade_admin_notices()

public function add_post_upgrade_admin_notices()

Adds dismissible admin notices.

Since: 2.3

Source: includes/class-gf-upgrade.php:2167

get_min_addon_requirements()

public function get_min_addon_requirements()

Returns an array of add-ons with the minimum version required for this version of Gravity Forms.

Returns

  • array

Since: 2.3

Source: includes/class-gf-upgrade.php:2220