WordPress cron running twice

I tried WP Crontrol instead and it turned out that two cron jobs were being created for generate_send_csv. To fix this, I created the crons within activation hooks and deactivation hooks as follows: register_activation_hook( __FILE__, ‘my_activation’ ); add_action( ‘generate_send_csv’, ‘generate_and_send_csv’ ); function my_activation() { wp_schedule_event(‘1488979800’, ‘daily’, ‘generate_send_csv’); } register_deactivation_hook( __FILE__, ‘my_deactivation’ ); function my_deactivation() { … Read more

Woocommerce how to update variable product price programitically?

I believe you want the woocommerce_variable_price_html filter hook. But there are several price related filters listed in the official docs here: WooCommerce Api Docs: Hooks woocommerce_variable_price_html in 3.0 is defined in /class-wc-product-variable.php https://docs.woocommerce.com/wc-apidocs/source-class-WC_Product_Variable.html#145 Hooking it with something like: add_filter( ‘woocommerce_variable_price_html’, ‘NAME_OF_YOUR_FUNCTION’, 10, 2 ); Here is some Additional info on Filter Hooks in WordPress There … Read more

wp_verify_nonce() why return false?

Revised code if(is_admin()) { add_action(‘admin_menu’, ‘awesome_page_create’); function awesome_page_create() { $page_title=”My Awesome Admin Page”; $menu_title=”Awesome Admin Page”; $capability = ‘edit_posts’; $menu_slug = ‘awesome_page’; $function = ‘my_awesome_page_display’; $icon_url=””; $position = 24; add_menu_page($page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position); } function my_awesome_page_display() { if (!current_user_can(‘manage_options’)) { wp_die(‘Unauthorized user’); } $value = get_option(‘awesome_text’, ”); ?> <h1>My Awesome Settings Page</h1> … Read more

Is there any background process that I can run from plugin without depending on page hits on a website without affecting page-load speed?

There is no reason for your design, but the core of your problem is that (I assume) people are trying to use a free tier of the API instead of properly paying for its use and removing the ridiculous restrictions. Anyway, the solution is fairly simple, run your cron every half an hour, allocate to … Read more

Use functionality of 2 wordpress plugins

Levi Dulstein has a lot of righ, but in my opinion Front-end-pm uses two hooks to send messages: fep_save_message (from back-end) fep_action_message_after_send (from front-end) Before sending a email few things are checked, like publishig or sending status (includes/class-fep-emails.php): function save_send_email( $postid, $post ) { if ( ! $post instanceof WP_Post ) { $post = get_post( … Read more