| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | if ( $dismissed === null ) { |
| 16 | 16 | $dismissed = get_option( 'frm_dismissed' ); |
| 17 | 17 | } |
| 18 | 18 | // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict |
| 19 | - return ! empty( $dismissed ) && in_array( $form['class'], $dismissed ); | |
| 19 | + return $dismissed && in_array( $form['class'], $dismissed ); | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * @return void |
| @@ -27,13 +27,14 @@ | ||
| 27 | 27 | |
| 28 | 28 | foreach ( $forms as $form ) { |
| 29 | 29 | if ( ! self::is_dismissed( $form ) ) { |
| 30 | 30 | self::install_banner( $form ); |
| 31 | - } else { | |
| 32 | - echo '<span>'; | |
| 33 | - self::install_button( $form, 'auto' ); | |
| 34 | - echo '</span>'; | |
| 31 | + continue; | |
| 35 | 32 | } |
| 33 | + | |
| 34 | + echo '<span>'; | |
| 35 | + self::install_button( $form, 'auto' ); | |
| 36 | + echo '</span>'; | |
| 36 | 37 | } |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | /** |
| @@ -121,8 +122,9 @@ | ||
| 121 | 122 | if ( empty( $install['link'] ) ) { |
| 122 | 123 | return ''; |
| 123 | 124 | } |
| 124 | 125 | |
| 126 | + // phpcs:disable Generic.WhiteSpace.ScopeIndent | |
| 125 | 127 | ?> |
| 126 | 128 | <div class="frm-feature-banner"> |
| 127 | 129 | <a href="#" class="dismiss alignright" id="<?php echo esc_attr( $install['class'] ); ?>" title="<?php esc_attr_e( 'Dismiss this message', 'formidable' ); ?>"> |
| 128 | 130 | <?php FrmAppHelper::icon_by_class( 'frmfont frm_close_icon', array( 'aria-label' => 'Dismiss' ) ); ?> |
| @@ -133,8 +135,9 @@ | ||
| 133 | 135 | <p>Did you know you can import your forms created in <?php echo esc_html( $install['name'] ); ?>?</p> |
| 134 | 136 | <?php self::install_button( $install ); ?> |
| 135 | 137 | </div> |
| 136 | 138 | <?php |
| 139 | + // phpcs:enable Generic.WhiteSpace.ScopeIndent | |
| 137 | 140 | return null; |
| 138 | 141 | } |
| 139 | 142 | |
| 140 | 143 | /** |
| @@ -150,11 +153,12 @@ | ||
| 150 | 153 | $label = __( 'Get Started', 'formidable' ); |
| 151 | 154 | $primary = 'button-primary frm-button-primary '; |
| 152 | 155 | } |
| 153 | 156 | |
| 157 | + // phpcs:disable Generic.WhiteSpace.ScopeIndent | |
| 154 | 158 | if ( $install['installed'] ) { |
| 155 | 159 | ?> |
| 156 | - <a rel="<?php echo esc_attr( $install['importer'] ); ?>" class="button frm-activate-addon <?php echo esc_attr( $primary . ( empty( $install['link'] ) ? 'frm_hidden' : '' ) ); ?>"><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?> | |
| 160 | + <a rel="<?php echo esc_attr( $install['importer'] ); ?>" class="button frm-activate-addon <?php echo esc_attr( $primary . ( ! empty( $install['link'] ) ? '' : 'frm_hidden' ) ); ?>"><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?> | |
| 157 | 161 | <?php |
| 158 | 162 | if ( $label === 'auto' ) { |
| 159 | 163 | /* translators: %s: Name of the plugin */ |
| 160 | 164 | $label = sprintf( __( 'Activate %s', 'formidable' ), $install['name'] ); |
| @@ -171,8 +175,9 @@ | ||
| 171 | 175 | ?> |
| 172 | 176 | <?php echo esc_html( $label ); ?> |
| 173 | 177 | </a> |
| 174 | 178 | <?php |
| 179 | + // phpcs:enable Generic.WhiteSpace.ScopeIndent | |
| 175 | 180 | } |
| 176 | 181 | |
| 177 | 182 | /** |
| 178 | 183 | * @return void |
| @@ -185,8 +190,8 @@ | ||
| 185 | 190 | $dismissed = array(); |
| 186 | 191 | } |
| 187 | 192 | |
| 188 | 193 | $dismissed[] = FrmAppHelper::get_param( 'plugin', '', 'post', 'sanitize_text_field' ); |
| 189 | - update_option( 'frm_dismissed', array_filter( $dismissed ), 'no' ); | |
| 194 | + update_option( 'frm_dismissed', array_filter( $dismissed ), false ); | |
| 190 | 195 | wp_die(); |
| 191 | 196 | } |
| 192 | 197 | } |