plugin updates

This commit is contained in:
Tony Volpe
2024-09-05 11:04:01 -04:00
parent ed6b060261
commit 50cd64dd3d
925 changed files with 16918 additions and 13003 deletions

View File

@@ -6279,7 +6279,7 @@ class GFFormsModel {
$new_key = trim( $new_key );
$new_key_md5 = md5( $new_key );
$previous_key = get_option( 'rg_gforms_key' );
$previous_key = get_option( GFForms::LICENSE_KEY_OPT );
/**
* @var License\GF_License_API_Connector $license_connector
@@ -6291,15 +6291,7 @@ class GFFormsModel {
delete_option( 'gform_version_info' );
if ( empty( $new_key ) ) {
if ( is_multisite() && is_main_site() ) {
$sites = get_sites();
foreach ( $sites as $site ) {
delete_blog_option( $site->blog_id, 'rg_gforms_key' );
}
}
delete_option( 'rg_gforms_key' );
self::update_license_key( '' );
// Unlink the site with the license key on Gravity API.
$license_connector->update_site_registration( '' );
@@ -8233,21 +8225,44 @@ class GFFormsModel {
* Updates the license key, If multisite, it updates the license key for all sites in the network.
*
* @since 2.7
* @since 2.8.17 Updated to also store the key as a network option.
*
* @param string $license The license key.
* @param string $license The license key MD5.
*
* @return void
*/
public static function update_license_key( $license ) {
if ( is_multisite() && is_main_site() ) {
$sites = get_sites();
foreach ( $sites as $site ) {
update_blog_option( $site->blog_id, 'rg_gforms_key', $license );
update_blog_option( $site->blog_id, 'gform_pending_installation', false );
if ( is_main_site() && GFCommon::is_network_active() ) {
if ( $license ) {
update_network_option( null, GFForms::LICENSE_KEY_OPT, $license );
} else {
delete_network_option( null, GFForms::LICENSE_KEY_OPT );
}
$ids = get_sites( array(
'fields' => 'ids',
'number' => 0,
'site__not_in' => array( get_current_blog_id() ),
) );
foreach ( $ids as $id ) {
switch_to_blog( $id );
if ( $license ) {
update_option( GFForms::LICENSE_KEY_OPT, $license );
delete_option( 'gform_pending_installation' );
delete_option( 'rg_gforms_message' );
} else {
delete_option( GFForms::LICENSE_KEY_OPT );
}
restore_current_blog();
}
}
update_option( 'rg_gforms_key', $license );
if ( $license ) {
update_option( GFForms::LICENSE_KEY_OPT, $license );
} else {
delete_option( GFForms::LICENSE_KEY_OPT );
}
}
}