<?php /** * Theme functions and definitions * * @package HelloElementorChild */ /** * Load child theme css and optional scripts * * @return void */ function hello_elementor_child_enqueue_scripts() { wp_enqueue_style( 'hello-elementor-child-style', get_stylesheet_directory_uri() . '/style.css', [ 'hello-elementor-theme-style', ], '1.0.0' ); } add_action( 'wp_enqueue_scripts', 'hello_elementor_child_enqueue_scripts', 20 ); // Allow SVG add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) { global $wp_version; if ( $wp_version !== '4.7.1' ) { return $data; } $filetype = wp_check_filetype( $filename, $mimes ); return [ 'ext' => $filetype['ext'], 'type' => $filetype['type'], 'proper_filename' => $data['proper_filename'] ]; }, 10, 4 ); function cc_mime_types( $mimes ){ $mimes['svg'] = 'image/svg+xml'; return $mimes; } add_filter( 'upload_mimes', 'cc_mime_types' ); function fix_svg() { echo '<style type="text/css"> .attachment-266x266, .thumbnail img { width: 100% !important; height: auto !important; } </style>'; } add_action( 'admin_head', 'fix_svg' ); /*reading time*/ function reading_time() { $content = get_post_field( 'post_content', $post->ID ); $word_count = str_word_count( strip_tags( $content ) ); $readingtime = ceil($word_count / 260); if ($readingtime == 1) { $timer = " minute read"; } else { $timer = " minutes read"; } $totalreadingtime = $readingtime . $timer; return $totalreadingtime; } add_shortcode('wpbread', 'reading_time'); // Add Categories and Tags to Pages function wpse_add_tags_categories_to_pages() { register_taxonomy_for_object_type('post_tag', 'page'); register_taxonomy_for_object_type('category', 'page'); } add_action( 'init', 'wpse_add_tags_categories_to_pages' ); /*add excerpt to wp poststs*/ add_post_type_support( 'page', 'excerpt' ); // Disable XML-RPC add_filter('xmlrpc_enabled', '__return_false'); // Elementor description meta tag function remove_hello_elementor_description_meta_tag() { remove_action( 'wp_head', 'hello_elementor_add_description_meta_tag' ); } add_action( 'after_setup_theme', 'remove_hello_elementor_description_meta_tag' ); add_filter('flying_press_js_delay_timeout', function(){ return 60;}); //Edit something add_action('elementor/editor/before_enqueue_scripts', function() { wp_add_inline_script('elementor-editor', ' window.addEventListener("DOMContentLoaded", function() { const originalEntries = Object.entries; Object.entries = function(obj) { if (obj === null || obj === undefined) { return []; } return originalEntries.call(this, obj); }; }); ', 'before'); }, 5); // Fix Cloudflare Turnstile not loading in Elementor popups // The plugin uses native addEventListener for 'elementor/popup/show' // but Elementor fires it via jQuery. This patch bridges the gap. function cft_turnstile_popup_fix() { ?> <script> (function() { if (typeof jQuery === 'undefined') return; jQuery(document).on('elementor/popup/show', function(event, id, instance) { setTimeout(function() { var settings = window.cfturnstileElementorSettings || {}; if (settings.mode && settings.mode !== 'turnstile') return; if (!window.turnstile) return; // First, process any unprocessed forms in the popup var popupForms = document.querySelectorAll('.elementor-popup-modal .elementor-form:not(.cft-processed)'); popupForms.forEach(function(form, index) { var submitButton = form.querySelector('button[type="submit"]'); if (submitButton && settings.sitekey) { var turnstileDiv = document.createElement('div'); turnstileDiv.className = 'elementor-turnstile-field cf-turnstile'; turnstileDiv.id = 'cf-turnstile-popup-fix-' + id + '-' + index; turnstileDiv.style.cssText = 'display: block; margin: 10px 0 15px 0; width: 100%;'; submitButton.parentNode.insertBefore(turnstileDiv, submitButton); form.classList.add('cft-processed'); } }); // Clean up any stale/failed turnstile children first var popupTurnstile = document.querySelectorAll('.elementor-popup-modal .cf-turnstile'); popupTurnstile.forEach(function(el) { // Remove old failed widget content while (el.firstChild) { el.removeChild(el.firstChild); } try { turnstile.remove('#' + el.id); } catch(e) {} turnstile.render('#' + el.id, { sitekey: settings.sitekey, theme: settings.theme || 'auto', callback: function(token) { if (typeof turnstileElementorCallback === 'function') { turnstileElementorCallback(token); } } }); }); }, 1500); }); })(); </script> <?php } add_action('wp_footer', 'cft_turnstile_popup_fix', 999); add_action('wp_ajax_nopriv_custom_knotweed_form', 'handle_knotweed_form_submission'); add_action('wp_ajax_custom_knotweed_form', 'handle_knotweed_form_submission'); function handle_knotweed_form_submission() { if (!isset($_POST['name'], $_POST['phone'], $_POST['postcode'])) { wp_send_json_error('Required fields are missing'); } $form_fields = [ 'name' => sanitize_text_field($_POST['name']), 'phone' => sanitize_text_field($_POST['phone']), 'postcode' => sanitize_text_field($_POST['postcode']), 'service' => sanitize_text_field($_POST['service'] ?? 'Not selected'), 'email' => sanitize_email($_POST['email'] ?? ''), ]; $uploaded_file_url = ''; $attachment = []; if (!empty($_FILES['photo']['name'])) { require_once(ABSPATH . 'wp-admin/includes/file.php'); $upload = wp_handle_upload($_FILES['photo'], ['test_form' => false]); if (isset($upload['file']) && !empty($upload['file'])) { $uploaded_file_url = $upload['url']; $attachment[] = $upload['file']; $form_fields['photo'] = $uploaded_file_url; } } if (class_exists('\ElementorPro\Modules\Forms\Classes\Record')) { $record = new \ElementorPro\Modules\Forms\Classes\Record([ 'form_name' => 'Hero Knotweed Quote Form', 'form_id' => 'hero_knotweed_form', 'post_id' => get_the_ID(), 'fields' => $form_fields, 'uploaded_files' => !empty($uploaded_file_url) ? ['photo' => ['url' => $uploaded_file_url]] : [], ]); $record->add_submission(); } $to_email = 'expert@environetuk.com'; $subject = 'New Knotweed Quote Request - ' . $form_fields['name']; $message = "New quote request received:\n\n"; $message .= "Name: " . $form_fields['name'] . "\n"; $message .= 'Email: ' . (isset($form_fields['email']) ? $form_fields['email'] : 'N/A') . "\n"; $message .= "Phone: " . $form_fields['phone'] . "\n"; $message .= "Postcode: " . $form_fields['postcode'] . "\n"; $message .= "Service: " . $form_fields['service'] . "\n"; if (!empty($uploaded_file_url)) { $message .= "\nPhoto: " . $uploaded_file_url . "\n"; } $headers = ['Content-Type: text/plain; charset=UTF-8']; wp_mail($to_email, $subject, $message, $headers, $attachment); // Lead prosto do Azure CRM (zamiennik martwego n8n) environet_push_to_crm(array( 'Name' => $form_fields['name'], 'Email' => isset($form_fields['email']) ? $form_fields['email'] : '', 'Telephone' => $form_fields['phone'], 'Postcode' => $form_fields['postcode'], 'Message' => isset($form_fields['service']) ? $form_fields['service'] : '', 'File' => !empty($uploaded_file_url) ? $uploaded_file_url : 'NONE', 'form_id' => 'hero_knotweed_form', 'form_name' => 'Knotweed PPC Form', )); wp_send_json_success('Success'); } /* ========================================================================= * Environet: formularze -> Azure CRM (zamiennik automatyzacji n8n) * ========================================================================= */ /** * Wspolny helper - wysyla zmapowanego leada prosto do funkcji Azure. * Endpoint Azure jest tylko tutaj, w jednym miejscu. */ function environet_push_to_crm( array $body ) { $body = wp_parse_args( $body, array( 'Name' => '', 'Email' => '', 'Telephone' => '', 'Postcode' => '', 'Message' => '', 'File' => 'NONE', 'Terms' => 'I accept the terms and conditions', 'Date' => date_i18n( 'F j, Y' ), 'Time' => date_i18n( 'g:i a' ), 'Page URL' => isset( $_SERVER['HTTP_REFERER'] ) ? esc_url_raw( $_SERVER['HTTP_REFERER'] ) : '', 'form_id' => 'unknown', 'form_name' => 'Unknown Form', ) ); // Koperta w formacie ktorego oczekuje funkcja Azure: tablica z jednym obiektem $payload = array( array( 'headers' => array( 'host' => isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '', 'user-agent' => isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '', ), 'params' => new stdClass(), 'query' => new stdClass(), 'body' => $body, 'webhookUrl' => '', 'executionMode' => 'production', ), ); $url = 'https://prod-webhookjsontolead-http.azurewebsites.net/api/Function1?code=NJLEOVYNWw/1ZBcRkMCqc/hG4x3OyFaXECwiaALkKsao9cp7Ufejaw=='; $response = wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 20, 'headers' => array( 'Content-Type' => 'application/json', 'Accept' => '*/*', ), 'body' => wp_json_encode( $payload ), ) ); // Log do debugowania - wlacz WP_DEBUG / WP_DEBUG_LOG w wp-config.php if ( is_wp_error( $response ) ) { error_log( 'Environet CRM error: ' . $response->get_error_message() ); } else { error_log( 'Environet CRM -> ' . wp_remote_retrieve_response_code( $response ) . ' ' . wp_remote_retrieve_body( $response ) ); } return $response; } /** * Formularze Elementor PRO (widget Form). Odpala sie na kazdy submit. * Domyslnie dla KAZDEJ formy - tak jak mialeś webhook wszedzie. * Jesli niektore formy nie maja isc do CRM, wpisz ID tych ktore MAJA isc w $allowed_forms. */ add_action( 'elementor_pro/forms/new_record', 'environet_form_to_crm', 10, 2 ); /** * Environet CRM Integration — Elementor Forms * Sends all Elementor form submissions directly to Dynamics 365 via Azure Function. * Replaces the broken n8n.hyroes.com webhook. * Fixed by IT MATES DIGITAL — 2026-06-17 */ function environet_form_to_crm( $record, $handler ) { $azure_url = 'https://prod-webhookjsontolead-http.azurewebsites.net/api/Function1'; $azure_code = 'NJLEOVYNWw/1ZBcRkMCqc/hG4x3OyFaXECwiaALkKsao9cp7Ufejaw=='; $form_name = $record->get_form_settings( 'form_name' ); $form_id = $record->get_form_settings( 'id' ); $raw_fields = $record->get( 'fields' ); $meta = $record->get( 'meta' ); $f = []; foreach ( $raw_fields as $id => $field ) { $f[ $id ] = sanitize_text_field( $field['value'] ?? '' ); } $body = [ 'Name' => $f['name'] ?? $f['full_name'] ?? '', 'Email' => $f['email'] ?? $f['email_address'] ?? '', 'Telephone' => $f['phone'] ?? $f['telephone'] ?? '', 'Postcode' => $f['postcode'] ?? $f['post_code'] ?? $f['zip'] ?? '', 'Message' => $f['message'] ?? $f['comments'] ?? $f['description'] ?? '', 'File' => $f['files'] ?? $f['file'] ?? 'NONE', 'Terms' => 'I accept the terms and conditions', 'Date' => $meta['date'] ?? wp_date( 'F j, Y' ), 'Time' => $meta['time'] ?? wp_date( 'g:i a' ), 'Page URL' => $meta['page_url'] ?? '', 'form_id' => $form_id, 'form_name' => $form_name, ]; $payload = [ [ 'headers' => [ 'host' => 'www.environetuk.com', 'user-agent' => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . home_url(), ], 'params' => new \stdClass(), 'query' => new \stdClass(), 'body' => $body, 'webhookUrl' => home_url(), 'executionMode' => 'production', ], ]; wp_remote_post( add_query_arg( 'code', $azure_code, $azure_url ), [ 'timeout' => 15, 'blocking' => false, 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => '*/*', ], 'body' => wp_json_encode( $payload ), ] ); } /** * Naprawia bledny atrybut pattern w polach telefonu (Elementor formy). * Pod flaga v w nowych przegladarkach wzorzec z myslnikiem w srodku klasy * jest nieprawidlowy (traktowany jako zakres). Przepisujemy na wersje * z myslnikiem na koncu klasy. Dziala dla WSZYSTKICH form na stronie. */ add_action( 'wp_footer', 'environet_fix_phone_pattern', 99 ); function environet_fix_phone_pattern() { ?> <script> (function () { var BAD = "[0-9()#&+*-=.]+"; var GOOD = "[0-9\\(\\)#&+*=.\\-]+"; function fix() { document.querySelectorAll('input[pattern]').forEach(function (el) { if (el.getAttribute('pattern') === BAD) { el.setAttribute('pattern', GOOD); } }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', fix); } else { fix(); } document.addEventListener('submit', fix, true); })(); </script> <?php } Japanese Knotweed and Invasive Plant Specialist Removal Company | Environet

