Файловый менеджер - Редактировать - /home/infrafs/INFRABIKEIT/wp-content/plugins/contact-form-7.zip
Назад
PK #74\��G modules/hidden.phpnu �[��� <?php add_action( 'wpcf7_init', 'wpcf7_add_form_tag_hidden', 10, 0 ); function wpcf7_add_form_tag_hidden() { wpcf7_add_form_tag( 'hidden', 'wpcf7_hidden_form_tag_handler', array( 'name-attr' => true, 'display-hidden' => true, ) ); } function wpcf7_hidden_form_tag_handler( $tag ) { if ( empty( $tag->name ) ) { return ''; } $atts = array(); $class = wpcf7_form_controls_class( $tag->type ); $atts['class'] = $tag->get_class_option( $class ); $atts['id'] = $tag->get_id_option(); $value = (string) reset( $tag->values ); $value = $tag->get_default_option( $value ); $atts['value'] = $value; $atts['type'] = 'hidden'; $atts['name'] = $tag->name; $atts = wpcf7_format_atts( $atts ); $html = sprintf( '<input %s />', $atts ); return $html; } PK #74\�)� modules/disallowed-list.phpnu �[��� <?php add_filter( 'wpcf7_spam', 'wpcf7_disallowed_list', 10, 2 ); function wpcf7_disallowed_list( $spam, $submission ) { if ( $spam ) { return $spam; } $target = wpcf7_array_flatten( $submission->get_posted_data() ); $target[] = $submission->get_meta( 'remote_ip' ); $target[] = $submission->get_meta( 'user_agent' ); $target = implode( "\n", $target ); $word = wpcf7_check_disallowed_list( $target ); $word = wpcf7_apply_filters_deprecated( 'wpcf7_submission_is_blacklisted', array( $word, $submission ), '5.3', 'wpcf7_submission_has_disallowed_words' ); $word = apply_filters( 'wpcf7_submission_has_disallowed_words', $word, $submission ); if ( $word ) { if ( is_bool( $word ) ) { $reason = __( "Disallowed words are used.", 'contact-form-7' ); } else { $reason = sprintf( __( "Disallowed words (%s) are used.", 'contact-form-7' ), implode( ', ', (array) $word ) ); } $submission->add_spam_log( array( 'agent' => 'disallowed_list', 'reason' => $reason, ) ); } $spam = (bool) $word; return $spam; } function wpcf7_check_disallowed_list( $target ) { $mod_keys = get_option( 'disallowed_keys' ); if ( is_scalar( $mod_keys ) ) { $mod_keys = trim( $mod_keys ); } else { $mod_keys = ''; } if ( '' === $mod_keys ) { return false; } foreach ( explode( "\n", $mod_keys ) as $word ) { $word = trim( $word ); $length = strlen( $word ); if ( $length < 2 or 256 < $length ) { continue; } $pattern = sprintf( '#%s#i', preg_quote( $word, '#' ) ); if ( preg_match( $pattern, $target ) ) { return $word; } } return false; } function wpcf7_blacklist_check( $target ) { wpcf7_deprecated_function( __FUNCTION__, '5.3', 'wpcf7_check_disallowed_list' ); return wpcf7_check_disallowed_list( $target ); } PK #74\�5�z$ z$ modules/checkbox.phpnu �[��� <?php /** ** A base module for [checkbox], [checkbox*], and [radio] **/ /* form_tag handler */ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_checkbox', 10, 0 ); function wpcf7_add_form_tag_checkbox() { wpcf7_add_form_tag( array( 'checkbox', 'checkbox*', 'radio' ), 'wpcf7_checkbox_form_tag_handler', array( 'name-attr' => true, 'selectable-values' => true, 'multiple-controls-container' => true, ) ); } function wpcf7_checkbox_form_tag_handler( $tag ) { if ( empty( $tag->name ) ) { return ''; } $validation_error = wpcf7_get_validation_error( $tag->name ); $class = wpcf7_form_controls_class( $tag->type ); if ( $validation_error ) { $class .= ' wpcf7-not-valid'; } $label_first = $tag->has_option( 'label_first' ); $use_label_element = $tag->has_option( 'use_label_element' ); $exclusive = $tag->has_option( 'exclusive' ); $free_text = $tag->has_option( 'free_text' ); $multiple = false; if ( 'checkbox' == $tag->basetype ) { $multiple = ! $exclusive; } else { // radio $exclusive = false; } if ( $exclusive ) { $class .= ' wpcf7-exclusive-checkbox'; } $atts = array(); $atts['class'] = $tag->get_class_option( $class ); $atts['id'] = $tag->get_id_option(); if ( $validation_error ) { $atts['aria-describedby'] = wpcf7_get_validation_error_reference( $tag->name ); } $tabindex = $tag->get_option( 'tabindex', 'signed_int', true ); if ( false !== $tabindex ) { $tabindex = (int) $tabindex; } $html = ''; $count = 0; if ( $data = (array) $tag->get_data_option() ) { if ( $free_text ) { $tag->values = array_merge( array_slice( $tag->values, 0, -1 ), array_values( $data ), array_slice( $tag->values, -1 ) ); $tag->labels = array_merge( array_slice( $tag->labels, 0, -1 ), array_values( $data ), array_slice( $tag->labels, -1 ) ); } else { $tag->values = array_merge( $tag->values, array_values( $data ) ); $tag->labels = array_merge( $tag->labels, array_values( $data ) ); } } $values = $tag->values; $labels = $tag->labels; $default_choice = $tag->get_default_option( null, array( 'multiple' => $multiple, ) ); $hangover = wpcf7_get_hangover( $tag->name, $multiple ? array() : '' ); foreach ( $values as $key => $value ) { if ( $hangover ) { $checked = in_array( $value, (array) $hangover, true ); } else { $checked = in_array( $value, (array) $default_choice, true ); } if ( isset( $labels[$key] ) ) { $label = $labels[$key]; } else { $label = $value; } $item_atts = array( 'type' => $tag->basetype, 'name' => $tag->name . ( $multiple ? '[]' : '' ), 'value' => $value, 'checked' => $checked, 'tabindex' => $tabindex, ); $item_atts = wpcf7_format_atts( $item_atts ); if ( $label_first ) { // put label first, input last $item = sprintf( '<span class="wpcf7-list-item-label">%1$s</span><input %2$s />', esc_html( $label ), $item_atts ); } else { $item = sprintf( '<input %2$s /><span class="wpcf7-list-item-label">%1$s</span>', esc_html( $label ), $item_atts ); } if ( $use_label_element ) { $item = '<label>' . $item . '</label>'; } if ( false !== $tabindex and 0 < $tabindex ) { $tabindex += 1; } $class = 'wpcf7-list-item'; $count += 1; if ( 1 == $count ) { $class .= ' first'; } if ( count( $values ) == $count ) { // last round $class .= ' last'; if ( $free_text ) { $free_text_name = $tag->name . '_free_text'; $free_text_atts = array( 'name' => $free_text_name, 'class' => 'wpcf7-free-text', 'tabindex' => $tabindex, ); if ( wpcf7_is_posted() and isset( $_POST[$free_text_name] ) ) { $free_text_atts['value'] = wp_unslash( $_POST[$free_text_name] ); } $free_text_atts = wpcf7_format_atts( $free_text_atts ); $item .= sprintf( ' <input type="text" %s />', $free_text_atts ); $class .= ' has-free-text'; } } $item = '<span class="' . esc_attr( $class ) . '">' . $item . '</span>'; $html .= $item; } $html = sprintf( '<span class="wpcf7-form-control-wrap" data-name="%1$s"><span %2$s>%3$s</span>%4$s</span>', esc_attr( $tag->name ), wpcf7_format_atts( $atts ), $html, $validation_error ); return $html; } add_action( 'wpcf7_swv_create_schema', 'wpcf7_swv_add_checkbox_rules', 10, 2 ); function wpcf7_swv_add_checkbox_rules( $schema, $contact_form ) { $tags = $contact_form->scan_form_tags( array( 'type' => array( 'checkbox*', 'radio' ), ) ); foreach ( $tags as $tag ) { $schema->add_rule( wpcf7_swv_create_rule( 'required', array( 'field' => $tag->name, 'error' => wpcf7_get_message( 'invalid_required' ), ) ) ); } } /* Tag generator */ add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_checkbox_and_radio', 30, 0 ); function wpcf7_add_tag_generator_checkbox_and_radio() { $tag_generator = WPCF7_TagGenerator::get_instance(); $tag_generator->add( 'checkbox', __( 'checkboxes', 'contact-form-7' ), 'wpcf7_tag_generator_checkbox' ); $tag_generator->add( 'radio', __( 'radio buttons', 'contact-form-7' ), 'wpcf7_tag_generator_checkbox' ); } function wpcf7_tag_generator_checkbox( $contact_form, $args = '' ) { $args = wp_parse_args( $args, array() ); $type = $args['id']; if ( 'radio' != $type ) { $type = 'checkbox'; } if ( 'checkbox' == $type ) { $description = __( "Generate a form-tag for a group of checkboxes. For more details, see %s.", 'contact-form-7' ); } elseif ( 'radio' == $type ) { $description = __( "Generate a form-tag for a group of radio buttons. For more details, see %s.", 'contact-form-7' ); } $desc_link = wpcf7_link( __( 'https://contactform7.com/checkboxes-radio-buttons-and-menus/', 'contact-form-7' ), __( 'Checkboxes, radio buttons and menus', 'contact-form-7' ) ); ?> <div class="control-box"> <fieldset> <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend> <table class="form-table"> <tbody> <?php if ( 'checkbox' == $type ) : ?> <tr> <th scope="row"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></th> <td> <fieldset> <legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'contact-form-7' ) ); ?></legend> <label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'contact-form-7' ) ); ?></label> </fieldset> </td> </tr> <?php endif; ?> <tr> <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th> <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td> </tr> <tr> <th scope="row"><?php echo esc_html( __( 'Options', 'contact-form-7' ) ); ?></th> <td> <fieldset> <legend class="screen-reader-text"><?php echo esc_html( __( 'Options', 'contact-form-7' ) ); ?></legend> <textarea name="values" class="values" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>"></textarea> <label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><span class="description"><?php echo esc_html( __( "One option per line.", 'contact-form-7' ) ); ?></span></label><br /> <label><input type="checkbox" name="label_first" class="option" /> <?php echo esc_html( __( 'Put a label first, a checkbox last', 'contact-form-7' ) ); ?></label><br /> <label><input type="checkbox" name="use_label_element" class="option" checked="checked" /> <?php echo esc_html( __( 'Wrap each item with label element', 'contact-form-7' ) ); ?></label> <?php if ( 'checkbox' == $type ) : ?> <br /><label><input type="checkbox" name="exclusive" class="option" /> <?php echo esc_html( __( 'Make checkboxes exclusive', 'contact-form-7' ) ); ?></label> <?php endif; ?> </fieldset> </td> </tr> <tr> <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th> <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td> </tr> <tr> <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th> <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td> </tr> </tbody> </table> </fieldset> </div> <div class="insert-box"> <input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" /> <div class="submitbox"> <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" /> </div> <br class="clear" /> <p class="description mail-tag"><label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( "To use the value input through this field in a mail field, you need to insert the corresponding mail-tag (%s) into the field on the Mail tab.", 'contact-form-7' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /></label></p> </div> <?php } PK #74\x$6y y modules/submit.phpnu �[��� <?php /** ** A base module for [submit] **/ /* form_tag handler */ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_submit', 10, 0 ); function wpcf7_add_form_tag_submit() { wpcf7_add_form_tag( 'submit', 'wpcf7_submit_form_tag_handler' ); } function wpcf7_submit_form_tag_handler( $tag ) { $class = wpcf7_form_controls_class( $tag->type, 'has-spinner' ); $atts = array(); $atts['class'] = $tag->get_class_option( $class ); $atts['id'] = $tag->get_id_option(); $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true ); $value = isset( $tag->values[0] ) ? $tag->values[0] : ''; if ( empty( $value ) ) { $value = __( 'Send', 'contact-form-7' ); } $atts['type'] = 'submit'; $atts['value'] = $value; $atts = wpcf7_format_atts( $atts ); $html = sprintf( '<input %1$s />', $atts ); return $html; } /* Tag generator */ add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_submit', 55, 0 ); function wpcf7_add_tag_generator_submit() { $tag_generator = WPCF7_TagGenerator::get_instance(); $tag_generator->add( 'submit', __( 'submit', 'contact-form-7' ), 'wpcf7_tag_generator_submit', array( 'nameless' => 1 ) ); } function wpcf7_tag_generator_submit( $contact_form, $args = '' ) { $args = wp_parse_args( $args, array() ); $description = __( "Generate a form-tag for a submit button. For more details, see %s.", 'contact-form-7' ); $desc_link = wpcf7_link( __( 'https://contactform7.com/submit-button/', 'contact-form-7' ), __( 'Submit button', 'contact-form-7' ) ); ?> <div class="control-box"> <fieldset> <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend> <table class="form-table"> <tbody> <tr> <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label></th> <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /></td> </tr> <tr> <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th> <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td> </tr> <tr> <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th> <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td> </tr> </tbody> </table> </fieldset> </div> <div class="insert-box"> <input type="text" name="submit" class="tag code" readonly="readonly" onfocus="this.select()" /> <div class="submitbox"> <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" /> </div> </div> <?php } PK #74\t�P� modules/reflection.phpnu �[��� <?php /** * Reflection module * * @link https://contactform7.com/reflection/ */ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_reflection', 10, 0 ); /** * Registers reflection-related form-tag types. */ function wpcf7_add_form_tag_reflection() { wpcf7_add_form_tag( 'reflection', 'wpcf7_reflection_form_tag_handler', array( 'name-attr' => true, 'display-block' => true, 'not-for-mail' => true, ) ); wpcf7_add_form_tag( 'output', 'wpcf7_output_form_tag_handler', array( 'name-attr' => true, 'not-for-mail' => true, ) ); } /** * The form-tag handler for the reflection type. */ function wpcf7_reflection_form_tag_handler( $tag ) { if ( empty( $tag->name ) ) { return ''; } $values = $tag->values ? $tag->values : array( '' ); if ( ! wpcf7_get_validation_error( $tag->name ) ) { $hangover = array_filter( (array) wpcf7_get_hangover( $tag->name ) ); if ( $hangover ) { $values = $hangover; } } $content = array_reduce( $values, static function ( $carry, $item ) use ( $tag ) { $output_tag = sprintf( '<output %1$s>%2$s</output>', wpcf7_format_atts( array( 'name' => $tag->name, 'data-default' => $item, ) ), ( '' !== $item ) ? esc_html( $item ) : ' ' ); return $carry . $output_tag; }, '' ); $html = sprintf( '<fieldset %1$s>%2$s</fieldset>', wpcf7_format_atts( array( 'data-reflection-of' => $tag->name, 'class' => $tag->get_class_option( wpcf7_form_controls_class( $tag->type ) ), 'id' => $tag->get_id_option(), ) ), $content ); return $html; } /** * The form-tag handler for the output type. */ function wpcf7_output_form_tag_handler( $tag ) { if ( empty( $tag->name ) ) { return ''; } $value = (string) reset( $tag->values ); if ( ! wpcf7_get_validation_error( $tag->name ) ) { $hangover = array_filter( (array) wpcf7_get_hangover( $tag->name ) ); if ( $hangover ) { $value = (string) reset( $hangover ); } } $html = sprintf( '<output %1$s>%2$s</output>', wpcf7_format_atts( array( 'data-reflection-of' => $tag->name, 'data-default' => $value, 'name' => $tag->name, 'class' => $tag->get_class_option( wpcf7_form_controls_class( $tag->type ) ), 'id' => $tag->get_id_option(), ) ), esc_html( $value ) ); return $html; } PK #74\$��� � modules/akismet/service.phpnu �[��� <?php if ( ! class_exists( 'WPCF7_Service' ) ) { return; } class WPCF7_Akismet extends WPCF7_Service { private static $instance; public static function get_instance() { if ( empty( self::$instance ) ) { self::$instance = new self; } return self::$instance; } public function get_title() { return __( 'Akismet', 'contact-form-7' ); } public function is_active() { return wpcf7_akismet_is_available(); } public function get_categories() { return array( 'spam_protection' ); } public function icon() { } public function link() { echo wpcf7_link( 'https://akismet.com/', 'akismet.com' ); } public function display( $action = '' ) { echo sprintf( '<p>%s</p>', esc_html( __( "CAPTCHAs are designed to distinguish spambots from humans, and are therefore helpless against human spammers. In contrast to CAPTCHAs, Akismet checks form submissions against the global database of spam; this means Akismet is a comprehensive solution against spam. This is why we consider Akismet to be the centerpiece of the spam prevention strategy.", 'contact-form-7' ) ) ); echo sprintf( '<p><strong>%s</strong></p>', wpcf7_link( __( 'https://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7' ), __( 'Spam filtering with Akismet', 'contact-form-7' ) ) ); if ( $this->is_active() ) { echo sprintf( '<p class="dashicons-before dashicons-yes">%s</p>', esc_html( __( "Akismet is active on this site.", 'contact-form-7' ) ) ); } } } PK #74\�3�ig g modules/akismet/akismet.phpnu �[��� <?php /** * The Akismet integration module * * @link https://akismet.com/development/api/ */ wpcf7_include_module_file( 'akismet/service.php' ); add_action( 'wpcf7_init', 'wpcf7_akismet_register_service', 30, 0 ); /** * Registers the Akismet service. */ function wpcf7_akismet_register_service() { $integration = WPCF7_Integration::get_instance(); $integration->add_service( 'akismet', WPCF7_Akismet::get_instance() ); } add_filter( 'wpcf7_spam', 'wpcf7_akismet', 10, 2 ); function wpcf7_akismet( $spam, $submission ) { if ( $spam ) { return $spam; } if ( ! wpcf7_akismet_is_available() ) { return false; } if ( ! $params = wpcf7_akismet_submitted_params() ) { return false; } $c = array(); $c['comment_author'] = $params['author']; $c['comment_author_email'] = $params['author_email']; $c['comment_author_url'] = $params['author_url']; $c['comment_content'] = $params['content']; $c['blog'] = get_option( 'home' ); $c['blog_lang'] = get_locale(); $c['blog_charset'] = get_option( 'blog_charset' ); $c['user_ip'] = $_SERVER['REMOTE_ADDR']; $c['user_agent'] = $_SERVER['HTTP_USER_AGENT']; $c['referrer'] = $_SERVER['HTTP_REFERER']; $c['comment_type'] = 'contact-form'; $datetime = date_create_immutable( '@' . $submission->get_meta( 'timestamp' ) ); if ( $datetime ) { $c['comment_date_gmt'] = $datetime->format( DATE_ATOM ); } if ( $permalink = get_permalink() ) { $c['permalink'] = $permalink; } $ignore = array( 'HTTP_COOKIE', 'HTTP_COOKIE2', 'PHP_AUTH_PW' ); foreach ( $_SERVER as $key => $value ) { if ( ! in_array( $key, (array) $ignore ) ) { $c["$key"] = $value; } } $c = apply_filters( 'wpcf7_akismet_parameters', $c ); if ( wpcf7_akismet_comment_check( $c ) ) { $spam = true; $submission->add_spam_log( array( 'agent' => 'akismet', 'reason' => __( "Akismet returns a spam response.", 'contact-form-7' ), ) ); } else { $spam = false; } return $spam; } /** * Returns true if Akismet is active and has a valid API key. */ function wpcf7_akismet_is_available() { if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) { return (bool) Akismet::get_api_key(); } return false; } /** * Returns an array of parameters based on the current form submission. * Returns false if Akismet is not active on the contact form. */ function wpcf7_akismet_submitted_params() { $akismet_tags = array_filter( wpcf7_scan_form_tags(), static function ( $tag ) { $akismet_option = $tag->get_option( 'akismet', '(author|author_email|author_url)', true ); return (bool) $akismet_option; } ); if ( ! $akismet_tags ) { // Akismet is not active on this contact form. return false; } $params = array( 'author' => '', 'author_email' => '', 'author_url' => '', 'content' => '', ); foreach ( (array) $_POST as $key => $val ) { if ( '_wpcf7' == substr( $key, 0, 6 ) or '_wpnonce' == $key ) { continue; } $vals = array_filter( wpcf7_array_flatten( $val ), static function ( $val ) { return '' !== trim( $val ); } ); if ( empty( $vals ) ) { continue; } if ( $tags = wpcf7_scan_form_tags( array( 'name' => $key ) ) ) { $tag = $tags[0]; $akismet_option = $tag->get_option( 'akismet', '(author|author_email|author_url)', true ); if ( 'author' === $akismet_option ) { $params['author'] = sprintf( '%s %s', $params['author'], implode( ' ', $vals ) ); continue; } if ( 'author_email' === $akismet_option and '' === $params['author_email'] ) { $params['author_email'] = $vals[0]; continue; } if ( 'author_url' === $akismet_option and '' === $params['author_url'] ) { $params['author_url'] = $vals[0]; continue; } $vals = array_filter( $vals, static function ( $val ) use ( $tag ) { if ( wpcf7_form_tag_supports( $tag->type, 'selectable-values' ) and in_array( $val, $tag->labels ) ) { return false; } else { return true; } } ); } if ( $vals ) { $params['content'] .= "\n\n" . implode( ', ', $vals ); } } $params = array_map( 'trim', $params ); return $params; } /** * Sends data to Akismet. * * @param array $comment Submission and environment data. * @return bool True if Akismet called it spam, or false otherwise. */ function wpcf7_akismet_comment_check( $comment ) { $spam = false; $query_string = wpcf7_build_query( $comment ); if ( is_callable( array( 'Akismet', 'http_post' ) ) ) { $response = Akismet::http_post( $query_string, 'comment-check' ); } else { return $spam; } if ( 'true' == $response[1] ) { $spam = true; } if ( $submission = WPCF7_Submission::get_instance() ) { $submission->push( 'akismet', array( 'comment' => $comment, 'spam' => $spam, ) ); } return apply_filters( 'wpcf7_akismet_comment_check', $spam, $comment ); } add_filter( 'wpcf7_posted_data', 'wpcf7_akismet_posted_data', 10, 1 ); /** * Removes Akismet-related properties from the posted data. * * This does not affect the $_POST variable itself. * * @link https://plugins.trac.wordpress.org/browser/akismet/tags/5.0/_inc/akismet-frontend.js */ function wpcf7_akismet_posted_data( $posted_data ) { if ( wpcf7_akismet_is_available() ) { $posted_data = array_diff_key( $posted_data, array( 'ak_bib' => '', 'ak_bfs' => '', 'ak_bkpc' => '', 'ak_bkp' => '', 'ak_bmc' => '', 'ak_bmcc' => '', 'ak_bmk' => '', 'ak_bck' => '', 'ak_bmmc' => '', 'ak_btmc' => '', 'ak_bsc' => '', 'ak_bte' => '', 'ak_btec' => '', 'ak_bmm' => '', ) ); } return $posted_data; } add_filter( 'wpcf7_default_template', 'wpcf7_akismet_default_template', 10, 2 ); function wpcf7_akismet_default_template( $template, $prop ) { if ( ! wpcf7_akismet_is_available() ) { return $template; } if ( 'form' === $prop ) { $template = str_replace( array( '[text* your-name ', '[email* your-email ', ), array( '[text* your-name akismet:author ', '[email* your-email akismet:author_email ', ), $template ); $privacy_notice = sprintf( '%s %s', __( "This form uses Akismet to reduce spam.", 'contact-form-7' ), wpcf7_link( 'https://akismet.com/privacy/', __( "Learn how your data is processed.", 'contact-form-7' ), array( 'target' => '_blank', 'rel' => 'nofollow noopener', ) ) ); $template .= "\n\n" . $privacy_notice; } return $template; } PK #74\�_�'