Forum Replies Created

Viewing 13 replies - 16 through 28 (of 28 total)
  • I mean, none of the error_log( … XXX) is found on php-fpm.log

    This is my wp-cron.php but I cannot find anything on my log file
    The strange thing is that if restart the cron service, the scheduled action are fired at least one time

    
    <?php
    /**
     * A pseudo-CRON daemon for scheduling WordPress tasks
     *
     * WP Cron is triggered when the site receives a visit. In the scenario
     * where a site may not receive enough visits to execute scheduled tasks
     * in a timely manner, this file can be called directly or via a server
     * CRON daemon for X number of times.
     *
     * Defining DISABLE_WP_CRON as true and calling this file directly are
     * mutually exclusive and the latter does not rely on the former to work.
     *
     * The HTTP request to this file will not slow down the visitor who happens to
     * visit when the cron job is needed to run.
     *
     * @package WordPress
     */
    
    ignore_user_abort( true );
    
    /* Don't make the request block till we finish, if possible. */
    if ( function_exists( 'fastcgi_finish_request' ) && version_compare( phpversion(), '7.0.16', '>=' ) ) {
    	fastcgi_finish_request();
    }
    
    if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) {
    	error_log('im return from line 27');
    	die();
    }
    
    /**
     * Tell WordPress we are doing the CRON task.
     *
     * @var bool
     */
    define( 'DOING_CRON', true );
    
    if ( ! defined( 'ABSPATH' ) ) {
    	/** Set up WordPress environment */
    	require_once( dirname( __FILE__ ) . '/wp-load.php' );
    }
    
    /**
     * Retrieves the cron lock.
     *
     * Returns the uncached <code>doing_cron</code> transient.
     *
     * @ignore
     * @since 3.3.0
     *
     * @global wpdb $wpdb WordPress database abstraction object.
     *
     * @return string|false Value of the <code>doing_cron</code> transient, 0|false otherwise.
     */
    function _get_cron_lock() {
    	global $wpdb;
    
    	$value = 0;
    	if ( wp_using_ext_object_cache() ) {
    		/*
    		 * Skip local cache and force re-fetch of doing_cron transient
    		 * in case another process updated the cache.
    		 */
    		$value = wp_cache_get( 'doing_cron', 'transient', true );
    	} else {
    		$row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) );
    		if ( is_object( $row ) ) {
    			$value = $row->option_value;
    		}
    	}
    	error_log('im return from line 71');
    	return $value;
    }
    
    $crons = wp_get_ready_cron_jobs();
    if ( empty( $crons ) ) {
    	error_log('im return from line 77');
    	die();
    }
    
    $gmt_time = microtime( true );
    
    // The cron lock: a unix timestamp from when the cron was spawned.
    $doing_cron_transient = get_transient( 'doing_cron' );
    
    // Use global $doing_wp_cron lock otherwise use the GET lock. If no lock, trying grabbing a new lock.
    if ( empty( $doing_wp_cron ) ) {
    	if ( empty( $_GET['doing_wp_cron'] ) ) {
    		// Called from external script/job. Try setting a lock.
    		if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) {
    			return;
    		}
    		$doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
    		set_transient( 'doing_cron', $doing_wp_cron );
    	} else {
    		$doing_wp_cron = $_GET['doing_wp_cron'];
    	}
    }
    
    /*
     * The cron lock (a unix timestamp set when the cron was spawned),
     * must match $doing_wp_cron (the "key").
     */
    if ( $doing_cron_transient != $doing_wp_cron ) {
    	error_log('im return from line 105');
    	return;
    }
    
    foreach ( $crons as $timestamp => $cronhooks ) {
    	if ( $timestamp > $gmt_time ) {
    		error_log('im return from line 111');
    		break;
    	}
    
    	foreach ( $cronhooks as $hook => $keys ) {
    
    		foreach ( $keys as $k => $v ) {
    
    			$schedule = $v['schedule'];
    
    			if ( $schedule != false ) {
    				$new_args = array( $timestamp, $schedule, $hook, $v['args'] );
    				call_user_func_array( 'wp_reschedule_event', $new_args );
    			}
    
    			wp_unschedule_event( $timestamp, $hook, $v['args'] );
    
    			/**
    			 * Fires scheduled events.
    			 *
    			 * @ignore
    			 * @since 2.1.0
    			 *
    			 * @param string $hook Name of the hook that was scheduled to be fired.
    			 * @param array  $args The arguments to be passed to the hook.
    			 */
    			do_action_ref_array( $hook, $v['args'] );
    
    			// If the hook ran too long and another cron process stole the lock, quit.
    			if ( _get_cron_lock() != $doing_wp_cron ) {
    				error_log('im return from line 141');
    				return;
    			}
    		}
    	}
    }
    
    if ( _get_cron_lock() == $doing_wp_cron ) {
    	delete_transient( 'doing_cron' );
    }
    error_log('im return from line 151');
    die();
    

    after many tests, I also realized that the object cache prevents my cron from working.
    I currently disabled the object cache.
    Has a solution been found?

    Wordpress 5.2.4
    W3TC 0.10.1
    PHP Version 7.0.33

    Thread Starter pukos

    (@pukos)

    * What’s the value of the cron option in your wp_options table? Can you paste it somewhere? (eg. Pastebin)

    https://pastebin.com/tfKafHbT

    * Can you try deactivating your other plugins one by one to see if something else is interfering? Try switching to one of the default themes too, such as Twenty Seventeen.

    It’s a live, big website with 60 plugin… whould be a nightmare. Let’s try others way before this.

    * Can you try one of the alternative cron management plugins, for example Cron Control to see if that also shows an empty cron events list?

    Yes, another plugin (Advanced Cron Manager – debug & control) list events correctly but I would prefer your πŸ™‚

    I have the same issue

    Thread Starter pukos

    (@pukos)

    Yes, the problem has been solved from your great support service.

    Thank you

    Thread Starter pukos

    (@pukos)

    Anyway, I realized that not all the post has error.

    Why the post without errors remains in development?
    The posts without errors don’t go in production (as draft) automatically?

    Thread Starter pukos

    (@pukos)

    I found that the problem is I received this error:
    General Errors: Sorry, We’re Unable to Process Image URL: There could have been a connection timeout. Please try again.

    Don’t known what to do πŸ™

    Thread Starter pukos

    (@pukos)

    Ok, now I understood the behavior.
    I’have been approved but I still have posts stuck in development even if they has no error. I can’t see them in production πŸ™

    There’s something I’m doing well?

    Thx for help

    Thread Starter pukos

    (@pukos)

    Ok, but then how can I move from development to production? On Facebook I see only 2 action in dropdown menu: edit or delete. Not publish!

    • This reply was modified 9 years, 3 months ago by pukos.
    Thread Starter pukos

    (@pukos)

    I realized that there is another scenario where the “Post to channel” does not work.

    Some of my post are automatically generated from a rss source that build drafts.
    I use to go in the “all posts” page to choose what to convert from draft to published.

    If I convert from draft to published through the “quick edit” option, the post is NOT posted to channel

    If I convert from draft to published through the normal edit option (entering in the post), the post is posted to channel

    Peraphs you could help me with another pattern. I’m tryng to exclude the images who has the class “nounveil”.

    Any cloue?

    Same situation here.
    Me too noticed that only the cache version suffer this problem so I disabled the cache, but I still found some https link in google news.

    Did you solve? How?

Viewing 13 replies - 16 through 28 (of 28 total)