We're in the business of helping people
solve their invasive plant problems

We provide expert advice, treatment, and removal services for the most challenging and destructive invasive plants, such as Japanese knotweed, across the UK.

As Featured in

Invasive Plant Specialists

Our Services

Japanese knotweed young shoots

Identification

Our experts will help you identify Japanese knotweed as well as a variety of other invasive plants

Dan Archer doing some management

Management Plans

Our experienced surveyors will come to your property and create a tailored solution to your invasive plant problem

Machines digging out invasive plant roots on a residential site in Swansea

Removal

Cost-effective Japanese knotweed, bamboo and other invasive removal & treatment methods
knotweed leaves

Identification

Our teams have the expertise to help you successfully identify the plant that you are dealing with

invasive plant excavation on a commercial site

Removal

We help businesses develop land affected by Japanese knotweed, Bamboo and other invasive plants

Samir looking at invasive plant rhizome

Consultancy

With over 25 years’ experience in the knotweed industry, we offer a variety of consultancy services

What our clients say

Reviews

What our clients say

Reviews

Feefo logo
Trust us, We Will get the Job Done

Why choose us?

Experience

Our friendly, dedicated and experienced team of specialists will act quickly to solve your invasive plant problem

Customer Service

We are committed to delivering consultancy and removal services that work for you, without delay. Over 90% of our customers rate us as ‘Excellent’

