• Resolved mjcampagna

    (@mjcampagna)


    I am integrating my WordPress navigation into several non-WordPress pages using the technique described on this page:
    http://www.designchemical.com/blog/index.php/website-coding/adding-a-wordpress-menu-to-a-non-wordpress-page/

    This all goes well until the Subscribe2 is activated, as which point my non-WordPress pages only display a white background and this message:

    “This version of Subscribe2 requires WordPress 3.3 or greater. Please update WordPress or use an older version of Subscribe2.”

    Note that I am NOT trying to use/display/etc. the Subscribe2 plugin on these pages; only the WordPress menu.

    The fix I have found for the problem is to edit the subscribe2.php file and kill line 42:

    // exit($exit_msg);

    However, I would prefer to implement a workaround via my functions.php file so that I needn’t edit the Subscribe2 plugin at all. Is this possible? Or could the next update perhaps do something to prevent this problem?

    Thanks,
    Matt

    http://wordpress.org/plugins/subscribe2/

Viewing 5 replies - 1 through 5 (of 5 total)
  • @matt,

    I think you’ll find this is happening because the WordPress version global is not defined ($GLOBALS[‘wp_version’]). You might want to try defining it. Maybe adding this line would work but I’m not sure that WPINC will be defined or whether it’ll help:
    require ABSPATH . WPINC . '/version.php';

    Thread Starter mjcampagna

    (@mjcampagna)

    That worked. Thanks!

    Although, having thought about it some, I have to question whether it’s appropriate for the plugin to kill all processing on the page having failed a version check. On fail, would it not be more appropriate to display an error in the WP admin, and just allow the client-facing page to fully process without the inclusion of Subscribe2?

    @matt,

    If the code had been called in the way it was intended to be called it would show that screen from the WordPress plugins page and would ensure that no code was activated that might cause issues when enabling is attempted on older versions of WordPress.

    This has only been an issue for you are you are calling code in ways that it wasn’t intended to be called.

    Thread Starter mjcampagna

    (@mjcampagna)

    I see. Thanks for the assist, and for the clarification. Also for getting back to me in such a timely manner. Subscribe2 is a welcome alternative to Jetpack, and I really appreciate your work on it.

    Cheers,
    Matt

    @matt,

    Based on what you said above I went looking for a more graceful way to deactivate the plugin code if the version checks fail. Sadly there doesn’t seem to be a better solution right now. Maybe something will be developed with WordPress in the future.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Plugin crashing non-WordPress pages’ is closed to new replies.