Plugin Name: Advanced Custom Fields: Repeater Collapser * Plugin URI: https://github.com/mrwweb/ACF-Repeater-Collapser * Description: Provides a way to collapse and expand repeater field instances in order to enable better sorting. * Version: 1.5.0 * Author: Aaron Rutley * Author URI: https://hookturn.io * Text Domain: advanced-custom-field-repeater-collapser */ define( 'ACF_REPEATER_COLLAPSER_VERSION', '1.5.0' ); /** * load text domain */ add_action( 'plugins_loaded', 'acf_repeater_collapser_textdomain' ); function acf_repeater_collapser_textdomain() { load_plugin_textdomain( 'advanced-custom-field-repeater-collapser' ); } /* Load the javascript and CSS files on the ACF admin pages */ // 11 helps take precedence over core styles add_action( 'acf/input/admin_enqueue_scripts', 'acf_repeater_collapser_assets', 11 ); function acf_repeater_collapser_assets() { if( ! class_exists( 'acf' ) ) { return; } $acf_version = acf()->settings['version']; if ( version_compare( $acf_version, '4.0', '<' ) ) { return; } $uri = plugin_dir_url( __FILE__ ); $version = ACF_REPEATER_COLLAPSER_VERSION; $prefix = version_compare( $acf_version, '5.3.1', '>=' ) ? 'acf5' : 'acf4'; wp_enqueue_script( 'acf_repeater_collapser_admin_js', esc_url( "{$uri}js/{$prefix}_repeater_collapser_admin.js" ), array( 'jquery' ), $version ); wp_localize_script( 'acf_repeater_collapser_admin_js', 'acfrcL10n', array( 'collapseRows' => esc_html__( 'Collapse All Rows', 'advanced-custom-field-repeater-collapser' ), 'collapseRow' => esc_html__( 'Collapse Row', 'advanced-custom-field-repeater-collapser' ), 'expandRows' => esc_html__( 'Expand All Rows', 'advanced-custom-field-repeater-collapser' ), 'expandRow' => esc_html__( 'Expand Row', 'advanced-custom-field-repeater-collapser' ), 'expandAll' => esc_html__( 'Expand All', 'advanced-custom-field-repeater-collapser' ), 'collapseAll' => esc_html__( 'Collapse All', 'advanced-custom-field-repeater-collapser' ), ) ); wp_enqueue_style( 'acf_repeater_collapser_admin_css', esc_url( "{$uri}css/{$prefix}_repeater_collapser_admin.css" ), false, $version ); } acf_has_upgrade * * Returns true if this site has an upgrade avaialble. * * @date 24/8/18 * @since 5.7.4 * * @param void * @return bool */ function acf_has_upgrade() { // vars $db_version = acf_get_db_version(); // return true if DB version is < latest upgrade version if( $db_version && acf_version_compare($db_version, '<', '5.5.0') ) { return true; } // update DB version if needed if( $db_version !== ACF_VERSION ) { acf_update_db_version( ACF_VERSION ); } // return return false; } /** * acf_upgrade_all * * Returns true if this site has an upgrade avaialble. * * @date 24/8/18 * @since 5.7.4 * * @param void * @return bool */ function acf_upgrade_all() { // increase time limit @set_time_limit(600); // start timer timer_start(); // log acf_dev_log('ACF Upgrade Begin.'); // vars $db_version = acf_get_db_version(); // 5.0.0 if( acf_version_compare($db_version, '<', '5.0.0') ) { acf_upgrade_500(); } // 5.5.0 if( acf_version_compare($db_version, '<', '5.5.0') ) { acf_upgrade_550(); } // upgrade DB version once all updates are complete acf_update_db_version( ACF_VERSION ); // log global $wpdb; acf_dev_log('ACF Upgrade Complete.', $wpdb->num_queries, timer_stop(0)); } /** * acf_get_db_version * * Returns the ACF DB version. * * @date 10/09/2016 * @since 5.4.0 * * @param void * @return string */ function acf_get_db_version() { return get_option('acf_version'); } /* * acf_update_db_version * * Updates the ACF DB version. * * @date 10/09/2016 * @since 5.4.0 * * @param string $version The new version. * @return void */ function acf_update_db_version( $version = '' ) { update_option('acf_version', $version ); } /** * acf_upgrade_500 * * Version 5 introduces new post types for field groups and fields. * * @date 23/8/18 * @since 5.7.4 * * @param void * @return void */ function acf_upgrade_500() { // log acf_dev_log('ACF Upgrade 5.0.0.'); // action do_action('acf/upgrade_500'); // do tasks acf_upgrade_500_field_groups(); // update version acf_update_db_version('5.0.0'); } /** * acf_upgrade_500_field_groups * * Upgrades all ACF4 field groups to ACF5 * * @date 23/8/18 * @since 5.7.4 * * @param void * @return void */ function acf_upgrade_500_field_groups() { // log acf_dev_log('ACF Upgrade 5.0.0 Field Groups.'); // get old field groups $ofgs = get_posts(array( 'numberposts' => -1, 'post_type' => 'acf', 'orderby' => 'menu_order title', 'order' => 'asc', 'suppress_filters' => true, )); // loop if( $ofgs ) { foreach( $ofgs as $ofg ){ acf_upgrade_500_field_group( $ofg ); } } } /** * acf_upgrade_500_field_group * * Upgrades a ACF4 field group to ACF5 * * @date 23/8/18 * @since 5.7.4 * * @param object $ofg The old field group post object. * @return array $nfg The new field group array. */ function acf_upgrade_500_field_group( $ofg ) { // log acf_dev_log('ACF Upgrade 5.0.0 Field Group.', $ofg); // vars $nfg = array( 'ID' => 0, 'title' => $ofg->post_title, 'menu_order' => $ofg->menu_order, ); // construct the location rules $rules = get_post_meta($ofg->ID, 'rule', false); $anyorall = get_post_meta($ofg->ID, 'allorany', true); if( is_array($rules) ) { // if field group was duplicated, rules may be a serialized string! $rules = array_map('maybe_unserialize', $rules); // convert rules to groups $nfg['location'] = acf_convert_rules_to_groups( $rules, $anyorall ); } // settings if( $position = get_post_meta($ofg->ID, 'position', true) ) { $nfg['position'] = $position; } if( $layout = get_post_meta($ofg->ID, 'layout', true) ) { $nfg['layout'] = $layout; } if( $hide_on_screen = get_post_meta($ofg->ID, 'hide_on_screen', true) ) { $nfg['hide_on_screen'] = maybe_unserialize($hide_on_screen); } // save field group // acf_upgrade_field_group will call the acf_get_valid_field_group function and apply 'compatibility' changes $nfg = acf_update_field_group( $nfg ); // log acf_dev_log('> Complete.', $nfg); // action for 3rd party do_action('acf/upgrade_500_field_group', $nfg, $ofg); // upgrade fields acf_upgrade_500_fields( $ofg, $nfg ); // trash? if( $ofg->post_status == 'trash' ) { acf_trash_field_group( $nfg['ID'] ); } // return return $nfg; } /** * acf_upgrade_500_fields * * Upgrades all ACF4 fields to ACF5 from a specific field group * * @date 23/8/18 * @since 5.7.4 * * @param object $ofg The old field group post object. * @param array $nfg The new field group array. * @return void */ function acf_upgrade_500_fields( $ofg, $nfg ) { // log acf_dev_log('ACF Upgrade 5.0.0 Fields.'); // global global $wpdb; // get field from postmeta $rows = $wpdb->get_results($wpdb->prepare("SELECT * FROM $wpdb->postmeta WHERE post_id = %d AND meta_key LIKE %s", $ofg->ID, 'field_%'), ARRAY_A); // check if( $rows ) { // vars $checked = array(); // loop foreach( $rows as $row ) { // vars $field = $row['meta_value']; $field = maybe_unserialize( $field ); $field = maybe_unserialize( $field ); // run again for WPML // bail early if key already migrated (potential duplicates in DB) if( isset($checked[ $field['key'] ]) ) continue; $checked[ $field['key'] ] = 1; // add parent $field['parent'] = $nfg['ID']; // migrate field $field = acf_upgrade_500_field( $field ); } } } /** * acf_upgrade_500_field * * Upgrades a ACF4 field to ACF5 * * @date 23/8/18 * @since 5.7.4 * * @param array $field The old field. * @return array $field The new field. */ function acf_upgrade_500_field( $field ) { // log acf_dev_log('ACF Upgrade 5.0.0 Field.', $field); // order_no is now menu_order $field['menu_order'] = acf_extract_var( $field, 'order_no', 0 ); // correct very old field keys (field2 => field_2) if( substr($field['key'], 0, 6) !== 'field_' ) { $field['key'] = 'field_' . str_replace('field', '', $field['key']); } // extract sub fields $sub_fields = array(); if( $field['type'] == 'repeater' ) { // loop over sub fields if( !empty($field['sub_fields']) ) { foreach( $field['sub_fields'] as $sub_field ) { $sub_fields[] = $sub_field; } } // remove sub fields from field unset( $field['sub_fields'] ); } elseif( $field['type'] == 'flexible_content' ) { // loop over layouts if( is_array($field['layouts']) ) { foreach( $field['layouts'] as $i => $layout ) { // generate key $layout['key'] = uniqid('layout_'); // loop over sub fields if( !empty($layout['sub_fields']) ) { foreach( $layout['sub_fields'] as $sub_field ) { $sub_field['parent_layout'] = $layout['key']; $sub_fields[] = $sub_field; } } // remove sub fields from layout unset( $layout['sub_fields'] ); // update $field['layouts'][ $i ] = $layout; } } } // save field $field = acf_update_field( $field ); // log acf_dev_log('> Complete.', $field); // sub fields if( $sub_fields ) { foreach( $sub_fields as $sub_field ) { $sub_field['parent'] = $field['ID']; acf_upgrade_500_field($sub_field); } } // action for 3rd party do_action('acf/update_500_field', $field); // return return $field; } /** * acf_upgrade_550 * * Version 5.5 adds support for the wp_termmeta table added in WP 4.4. * * @date 23/8/18 * @since 5.7.4 * * @param void * @return void */ function acf_upgrade_550() { // log acf_dev_log('ACF Upgrade 5.5.0.'); // action do_action('acf/upgrade_550'); // do tasks acf_upgrade_550_termmeta(); // update version acf_update_db_version('5.5.0'); } /** * acf_upgrade_550_termmeta * * Upgrades all ACF4 termmeta saved in wp_options to the wp_termmeta table. * * @date 23/8/18 * @since 5.7.4 * * @param void * @return void */ function acf_upgrade_550_termmeta() { // log acf_dev_log('ACF Upgrade 5.5.0 Termmeta.'); // bail early if no wp_termmeta table if( get_option('db_version') < 34370 ) { return; } // get all taxonomies $taxonomies = get_taxonomies(false, 'objects'); // loop if( $taxonomies ) { foreach( $taxonomies as $taxonomy ) { acf_upgrade_550_taxonomy( $taxonomy->name ); }} // action for 3rd party do_action('acf/upgrade_550_termmeta'); } /* * acf_wp_upgrade_550_termmeta * * When the database is updated to support term meta, migrate ACF term meta data across. * * @date 23/8/18 * @since 5.7.4 * * @param string $wp_db_version The new $wp_db_version. * @param string $wp_current_db_version The old (current) $wp_db_version. * @return void */ function acf_wp_upgrade_550_termmeta( $wp_db_version, $wp_current_db_version ) { if( $wp_db_version >= 34370 && $wp_current_db_version < 34370 ) { if( acf_version_compare(acf_get_db_version(), '>', '5.5.0') ) { acf_upgrade_550_termmeta(); } } } add_action( 'wp_upgrade', 'acf_wp_upgrade_550_termmeta', 10, 2 ); /** * acf_upgrade_550_taxonomy * * Upgrades all ACF4 termmeta for a specific taxonomy. * * @date 24/8/18 * @since 5.7.4 * * @param string $taxonomy The taxonomy name. * @return void */ function acf_upgrade_550_taxonomy( $taxonomy ) { // log acf_dev_log('ACF Upgrade 5.5.0 Taxonomy.', $taxonomy); // global global $wpdb; // vars $search = $taxonomy . '_%'; $_search = '_' . $search; // escape '_' // http://stackoverflow.com/questions/2300285/how-do-i-escape-in-sql-server $search = str_replace('_', '\_', $search); $_search = str_replace('_', '\_', $_search); // search // results show faster query times using 2 LIKE vs 2 wildcards $rows = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $wpdb->options WHERE option_name LIKE %s OR option_name LIKE %s", $search, $_search ), ARRAY_A); // loop if( $rows ) { foreach( $rows as $row ) { /* Use regex to find "(_)taxonomy_(term_id)_(field_name)" and populate $matches: Array ( [0] => _category_3_color [1] => _ [2] => 3 [3] => color ) */ if( !preg_match("/^(_?){$taxonomy}_(\d+)_(.+)/", $row['option_name'], $matches) ) { continue; } // vars $term_id = $matches[2]; $meta_key = $matches[1] . $matches[3]; $meta_value = $row['option_value']; // update // memory usage reduced by 50% by using a manual insert vs update_metadata() function. //update_metadata( 'term', $term_id, $meta_name, $meta_value ); $wpdb->insert( $wpdb->termmeta, array( 'term_id' => $term_id, 'meta_key' => $meta_key, 'meta_value' => $meta_value )); // log acf_dev_log('ACF Upgrade 5.5.0 Term.', $term_id, $meta_key); // action do_action('acf/upgrade_550_taxonomy_term', $term_id); }} // action for 3rd party do_action('acf/upgrade_550_taxonomy', $taxonomy); } ?> Plugin Name: CF7 Customizer * Plugin URI: https://WPCouple.com/ * Description: Customize Contact Form 7 forms with live theme customizer. After installing this plugin, go to Contact > CF7 Customizer Settings! * Author: WPCouple(Ahmad Awais & Maedah Batool) * Author URI: https://AhmadAwais.com/ * Version: 1.1.1 * License: GPL v2+ * License URI: http://www.gnu.org/licenses/gpl-2.0.txt * * @package CFC */ /* Copyright 2015-2020 WPTie ( email: support at wptie.com ) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or ( at your option ) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } /** * Define global constants. * * @package CFC * @since 0.0.1 */ // Plugin version. if ( ! defined( 'CFC_VERSION' ) ) { define( 'CFC_VERSION', '1.1.0' ); } if ( ! defined( 'CFC_NAME' ) ) { define( 'CFC_NAME', trim( dirname( plugin_basename( __FILE__ ) ), '/' ) ); } if ( ! defined('CFC_DIR' ) ) { define( 'CFC_DIR', WP_PLUGIN_DIR . '/' . CFC_NAME ); } if ( ! defined('CFC_URL' ) ) { define( 'CFC_URL', WP_PLUGIN_URL . '/' . CFC_NAME ); } // Assets Path. $cft_assets = CFC_URL . '/assets/'; /** * CFC Main File. * * This is the main file of CFC which controls everything in this plugin. * * @since 0.0.1 */ if ( file_exists( CFC_DIR . '/assets/inc/cfc.php' ) ) { require_once( CFC_DIR . '/assets/inc/cfc.php' ); } // Commented since freemius takes care of the redirect. // Makes no sense to make a duplicate redirect. /** * Plugin Activation. * * Add the welcome page transient. * * @since 0.0.1 * @package CFC */ /* // The register_activation_hook( __FILE__, 'cfc_welcome_screen_activate' ); hook. function cfc_welcome_screen_activate() { set_transient( '_welcome_redirect_cfc', true ); } */ /** * Plugin Deactivation. * * Delete the welcome page transient. * * @since 0.0.1 * @package CFC */ /* // The register_deactivation_hook( __FILE__, 'cfc_welcome_screen_deactivate' ); hook. function cfc_welcome_screen_deactivate() { delete_transient( '_welcome_redirect_cfc' ); } */ Get contact form 7 id * * Back compat for CF7 3.9 * @see http://contactform7.com/2014/07/02/contact-form-7-39-beta/ * * @param $cf7 Contact Form 7 object * @since 0.1.0 */ if ( !defined( 'ABSPATH' ) ) { exit; } function get_form_id( $cf7 ) { if ( version_compare( WPCF7_VERSION, '3.9-alpha', '>' ) ) { if (!is_object($cf7)) { return false; } return $cf7->id(); } } CF7 Style System status */ if ( !defined( 'ABSPATH' ) ) { exit; } function cf7style_system_status() { /** * let_to_num function. * * This function transforms the php.ini notation for numbers (like '2M') to an integer. * * @param $size * @return int */ function cf7style_let_to_num( $size ) { $l = substr( $size, -1 ); $ret = substr( $size, 0, -1 ); switch ( strtoupper( $l ) ) { case 'P': $ret *= 1024; case 'T': $ret *= 1024; case 'G': $ret *= 1024; case 'M': $ret *= 1024; case 'K': $ret *= 1024; } return $ret; } // Cache variables $html = ''; $table = ''; $form = ''; $table_start = ''; $table_end = '
 '; $html .= '