Guarantee

We guarantee all our work. For your ultimate peace of mind, our Japanese knotweed work is underwritten by an “AA- rated” insurer

PCA Membership

The Property Care Association has approved our policies, procedures and staff. You can trust us to resolve your knotweed problem

Eco-Innovations

We have developed zero waste-to-landfill solutions that offer eco-friendly ways to remove Japanese knotweed and other invasives like Bamboo

Cost-Effective

Our teams work hard to provide you with the most efficient and cost-effective solutions, tailored to your invasive plant problem

Some examples of what we do

Before & After

JK before pic 20231014_141928
Japanese knotweed removal comparison before photo of a garden after removal of Japanese knotweed
Bamboo comparison before Bamboo comparison after
Site before pic Site after pic

100%
Employee Owned

Everyone has a stake in the success of our business

Why choose environet

About Us

Environet is the UK’s leading specialist in invasive plant removal from residential and commercial properties. We are committed to delivering the best possible experience for our customers. 

Proudly EO logo

Established in 1996, we have a proven track record in safely and efficiently dealing with Japanese knotweed and other invasive species. Our eco-innovative solutions are designed to give the best results for both our customers, and the environment

We’re a company that is 100% owned by all its employees. Our continued growth and success is thanks to the passion of our highly motivated and knowledgeable team in delivering solutions with real-value to solve our customers’ invasive plant problems

