public function controller ($atts, $content = null, $shortcode)
{
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ $controllerShortcode = $shortcode;
+ $controllerStartTime = microtime(true);
}
// Start with no cache_code - This prevents caching for subordinate controller hits
$controlError = false;
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
// Also turn on SQL error messages
$this->wpdb->show_errors();
}
)
);
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
trigger_error("Executing Shortcode: $shortcode", E_USER_NOTICE);
}
$modelName = GLM_MEMBERS_WORDPRESS_PLUGIN_PATH . "$plugIn/models/front/$menuItem/$action.php";
$className = 'GlmMembersFront_' . $menuItem . '_' . $action;
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
trigger_error("Model: $modelName", E_USER_NOTICE);
}
// Otherwise, load and run the model
} else {
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
trigger_error("Front Controller: Loading - Model = $modelName, Action = $action, Class = $className", E_USER_NOTICE);
}
// Set the new model action
$action = $results['modelRedirect'];
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
trigger_error("Model Redirect: ".$results['modelRedirect'], E_USER_NOTICE);
}
$inTheme = '';
}
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
trigger_error("View$inTheme: $viewPath", E_USER_NOTICE);
}
}
- if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) {
+ if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+ $controllerTime = round(microtime(true) - $controllerStartTime, 6);
+ trigger_error($controllerTime." seconds - Shortcode: $controllerShortcode, Model class: $className ---", E_USER_NOTICE);
}
return $out;
'customerProfileId' => $response->getCustomerProfileId(),
'paymentProfileId' => $response->getCustomerPaymentProfileIdList()[0],
'profileStatus' => true,
- 'profileStatusText' => $errorMessages[0]->getCode().' '.$errorMessages[0]->getText()
+ 'profileStatusText' => $errorMessages[0]->getText()
);
return $resp;
'customerProfileId' => false,
'paymentProfileId' => false,
'profileStatus' => false,
- 'profileStatusText' => $errorMessages[0]->getCode().' '.$errorMessages[0]->getText()
+ 'profileStatusText' => $errorMessages[0]->getText()
);
return $resp;
}
if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'add') {
- delete_option('glmMembersDatabaseMemberID');
$memberID = 0;
+ setcookie("glmMembersDatabaseMemberID", $memberID, time()-3600);
// Check if a redirecting model supplied the member ID
} elseif (isset($actionData['memberID'])) {
} else {
- $memberID = get_option('glmMembersDatabaseMemberID');
+ $memberID = 0;
+ if (isset($_COOKIE['glmMembersDatabaseMemberID']) && $_COOKIE['glmMembersDatabaseMemberID'] > 0) {
+ $memberID = $_COOKIE['glmMembersDatabaseMemberID'];
+ }
}
}
}
}
+ // ***** THIS IS ONLY TEMPORARY AS WE TRANSITION AWAY FROM OPTION FOR LAST MEMBER ID - Can be deleted at next update. ******
+ delete_option('glmMembersDatabaseMemberID');
+
// If we have a member then also get a list of member info records
$haveInfoRecords = false;
$memberInfoRecords = false;
$noActive = true;
}
- // Also save the mmeber ID in a WordPress "option" in case someone clicks the "Member" sub-menu
- update_option('glmMembersDatabaseMemberID', $memberID);
+ // Also save the mmeber ID as a cookie
+ setcookie("glmMembersDatabaseMemberID", $memberID, time()+86400);
/*
* Get member view stats