@@ -26,12 +26,12 @@ discard block |
||
| 26 | 26 | </ul> |
| 27 | 27 | </div> |
| 28 | 28 | |
| 29 | - <?php do_action('frm_before_settings'); ?> |
|
| 29 | + <?php do_action( 'frm_before_settings' ); ?> |
|
| 30 | 30 | |
| 31 | 31 | <form name="frm_settings_form" method="post" class="frm_settings_form" action="?page=formidable-settings<?php echo ( $a ? '&t=' . $a : '' ); ?>"> |
| 32 | 32 | <input type="hidden" name="frm_action" value="process-form" /> |
| 33 | 33 | <input type="hidden" name="action" value="process-form" /> |
| 34 | - <?php wp_nonce_field('process_form_nonce', 'process_form'); ?> |
|
| 34 | + <?php wp_nonce_field( 'process_form_nonce', 'process_form' ); ?> |
|
| 35 | 35 | |
| 36 | 36 | <div class="general_settings tabs-panel <?php echo esc_attr( $a === 'general_settings' ? 'frm_block' : 'frm_hidden' ); ?>"> |
| 37 | 37 | <p class="submit"> |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | <p> |
| 58 | 58 | <label for="frm_use_html"> |
| 59 | - <input type="checkbox" id="frm_use_html" name="frm_use_html" value="1" <?php checked($frm_settings->use_html, 1) ?>> <?php esc_html_e( 'Use HTML5 in forms', 'formidable' ) ?> |
|
| 59 | + <input type="checkbox" id="frm_use_html" name="frm_use_html" value="1" <?php checked( $frm_settings->use_html, 1 ) ?>> <?php esc_html_e( 'Use HTML5 in forms', 'formidable' ) ?> |
|
| 60 | 60 | </label> |
| 61 | 61 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'We recommend using HTML 5 for your forms. It adds some nifty options like placeholders, patterns, and autocomplete.', 'formidable' ) ?>"></span> |
| 62 | 62 | </p> |
@@ -95,10 +95,10 @@ discard block |
||
| 95 | 95 | </p> |
| 96 | 96 | |
| 97 | 97 | <p><label class="frm_left_label"><?php esc_html_e( 'Site Key', 'formidable' ) ?></label> |
| 98 | - <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr($frm_settings->pubkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 98 | + <input type="text" name="frm_pubkey" id="frm_pubkey" size="42" value="<?php echo esc_attr( $frm_settings->pubkey ) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 99 | 99 | |
| 100 | 100 | <p><label class="frm_left_label"><?php esc_html_e( 'Secret Key', 'formidable' ) ?></label> |
| 101 | - <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr($frm_settings->privkey) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 101 | + <input type="text" name="frm_privkey" id="frm_privkey" size="42" value="<?php echo esc_attr( $frm_settings->privkey ) ?>" placeholder="<?php esc_attr_e( 'Optional', 'formidable' ) ?>" /></p> |
|
| 102 | 102 | |
| 103 | 103 | <p><label class="frm_left_label"><?php esc_html_e( 'reCAPTCHA Type', 'formidable' ) ?></label> |
| 104 | 104 | <select name="frm_re_type" id="frm_re_type"> |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | <select name="frm_re_lang" id="frm_re_lang"> |
| 115 | 115 | <option value="" <?php selected( $frm_settings->re_lang, '' ) ?>><?php esc_html_e( 'Browser Default', 'formidable' ); ?></option> |
| 116 | 116 | <?php foreach ( $captcha_lang as $lang => $lang_name ) { ?> |
| 117 | - <option value="<?php echo esc_attr($lang) ?>" <?php selected($frm_settings->re_lang, $lang) ?>><?php echo esc_html( $lang_name ) ?></option> |
|
| 117 | + <option value="<?php echo esc_attr( $lang ) ?>" <?php selected( $frm_settings->re_lang, $lang ) ?>><?php echo esc_html( $lang_name ) ?></option> |
|
| 118 | 118 | <?php } ?> |
| 119 | 119 | </select></p> |
| 120 | 120 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | <label class="frm_left_label"><?php esc_html_e( 'Success Message', 'formidable' ); ?> |
| 168 | 168 | <span class="frm_help frm_icon_font frm_tooltip_icon" title="<?php esc_attr_e( 'The default message seen after a form is submitted.', 'formidable' ) ?>" ></span> |
| 169 | 169 | </label> |
| 170 | - <input type="text" id="frm_success_msg" name="frm_success_msg" class="frm_with_left_label" value="<?php echo esc_attr($frm_settings->success_msg) ?>" /> |
|
| 170 | + <input type="text" id="frm_success_msg" name="frm_success_msg" class="frm_with_left_label" value="<?php echo esc_attr( $frm_settings->success_msg ) ?>" /> |
|
| 171 | 171 | </p> |
| 172 | 172 | |
| 173 | 173 | <p> |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | <input type="text" value="<?php echo esc_attr( $frm_settings->submit_value ) ?>" id="frm_submit_value" name="frm_submit_value" class="frm_with_left_label" /> |
| 176 | 176 | </p> |
| 177 | 177 | |
| 178 | - <?php do_action('frm_settings_form', $frm_settings); ?> |
|
| 178 | + <?php do_action( 'frm_settings_form', $frm_settings ); ?> |
|
| 179 | 179 | |
| 180 | 180 | <?php if ( ! FrmAppHelper::pro_is_installed() ) { ?> |
| 181 | 181 | <div class="clear"></div> |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | </a> |
| 67 | 67 | <?php } ?> |
| 68 | 68 | <?php |
| 69 | - if ( $style->ID ) { |
|
| 69 | + if ( $style->ID ) { |
|
| 70 | 70 | echo '<span class="howto"><span>.frm_style_' . esc_attr( $style->post_name ) . '</span></span>'; |
| 71 | 71 | } |
| 72 | 72 | ?> |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | $user_ID = get_current_user_id(); |
| 43 | 43 | $user_ID = ( $user_ID ? $user_ID : '' ); |
| 44 | - $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][ $this->field['id'] ] ) ); |
|
| 44 | + $posted_value = ( FrmAppHelper::is_admin() && $_POST && isset( $_POST['item_meta'][$this->field['id']] ) ); |
|
| 45 | 45 | $updating = ( isset( $args['action'] ) && $args['action'] == 'update' ); |
| 46 | 46 | $value = ( is_numeric( $this->field['value'] ) || $posted_value || $updating ) ? $this->field['value'] : $user_ID; |
| 47 | 47 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $size_html = $size ? ' style="width:' . esc_attr( $size . ( is_numeric( $size ) ? 'px' : '' ) ) . '";' : ''; |
| 35 | 35 | |
| 36 | 36 | $max = FrmField::get_option( $this->field, 'max' ); |
| 37 | - $default_value = FrmAppHelper::esc_textarea( force_balance_tags( $this->get_field_column('default_value') ) ); |
|
| 37 | + $default_value = FrmAppHelper::esc_textarea( force_balance_tags( $this->get_field_column( 'default_value' ) ) ); |
|
| 38 | 38 | |
| 39 | 39 | echo '<textarea name="' . esc_attr( $this->html_name( $name ) ) . '" ' . |
| 40 | 40 | $size_html . ' rows="' . esc_attr( $max ) . '" ' . |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | return $errors; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - if ( ! isset( $_POST['g-recaptcha-response']) ) { |
|
| 145 | + if ( ! isset( $_POST['g-recaptcha-response'] ) ) { |
|
| 146 | 146 | // If captcha is missing, check if it was already verified |
| 147 | 147 | if ( ! isset( $_POST['recaptcha_checked'] ) || ! wp_verify_nonce( $_POST['recaptcha_checked'], 'frm_ajax' ) ) { |
| 148 | 148 | // There was no captcha submitted |
| 149 | - $errors[ 'field' . $args['id'] ] = __( 'The captcha is missing from this form', 'formidable' ); |
|
| 149 | + $errors['field' . $args['id']] = __( 'The captcha is missing from this form', 'formidable' ); |
|
| 150 | 150 | } |
| 151 | 151 | return $errors; |
| 152 | 152 | } |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | if ( isset( $response['success'] ) && ! $response['success'] ) { |
| 160 | 160 | // What happens when the CAPTCHA was entered incorrectly |
| 161 | 161 | $invalid_message = FrmField::get_option( $this->field, 'invalid' ); |
| 162 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
| 162 | + $errors['field' . $args['id']] = ( $invalid_message == '' ? $frm_settings->re_msg : $invalid_message ); |
|
| 163 | 163 | } elseif ( is_wp_error( $resp ) ) { |
| 164 | 164 | $error_string = $resp->get_error_message(); |
| 165 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
| 166 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
| 165 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your recaptcha', 'formidable' ); |
|
| 166 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | return $errors; |
@@ -39,15 +39,15 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function insert_installed_addon( $plugins ) { |
| 42 | - $plugins[ $this->plugin_slug ] = $this; |
|
| 42 | + $plugins[$this->plugin_slug] = $this; |
|
| 43 | 43 | return $plugins; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public static function get_addon( $plugin_slug ) { |
| 47 | 47 | $plugins = apply_filters( 'frm_installed_addons', array() ); |
| 48 | 48 | $plugin = false; |
| 49 | - if ( isset( $plugins[ $plugin_slug ] ) ) { |
|
| 50 | - $plugin = $plugins[ $plugin_slug ]; |
|
| 49 | + if ( isset( $plugins[$plugin_slug] ) ) { |
|
| 50 | + $plugin = $plugins[$plugin_slug]; |
|
| 51 | 51 | } |
| 52 | 52 | return $plugin; |
| 53 | 53 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | echo '<tr class="plugin-update-tr active"><td colspan="' . esc_attr( $wp_list_table->get_column_count() ) . '" class="plugin-update colspanchange"><div class="update-message">'; |
| 156 | 156 | |
| 157 | 157 | /* translators: %1$s: Plugin name, %2$s: Start link HTML, %3$s: end link HTML */ |
| 158 | - printf( esc_html__( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), esc_html( $this->plugin_name ), '<a href="' . esc_url( admin_url('admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' ); |
|
| 158 | + printf( esc_html__( 'Your %1$s license key is missing. Please add it on the %2$slicenses page%3$s.', 'formidable' ), esc_html( $this->plugin_name ), '<a href="' . esc_url( admin_url( 'admin.php?page=formidable-settings&t=licenses_settings' ) ) . '">', '</a>' ); |
|
| 159 | 159 | $id = sanitize_title( $plugin['Name'] ); |
| 160 | 160 | echo '<script type="text/javascript">var d = document.getElementById("' . esc_attr( $id ) . '");if ( d !== null ){ d.className = d.className + " update"; }</script>'; |
| 161 | 161 | echo '</div></td></tr>'; |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | if ( $this->is_current_version( $transient ) ) { |
| 170 | 170 | //make sure it doesn't show there is an update if plugin is up-to-date |
| 171 | - if ( isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 172 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 171 | + if ( isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 172 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 173 | 173 | } |
| 174 | - } elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) { |
|
| 174 | + } elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) { |
|
| 175 | 175 | $cache_key = $this->version_cache_key(); |
| 176 | 176 | $version_info = get_option( $cache_key ); |
| 177 | 177 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | if ( false !== $version_info && version_compare( $version_info->new_version, $this->version, '>' ) ) { |
| 186 | - $transient->response[ $this->plugin_folder ] = $version_info; |
|
| 186 | + $transient->response[$this->plugin_folder] = $version_info; |
|
| 187 | 187 | } else { |
| 188 | 188 | delete_option( $cache_key ); |
| 189 | 189 | if ( ! $this->has_been_cleared() ) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $this->manually_queue_update(); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - unset( $transient->response[ $this->plugin_folder ] ); |
|
| 195 | + unset( $transient->response[$this->plugin_folder] ); |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | private function is_current_version( $transient ) { |
| 229 | - if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) { |
|
| 229 | + if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) { |
|
| 230 | 230 | return false; |
| 231 | 231 | } |
| 232 | 232 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | return true; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version; |
|
| 238 | + return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version; |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | private function has_been_cleared() { |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | $response['message'] = $response['status']; |
| 312 | 312 | } else { |
| 313 | 313 | $messages = $this->get_messages(); |
| 314 | - if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) { |
|
| 315 | - $response['message'] = $messages[ $response['status'] ]; |
|
| 314 | + if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) { |
|
| 315 | + $response['message'] = $messages[$response['status']]; |
|
| 316 | 316 | } else { |
| 317 | 317 | $response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) ); |
| 318 | 318 | } |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | * @return array |
| 137 | 137 | */ |
| 138 | 138 | private function prepare_array_property( $index, $atts ) { |
| 139 | - if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) { |
|
| 139 | + if ( isset( $atts[$index] ) && ! empty( $atts[$index] ) ) { |
|
| 140 | 140 | |
| 141 | - if ( is_array( $atts[ $index ] ) ) { |
|
| 142 | - $property = $atts[ $index ]; |
|
| 141 | + if ( is_array( $atts[$index] ) ) { |
|
| 142 | + $property = $atts[$index]; |
|
| 143 | 143 | } else { |
| 144 | - $property = explode( ',', $atts[ $index ] ); |
|
| 144 | + $property = explode( ',', $atts[$index] ); |
|
| 145 | 145 | } |
| 146 | 146 | } else { |
| 147 | 147 | $property = array(); |
@@ -274,6 +274,6 @@ discard block |
||
| 274 | 274 | * @param stdClass $field |
| 275 | 275 | */ |
| 276 | 276 | protected function add_field_values( $field ) { |
| 277 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
| 277 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
| 278 | 278 | } |
| 279 | 279 | } |
@@ -59,8 +59,8 @@ discard block |
||
| 59 | 59 | protected function init_saved_value( $entry ) { |
| 60 | 60 | if ( $this->field->type === 'html' ) { |
| 61 | 61 | $this->saved_value = $this->field->description; |
| 62 | - } else if ( isset( $entry->metas[ $this->field->id ] ) ) { |
|
| 63 | - $this->saved_value = $entry->metas[ $this->field->id ]; |
|
| 62 | + } else if ( isset( $entry->metas[$this->field->id] ) ) { |
|
| 63 | + $this->saved_value = $entry->metas[$this->field->id]; |
|
| 64 | 64 | } else { |
| 65 | 65 | $this->saved_value = ''; |
| 66 | 66 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | // TODO: maybe change from 'source' to 'run_filters' = 'email' |
| 177 | 177 | if ( isset( $atts['source'] ) && $atts['source'] === 'entry_formatter' ) { |
| 178 | 178 | // Deprecated frm_email_value hook |
| 179 | - $meta = array( |
|
| 179 | + $meta = array( |
|
| 180 | 180 | 'item_id' => $entry->id, |
| 181 | 181 | 'field_id' => $this->field->id, |
| 182 | 182 | 'meta_value' => $this->saved_value, |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | $this->error_message = isset( $atts['error_message'] ) ? $atts['error_message'] : ''; |
| 22 | 22 | $this->uploads = wp_upload_dir(); |
| 23 | 23 | $this->set_new_file_path( $atts ); |
| 24 | - $this->chmod_dir = defined('FS_CHMOD_DIR') ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
| 25 | - $this->chmod_file = defined('FS_CHMOD_FILE') ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
| 24 | + $this->chmod_dir = defined( 'FS_CHMOD_DIR' ) ? FS_CHMOD_DIR : ( fileperms( ABSPATH ) & 0777 | 0755 ); |
|
| 25 | + $this->chmod_file = defined( 'FS_CHMOD_FILE' ) ? FS_CHMOD_FILE : ( fileperms( ABSPATH . 'index.php' ) & 0777 | 0644 ); |
|
| 26 | 26 | |
| 27 | 27 | $this->check_permission(); |
| 28 | 28 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | private function get_creds() { |
| 157 | - if ( ! function_exists('get_filesystem_method') ) { |
|
| 157 | + if ( ! function_exists( 'get_filesystem_method' ) ) { |
|
| 158 | 158 | include_once( ABSPATH . 'wp-admin/includes/file.php' ); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -173,13 +173,13 @@ discard block |
||
| 173 | 173 | 'username' => '', |
| 174 | 174 | ) ); |
| 175 | 175 | |
| 176 | - $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : $credentials['hostname']; |
|
| 177 | - $credentials['username'] = defined('FTP_USER') ? FTP_USER : $credentials['username']; |
|
| 178 | - $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : ''; |
|
| 176 | + $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : $credentials['hostname']; |
|
| 177 | + $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : $credentials['username']; |
|
| 178 | + $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : ''; |
|
| 179 | 179 | |
| 180 | 180 | // Check to see if we are setting the public/private keys for ssh |
| 181 | - $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : ''; |
|
| 182 | - $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : ''; |
|
| 181 | + $credentials['public_key'] = defined( 'FTP_PUBKEY' ) ? FTP_PUBKEY : ''; |
|
| 182 | + $credentials['private_key'] = defined( 'FTP_PRIKEY' ) ? FTP_PRIKEY : ''; |
|
| 183 | 183 | |
| 184 | 184 | // Sanitize the hostname, Some people might pass in odd-data: |
| 185 | 185 | $credentials['hostname'] = preg_replace( '|\w+://|', '', $credentials['hostname'] ); //Strip any schemes off |