We have an ethos of continuous improvement to eliminate or reduce the risks with detailed working procedures, on-going training and monitoring. We are also accredited by the PCA, CHAS and Constructionline

30 years in business
8500 projects completed
We cover England and Wales
Director Emily Grant BSc MSc

Emily Grant, Director of Operations

Mat Day, Director at Environet

Mat Day, Finance and Technical Director

Director Luke Walton

Luke Walton, Contracts Director

EVERYTHING YOU NEED TO KNOW

Knowledge Hub

Knotsure sliver

Introducing KnotSure™: A Smarter Way to Assess Japanese Knotweed Risk

With the launch of KnotSure™, our new desktop report, property professionals and homebuyers finally have a fast, affordable way to understand the knotweed risk at any UK address, using real data and expert insight – ahead of committing to an on-site survey.
Japanese knotweed new shoots spring 2016
February 27, 2026
[wpbread]

Japanese knotweed first shoots: when do they appear each year in the UK?

Environet's 2026 dream team
May 29, 2026
[wpbread]

Environet Celebrates 30 Years and 8,500 Invasive Plant Problems Solved

Environet marks 30 years in business, celebrating more than 8,500 invasive plant problems solved and our growth from a one-man start-up to a leading UK specialist.
Environet's 2026 dream team
May 29, 2026
[wpbread]

