updated plugin Easy Digital Downloads version 3.1.1.3

This commit is contained in:
2023-03-29 18:20:17 +00:00
committed by Gitium
parent 2573ae37c7
commit e42ba0e05a
20 changed files with 234 additions and 155 deletions

View File

@ -81,18 +81,7 @@ class Tools extends Step {
?>
</div>
<div class="edd-onboarding__get-suggestions-section">
<h3>
<?php esc_html_e( 'Join the EDD Community', 'easy-digital-downloads' ); ?>
</h3>
<label for="edd-onboarding__telemery-toggle" class="edd-onboarding__get-suggestions-section_label">
<?php esc_html_e( 'Help us provide a better experience and faster fixes by sharing some anonymous data about how you use Easy Digital Downloads.', 'easy-digital-downloads' ); ?>
</label>
<div class="edd-toggle">
<input type="checkbox" id="edd-onboarding__telemery-toggle" class="edd-onboarding__get-suggestions-section_input" name="telemetry" value="1" checked>
</div>
</div>
<?php $this->telemetry(); ?>
<div class="edd-onboarding__selected-plugins">
<p><?php esc_html_e( 'Based on your selection above, the following plugins will be installed:', 'easy-digital-downloads' ); ?> <span class="edd-onboarding__selected-plugins-text"></span></p>
@ -235,4 +224,30 @@ class Tools extends Step {
return $available_plugins;
}
/**
* Outputs the telemetry checkbox.
*
* @since 3.1.1.3
* @return void
*/
private function telemetry() {
if ( edd_is_pro() ) {
return;
}
?>
<div class="edd-onboarding__get-suggestions-section">
<h3>
<?php esc_html_e( 'Join the EDD Community', 'easy-digital-downloads' ); ?>
</h3>
<label for="edd-onboarding__telemery-toggle" class="edd-onboarding__get-suggestions-section_label">
<?php esc_html_e( 'Help us provide a better experience and faster fixes by sharing some anonymous data about how you use Easy Digital Downloads.', 'easy-digital-downloads' ); ?>
</label>
<div class="edd-toggle">
<input type="checkbox" id="edd-onboarding__telemery-toggle" class="edd-onboarding__get-suggestions-section_input" name="telemetry" value="1" checked>
</div>
</div>
<?php
}
}

View File

@ -38,7 +38,7 @@ final class Notifications extends Table {
* @since 3.1.1
* @var int
*/
protected $version = 202302131;
protected $version = 202303220;
/**
* Array of upgrade versions and methods
@ -48,8 +48,7 @@ final class Notifications extends Table {
* @var array
*/
protected $upgrades = array(
'202301251' => 202301251,
'202302131' => 202302131,
'202303220' => 202303220,
);
/**
@ -103,8 +102,6 @@ final class Notifications extends Table {
'remote-id' => false,
);
$columns = $this->get_db()->get_results( "SHOW FIELDS FROM {$this->table_name} WHERE Field = 'remote_id';" );
if ( false === $this->column_exists( 'source' ) ) {
$source = $this->get_db()->query(
"ALTER TABLE {$this->table_name} ADD COLUMN `source` varchar(20) NOT NULL DEFAULT 'api' AFTER `remote_id`;"
@ -134,4 +131,16 @@ final class Notifications extends Table {
return true;
}
/**
* Runs another database upgrade for sites which got into a bit of a snarl with the database versions.
*
* @since 3.1.1.3
* @return bool
*/
protected function __202303220() {
$this->__202301251();
return $this->__202302131();
}
}

View File

@ -36,6 +36,9 @@ class Licenses {
* @return array
*/
private function get_pro_license() {
if ( ! edd_is_pro() ) {
return false;
}
$pro_license = new License( 'pro' );
return array(

View File

@ -30,8 +30,15 @@ class Settings {
foreach ( $section_settings as $setting_key => $setting ) {
$value = $this->get_setting_value( $tab_key, $section_key, $setting_key );
// If the value is null, it's a skipped setting.
if ( ! is_null( $value ) ) {
$setting_id = isset( $setting['id'] ) ? $setting['id'] : sanitize_title( $setting['name'] );
if ( is_null( $value ) ) {
continue;
}
$setting_id = isset( $setting['id'] ) ? $setting['id'] : sanitize_title( $setting['name'] );
if ( is_array( $value ) ) {
foreach ( $value as $v ) {
$data[ "{$setting_id}_{$v}" ] = 1;
}
} else {
$data[ $setting_id ] = $value;
}
}