Skip to content

Commit

Permalink
fix: uninstall feedback disclosure issues when one of the feedback fi…
Browse files Browse the repository at this point in the history
…elds is open

Improve license and rollback sanity checks.
  • Loading branch information
selul committed Jan 28, 2019
1 parent 2aa7307 commit 4631eef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Modules/Licenser.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ function activate_license() {
$license_data = new \stdClass();
$license_data->license = ( 'valid' != $status ) ? 'valid' : 'invalid';
}
if ( ! isset( $license_data->license ) ) {
$license_data->license = 'invalid';
}
}
if ( ! isset( $license_data->key ) ) {
$license_data->key = $license;
Expand Down
7 changes: 6 additions & 1 deletion src/Modules/Rollback.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public function get_rollback() {
$rollback = array();
$versions = $this->get_api_versions();
$versions = apply_filters( $this->product->get_key() . '_rollbacks', $versions );

if ( empty( $versions ) ) {
return $rollback;
}
if ( $versions ) {
usort( $versions, array( $this, 'sort_rollback_array' ) );
foreach ( $versions as $version ) {
Expand Down Expand Up @@ -177,6 +179,9 @@ private function get_versions_api_url() {
*/
public function add_rollback_link( $links ) {
$version = $this->get_rollback();
if ( empty( $version ) ) {
return $links;
}
$links[] = '<a href="' . wp_nonce_url( admin_url( 'admin-post.php?action=' . $this->product->get_key() . '_rollback' ), $this->product->get_key() . '_rollback' ) . '">' . sprintf( apply_filters( $this->product->get_key() . '_rollback_label', 'Rollback to v%s' ), $version['version'] ) . '</a>';

return $links;
Expand Down
9 changes: 4 additions & 5 deletions src/Modules/Uninstall_feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,19 @@ function add_css( $type, $key ) {
body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #<?php echo $key; ?>-info-disclosure-content {
display: none;
}

body.<?php echo $suffix; ?> .<?php echo $key; ?>-container.<?php echo $key; ?>-container-disc-open #<?php echo $key; ?>-info-disclosure-content {
display: block;
margin-top: 80px;
position:absolute;
bottom: 100px;
}

body.<?php echo $suffix; ?> .<?php echo $key; ?>-container.<?php echo $key; ?>-container-disc-open #<?php echo $key; ?>-info-disclosure {
top: -150px;
top: -130px;
}

body.<?php echo $suffix; ?> .<?php echo $key; ?>-container.<?php echo $key; ?>-container-disc-open {
height: 570px !important;
height: 590px !important;
}

body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #<?php echo $key; ?>-info-disclosure {
position: absolute;
top: -50px;
Expand Down

0 comments on commit 4631eef

Please sign in to comment.