Environet Celebrates 30 Years and 8,500 Invasive Plant Problems Solved

Japanese knotweed new shoots spring 2016
February 27, 2026
[wpbread]

Japanese knotweed first shoots: when do they appear each year in the UK?

Property and Poppadoms logo on a brown background
February 11, 2026
[wpbread]

Environet sponsor the first national Property and Poppadoms event

Blog header knotweed in river
January 7, 2026
[wpbread]

Environet’s 2025 Year in Review 

Knotweed map of UK

Japanese Knotweed UK Heatmap

Exposed™: The Japanese Knotweed Heatmap is an interactive online heatmap of Japanese knotweed sightings across the UK.
Mortgage paperwork with some keys and a pen

A Guide to Mortgages and Japanese Knotweed

Understand how the presence of Japanese knotweed could affect your mortgage.
Insurance button on keyboard

Japanese Knotweed Insurance Guide

Making sure you have the right protection against the costs associated with the discovery of Japanese knotweed.
Photo of a Seminar led by Nic Seal
October 10, 2025
[wpbread]

Webinars and Seminars

Webinar advert
March 21, 2023
[wpbread]

‘How does Japanese knotweed affect property sales’

This morning, our Managing Director and Founder, Nic Seal, guest presented a webinar for leading conveyancing body, Searches UK. Nic presented the webinar ‘How does Japanese knotweed affect property sales’ to over 170 registrants.
Webinar advertisement
March 21, 2023
[wpbread]

“How to identify invasive plants and understand the risk they present”

Last week, we were thrilled to have one of our directors, Emily Grant, present to an audience of knowledgeable property professionals, including chartered surveyors and property developers, her latest webinar, ‘How to identify invasive plants and understand the risks they present’ which took place, with limited capacity on Tuesday 14th March,10am.
GET IN TOUCH

Our team of experts is available between 9am and 5:30pm, Monday to Friday to answer your enquiries and advise you on the next steps

Want a survey?

If you already know you have an invasive plant problem, you can request a survey online in less than two minutes by providing a few brief details. A member of the team will swiftly come back to you with further information and our availability.

Need quick plant identification?

Simply upload a few images of your problem plant to our identification form and one of our invasive plant experts will take a look and let you know, free of charge what you are dealing with. We’ll also be there to help with next steps where necessary. 

Fill the form and we will contact you soon!