Wordpress - Uncaught Error: Call to undefined function wp_generate_attachment_metadata() @ wp-cron

Some of what is usually admin side functionality is not included as part of the "main" wordpress bootstrap, files containing uploaded file manipulation functions are one of them and you need to explicitly include them by adding

include_once( ABSPATH . 'wp-admin/includes/image.php' );

into your call_import function.


At the top of your cronjob script (for example: my-cron.php), do this:

if ( ! defined('ABSPATH') ) {
    /** Set up WordPress environment */
    require_once( dirname( __FILE__ ) . '/wp-load.php' );
}

Then setup cron like this in your server:

5 * * * * wget -q -O - http://your-domain.com/my-cron.php

Note: perhaps you were trying to run cron as PHP Command Line (CLI), that'll not work. You need to run cron as HTTP request (with wget or curl), as shown above.

For more information read this official WordPress document.

Update:

Based on newly added CODE, I can see this CODE is wrong:

register_activation_hook( __FILE__, 'OA_FeedManager_activated' );
function importpicture_activated() {
    if ( ! wp_next_scheduled( 'import_feed' ) )  {
        wp_schedule_event( time(), 'hourly', 'import' );
    }
 }

 add_action( 'import', 'call_import' );
 function call_import() {
     // lots of code
 }

You checked if ( ! wp_next_scheduled( 'import_feed' ) ) but you are scheduling add_action( 'import', 'call_import' );. For cron to work properly you must register the same action import. Also, your activation hook is OA_FeedManager_activated, make sure it runs importpicture_activated function. So the CODE should be like:

register_activation_hook( __FILE__, 'OA_FeedManager_activated' );

function OA_FeedManager_activated() {
    importpicture_activated();
}

function importpicture_activated() {
    if ( ! wp_next_scheduled( 'import' ) ) {
        wp_schedule_event( time(), 'hourly', 'import' );
    }
 }

 add_action( 'import', 'call_import' );
 function call_import() {
     // lots of code
 }

To check if your cron is registered properly, you may use the control plugin. Also, activate WP debugging to see what error your CODE is generating.

Note: For undefined function wp_generate_attachment_metadata() error check Mark's answer.

Also, since you've scheduled the cron in plugin's activation hook, you must deactivate and then activate the plugin again if you change activation hook function. Using Crontrol Plugin, make sure there is not unnecessary cron registered in the backend.

Finally, check if in wp-config.php you have define( 'DISABLE_WP_CRON', true );. You must remove it (if it is there) or set it to false, if you want WP cron to run on normal WP load. Otherwise, you'll need to set cron with OS crontab (like shown at the beginning of my answer.)