Asking help regarding potential malware

Although this is not the place for hacking questions … a quick look seems to indicate attempts to get database credentials, and to upload files that can be executed later. One file it looks for (and tries to inlcude) is ‘command.php’. So take a look if that file is there. You could also look at … Read more

JS working when used normally but not in wordpress

Solved. The problem was that mojs has to be included between the <body></body> tags, and the wp_enqueue_script() function that enqueued mojs needed an empty string as argument just before the ‘true’ parameter (I forgot to specify that there was no required version number of that script). So, changing wp_enqueue_script(‘mojs’, ‘https://cdn.jsdelivr.net/mojs/latest/mo.min.js’, array(‘jquery’), true); wp_enqueue_script(‘favjs’, $favbtnscript, array(‘jquery’, … Read more

Changing the CSS with a plugin

You’re using the wrong hook to enqueue your styles: add_action(‘admin_enqueue_scripts’, ‘seizoenplugin_enqueue_styles’ ); As the name suggests, admin_enqueue_scripts is for enqueuing scripts and styles in the admin. To enqueue scripts on the front end use wp_enqueue_scripts: add_action(‘wp_enqueue_scripts’, ‘seizoenplugin_enqueue_styles’ );

Adding discount functionality to the cart

after quite some headbanging I managed to make it somehow to work. Here is my code: add_action( ‘woocommerce_cart_calculate_fees’, ‘iom_add_custom_discount’, 10, 1 ); function iom_add_custom_discount( $wc_cart ){ $discount = 0; $product_ids = array(); $product_ids_disc = array(); $item_prices = array(); $in_cart = false; foreach ( $wc_cart->get_cart() as $cart_item_key => $cart_item ) { $cart_product = $cart_item[‘data’]; // here … Read more