Forum Replies Created

Viewing 15 replies - 31 through 45 (of 108 total)
  • I believe the code that registers the schedules is not correct.

    From https://codex.www.ads-software.com/Plugin_API/Filter_Reference/cron_schedules

    function my_add_weekly( $schedules ) {
    	// add a 'weekly' schedule to the existing set
    	$schedules['weekly'] = array(
    		'interval' => 604800,
    		'display' => __('Once Weekly')
    	);
    	return $schedules;
    }
    add_filter( 'cron_schedules', 'my_add_weekly' );

    What is done in the plugin:

    // ADD EXTRA CRON SCHEDULES
    		add_filter('cron_schedules', array(&$this, 'odb_extra_cron_schedules'));
    
    function odb_extra_cron_schedules()
    	{
    		global $odb_class;
    
    		$schedules['weekly'] = array(
    			'interval' => 604800,
    			'display'  => __('Once Weekly', $odb_class->odb_txt_domain)
    		);
    		// FOR DEBUGGING
    		$schedules['fiveminutes'] = array(
    			'interval' => 300,
    			'display'  => __('Every Five Minutes', $odb_class->odb_txt_domain)
    		);
    		return $schedules;
    	} // odb_extra_cron_schedules()

    The method is not taking in the passed in $schedules objects. It is creating its own.

    I’m having an issue as well with another plugin. WP Missed Schedule Fix Future Posts Failed is no longer working.

    https://www.ads-software.com/plugins/wp-missed-schedule/

    I look at the cron events or what’s in cron and the schedules it defined are not present and it’s event is not registered.

    These are the Schedules available when I disable ODB.

    Available schedules
    
    Every Ten Minutes, every 10 mins
    [W3TC] Object Cache file GC (every 3600 seconds), every 1 hour
    [W3TC] Page Cache file GC (every 3600 seconds), every 1 hour
    [W3TC] Page Cache prime (every 900 seconds), every 15 mins
    [W3TC] CDN queue process (every 900 seconds), every 15 mins
    [W3TC] CDN auto upload (every 3600 seconds), every 1 hour
    [W3TC] Minify file GC (every 86400 seconds), every 1 day
    Once Hourly, every 1 hour
    Twice Daily, every 12 hours
    Once Daily, every 1 day

    When I enable the plugin, all of the custom schedules disappear, except for the ones the ODB plugin creates…

    Available schedules
    
    Once Weekly, every 1 week
    Every Five Minutes, every 5 mins
    Once Hourly, every 1 hour
    Twice Daily, every 12 hours
    Once Daily, every 1 day

    So I believe this causes all of plugins that rely on a custom schedule to break.

    Rich

    Thread Starter awhig

    (@awhig)

    I’ve had DISABLE_WP_CRON set to true for many years.

    This disables the internal cron mechanism of WP which does not reliably run on the desired time schedule.

    I use a “real” cron job on my server to call wp-cron.php every 5 minutes.

    See:

    https://code.tutsplus.com/articles/insights-into-wp-cron-an-introduction-to-scheduling-tasks-in-wordpress–wp-23119

    or

    https://wpdailybits.com/blog/replace-wordpress-cron-with-real-cron-job/74

    For more info on this.

    Any case, you plugin was working with

    <br />
    define('DISABLE_WP_CRON',true);<br />

    up until I installed WP 4.4.

    As far as I can tell, it does not work with WP 4.4.

    Rich

    Thread Starter awhig

    (@awhig)

    Hi,

    I tried using 2015.0228.3, I still don’t see any relevant event in Cron.

    WP-Cron Events
    There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was:
    The DISABLE_WP_CRON constant is set to true. WP-Cron spawning is disabled.
    Hook Name Arguments Next Run Recurrence
    antispam_bee_daily_cronjob None 2015-12-15 14:47:57 (1 hour 37 minutes) 1 day Edit Run Now Delete
    wp_update_plugins None 2015-12-15 17:57:09 (4 hours 46 minutes) 12 hours Edit Run Now Delete
    wp_update_themes None 2015-12-15 17:57:09 (4 hours 46 minutes) 12 hours Edit Run Now Delete
    wp_maybe_auto_update None 2015-12-15 18:00:00 (4 hours 49 minutes) 12 hours Edit Run Now Delete
    wprc_schedule_update_plugins None 2015-12-15 18:35:00 (5 hours 24 minutes) 12 hours Edit Run Now Delete
    wprc_schedule_update_themes None 2015-12-15 18:35:00 (5 hours 24 minutes) 12 hours Edit Run Now Delete
    wp_version_check None 2015-12-15 23:02:20 (9 hours 51 minutes) 12 hours Edit Run Now Delete
    polldaddy_rating_update_job None 2015-12-16 02:00:05 (12 hours 49 minutes) 1 day Edit Run Now Delete
    update_wpml_config_index None 2015-12-16 07:12:14 (18 hours 1 minute) 1 day Edit Run Now Delete
    wp_scheduled_delete None 2015-12-16 11:09:37 (21 hours 58 minutes) 1 day Edit Run Now Delete
    wp_scheduled_auto_draft_delete None 2015-12-16 12:59:54 (23 hours 49 minutes) 1 day Edit Run Now Delete
    odb_scheduler None 2015-12-19 17:00:00 (4 days 3 hours) 1 week Edit Run Now Delete

    I already posted above what is in my Cron after trying Version 2014.1231.2015.

    Rich

    Thread Starter awhig

    (@awhig)

    Hi,

    So I disabled my current WP MS plugin and deleted it.
    I installed the cleaner and activate/deactive and removed it.

    I then installed from the plugin store WP MS. Version 2014.1231.2015

    I cleared all my caches along the way.

    I’m not sure how I would test if its working. Do you know how to test it?

    Rich

    I then checked What’s in Cron, and it showed the following:

    Available schedules
    
    Once Weekly, every 1 week
    Every Five Minutes, every 5 mins
    Once Hourly, every 1 hour
    Twice Daily, every 12 hours
    Once Daily, every 1 day
    Events
    
    Next due (GMT/UTC)	Schedule	Hook	Arguments
    Dec 12, 2015 @ 22:57 (1449961029)	Twice Daily	wp_update_plugins
    Dec 12, 2015 @ 22:57 (1449961029)	Twice Daily	wp_update_themes
    Dec 12, 2015 @ 23:00 (1449961200)	Twice Daily	wp_maybe_auto_update
    Dec 12, 2015 @ 23:35 (1449963300)	Twice Daily	wprc_schedule_update_plugins
    Dec 12, 2015 @ 23:35 (1449963300)	Twice Daily	wprc_schedule_update_themes
    Dec 13, 2015 @ 0:07 (1449965260)	One-off event	upgrader_scheduled_cleanup
    [0]: 82664
    Dec 13, 2015 @ 4:02 (1449979340)	Twice Daily	wp_version_check
    Dec 13, 2015 @ 7:00 (1449990005)	Once Daily	polldaddy_rating_update_job
    Dec 13, 2015 @ 12:12 (1450008734)	Once Daily	update_wpml_config_index
    Dec 13, 2015 @ 16:09 (1450022977)	Once Daily	wp_scheduled_delete
    Dec 13, 2015 @ 17:59 (1450029594)	Once Daily	wp_scheduled_auto_draft_delete
    Dec 13, 2015 @ 19:47 (1450036077)	Once Daily	antispam_bee_daily_cronjob
    Dec 19, 2015 @ 22:00 (1450562400)	Once Weekly	odb_scheduler
    Thread Starter awhig

    (@awhig)

    Hi,

    The version is what I’m seeing on the plugins page.

    Here is a screenshot

    https://drive.google.com/file/d/0B_xeS-OgIIkCb2R5MVAzcEg1MHM/view?usp=sharing

    I will try reinstalling the plugin to see if that does anything.

    Rich

    I long ago ran into issues with WPML when Database caching is on.

    I had to turn it off.

    I just use object cache and page cache now.

    Rich

    FYI,

    I’m currently using WPML Version 3.1.9.7. I do not know if my modiifed code will work with the next version.

    Rich

    Hi,

    I just started using this plugin. I too use WPML and noticed that it does not filter out related posts that are in different languages.

    I’ve made this change to the current plugin version so that only posts that are of the same language as the target post are shown.

    This is currently working for me

    Just replace the recommendations.php file with this version.

    This is for Version 1.12 of the zemanta plugin.

    https://gist.github.com/awhig/6a752c0673d329f12c2c

    Ajay,

    Ah. I wasn’t aware that’s how CRP’s caching worked. I will try turning it on and see how it goes. I suspect I’ll have slow load times initially until the cache is created. Subsequent crawls should be faster.

    Rich

    Hi Ajay,

    I’m using W3 Total cache, so I already have caching of my posts. I’m not using the plugin caching mechanism currently.

    I’m thinking when a crawler like google comes and crawls all my old pages (we have thousands), the load increases too much on the server, causing the avg. page load times to increase.

    Rich

    Here are the distinct values I found in my table.

    comment
    post_
    post_page
    post_post
    tax_category
    tax_link_category
    tax_post_format
    tax_post_tag

    I don’t think your query is correct though. The elment_id could be the same between a post and a page (theoretically). You can’t just throw an OR statement in there.

    Sorry to saw though, after running the plugin for a couple of days I decided to turn it off as it caused 3X the load time of my pages (according to google crawl stats). Don’t think my server is good enough to get the speed I want.

    Good luck,
    Rich

    Hi Ajay,

    Yes. This is a much better way of making it WPML compatible.

    You left out the check to see that WPML is currently activated.

    I’ve modified the code to be:

    function icl_crp_join( $join ) {
         global $wpdb;
    
        if ( function_exists('icl_object_id') ) {
         $join .= "  INNER JOIN {$wpdb->prefix}icl_translations ON {$wpdb->prefix}icl_translations.element_id= $wpdb->posts.ID AND {$wpdb->prefix}icl_translations.element_type='post_post' AND language_code='" . ICL_LANGUAGE_CODE . "' " ;
        }
    
         return $join;
    }
    add_filter( 'crp_posts_join', 'icl_crp_join' );

    An additional disclaimer; I only use related posts on my posts page, not any pages. This code only looks for posts (element_type=’post_post’). If someone is also using the plugin for pages then they may want to modify this code.

    Rich

    Hi all,

    I started using this plugin and it seems pretty good. I also wanted it to work with WPML.

    Seeing this thread I went ahead and made modifications to my copy of the plugin so that it only recommends posts that are of the same language.

    I tried to make it work even if wpml is deactivated, so it should be safe.

    I didn’t do anything about translating the “Related Posts” text.

    The major code change occurs on line 359. I modified the $join string of the sql query.

    Hope this helps some people.

    I modified the contextual-related-posts.php file of the plugin. My modified version is below.

    https://gist.github.com/awhig/93e53e79c198ddbd73f5

    Rich

    Thread Starter awhig

    (@awhig)

    Forgot,

    I’m using php 5.5.20

Viewing 15 replies - 31 through 45 (of 108 total)