Home › Forums › WoodMart support forum › Woodmart Custom JS
Woodmart Custom JS
- This topic has 3 replies, 2 voices, and was last updated 1 week, 5 days ago by Artem Temos.
-
AuthorPosts
-
May 7, 2024 at 11:36 am #563781
Michael de JagerParticipantHi,
is there a way that we can deactivate the custom js option in the woodmart theme?All three our websites keep on getting hacked through the custom js.
Please will you look at this urgently.
Thank you
Regards
Derick CarlsonMay 7, 2024 at 11:44 am #563785
Artem TemosKeymasterHello,
The fact that someone is adding custom code to your website only indicates that someone has access to your site. This doesn’t necessarily mean that your site is being compromised through the custom field in the theme settings. You need to investigate how exactly your site was compromised and change all passwords. If you’d like, we can advise on where you can remove this field from the code, but it’s unlikely to change anything as long as the attackers have access to your site.
Kind Regards
May 7, 2024 at 12:07 pm #563790
Michael de JagerParticipantIs there a way to disable this because we have another custom js plugin that we use and have never had strange code in there?
We have Solid Security and Sucuri on the website and have done a password reset on all three websites.
We also have a plugin that monitors the changes on the backend and the code does not get added manually by a user.
All three of our websites have different passwords yet the code gets added to all three.
Even if we deactivate all the plugins it still gets added in only the woodmart custom js
May 7, 2024 at 3:13 pm #563855
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file to disable this option and not output any Custom JS code on your website.
add_filter( 'woodmart_option', function ( $opt, $slug ) { if ( in_array( $slug, array( 'custom_js', 'js_ready' ), true ) ) { $opt = ''; } return $opt; }, 10, 2 );
To hide this field, you can also edit the file
wp-content\themes\woodmart\inc\classes\class-theme.php
and remove this line'admin/settings/custom-js',
also edit this file
wp-content\themes\woodmart\inc\admin\settings\sections.php
and remove the following code/** * Custom JS section. */ Options::add_section( array( 'id' => 'custom_js', 'name' => esc_html__( 'Custom JS', 'woodmart' ), 'priority' => 190, 'icon' => 'xts-i-file-code-js', ) );
-
AuthorPosts
- You must be logged in to create new topics. Login / Register