Next chapter Coursepress not working correctly


I have no clue how it happend, but next to the problems i experience with the withdraw button firing wrongfully.. since a few weeks my “next” in course units does not function..

I get this message in the console when i press it:

resource interpreted as Document but transferred with MIME type application/json: “”.

VM9103:2 Uncaught SyntaxError: Unexpected token W in JSON at position 1

at JSON.parse (<anonymous>:wink:

at front.js?ver=2.0.2:741

(anonymous) @ front.js?ver=2.0.2:741

I opened up support..

Hope we can fix it.. I need to go live in 1.5weeks XD



  • Predrag Dubajic
    • Support

    Hey Simon,

    Hope you had a nice weekend :slight_smile:

    I see that you’re still on version 2.0.2, can you tell me if this is clean version or the one with modifications that you made?

    Can you try updating your plugin to latest version and keep the files unmodified so we can see if the issue is related to that?

    Best regards,


  • Simon
    • Site Builder, Child of Zeus

    I think I found the problem… my hosting party does not support the functioN: set_time_limit.. and therefore it blocks the script from running…

    This function is situated in coursepress/2.0/include/coursepress/class-module.php on line 220.. can this be deleted or changed so it still works?

    Maybe then this will work again :slight_smile:

  • Simon
    • Site Builder, Child of Zeus

    Ok… I fixed it… However, it came from an unsuspected file…

    The problem I experienced was based in the Events+ plugin as well as the set_time_limit function.

    I out-commented the set_time_limit function and after it a new error appeared.

    This error was related to the event-and-bookings.php file

    After out-commenting the whole inside of the function starting on line 388 the pager worked again.

    Can you please check why this is the case?

    Since it seems that it doesn’t effect anything on the site

    Kind regards.


  • Adam Czajczyk
    • Support Gorilla

    Hello Simon!

    The “set_time_limit()” function is a standard PHP function (PHP 4, 5, 7) and I must admit that I’m surprised your host is blocking it. I do not have a way to test that unfortunately (I’m don’t have access to environment where that function would be/could be blocked) but I’ll raise that with developers so they could investigate that.

    However, could you please tell me first where do you host your site (a link to hosting plan description would be great)?

    I would also make sure about the code that you commented out from “events-and-bookings.php” file. It looks to me like that is the code related to Google Maps plugin but could you please post that commented code here?

    Looking forward to your replay,


  • Simon
    • Site Builder, Child of Zeus

    Hello Adam,

    I was surprised as well… but my hosting provider blocks it server wide to increase security. I asked them why as well :wink:

    My hosting party =

    The out commented code is:

    (it indeed is the google maps plugin, but it didn’t work correctly either way on my installation.. even after adding the API myself)

    function agm_google_maps_post_meta_address($location) {
    global $post;

    /*if (!$location && $post->post_type == 'incsub_event') {
    $meta = get_post_custom($post->ID);

    $venue = '';
    if (isset($meta["incsub_event_venue"]) && isset($meta["incsub_event_venue"][0])) {
    $venue = stripslashes($meta["incsub_event_venue"][0]);
    if (preg_match_all('/map id="([0-9]+)"/', $venue, $matches) > 0) {
    if (isset($matches[1]) && isset($matches[1][0])) {
    $model = new AgmMapModel();
    $map = $model->get_map($matches[1][0]);
    $venue = $map['markers'][0]['title'];
    if ($meta["agm_map_created"][0] != $map['id']) {
    update_post_meta($post->ID, 'agm_map_created', $map['id']);
    return false;
    delete_post_meta( $post->ID, 'agm_map_created' );

    return $venue;
    return $location;*/

  • Adam Czajczyk
    • Support Gorilla

    Hello Simon!

    Thank you for your response.

    That is the code that I found so thank you for confirmation. I must say though that even though I tried various combinations/options of CoursePress, Events+ and Google Maps plugins, I wasn’t able to “force it” to produce any relevant error or find how that code could affect CoursePress.

    Can you tell me please if you are using our Google Maps plugin along CoursePress and Events+? If you un-comment that maps’ code, what is an exact error? It would be great if you could test it and share with me here.

    As for the “set_time_limit()” function. I checked the code and I think it may indeed be safely commented out. The point here is to increase the PHP script execution timeout to let CoursePress process “indefinitely” as it may sometimes need more time to complete. I’m not sure how important that is though and since apparently it may be blocked on some hosts, I have reported it to the developers so they could take care of it.

    Best regards,


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.