'; $html .= '

' . __( "System Status", "contact-form-7-style" ) . '

'; $html .= '

' . __( "The Contact Form 7 Style System Status is a tool for troubleshooting issues with your site.", "contact-form-7-style" ) . '

'; $html .= '

' . __( "With the informations gathered from you we can debug and analyze and try to offer you a fix.", "contact-form-7-style" ) . '

'; $html .= '

' . __( "The System Status is the best way for Contact Form 7 Style Support to help you!", "contact-form-7-style" ) . '

'; // Form $form .= '
'; $form .= '

'; $form .= '

'; $form .= '

'; $form .= ''; // Debug - system status send button //delete_transient( 'cf7style_system_report' ); $report_status = get_transient( 'cf7style_system_report' ); if( $report_status && 'sent' == $report_status ) { $form .= ''; } else { $form .= ''; } $form .= '
'; $html .= $form; // General $table .= $table_start; $table .= '' . __( "Your WordPress Setup", "contact-form-7-style" ) . ''; // Home URL $table .= "" . __( 'Home URL:', 'contact-form-7-style' ) . ""; $table .= "" . home_url() . ""; // Site URL $table .= "" . __( 'Site URL:', 'contact-form-7-style' ) . ""; $table .= "" . site_url() . ""; // CF7 Style Version $table .= "" . __( 'Contact Form 7 Style Version:', 'contact-form-7-style' ) . ""; $table .= "" . WPCF7S_PLUGIN_VER . ""; // WP Version $table .= "" . __( 'WP Version:', 'contact-form-7-style' ) . ""; $table .= "" . get_bloginfo( 'version' ) . ""; // WP Multisite $table .= "" . __( 'WP Multisite:', 'contact-form-7-style' ) . ""; $table .= "" . ( ( is_multisite() ) ? "Yes" : "No" ) . ""; // WP Memory Limit $memory = cf7style_let_to_num( WP_MEMORY_LIMIT ); $table .= "" . __( ' WP Memory Limit:', 'contact-form-7-style' ) . ""; if ( $memory < 100663296 ) { $table .= '' . sprintf( __( '%s - Recommended memory at least 96MB. See: Increasing memory allocated to PHP', 'contact-form-7-style' ), size_format( $memory ), 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP' ) . ''; } else { $table .= '' . size_format( $memory ) . ''; } // WP Debug Mode $table .= "" . __( 'WP Debug Mode:', 'contact-form-7-style' ) . ""; $table .= "" . ( ( WP_DEBUG ) ? "enabled" : "disabled" ) . ""; // Language $table .= "" . __( 'Language:', 'contact-form-7-style' ) . ""; $table .= "" . get_locale() . ""; // Email address for feedback $table .= "" . __( 'Site email address', 'contact-form-7-style' ) . ""; $table .= "" . get_option( 'admin_email' ) . ""; $table .= $table_end; // Your Server Setup $table .= $table_start; $table .= '' . __( "Your Server Setup", "contact-form-7-style" ) . ''; // Server info $table .= "" . __( 'Server info', 'contact-form-7-style' ) . ""; $table .= "" . esc_html( $_SERVER['SERVER_SOFTWARE'] ) . ""; // PHP version $table .= "" . __( 'PHP Version', 'contact-form-7-style' ) . ""; if ( function_exists( 'phpversion' ) ) : $php_version = phpversion(); if ( version_compare( $php_version, '5.6', '<' ) ) { $table .= '' . sprintf( __( '%s - WordPress recommends a minimum PHP version of 5.6. See: %s', 'contact-form-7-style' ), esc_html( $php_version ), '' . __( 'WordPress Requirements', 'contact-form-7-style' ) . '' ) . ''; } else { $table .= '' . esc_html( $php_version ) . ''; } else : $table .= '' . __( "Couldn't determine PHP version because phpversion() doesn't exist.", 'contact-form-7-style' ) . ''; endif; if ( function_exists( 'ini_get' ) ) : // PHP Post Max Size $table .= "" . __( 'PHP Post Max Size:', 'contact-form-7-style' ) . ""; $table .= "" . size_format( cf7style_let_to_num( ini_get( 'post_max_size' ) ) ) . ""; endif; // MySQL Version /** @global wpdb $wpdb */ global $wpdb; $table .= "" . __( 'MySQL Version:', 'contact-form-7-style' ) . ""; $table .= "" . $wpdb->db_version() . ""; // Max Upload Size $table .= "" . __( 'Max Upload Size', 'contact-form-7-style' ) . ""; $table .= "" . size_format( wp_max_upload_size() ) . ""; // Default Timezone $default_timezone = date_default_timezone_get(); $table .= "" . __( 'Default Timezone:', 'contact-form-7-style' ) . ""; $table .= '' . $default_timezone . ''; $table .= $table_end; // Active Plugins $active_plugins_count = count( (array) get_option( 'active_plugins' ) ); $table .= $table_start; $table .= '' . __( "Active Plugins", "contact-form-7-style" ) . ' (' . $active_plugins_count . ')'; $active_plugins = (array) get_option( 'active_plugins', array() ); if ( is_multisite() ) { $network_activated_plugins = array_keys( get_site_option( 'active_sitewide_plugins', array() ) ); $active_plugins = array_merge( $active_plugins, $network_activated_plugins ); } foreach ( $active_plugins as $plugin ) { $plugin_data = @get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); $dirname = dirname( $plugin ); $version_string = ''; $network_string = ''; if ( ! empty( $plugin_data['Name'] ) ) { // Link the plugin name to the plugin url if available. $plugin_name = esc_html( $plugin_data['Name'] ); if ( ! empty( $plugin_data['PluginURI'] ) ) { $plugin_name = '' . $plugin_name . ''; } $table .= "" . $plugin_name. ""; $table .= "" . sprintf( _x( 'by %s', 'by author', 'contact-form-7-style' ), $plugin_data['Author'] ) . ' – ' . __( 'Version', 'contact-form-7-style' ) . ' ' . esc_html( $plugin_data['Version'] ) . $version_string . $network_string . ""; } } $table .= $table_end; // Active Theme $active_theme = wp_get_theme(); $table .= $table_start; $table .= '' . __( "Theme", "contact-form-7-style" ) . ''; $table .= "" . __( 'Name:', 'contact-form-7-style' ) . ""; $table .= "" . $active_theme->Name . ""; $table .= "" . __( 'Version:', 'contact-form-7-style' ) . ""; $table .= "" . $active_theme->Version . ""; $table .= "" . __( 'Child Theme:', 'contact-form-7-style' ) . ""; $table .= "" . ( ( is_child_theme() ) ? 'Yes' : 'No' ) . ""; $table .= "" . __( 'Theme URL:', 'contact-form-7-style' ) . ""; $table .= "" . $active_theme->get( 'ThemeURI' ) . ""; $table .= $table_end; $html .= $table; $html .= '
'; echo $html; } add_action( 'admin_menu', 'cf7style_register_help_submenu_page' ); function cf7style_register_help_submenu_page() { add_submenu_page( 'edit.php?post_type=cf7_style', 'System Status', 'System Status', 'manage_options', 'system-status', 'cf7style_system_status' ); } /** * Send status report */ function cf7_style_send_status_report() { $name = sanitize_text_field( $_POST['name'] ); $email = sanitize_email( $_POST['email'] ); $message = sanitize_text_field( $_POST['message'] ); $site_name = get_bloginfo( 'name' ); $to = 'cf7style@gmail.com'; $subject = __( 'CF7 Style System Status', 'contact-form-7-style' ) . " - {$site_name}"; $body = wp_kses_post( $_POST['report'] ); $body .= ""; $body .= ""; $body .= "
Name: " . $name . "
Email: " . $email . "
Message: " . $message . "
"; $headers = array( 'Content-Type: text/html; charset=UTF-8' ); $wp_mail = wp_mail( $to, $subject, $body, $headers ); // Auto-response $auto_response = ""; $auto_response .= ""; $auto_response .= ""; $auto_response .= ""; $auto_response .= ""; $auto_response .= "
" . __( 'Hey there', 'contact-form-7-style' ) . ",
" . __( 'Thank you for using Contact Form 7 Style', 'contact-form-7-style' ) . ".
" . __( 'One of our consultants will reply as soon as possible', 'contact-form-7-style' ) . ".
" . __( 'Thank you!', 'contact-form-7-style' ) . "
" . __( 'Contact Form 7 Style Support Team', 'contact-form-7-style' ) . "
"; $auto_response .= ""; $auto_response .= ""; $auto_response .= ""; $auto_response .= ""; $auto_response .= ""; $auto_response .= "
" . __( 'If you like this plugin we hope that you will help support our continued development', 'contact-form-7-style' ) . ".
" . __( 'The two best ways to offer your support is to', 'contact-form-7-style' ) . " "; $auto_response .= __( 'send us a Donation', 'contact-form-7-style' ) . ". "; $auto_response .= __( 'Even $1 helps encourage us to do more', 'contact-form-7-style' ) . ".
" . __( 'If you can’t donate, please help us reach our 5-star rating by', 'contact-form-7-style' ); $auto_response .= " " . __( 'rating this plugin', 'contact-form-7-style' ) . "."; $auto_response .= "
" . __( 'All contributions will be gratefully acknowledged', 'contact-form-7-style' ) . "!
"; $wp_mail2 = wp_mail( $email, $subject, $auto_response, $headers ); if( false === $wp_mail ) { echo 'error'; } else { set_transient( 'cf7style_system_report', 'sent', DAY_IN_SECONDS ); echo 'success'; } wp_die(); } add_action( 'wp_ajax_cf7_style_send_status_report', 'cf7_style_send_status_report' ); All the functions and classes in this file are deprecated. * You shouldn't use them. The functions and classes will be * removed in a later version. */ function wpcf7_add_shortcode( $tag, $func, $has_name = false ) { wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_add_form_tag' ); return wpcf7_add_form_tag( $tag, $func, $has_name ); } function wpcf7_remove_shortcode( $tag ) { wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_remove_form_tag' ); return wpcf7_remove_form_tag( $tag ); } function wpcf7_do_shortcode( $content ) { wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_replace_all_form_tags' ); return wpcf7_replace_all_form_tags( $content ); } function wpcf7_scan_shortcode( $cond = null ) { wpcf7_deprecated_function( __FUNCTION__, '4.6', 'wpcf7_scan_form_tags' ); return wpcf7_scan_form_tags( $cond ); } class WPCF7_ShortcodeManager { private static $form_tags_manager; private function __construct() {} public static function get_instance() { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::get_instance' ); self::$form_tags_manager = WPCF7_FormTagsManager::get_instance(); return new self; } public function get_scanned_tags() { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::get_scanned_tags' ); return self::$form_tags_manager->get_scanned_tags(); } public function add_shortcode( $tag, $func, $has_name = false ) { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::add' ); return self::$form_tags_manager->add( $tag, $func, $has_name ); } public function remove_shortcode( $tag ) { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::remove' ); return self::$form_tags_manager->remove( $tag ); } public function normalize_shortcode( $content ) { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::normalize' ); return self::$form_tags_manager->normalize( $content ); } public function do_shortcode( $content, $exec = true ) { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::replace_all' ); if ( $exec ) { return self::$form_tags_manager->replace_all( $content ); } else { return self::$form_tags_manager->scan( $content ); } } public function scan_shortcode( $content ) { wpcf7_deprecated_function( __METHOD__, '4.6', 'WPCF7_FormTagsManager::scan' ); return self::$form_tags_manager->scan( $content ); } } class WPCF7_Shortcode extends WPCF7_FormTag { public function __construct( $tag ) { wpcf7_deprecated_function( 'WPCF7_Shortcode', '4.6', 'WPCF7_FormTag' ); parent::__construct( $tag ); } } * Special Mail Tags ** https://contactform7.com/special-mail-tags/ **/ add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag', 10, 3 ); function wpcf7_special_mail_tag( $output, $name, $html ) { $name = preg_replace( '/^wpcf7\./', '_', $name ); // for back-compat $submission = WPCF7_Submission::get_instance(); if ( ! $submission ) { return $output; } if ( '_remote_ip' == $name ) { if ( $remote_ip = $submission->get_meta( 'remote_ip' ) ) { return $remote_ip; } else { return ''; } } if ( '_user_agent' == $name ) { if ( $user_agent = $submission->get_meta( 'user_agent' ) ) { return $html ? esc_html( $user_agent ) : $user_agent; } else { return ''; } } if ( '_url' == $name ) { if ( $url = $submission->get_meta( 'url' ) ) { return esc_url( $url ); } else { return ''; } } if ( '_date' == $name or '_time' == $name ) { if ( $timestamp = $submission->get_meta( 'timestamp' ) ) { if ( '_date' == $name ) { return date_i18n( get_option( 'date_format' ), $timestamp ); } if ( '_time' == $name ) { return date_i18n( get_option( 'time_format' ), $timestamp ); } } return ''; } if ( '_invalid_fields' == $name ) { return count( $submission->get_invalid_fields() ); } return $output; } add_filter( 'wpcf7_special_mail_tags', 'wpcf7_post_related_smt', 10, 3 ); function wpcf7_post_related_smt( $output, $name, $html ) { if ( '_post_' != substr( $name, 0, 6 ) ) { return $output; } $submission = WPCF7_Submission::get_instance(); if ( ! $submission ) { return $output; } $post_id = (int) $submission->get_meta( 'container_post_id' ); if ( ! $post_id or ! $post = get_post( $post_id ) ) { return ''; } if ( '_post_id' == $name ) { return (string) $post->ID; } if ( '_post_name' == $name ) { return $post->post_name; } if ( '_post_title' == $name ) { return $html ? esc_html( $post->post_title ) : $post->post_title; } if ( '_post_url' == $name ) { return get_permalink( $post->ID ); } $user = new WP_User( $post->post_author ); if ( '_post_author' == $name ) { return $user->display_name; } if ( '_post_author_email' == $name ) { return $user->user_email; } return $output; } add_filter( 'wpcf7_special_mail_tags', 'wpcf7_site_related_smt', 10, 3 ); function wpcf7_site_related_smt( $output, $name, $html ) { $filter = $html ? 'display' : 'raw'; if ( '_site_title' == $name ) { return get_bloginfo( 'name', $filter ); } if ( '_site_description' == $name ) { return get_bloginfo( 'description', $filter ); } if ( '_site_url' == $name ) { return get_bloginfo( 'url', $filter ); } if ( '_site_admin_email' == $name ) { return get_bloginfo( 'admin_email', $filter ); } return $output; } add_filter( 'wpcf7_special_mail_tags', 'wpcf7_user_related_smt', 10, 3 ); function wpcf7_user_related_smt( $output, $name, $html ) { if ( '_user_' != substr( $name, 0, 6 ) or '_user_agent' == $name ) { return $output; } $submission = WPCF7_Submission::get_instance(); if ( ! $submission ) { return $output; } $user_id = (int) $submission->get_meta( 'current_user_id' ); if ( ! $user_id ) { return ''; } $primary_props = array( 'user_login', 'user_email', 'user_url' ); $opt = ltrim( $name, '_' ); $opt = in_array( $opt, $primary_props ) ? $opt : substr( $opt, 5 ); $user = new WP_User( $user_id ); if ( $user->has_prop( $opt ) ) { return $user->get( $opt ); } return ''; }