WP Sessions locks up entire site
-
I’ve seen some discussion about this problem on here, but no solutions were posted. I’m working on a plugin that I would like to use WP Sessions in. I’ve installed and activated WP Sessions. In my plugin PHP file, outside of any functions, I’ve added the following code:
<?php /* Plugin Name: Analytical 360 Customer Portal Stuff here, snipped for brevity */ foreach ( glob( plugin_dir_path( __FILE__ ) . "includes/*.php" ) as $file ) { include_once $file; } global $wp_session; $wp_session = WP_Session::get_instance(); //register our shortcode add_shortcode("anl_portal", "anl_portal_handler"); //shortcode handler function anl_portal_handler($incomingfrompost) { global $wpdb; global $wp_session; $members_table_name = $wpdb->prefix . "anl_portal_members";
the
$wp_session = WP_Session::get_instance();
line causes the following error:
[20-May-2015 04:57:31] PHP Fatal error: Class 'WP_Session' not found in /srv/www/cbd.analytical360.com/public_html/wp-content/plugins/anl_portal/anl_portal.php on line 21
which causes the whole site to not work.
Any idea why this is? Do I need to get the instance somewhere else in my code?
No link to the site because i commented that line out for now since it brings the site down completely, and it’s difficult to work on other parts of the site with it dead.
Thanks,
Jeff
- The topic ‘WP Sessions locks up entire site’ is closed to new replies.