@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | <?php } ?> |
| 130 | 130 | |
| 131 | 131 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before{ |
| 132 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['-'] : $minus_icons[1]['-'] ); ?>"; |
|
| 132 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['-'] : $minus_icons[1]['-'] ); ?>"; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_plus_icon:before{ |
| 136 | - content:"\e<?php echo esc_html( isset( $minus_icons[ $repeat_icon ] ) ? $minus_icons[ $repeat_icon ]['+'] : $minus_icons[1]['+'] ); ?>"; |
|
| 136 | + content:"\e<?php echo esc_html( isset( $minus_icons[$repeat_icon] ) ? $minus_icons[$repeat_icon]['+'] : $minus_icons[1]['+'] ); ?>"; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | .<?php echo esc_html( $style_class ); ?> .frm_icon_font.frm_minus_icon:before, |
@@ -145,14 +145,14 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | .<?php echo esc_html( $style_class ); ?> .frm_trigger.active .frm_icon_font.frm_arrow_icon:before{ |
| 148 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['-'] : $arrow_icons[1]['-'] ); ?>"; |
|
| 148 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['-'] : $arrow_icons[1]['-'] ); ?>"; |
|
| 149 | 149 | <?php if ( ! empty( $section_color ) ) { ?> |
| 150 | 150 | color:<?php echo esc_html( $section_color . $important ); ?>; |
| 151 | 151 | <?php } ?> |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | .<?php echo esc_html( $style_class ); ?> .frm_trigger .frm_icon_font.frm_arrow_icon:before{ |
| 155 | - content:"\e<?php echo esc_html( isset( $arrow_icons[ $collapse_icon ] ) ? $arrow_icons[ $collapse_icon ]['+'] : $arrow_icons[1]['+'] ); ?>"; |
|
| 155 | + content:"\e<?php echo esc_html( isset( $arrow_icons[$collapse_icon] ) ? $arrow_icons[$collapse_icon]['+'] : $arrow_icons[1]['+'] ); ?>"; |
|
| 156 | 156 | <?php if ( ! empty( $section_color ) ) { ?> |
| 157 | 157 | color:<?php echo esc_html( $section_color . $important ); ?>; |
| 158 | 158 | <?php } ?> |
@@ -193,6 +193,7 @@ |
||
| 193 | 193 | |
| 194 | 194 | /** |
| 195 | 195 | * @since 4.05.02 |
| 196 | + * @param string $key |
|
| 196 | 197 | */ |
| 197 | 198 | public function remove( $key ) { |
| 198 | 199 | if ( isset( $this->messages[ $key ] ) ) { |
@@ -71,18 +71,18 @@ discard block |
||
| 71 | 71 | * @param array $message |
| 72 | 72 | */ |
| 73 | 73 | public function add_message( $message ) { |
| 74 | - if ( isset( $this->messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) { |
|
| 74 | + if ( isset( $this->messages[$message['key']] ) && ! isset( $message['force'] ) ) { |
|
| 75 | 75 | // Don't replace messages unless required. |
| 76 | 76 | return; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if ( isset( $this->messages[ $message['key'] ] ) ) { |
|
| 79 | + if ( isset( $this->messages[$message['key']] ) ) { |
|
| 80 | 80 | // Move up and mark as new. |
| 81 | - unset( $this->messages[ $message['key'] ] ); |
|
| 81 | + unset( $this->messages[$message['key']] ); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $message = $this->fill_message( $message ); |
| 85 | - $this->messages[ $message['key'] ] = array( |
|
| 85 | + $this->messages[$message['key']] = array( |
|
| 86 | 86 | 'created' => $message['time'], |
| 87 | 87 | 'message' => $message['message'], |
| 88 | 88 | 'subject' => $message['subject'], |
@@ -112,11 +112,11 @@ discard block |
||
| 112 | 112 | private function clean_messages() { |
| 113 | 113 | $removed = false; |
| 114 | 114 | foreach ( $this->messages as $t => $message ) { |
| 115 | - $read = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' ); |
|
| 116 | - $dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); |
|
| 115 | + $read = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' ); |
|
| 116 | + $dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' ); |
|
| 117 | 117 | $expired = isset( $message['expires'] ) && ! empty( $message['expires'] ) && $message['expires'] < time(); |
| 118 | 118 | if ( $read || $expired || $dismissed ) { |
| 119 | - unset( $this->messages[ $t ] ); |
|
| 119 | + unset( $this->messages[$t] ); |
|
| 120 | 120 | $removed = true; |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -130,14 +130,14 @@ discard block |
||
| 130 | 130 | * @param string $key |
| 131 | 131 | */ |
| 132 | 132 | public function mark_read( $key ) { |
| 133 | - if ( ! isset( $this->messages[ $key ] ) ) { |
|
| 133 | + if ( ! isset( $this->messages[$key] ) ) { |
|
| 134 | 134 | return; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - if ( ! isset( $this->messages[ $key ]['read'] ) ) { |
|
| 138 | - $this->messages[ $key ]['read'] = array(); |
|
| 137 | + if ( ! isset( $this->messages[$key]['read'] ) ) { |
|
| 138 | + $this->messages[$key]['read'] = array(); |
|
| 139 | 139 | } |
| 140 | - $this->messages[ $key ]['read'][ get_current_user_id() ] = time(); |
|
| 140 | + $this->messages[$key]['read'][get_current_user_id()] = time(); |
|
| 141 | 141 | |
| 142 | 142 | $this->update_list(); |
| 143 | 143 | } |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | * @since 4.05.02 |
| 149 | 149 | */ |
| 150 | 150 | public function mark_unread( $key ) { |
| 151 | - $is_read = isset( $this->messages[ $key ] ) && isset( $this->messages[ $key ]['read'] ) && isset( $this->messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 151 | + $is_read = isset( $this->messages[$key] ) && isset( $this->messages[$key]['read'] ) && isset( $this->messages[$key]['read'][get_current_user_id()] ); |
|
| 152 | 152 | if ( $is_read ) { |
| 153 | - unset( $this->messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 153 | + unset( $this->messages[$key]['read'][get_current_user_id()] ); |
|
| 154 | 154 | $this->update_list(); |
| 155 | 155 | } |
| 156 | 156 | } |
@@ -159,14 +159,14 @@ discard block |
||
| 159 | 159 | * @param string $key |
| 160 | 160 | */ |
| 161 | 161 | public function dismiss( $key ) { |
| 162 | - if ( ! isset( $this->messages[ $key ] ) ) { |
|
| 162 | + if ( ! isset( $this->messages[$key] ) ) { |
|
| 163 | 163 | return; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) { |
|
| 167 | - $this->messages[ $key ]['dismissed'] = array(); |
|
| 166 | + if ( ! isset( $this->messages[$key]['dismissed'] ) ) { |
|
| 167 | + $this->messages[$key]['dismissed'] = array(); |
|
| 168 | 168 | } |
| 169 | - $this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time(); |
|
| 169 | + $this->messages[$key]['dismissed'][get_current_user_id()] = time(); |
|
| 170 | 170 | |
| 171 | 171 | $this->update_list(); |
| 172 | 172 | } |
@@ -175,8 +175,8 @@ discard block |
||
| 175 | 175 | $messages = $this->get_messages(); |
| 176 | 176 | $user_id = get_current_user_id(); |
| 177 | 177 | foreach ( $messages as $t => $message ) { |
| 178 | - if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) { |
|
| 179 | - unset( $messages[ $t ] ); |
|
| 178 | + if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) { |
|
| 179 | + unset( $messages[$t] ); |
|
| 180 | 180 | } |
| 181 | 181 | } |
| 182 | 182 | return $messages; |
@@ -195,8 +195,8 @@ discard block |
||
| 195 | 195 | * @since 4.05.02 |
| 196 | 196 | */ |
| 197 | 197 | public function remove( $key ) { |
| 198 | - if ( isset( $this->messages[ $key ] ) ) { |
|
| 199 | - unset( $this->messages[ $key ] ); |
|
| 198 | + if ( isset( $this->messages[$key] ) ) { |
|
| 199 | + unset( $this->messages[$key] ); |
|
| 200 | 200 | $this->update_list(); |
| 201 | 201 | } |
| 202 | 202 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | '-' => 'down', |
| 192 | 192 | '+' => 'up', |
| 193 | 193 | ); |
| 194 | - $class = 'frm_arrow' . $arrow[ $icon ]; |
|
| 194 | + $class = 'frm_arrow' . $arrow[$icon]; |
|
| 195 | 195 | } else { |
| 196 | 196 | //frm_minus1_icon |
| 197 | 197 | $key = str_replace( 'p', '', $key ); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | '-' => 'minus', |
| 200 | 200 | '+' => 'plus', |
| 201 | 201 | ); |
| 202 | - $class = 'frm_' . $plus[ $icon ]; |
|
| 202 | + $class = 'frm_' . $plus[$icon]; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if ( $key ) { |
@@ -219,8 +219,8 @@ discard block |
||
| 219 | 219 | ?> |
| 220 | 220 | <div class="btn-group" id="frm_<?php echo esc_attr( $name ); ?>_select"> |
| 221 | 221 | <button class="multiselect dropdown-toggle btn btn-default" data-toggle="dropdown" type="button"> |
| 222 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '+', $type ) ); ?> |
|
| 223 | - <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[ $name ], '-', $type ) ); ?> |
|
| 222 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '+', $type ) ); ?> |
|
| 223 | + <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $style->post_content[$name], '-', $type ) ); ?> |
|
| 224 | 224 | <b class="caret"></b> |
| 225 | 225 | </button> |
| 226 | 226 | <ul class="multiselect-container frm-dropdown-menu"> |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | <li <?php echo ( $style->post_content['collapse_icon'] == $key ) ? 'class="active"' : ''; ?>> |
| 229 | 229 | <a href="javascript:void(0);"> |
| 230 | 230 | <label> |
| 231 | - <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[ $name ], $key ); ?>/> |
|
| 231 | + <input type="radio" value="<?php echo esc_attr( $key ); ?>" name="<?php echo esc_attr( $frm_style->get_field_name( $name ) ); ?>" <?php checked( $style->post_content[$name], $key ); ?>/> |
|
| 232 | 232 | <span> |
| 233 | 233 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '+', $type ) ); ?> |
| 234 | 234 | <?php FrmAppHelper::icon_by_class( 'frmfont ' . self::icon_key_to_class( $key, '-', $type ) ); ?> |
@@ -310,12 +310,12 @@ discard block |
||
| 310 | 310 | $vars = array_diff( $vars, $remove ); |
| 311 | 311 | |
| 312 | 312 | foreach ( $vars as $var ) { |
| 313 | - if ( ! isset( $settings[ $var ] ) ) { |
|
| 313 | + if ( ! isset( $settings[$var] ) ) { |
|
| 314 | 314 | continue; |
| 315 | 315 | } |
| 316 | - $show = empty( $defaults ) || ( $settings[ $var ] !== '' && $settings[ $var ] !== $defaults[ $var ] ); |
|
| 316 | + $show = empty( $defaults ) || ( $settings[$var] !== '' && $settings[$var] !== $defaults[$var] ); |
|
| 317 | 317 | if ( $show ) { |
| 318 | - echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[ $var ] ) : esc_html( $settings[ $var ] ) ) . ';'; // WPCS: XSS ok. |
|
| 318 | + echo '--' . esc_html( str_replace( '_', '-', $var ) ) . ':' . ( $var === 'font' ? FrmAppHelper::kses( $settings[$var] ) : esc_html( $settings[$var] ) ) . ';'; // WPCS: XSS ok. |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | } |
@@ -355,14 +355,14 @@ discard block |
||
| 355 | 355 | $settings['style_class'] = 'frm_style_' . $style->post_name . '.'; |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | - $settings['style_class'] .= 'with_frm_style'; |
|
| 358 | + $settings['style_class'] .= 'with_frm_style'; |
|
| 359 | 359 | $settings['font'] = stripslashes( $settings['font'] ); |
| 360 | 360 | $settings['change_margin'] = self::description_margin_for_screensize( $settings['width'] ); |
| 361 | 361 | |
| 362 | 362 | $checkbox_opts = array( 'important_style', 'auto_width', 'submit_style', 'collapse_icon', 'center_form' ); |
| 363 | 363 | foreach ( $checkbox_opts as $opt ) { |
| 364 | - if ( ! isset( $settings[ $opt ] ) ) { |
|
| 365 | - $settings[ $opt ] = 0; |
|
| 364 | + if ( ! isset( $settings[$opt] ) ) { |
|
| 365 | + $settings[$opt] = 0; |
|
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | $css = ''; |
| 387 | 387 | } |
| 388 | 388 | foreach ( $opts as $opt ) { |
| 389 | - self::get_color_output( $css, $settings[ $opt ] ); |
|
| 389 | + self::get_color_output( $css, $settings[$opt] ); |
|
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | } |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | foreach ( $settings as $setting => $default ) { |
| 154 | - if ( isset( $params[ 'frm_' . $setting ] ) ) { |
|
| 155 | - $this->{$setting} = $params[ 'frm_' . $setting ]; |
|
| 154 | + if ( isset( $params['frm_' . $setting] ) ) { |
|
| 155 | + $this->{$setting} = $params['frm_' . $setting]; |
|
| 156 | 156 | } elseif ( ! isset( $this->{$setting} ) ) { |
| 157 | 157 | $this->{$setting} = $default; |
| 158 | 158 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | |
| 258 | 258 | $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'old_css', 'no_ips', 'tracking', 'admin_bar' ); |
| 259 | 259 | foreach ( $checkboxes as $set ) { |
| 260 | - $this->$set = isset( $params[ 'frm_' . $set ] ) ? $params[ 'frm_' . $set ] : 0; |
|
| 260 | + $this->$set = isset( $params['frm_' . $set] ) ? $params['frm_' . $set] : 0; |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $frm_roles = FrmAppHelper::frm_capabilities(); |
| 268 | 268 | $roles = get_editable_roles(); |
| 269 | 269 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 270 | - $this->$frm_role = (array) ( isset( $params[ $frm_role ] ) ? $params[ $frm_role ] : 'administrator' ); |
|
| 270 | + $this->$frm_role = (array) ( isset( $params[$frm_role] ) ? $params[$frm_role] : 'administrator' ); |
|
| 271 | 271 | |
| 272 | 272 | // Make sure administrators always have permissions |
| 273 | 273 | if ( ! in_array( 'administrator', $this->$frm_role ) ) { |
@@ -71,12 +71,12 @@ discard block |
||
| 71 | 71 | $show_intervals = array( 50, 200, 500 ); |
| 72 | 72 | $asked = $this->review_status['asked']; |
| 73 | 73 | |
| 74 | - if ( ! isset( $show_intervals[ $asked ] ) ) { |
|
| 74 | + if ( ! isset( $show_intervals[$asked] ) ) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | $entries = FrmEntry::getRecordCount(); |
| 79 | - $count = $show_intervals[ $asked ]; |
|
| 79 | + $count = $show_intervals[$asked]; |
|
| 80 | 80 | $user = wp_get_current_user(); |
| 81 | 81 | |
| 82 | 82 | // Only show review request if the site has collected enough entries |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $requests = $message->get_messages(); |
| 119 | 119 | $key = $this->inbox_key . ( $asked ? $asked : '' ); |
| 120 | 120 | |
| 121 | - if ( isset( $requests[ $key ] ) ) { |
|
| 121 | + if ( isset( $requests[$key] ) ) { |
|
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | * @since 4.05.02 |
| 155 | 155 | */ |
| 156 | 156 | private function has_later_request( $requests, $asked ) { |
| 157 | - return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] ); |
|
| 157 | + return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] ); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /** |