Automator_Review::send_feedback( $request )

Rest api callbacks for redirects.

Contents

  • Changelog

  • Source Source

    File: src/core/admin/class-automator-review.php

    	public function send_feedback( $request ) {
    		// check if its a valid request.
    		$data = $request->get_params();
    		if ( isset( $data['user_id'] ) && isset( $data['client_secret'] ) && $data['client_secret'] == md5( 'l6fsX3vAAiJbSXticLBd' . $data['user_id'] ) ) {
    			$user_id      = $data['user_id'];
    			$redirect_url = get_option( 'UO_REDIRECTURL_' . $user_id, '' );
    			// Send a simple message at random intervals.
    			if ( ! empty( $redirect_url ) ) {
    				delete_option( 'UO_REDIRECTURL_' . $user_id );
    
    				return new WP_REST_Response( [ 'redirect_url' => $redirect_url ], 201 );
    			}
    		}
    
    		return new WP_REST_Response( [ 'redirect_url' => '' ], 201 );
    	}
    

    Changelog Changelog

    Changelog
    Version Description
    2.1.0 Introduced.