ShrimpTest Core class
The core ShrimpTest controller class. One global instance of this class is created, as $shrimp.
Located in /classes/core.php (line 17)
How long ShrimpTest cookies should live for
Some cookie environment constants based on WordPress install
A random hash used to produce the random cookie values
By default, set to "ebisen"
Some cookie environment constants based on WordPress install
Database schema version: change to force database schema update
reference to the ShrimpTest_Interface instance
reference to the ShrimpTest_Model instance
An array which maps experiments to overridden variants, for when the logged-in user has used the variant preview to override the variant they are viewing.
A collection of information on the experiments which were "touched" during this execution.
A collection of information on the metrics which were "touched" during this execution.
Variables to track information about/throughout the current execution
Variables to track information about/throughout the current execution
ShrimpTest constructor
Hint: run init() to get the party started.
Check whether this visitor/visit should be "blocked" from the testing pool.
A visit is blocked if it's an AJAX or XMLRPC call, if we're in wp-admin, or if the shrimptest_blocked_visit filter returns true.
Check to see if the user has a valid ShrimpTest cookie. If not, calls set_cookie().
This will only happen if the user is not "exempt", as determined by exempt_visitor().
Make sure that our tables are set up.
Check whether the visitor/visit is exempt from ShrimpTest behavior.
A user is exempt if they're logged in or if the shrimptest_exempt_visitor filter returns true.
Get the $slug variable from the active ShrimpTest_Interface
Get the current user's "override" variant id for a particular experiment.
A variant is "overridden" when the variant preview feature is used.
Get the array of experiments which have been "touched" throughout this execution.
Get the array of metrics which have been "touched" throughout this execution.
Get the current visitor's variant id for a particular experiment id
This function will return a variant id for the current (or given) visitor and the given experiment, first checking if the user has an "override" set. It will only work if the visitor is not exempt.
Returns null if unavailable.
Check whether we have "touched" any experiments or metrics during execution.
The actual initialization function
Initializes all the internal cookie settings, calls load_model_and_interface(), load_default_metric_and_variant(), load_plugins(), and then registers a number of actions.
Must be called separately, after the constructor.
Load the default metric and variant types: the "manual" type
Initialize a ShrimpTest_Model as $model and ShrimpTest_Interface as $interface
The SHRIMPTEST_MODEL_CLASS and SHRIMPTEST_INTERFACE_CLASS constants are used as the model and interface class names, respectively.
Load all files in the /plugins directory
Records the "override" variant specified in the $_POST request.
Prints a script in the footer to support accurate counting of "unique human visitors".
Record the "cookieability" of a user who has pinged back
The script printed by print_foot() will ping back, if the user has JavaScript. This ping will then tell us whether the user actually picked up the cookie we sent them or not. Only users whose cookies were picked up are used in statistics.
Sets the cookie and returns the visitor id
"Touch" an experiment, with the given arguments
This function is used to keep track of what experiments were accessed ("touched") througout the printing of the current page. This information is not normally printed, but is used to produce the ShrimpTest bar (or ShrimpTest component of the Admin Bar) when an admin is logged in.
Like touch_experiment, but for metrics
Update a goal metric's value for the current (or given user)
Returns the updated value.
Adds DB versioning support
Note here I use site_option because ShrimpTest db tables exist for each site.
Documentation generated on Sat, 04 Sep 2010 23:40:57 -0400 by phpDocumentor 1.4.3