How to add new jobs in ultimate cron in Drupal 7? - drupal

I am new with drupal. I have installed ultimate cron in Drupal 7. now I have created a php script to be a mycron.php, my problem is that I don't know where can I insert my cron job in my Drupal's ultimate cron.
I am looking where can I insert mycron.php to ultimate cron module page but I failed.
I also look to the site where i downloaded it but it is not there. http://drupal.org/project/ultimate_cron
Does anyone have an idea how to solve my problem?

Usually you don't add custom cron scripts (full .php files) but defining the job that needs to be done using hook_cron()
If you create a module with "myname" as the name and you can now define a function like
function myname_cron(){
//do stuff here
}
You can use full Drupal functions here as a fully boostrapped Drupal instance available for you. and Ultimate Cron (or other cron-related modules) can take care of load balancing now.

Related

Wordpress ftp_nb_fput missing - BackWPup

I've set up a new Wordpress blog and already customized its look and fell. Everything went smooth up to know.
I just wanted to set up a backup plugin called BackWPup for a daily backup. I need to upload the backup files fia FTP to a designated server. When I create a new backup job I can't tick the storage location FTP cause the error "Missing function „ftp_nb_fput“" appears.
How can I fix that? Is it just a function which is disabled or is my wordpress version missing something?
ftp_nb_fput is a regular PHP function which should be available to you no matter which PHP version you have on your hosting.
Therefore you probably need to contact your web hosting company and learn if they did not disable those functions on purpose (for example on a security basis).
Alternatively you website may be running on HHVM which lacks those functions but I doubt that this is the case.

When is Wordpress Auto-Update Process started

I wounder how and when wordpress starts the auto-update process (if configured). I think on a (hosted) Webserver you cannot create a task for checking and starting updates for your website. Also, wordpress uses auto-updates out of the box without additional configuration.
So how does it work? When and how does wordpress check if there is a new version available? Does this happen when anybody visits your website and the update-function is started or are there other possabilities e.g. the webserver always runs an open thread for checking for updates and processing them.
I hope you understand my question.
Firstly, you can create a task for checking and starting updates, most commonly used is a cron job.
In wordpress 3.7 the automatic updates feature was added.
To enable it you add this to wp-config.php:
define('WP_AUTO_UPDATE_CORE', true);
In default-filters.php you will find add_action( 'init', 'wp_cron' );
It runs wp-includes/cron.php on every page load from a user, which will auto-update it.
So long answer short it checks whenever a user loads the webpage.
I believe it uses a cron job to perform this. The only restriction is that these jobs can only be run when the website is accessed from the server ie. when people are visiting it.
I've noticed this a few times with local copies, that whenever I open them up to browse them (after not viewing them for a while), I get a local email saying my Wordpress installation has automatically been upgraded.

Automated WordPress Installation with themes/plugins

I have used Fantastico and Softaculous in the past to install WordPress, however they are limited in that they require me to step through the wizard manually, and they can't set the default theme or install plugins.
Is it possible to write a script that automates the process? Would this be possible in PHP?
Even if it's not possible with a script, I am at least hoping to find a way to set the default WordPress theme upon installation.
You can switch themes using the switch_theme function. As for automating, of course it's possible. Your script could grab the wordpress code base with curl, includes a wp_config.php file you've already filled out, read the database info from that file in order to create the database and grant permissions as appropriate, and then run the wp_install process itself.
You can create a custom script in Softaculous and have your themes or plugins pre installed.
Here is the guide :
http://www.softaculous.com/docs/Making_Custom_Package

why we are using the ../../../wp-load.php in wordpress?

Sorry for asking this type of stupid ques.
But i don't know I need your help
I look out the coding that they are in wordpress plugin.
require_once('../../../wp-load.php');
I really don't know what the ../../.. is perform some one know ,let me give an suggestion
I am not tell about the core file and all .that extension before the php file.
Thanks.
That loads the WordPress framework for use outside of the native environment.
For example, if you wanted to have a PHP controller that handled AJAX requests, you could load the WordPress environment to validate the current WordPress user login status.
The "../../.." tells the require function to start at the current file, go up three directories, then access wp-load.php.
Based on that path, I can guess that the file is sitting in a theme folder. wp-content/themes/yourtheme

problem with Search module in drupal

I've problem with the search module in drupal. When I do a seach, it return 0 results even-though there are patterns matching. I ran the cron manually and flushed the cache. Now, the search module works fine.
I wanna know whether I should do this procedure regularly for the search module to work?
thanks.
clearing cache is not need, running cron is main
read here how to do: http://drupal.org/cron

Resources