define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE', $settings['admin_debug_verbose']);
define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG', $settings['front_debug']);
define('GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE', $settings['front_debug_verbose']);
+ define('GLM_MEMBERS_PLUGIN_DEBUG', $settings['admin_debug'] || $settings['front_debug']);
+ define('GLM_MEMBERS_PLUGIN_DEBUG_VERBOSE', $settings['admin_debug_verbose'] || $settings['front_debug_verbose']);
}
// Check for config value replacements in the current theme
*/
public function __construct ($wpdb, $config)
{
-
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
// Save WordPress Database object
$this->wpdb = $wpdb;
}
}
-
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
}
/**
public function glmMembersAdminAjax()
{
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
// Get the model action
if (isset($_REQUEST['glm_action']) && $_REQUEST['glm_action'] != '') {
$glmAction = sanitize_text_field($_REQUEST['glm_action']);
// Generate output from model data and view
$smarty->template->display($viewFile);
-
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
exit; // Need to test if this is here for a reason!
wp_die();
*/
public function controller( $menuItem, $action = false, $actionData = false, $returnOutput = false )
{
-
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
// Enque admin scripts and css here so that only happens when we're doing something
$this->glmMembersAdminScripts();
// Restore timezone that was set before our code was called
date_default_timezone_set($defaultTimeZone);
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
if ( $returnOutput ) {
return $output;
}
public function __construct ($wpdb, $config)
{
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
// Save WordPress Database object
$this->wpdb = $wpdb;
// Add filters for use anywhere else (apply_filter). Will have to add this to index.php eventually
add_filter('glmMembersFrontScriptsFilter',array($this,'glmMembersFrontScripts'));
add_action('glmMembersFrontCSSFilter',array($this,'glmMembersFrontCSS'));
-
+
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
}
/**
public function controller ($atts, $content = null, $shortcode)
{
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
// Start with no cache_code - This prevents caching for subordinate controller hits
$cache_code = false;
}
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ }
+
return $out;
}
* @version 2.10.20
*/
+$GLOBALS['glmAssociateMemTracker'] = memory_get_usage();
+
// Check that we're being called by WordPress.
if (!defined('ABSPATH')) {
header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
// Get configuration
require_once 'config.php';
+if (GLM_MEMBERS_PLUGIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+}
+
/*
*
* Hook in add-ons and integrate their actions
$config['loggedInUser'] = apply_filters('glm_members_current_logged_in_user', $config['loggedInUser']);
}
+if (GLM_MEMBERS_PLUGIN_DEBUG_VERBOSE) {
+ trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+}
+
/*
*
* Run desired controller
${GLM_MEMBERS_PLUGIN_PREFIX."updateChecker"}->declareCredentials(array(
'license_key' => __('License Key:')
));
+
+
+function glmAssociateMemoryUsage() {
+ $m = memory_get_usage();
+ $mu = $m - $GLOBALS['glmAssociateMemTracker'];
+ return 'GLM Associate Memory Usage: '.number_format($mu,0).' of '.number_format($m,0).' Bytes';
+}
\ No newline at end of file