How to block checkout process when session origin is unknown?

add_action(‘woocommerce_checkout_create_order’, function($order, $data) { if (!isset($_REQUEST[‘wc_order_attribution_utm_source’])) { wc_add_notice(__(‘Order creation failed: Safetech Security.’, ‘woocommerce’), ‘error’); throw new Exception(‘Order creation halted.’); } }, 10, 2); This works for me Updates the issue is in the Paypal wooocommerce plugin, I had to edit the code and stop auto-update if (!isset($_COOKIE[‘sbjs_first’])) { throw new RuntimeException( __(‘Order creation failed: Origin … Read more

When using https, WordPress doesn’t use https for CSS and JavaScript, and admin doesn’t work. How do I fix this?

Check two things: in the wp-options table, the site URLs (in two places) should be the full URL, as in https://www.example.com . check the site’s htaccess file for proper rewrite of http to https. For a htaccess rule, this one works in most case: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Then look … Read more

Is it possible to automatically set the publication time to 8am on new posts?

you can automate this hour selection with the following code. take into account that this code also affect the date of a post created trough the API. add_filter(“wp_insert_post_data”, function ($data, $postarr, $unsanitized_postarr, $update) { if ( !$update && (“post” === $data[“post_type”]) && (“auto-draft” === $data[“post_status”]) ) { $date = current_datetime() ->modify(“tomorrow 08:00:00”) ->format(“Y-m-d H:i:s”) ; … Read more

Plugin or code to send out email to admin when a post is created

No need for plugin here are a few lines of code you can modify and paste in your themes functions.php file and you will get a new email whenever a post is published: add_action(‘publish_post’, ‘send_admin_email’); function send_admin_email($post_id){ $to = ‘[email protected]’; $subject=”mail subject here”; $message = “your message here ex: new post published at: “.get_permalink($post_id); wp_mail($to, … Read more

Is there a security vulnerability in Advanced Custom Fields related to the SCF fork?

It’s probably the issue mentioned in the changelog for 6.3.8 here. The developers were unable to release the patch on dot org themselves because Mullenweg had unilaterally revoked their access to the plugin repository because the plugin is owned by WP Engine. The issue has been patched in the version available directly from the developer, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)