@@ -4,29 +4,29 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Task_Ajax_Adapters_Registry { |
| 6 | 6 | |
| 7 | - private $task_ajax_adapters = array(); |
|
| 7 | + private $task_ajax_adapters = array(); |
|
| 8 | 8 | |
| 9 | - public function __construct( $adapters = array() ) { |
|
| 9 | + public function __construct( $adapters = array() ) { |
|
| 10 | 10 | |
| 11 | - $this->task_ajax_adapters = is_array( $adapters ) ? $adapters : array( $adapters ); |
|
| 11 | + $this->task_ajax_adapters = is_array( $adapters ) ? $adapters : array( $adapters ); |
|
| 12 | 12 | |
| 13 | - } |
|
| 13 | + } |
|
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * @param Task_Ajax_Adapter $task_ajax_adapter |
|
| 17 | - */ |
|
| 18 | - public function register( $task_ajax_adapter ) { |
|
| 15 | + /** |
|
| 16 | + * @param Task_Ajax_Adapter $task_ajax_adapter |
|
| 17 | + */ |
|
| 18 | + public function register( $task_ajax_adapter ) { |
|
| 19 | 19 | |
| 20 | - $this->task_ajax_adapters[] = $task_ajax_adapter; |
|
| 20 | + $this->task_ajax_adapters[] = $task_ajax_adapter; |
|
| 21 | 21 | |
| 22 | - } |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * @return Task_Ajax_Adapter[] |
|
| 26 | - */ |
|
| 27 | - public function get_task_ajax_adapters() { |
|
| 24 | + /** |
|
| 25 | + * @return Task_Ajax_Adapter[] |
|
| 26 | + */ |
|
| 27 | + public function get_task_ajax_adapters() { |
|
| 28 | 28 | |
| 29 | - return $this->task_ajax_adapters; |
|
| 30 | - } |
|
| 29 | + return $this->task_ajax_adapters; |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | } |
@@ -6,16 +6,16 @@ |
||
| 6 | 6 | |
| 7 | 7 | private $task_ajax_adapters = array(); |
| 8 | 8 | |
| 9 | - public function __construct( $adapters = array() ) { |
|
| 9 | + public function __construct($adapters = array()) { |
|
| 10 | 10 | |
| 11 | - $this->task_ajax_adapters = is_array( $adapters ) ? $adapters : array( $adapters ); |
|
| 11 | + $this->task_ajax_adapters = is_array($adapters) ? $adapters : array($adapters); |
|
| 12 | 12 | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * @param Task_Ajax_Adapter $task_ajax_adapter |
| 17 | 17 | */ |
| 18 | - public function register( $task_ajax_adapter ) { |
|
| 18 | + public function register($task_ajax_adapter) { |
|
| 19 | 19 | |
| 20 | 20 | $this->task_ajax_adapters[] = $task_ajax_adapter; |
| 21 | 21 | |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface Page { |
| 6 | 6 | |
| 7 | - public function get_menu_slug(); |
|
| 7 | + public function get_menu_slug(); |
|
| 8 | 8 | |
| 9 | 9 | } |
@@ -12,13 +12,13 @@ |
||
| 12 | 12 | $wl_version = Wordlift::get_instance()->get_version(); |
| 13 | 13 | |
| 14 | 14 | // Get the WP version. |
| 15 | - $wp_version = get_bloginfo( 'version' ); |
|
| 15 | + $wp_version = get_bloginfo('version'); |
|
| 16 | 16 | |
| 17 | 17 | // Get the home url. |
| 18 | - $home_url = home_url( '/' ); |
|
| 18 | + $home_url = home_url('/'); |
|
| 19 | 19 | |
| 20 | 20 | // Get the locale flag. |
| 21 | - $locale = apply_filters( 'core_version_check_locale', get_locale() ); |
|
| 21 | + $locale = apply_filters('core_version_check_locale', get_locale()); |
|
| 22 | 22 | |
| 23 | 23 | // Get the multisite flag. |
| 24 | 24 | $multisite = is_multisite() ? 'yes' : 'no'; |
@@ -6,28 +6,28 @@ |
||
| 6 | 6 | |
| 7 | 7 | class User_Agent { |
| 8 | 8 | |
| 9 | - public static function get_user_agent() { |
|
| 9 | + public static function get_user_agent() { |
|
| 10 | 10 | |
| 11 | - // Get WL version. |
|
| 12 | - $wl_version = Wordlift::get_instance()->get_version(); |
|
| 11 | + // Get WL version. |
|
| 12 | + $wl_version = Wordlift::get_instance()->get_version(); |
|
| 13 | 13 | |
| 14 | - // Get the WP version. |
|
| 15 | - $wp_version = get_bloginfo( 'version' ); |
|
| 14 | + // Get the WP version. |
|
| 15 | + $wp_version = get_bloginfo( 'version' ); |
|
| 16 | 16 | |
| 17 | - // Get the home url. |
|
| 18 | - $home_url = home_url( '/' ); |
|
| 17 | + // Get the home url. |
|
| 18 | + $home_url = home_url( '/' ); |
|
| 19 | 19 | |
| 20 | - // Get the locale flag. |
|
| 21 | - $locale = apply_filters( 'core_version_check_locale', get_locale() ); |
|
| 20 | + // Get the locale flag. |
|
| 21 | + $locale = apply_filters( 'core_version_check_locale', get_locale() ); |
|
| 22 | 22 | |
| 23 | - // Get the multisite flag. |
|
| 24 | - $multisite = is_multisite() ? 'yes' : 'no'; |
|
| 23 | + // Get the multisite flag. |
|
| 24 | + $multisite = is_multisite() ? 'yes' : 'no'; |
|
| 25 | 25 | |
| 26 | - // Get the PHP version. |
|
| 27 | - $php_version = phpversion(); |
|
| 26 | + // Get the PHP version. |
|
| 27 | + $php_version = phpversion(); |
|
| 28 | 28 | |
| 29 | - /** @var string $wp_version The variable is defined in `version.php`. */ |
|
| 30 | - return "WordLift/$wl_version WordPress/$wp_version (multisite:$multisite, url:$home_url, locale:$locale) PHP/$php_version"; |
|
| 31 | - } |
|
| 29 | + /** @var string $wp_version The variable is defined in `version.php`. */ |
|
| 30 | + return "WordLift/$wl_version WordPress/$wp_version (multisite:$multisite, url:$home_url, locale:$locale) PHP/$php_version"; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | } |
@@ -12,15 +12,15 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Wordlift_Install_3_27_1 extends Wordlift_Install { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * {@inheritdoc} |
|
| 17 | - */ |
|
| 18 | - protected static $version = '3.27.1'; |
|
| 15 | + /** |
|
| 16 | + * {@inheritdoc} |
|
| 17 | + */ |
|
| 18 | + protected static $version = '3.27.1'; |
|
| 19 | 19 | |
| 20 | - public function install() { |
|
| 21 | - $procedure = new Recipe_Maker_Entity_Type_Procedure(); |
|
| 22 | - $procedure->run_procedure(); |
|
| 23 | - } |
|
| 20 | + public function install() { |
|
| 21 | + $procedure = new Recipe_Maker_Entity_Type_Procedure(); |
|
| 22 | + $procedure->run_procedure(); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | } |
@@ -40,6 +40,6 @@ |
||
| 40 | 40 | * |
| 41 | 41 | * @return bool Whether the post passes or not the validation. |
| 42 | 42 | */ |
| 43 | - public function is_valid( $identifier, $operator, $operand_1, $operand_2, $type ); |
|
| 43 | + public function is_valid($identifier, $operator, $operand_1, $operand_2, $type); |
|
| 44 | 44 | |
| 45 | 45 | } |
@@ -19,27 +19,27 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | interface Rule_Validator { |
| 21 | 21 | |
| 22 | - const IS_EQUAL_TO = '==='; |
|
| 23 | - const IS_NOT_EQUAL_TO = '!=='; |
|
| 22 | + const IS_EQUAL_TO = '==='; |
|
| 23 | + const IS_NOT_EQUAL_TO = '!=='; |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * Get the validator label. |
|
| 27 | - * |
|
| 28 | - * @return string The validator label. |
|
| 29 | - */ |
|
| 30 | - public function get_label(); |
|
| 25 | + /** |
|
| 26 | + * Get the validator label. |
|
| 27 | + * |
|
| 28 | + * @return string The validator label. |
|
| 29 | + */ |
|
| 30 | + public function get_label(); |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * Test whether a post passes a validation. |
|
| 34 | - * |
|
| 35 | - * @param int $identifier The post id or term id. |
|
| 36 | - * @param string $operator The operator. |
|
| 37 | - * @param string $operand_1 The first operand. |
|
| 38 | - * @param string $operand_2 The second operand. |
|
| 39 | - * @param string $type The type is either post or term. |
|
| 40 | - * |
|
| 41 | - * @return bool Whether the post passes or not the validation. |
|
| 42 | - */ |
|
| 43 | - public function is_valid( $identifier, $operator, $operand_1, $operand_2, $type ); |
|
| 32 | + /** |
|
| 33 | + * Test whether a post passes a validation. |
|
| 34 | + * |
|
| 35 | + * @param int $identifier The post id or term id. |
|
| 36 | + * @param string $operator The operator. |
|
| 37 | + * @param string $operand_1 The first operand. |
|
| 38 | + * @param string $operand_2 The second operand. |
|
| 39 | + * @param string $type The type is either post or term. |
|
| 40 | + * |
|
| 41 | + * @return bool Whether the post passes or not the validation. |
|
| 42 | + */ |
|
| 43 | + public function is_valid( $identifier, $operator, $operand_1, $operand_2, $type ); |
|
| 44 | 44 | |
| 45 | 45 | } |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | interface Abstract_Data_Source { |
| 15 | 15 | |
| 16 | - public function get_data( $identifier, $property, $type ); |
|
| 16 | + public function get_data( $identifier, $property, $type ); |
|
| 17 | 17 | |
| 18 | 18 | } |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | interface Abstract_Data_Source { |
| 15 | 15 | |
| 16 | - public function get_data( $identifier, $property, $type ); |
|
| 16 | + public function get_data($identifier, $property, $type); |
|
| 17 | 17 | |
| 18 | 18 | } |
@@ -12,170 +12,170 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | abstract class Wordlift_Plugin_WP_Async_Request { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Prefix |
|
| 17 | - * |
|
| 18 | - * (default value: 'wp') |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - * @access protected |
|
| 22 | - */ |
|
| 23 | - protected $prefix = 'wp'; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Action |
|
| 27 | - * |
|
| 28 | - * (default value: 'async_request') |
|
| 29 | - * |
|
| 30 | - * @var string |
|
| 31 | - * @access protected |
|
| 32 | - */ |
|
| 33 | - protected $action = 'async_request'; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Identifier |
|
| 37 | - * |
|
| 38 | - * @var mixed |
|
| 39 | - * @access protected |
|
| 40 | - */ |
|
| 41 | - protected $identifier; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Data |
|
| 45 | - * |
|
| 46 | - * (default value: array()) |
|
| 47 | - * |
|
| 48 | - * @var array |
|
| 49 | - * @access protected |
|
| 50 | - */ |
|
| 51 | - protected $data = array(); |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Initiate new async request |
|
| 55 | - */ |
|
| 56 | - public function __construct() { |
|
| 57 | - $this->identifier = $this->prefix . '_' . $this->action; |
|
| 58 | - |
|
| 59 | - add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 60 | - add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Set data used during the request |
|
| 65 | - * |
|
| 66 | - * @param array $data Data. |
|
| 67 | - * |
|
| 68 | - * @return $this |
|
| 69 | - */ |
|
| 70 | - public function data( $data ) { |
|
| 71 | - $this->data = $data; |
|
| 72 | - |
|
| 73 | - return $this; |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * Dispatch the async request |
|
| 78 | - * |
|
| 79 | - * @return array|WP_Error |
|
| 80 | - */ |
|
| 81 | - public function dispatch() { |
|
| 82 | - $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); |
|
| 83 | - $args = $this->get_post_args(); |
|
| 84 | - |
|
| 85 | - return wp_remote_post( esc_url_raw( $url ), $args ); |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * Get query args |
|
| 90 | - * |
|
| 91 | - * @return array |
|
| 92 | - */ |
|
| 93 | - protected function get_query_args() { |
|
| 94 | - if ( property_exists( $this, 'query_args' ) ) { |
|
| 95 | - return $this->query_args; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - $args = array( |
|
| 99 | - 'action' => $this->identifier, |
|
| 100 | - 'nonce' => wp_create_nonce( $this->identifier ), |
|
| 101 | - ); |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * Filters the post arguments used during an async request. |
|
| 105 | - * |
|
| 106 | - * @param array $url |
|
| 107 | - */ |
|
| 108 | - return apply_filters( $this->identifier . '_query_args', $args ); |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * Get query URL |
|
| 113 | - * |
|
| 114 | - * @return string |
|
| 115 | - */ |
|
| 116 | - protected function get_query_url() { |
|
| 117 | - if ( property_exists( $this, 'query_url' ) ) { |
|
| 118 | - return $this->query_url; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - $url = admin_url( 'admin-ajax.php' ); |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * Filters the post arguments used during an async request. |
|
| 125 | - * |
|
| 126 | - * @param string $url |
|
| 127 | - */ |
|
| 128 | - return apply_filters( $this->identifier . '_query_url', $url ); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * Get post args |
|
| 133 | - * |
|
| 134 | - * @return array |
|
| 135 | - */ |
|
| 136 | - protected function get_post_args() { |
|
| 137 | - if ( property_exists( $this, 'post_args' ) ) { |
|
| 138 | - return $this->post_args; |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - $args = array( |
|
| 142 | - 'timeout' => 0.01, |
|
| 143 | - 'blocking' => false, |
|
| 144 | - 'body' => $this->data, |
|
| 145 | - 'cookies' => $_COOKIE, |
|
| 146 | - 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), |
|
| 147 | - ); |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * Filters the post arguments used during an async request. |
|
| 151 | - * |
|
| 152 | - * @param array $args |
|
| 153 | - */ |
|
| 154 | - return apply_filters( $this->identifier . '_post_args', $args ); |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * Maybe handle |
|
| 159 | - * |
|
| 160 | - * Check for correct nonce and pass to handler. |
|
| 161 | - */ |
|
| 162 | - public function maybe_handle() { |
|
| 163 | - // Don't lock up other requests while processing |
|
| 164 | - session_write_close(); |
|
| 165 | - |
|
| 166 | - check_ajax_referer( $this->identifier, 'nonce' ); |
|
| 167 | - |
|
| 168 | - $this->handle(); |
|
| 169 | - |
|
| 170 | - wp_die(); |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * Handle |
|
| 175 | - * |
|
| 176 | - * Override this method to perform any actions required |
|
| 177 | - * during the async request. |
|
| 178 | - */ |
|
| 179 | - abstract protected function handle(); |
|
| 15 | + /** |
|
| 16 | + * Prefix |
|
| 17 | + * |
|
| 18 | + * (default value: 'wp') |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + * @access protected |
|
| 22 | + */ |
|
| 23 | + protected $prefix = 'wp'; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * Action |
|
| 27 | + * |
|
| 28 | + * (default value: 'async_request') |
|
| 29 | + * |
|
| 30 | + * @var string |
|
| 31 | + * @access protected |
|
| 32 | + */ |
|
| 33 | + protected $action = 'async_request'; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Identifier |
|
| 37 | + * |
|
| 38 | + * @var mixed |
|
| 39 | + * @access protected |
|
| 40 | + */ |
|
| 41 | + protected $identifier; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Data |
|
| 45 | + * |
|
| 46 | + * (default value: array()) |
|
| 47 | + * |
|
| 48 | + * @var array |
|
| 49 | + * @access protected |
|
| 50 | + */ |
|
| 51 | + protected $data = array(); |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Initiate new async request |
|
| 55 | + */ |
|
| 56 | + public function __construct() { |
|
| 57 | + $this->identifier = $this->prefix . '_' . $this->action; |
|
| 58 | + |
|
| 59 | + add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 60 | + add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Set data used during the request |
|
| 65 | + * |
|
| 66 | + * @param array $data Data. |
|
| 67 | + * |
|
| 68 | + * @return $this |
|
| 69 | + */ |
|
| 70 | + public function data( $data ) { |
|
| 71 | + $this->data = $data; |
|
| 72 | + |
|
| 73 | + return $this; |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * Dispatch the async request |
|
| 78 | + * |
|
| 79 | + * @return array|WP_Error |
|
| 80 | + */ |
|
| 81 | + public function dispatch() { |
|
| 82 | + $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); |
|
| 83 | + $args = $this->get_post_args(); |
|
| 84 | + |
|
| 85 | + return wp_remote_post( esc_url_raw( $url ), $args ); |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * Get query args |
|
| 90 | + * |
|
| 91 | + * @return array |
|
| 92 | + */ |
|
| 93 | + protected function get_query_args() { |
|
| 94 | + if ( property_exists( $this, 'query_args' ) ) { |
|
| 95 | + return $this->query_args; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + $args = array( |
|
| 99 | + 'action' => $this->identifier, |
|
| 100 | + 'nonce' => wp_create_nonce( $this->identifier ), |
|
| 101 | + ); |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * Filters the post arguments used during an async request. |
|
| 105 | + * |
|
| 106 | + * @param array $url |
|
| 107 | + */ |
|
| 108 | + return apply_filters( $this->identifier . '_query_args', $args ); |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * Get query URL |
|
| 113 | + * |
|
| 114 | + * @return string |
|
| 115 | + */ |
|
| 116 | + protected function get_query_url() { |
|
| 117 | + if ( property_exists( $this, 'query_url' ) ) { |
|
| 118 | + return $this->query_url; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + $url = admin_url( 'admin-ajax.php' ); |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * Filters the post arguments used during an async request. |
|
| 125 | + * |
|
| 126 | + * @param string $url |
|
| 127 | + */ |
|
| 128 | + return apply_filters( $this->identifier . '_query_url', $url ); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * Get post args |
|
| 133 | + * |
|
| 134 | + * @return array |
|
| 135 | + */ |
|
| 136 | + protected function get_post_args() { |
|
| 137 | + if ( property_exists( $this, 'post_args' ) ) { |
|
| 138 | + return $this->post_args; |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + $args = array( |
|
| 142 | + 'timeout' => 0.01, |
|
| 143 | + 'blocking' => false, |
|
| 144 | + 'body' => $this->data, |
|
| 145 | + 'cookies' => $_COOKIE, |
|
| 146 | + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), |
|
| 147 | + ); |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * Filters the post arguments used during an async request. |
|
| 151 | + * |
|
| 152 | + * @param array $args |
|
| 153 | + */ |
|
| 154 | + return apply_filters( $this->identifier . '_post_args', $args ); |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * Maybe handle |
|
| 159 | + * |
|
| 160 | + * Check for correct nonce and pass to handler. |
|
| 161 | + */ |
|
| 162 | + public function maybe_handle() { |
|
| 163 | + // Don't lock up other requests while processing |
|
| 164 | + session_write_close(); |
|
| 165 | + |
|
| 166 | + check_ajax_referer( $this->identifier, 'nonce' ); |
|
| 167 | + |
|
| 168 | + $this->handle(); |
|
| 169 | + |
|
| 170 | + wp_die(); |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * Handle |
|
| 175 | + * |
|
| 176 | + * Override this method to perform any actions required |
|
| 177 | + * during the async request. |
|
| 178 | + */ |
|
| 179 | + abstract protected function handle(); |
|
| 180 | 180 | |
| 181 | 181 | } |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | * Initiate new async request |
| 55 | 55 | */ |
| 56 | 56 | public function __construct() { |
| 57 | - $this->identifier = $this->prefix . '_' . $this->action; |
|
| 57 | + $this->identifier = $this->prefix.'_'.$this->action; |
|
| 58 | 58 | |
| 59 | - add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 60 | - add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 59 | + add_action('wp_ajax_'.$this->identifier, array($this, 'maybe_handle')); |
|
| 60 | + add_action('wp_ajax_nopriv_'.$this->identifier, array($this, 'maybe_handle')); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return $this |
| 69 | 69 | */ |
| 70 | - public function data( $data ) { |
|
| 70 | + public function data($data) { |
|
| 71 | 71 | $this->data = $data; |
| 72 | 72 | |
| 73 | 73 | return $this; |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | * @return array|WP_Error |
| 80 | 80 | */ |
| 81 | 81 | public function dispatch() { |
| 82 | - $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); |
|
| 82 | + $url = add_query_arg($this->get_query_args(), $this->get_query_url()); |
|
| 83 | 83 | $args = $this->get_post_args(); |
| 84 | 84 | |
| 85 | - return wp_remote_post( esc_url_raw( $url ), $args ); |
|
| 85 | + return wp_remote_post(esc_url_raw($url), $args); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -91,13 +91,13 @@ discard block |
||
| 91 | 91 | * @return array |
| 92 | 92 | */ |
| 93 | 93 | protected function get_query_args() { |
| 94 | - if ( property_exists( $this, 'query_args' ) ) { |
|
| 94 | + if (property_exists($this, 'query_args')) { |
|
| 95 | 95 | return $this->query_args; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $args = array( |
| 99 | 99 | 'action' => $this->identifier, |
| 100 | - 'nonce' => wp_create_nonce( $this->identifier ), |
|
| 100 | + 'nonce' => wp_create_nonce($this->identifier), |
|
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @param array $url |
| 107 | 107 | */ |
| 108 | - return apply_filters( $this->identifier . '_query_args', $args ); |
|
| 108 | + return apply_filters($this->identifier.'_query_args', $args); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -114,18 +114,18 @@ discard block |
||
| 114 | 114 | * @return string |
| 115 | 115 | */ |
| 116 | 116 | protected function get_query_url() { |
| 117 | - if ( property_exists( $this, 'query_url' ) ) { |
|
| 117 | + if (property_exists($this, 'query_url')) { |
|
| 118 | 118 | return $this->query_url; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - $url = admin_url( 'admin-ajax.php' ); |
|
| 121 | + $url = admin_url('admin-ajax.php'); |
|
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | 124 | * Filters the post arguments used during an async request. |
| 125 | 125 | * |
| 126 | 126 | * @param string $url |
| 127 | 127 | */ |
| 128 | - return apply_filters( $this->identifier . '_query_url', $url ); |
|
| 128 | + return apply_filters($this->identifier.'_query_url', $url); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @return array |
| 135 | 135 | */ |
| 136 | 136 | protected function get_post_args() { |
| 137 | - if ( property_exists( $this, 'post_args' ) ) { |
|
| 137 | + if (property_exists($this, 'post_args')) { |
|
| 138 | 138 | return $this->post_args; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | 'blocking' => false, |
| 144 | 144 | 'body' => $this->data, |
| 145 | 145 | 'cookies' => $_COOKIE, |
| 146 | - 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), |
|
| 146 | + 'sslverify' => apply_filters('https_local_ssl_verify', false), |
|
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param array $args |
| 153 | 153 | */ |
| 154 | - return apply_filters( $this->identifier . '_post_args', $args ); |
|
| 154 | + return apply_filters($this->identifier.'_post_args', $args); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // Don't lock up other requests while processing |
| 164 | 164 | session_write_close(); |
| 165 | 165 | |
| 166 | - check_ajax_referer( $this->identifier, 'nonce' ); |
|
| 166 | + check_ajax_referer($this->identifier, 'nonce'); |
|
| 167 | 167 | |
| 168 | 168 | $this->handle(); |
| 169 | 169 | |
@@ -12,170 +12,170 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | abstract class WP_Async_Request { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Prefix |
|
| 17 | - * |
|
| 18 | - * (default value: 'wp') |
|
| 19 | - * |
|
| 20 | - * @var string |
|
| 21 | - * @access protected |
|
| 22 | - */ |
|
| 23 | - protected $prefix = 'wp'; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Action |
|
| 27 | - * |
|
| 28 | - * (default value: 'async_request') |
|
| 29 | - * |
|
| 30 | - * @var string |
|
| 31 | - * @access protected |
|
| 32 | - */ |
|
| 33 | - protected $action = 'async_request'; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Identifier |
|
| 37 | - * |
|
| 38 | - * @var mixed |
|
| 39 | - * @access protected |
|
| 40 | - */ |
|
| 41 | - protected $identifier; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Data |
|
| 45 | - * |
|
| 46 | - * (default value: array()) |
|
| 47 | - * |
|
| 48 | - * @var array |
|
| 49 | - * @access protected |
|
| 50 | - */ |
|
| 51 | - protected $data = array(); |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Initiate new async request |
|
| 55 | - */ |
|
| 56 | - public function __construct() { |
|
| 57 | - $this->identifier = $this->prefix . '_' . $this->action; |
|
| 58 | - |
|
| 59 | - add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 60 | - add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Set data used during the request |
|
| 65 | - * |
|
| 66 | - * @param array $data Data. |
|
| 67 | - * |
|
| 68 | - * @return $this |
|
| 69 | - */ |
|
| 70 | - public function data( $data ) { |
|
| 71 | - $this->data = $data; |
|
| 72 | - |
|
| 73 | - return $this; |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * Dispatch the async request |
|
| 78 | - * |
|
| 79 | - * @return array|WP_Error |
|
| 80 | - */ |
|
| 81 | - public function dispatch() { |
|
| 82 | - $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); |
|
| 83 | - $args = $this->get_post_args(); |
|
| 84 | - |
|
| 85 | - return wp_remote_post( esc_url_raw( $url ), $args ); |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * Get query args |
|
| 90 | - * |
|
| 91 | - * @return array |
|
| 92 | - */ |
|
| 93 | - protected function get_query_args() { |
|
| 94 | - if ( property_exists( $this, 'query_args' ) ) { |
|
| 95 | - return $this->query_args; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - $args = array( |
|
| 99 | - 'action' => $this->identifier, |
|
| 100 | - 'nonce' => wp_create_nonce( $this->identifier ), |
|
| 101 | - ); |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * Filters the post arguments used during an async request. |
|
| 105 | - * |
|
| 106 | - * @param array $url |
|
| 107 | - */ |
|
| 108 | - return apply_filters( $this->identifier . '_query_args', $args ); |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * Get query URL |
|
| 113 | - * |
|
| 114 | - * @return string |
|
| 115 | - */ |
|
| 116 | - protected function get_query_url() { |
|
| 117 | - if ( property_exists( $this, 'query_url' ) ) { |
|
| 118 | - return $this->query_url; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - $url = admin_url( 'admin-ajax.php' ); |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * Filters the post arguments used during an async request. |
|
| 125 | - * |
|
| 126 | - * @param string $url |
|
| 127 | - */ |
|
| 128 | - return apply_filters( $this->identifier . '_query_url', $url ); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * Get post args |
|
| 133 | - * |
|
| 134 | - * @return array |
|
| 135 | - */ |
|
| 136 | - protected function get_post_args() { |
|
| 137 | - if ( property_exists( $this, 'post_args' ) ) { |
|
| 138 | - return $this->post_args; |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - $args = array( |
|
| 142 | - 'timeout' => 0.01, |
|
| 143 | - 'blocking' => false, |
|
| 144 | - 'body' => $this->data, |
|
| 145 | - 'cookies' => $_COOKIE, |
|
| 146 | - 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), |
|
| 147 | - ); |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * Filters the post arguments used during an async request. |
|
| 151 | - * |
|
| 152 | - * @param array $args |
|
| 153 | - */ |
|
| 154 | - return apply_filters( $this->identifier . '_post_args', $args ); |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * Maybe handle |
|
| 159 | - * |
|
| 160 | - * Check for correct nonce and pass to handler. |
|
| 161 | - */ |
|
| 162 | - public function maybe_handle() { |
|
| 163 | - // Don't lock up other requests while processing |
|
| 164 | - session_write_close(); |
|
| 165 | - |
|
| 166 | - check_ajax_referer( $this->identifier, 'nonce' ); |
|
| 167 | - |
|
| 168 | - $this->handle(); |
|
| 169 | - |
|
| 170 | - wp_die(); |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * Handle |
|
| 175 | - * |
|
| 176 | - * Override this method to perform any actions required |
|
| 177 | - * during the async request. |
|
| 178 | - */ |
|
| 179 | - abstract protected function handle(); |
|
| 15 | + /** |
|
| 16 | + * Prefix |
|
| 17 | + * |
|
| 18 | + * (default value: 'wp') |
|
| 19 | + * |
|
| 20 | + * @var string |
|
| 21 | + * @access protected |
|
| 22 | + */ |
|
| 23 | + protected $prefix = 'wp'; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * Action |
|
| 27 | + * |
|
| 28 | + * (default value: 'async_request') |
|
| 29 | + * |
|
| 30 | + * @var string |
|
| 31 | + * @access protected |
|
| 32 | + */ |
|
| 33 | + protected $action = 'async_request'; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Identifier |
|
| 37 | + * |
|
| 38 | + * @var mixed |
|
| 39 | + * @access protected |
|
| 40 | + */ |
|
| 41 | + protected $identifier; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Data |
|
| 45 | + * |
|
| 46 | + * (default value: array()) |
|
| 47 | + * |
|
| 48 | + * @var array |
|
| 49 | + * @access protected |
|
| 50 | + */ |
|
| 51 | + protected $data = array(); |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Initiate new async request |
|
| 55 | + */ |
|
| 56 | + public function __construct() { |
|
| 57 | + $this->identifier = $this->prefix . '_' . $this->action; |
|
| 58 | + |
|
| 59 | + add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 60 | + add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Set data used during the request |
|
| 65 | + * |
|
| 66 | + * @param array $data Data. |
|
| 67 | + * |
|
| 68 | + * @return $this |
|
| 69 | + */ |
|
| 70 | + public function data( $data ) { |
|
| 71 | + $this->data = $data; |
|
| 72 | + |
|
| 73 | + return $this; |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * Dispatch the async request |
|
| 78 | + * |
|
| 79 | + * @return array|WP_Error |
|
| 80 | + */ |
|
| 81 | + public function dispatch() { |
|
| 82 | + $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); |
|
| 83 | + $args = $this->get_post_args(); |
|
| 84 | + |
|
| 85 | + return wp_remote_post( esc_url_raw( $url ), $args ); |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * Get query args |
|
| 90 | + * |
|
| 91 | + * @return array |
|
| 92 | + */ |
|
| 93 | + protected function get_query_args() { |
|
| 94 | + if ( property_exists( $this, 'query_args' ) ) { |
|
| 95 | + return $this->query_args; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + $args = array( |
|
| 99 | + 'action' => $this->identifier, |
|
| 100 | + 'nonce' => wp_create_nonce( $this->identifier ), |
|
| 101 | + ); |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * Filters the post arguments used during an async request. |
|
| 105 | + * |
|
| 106 | + * @param array $url |
|
| 107 | + */ |
|
| 108 | + return apply_filters( $this->identifier . '_query_args', $args ); |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * Get query URL |
|
| 113 | + * |
|
| 114 | + * @return string |
|
| 115 | + */ |
|
| 116 | + protected function get_query_url() { |
|
| 117 | + if ( property_exists( $this, 'query_url' ) ) { |
|
| 118 | + return $this->query_url; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + $url = admin_url( 'admin-ajax.php' ); |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * Filters the post arguments used during an async request. |
|
| 125 | + * |
|
| 126 | + * @param string $url |
|
| 127 | + */ |
|
| 128 | + return apply_filters( $this->identifier . '_query_url', $url ); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * Get post args |
|
| 133 | + * |
|
| 134 | + * @return array |
|
| 135 | + */ |
|
| 136 | + protected function get_post_args() { |
|
| 137 | + if ( property_exists( $this, 'post_args' ) ) { |
|
| 138 | + return $this->post_args; |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + $args = array( |
|
| 142 | + 'timeout' => 0.01, |
|
| 143 | + 'blocking' => false, |
|
| 144 | + 'body' => $this->data, |
|
| 145 | + 'cookies' => $_COOKIE, |
|
| 146 | + 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), |
|
| 147 | + ); |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * Filters the post arguments used during an async request. |
|
| 151 | + * |
|
| 152 | + * @param array $args |
|
| 153 | + */ |
|
| 154 | + return apply_filters( $this->identifier . '_post_args', $args ); |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * Maybe handle |
|
| 159 | + * |
|
| 160 | + * Check for correct nonce and pass to handler. |
|
| 161 | + */ |
|
| 162 | + public function maybe_handle() { |
|
| 163 | + // Don't lock up other requests while processing |
|
| 164 | + session_write_close(); |
|
| 165 | + |
|
| 166 | + check_ajax_referer( $this->identifier, 'nonce' ); |
|
| 167 | + |
|
| 168 | + $this->handle(); |
|
| 169 | + |
|
| 170 | + wp_die(); |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * Handle |
|
| 175 | + * |
|
| 176 | + * Override this method to perform any actions required |
|
| 177 | + * during the async request. |
|
| 178 | + */ |
|
| 179 | + abstract protected function handle(); |
|
| 180 | 180 | |
| 181 | 181 | } |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | * Initiate new async request |
| 55 | 55 | */ |
| 56 | 56 | public function __construct() { |
| 57 | - $this->identifier = $this->prefix . '_' . $this->action; |
|
| 57 | + $this->identifier = $this->prefix.'_'.$this->action; |
|
| 58 | 58 | |
| 59 | - add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 60 | - add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); |
|
| 59 | + add_action('wp_ajax_'.$this->identifier, array($this, 'maybe_handle')); |
|
| 60 | + add_action('wp_ajax_nopriv_'.$this->identifier, array($this, 'maybe_handle')); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | * |
| 68 | 68 | * @return $this |
| 69 | 69 | */ |
| 70 | - public function data( $data ) { |
|
| 70 | + public function data($data) { |
|
| 71 | 71 | $this->data = $data; |
| 72 | 72 | |
| 73 | 73 | return $this; |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | * @return array|WP_Error |
| 80 | 80 | */ |
| 81 | 81 | public function dispatch() { |
| 82 | - $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); |
|
| 82 | + $url = add_query_arg($this->get_query_args(), $this->get_query_url()); |
|
| 83 | 83 | $args = $this->get_post_args(); |
| 84 | 84 | |
| 85 | - return wp_remote_post( esc_url_raw( $url ), $args ); |
|
| 85 | + return wp_remote_post(esc_url_raw($url), $args); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -91,13 +91,13 @@ discard block |
||
| 91 | 91 | * @return array |
| 92 | 92 | */ |
| 93 | 93 | protected function get_query_args() { |
| 94 | - if ( property_exists( $this, 'query_args' ) ) { |
|
| 94 | + if (property_exists($this, 'query_args')) { |
|
| 95 | 95 | return $this->query_args; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | $args = array( |
| 99 | 99 | 'action' => $this->identifier, |
| 100 | - 'nonce' => wp_create_nonce( $this->identifier ), |
|
| 100 | + 'nonce' => wp_create_nonce($this->identifier), |
|
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @param array $url |
| 107 | 107 | */ |
| 108 | - return apply_filters( $this->identifier . '_query_args', $args ); |
|
| 108 | + return apply_filters($this->identifier.'_query_args', $args); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -114,18 +114,18 @@ discard block |
||
| 114 | 114 | * @return string |
| 115 | 115 | */ |
| 116 | 116 | protected function get_query_url() { |
| 117 | - if ( property_exists( $this, 'query_url' ) ) { |
|
| 117 | + if (property_exists($this, 'query_url')) { |
|
| 118 | 118 | return $this->query_url; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - $url = admin_url( 'admin-ajax.php' ); |
|
| 121 | + $url = admin_url('admin-ajax.php'); |
|
| 122 | 122 | |
| 123 | 123 | /** |
| 124 | 124 | * Filters the post arguments used during an async request. |
| 125 | 125 | * |
| 126 | 126 | * @param string $url |
| 127 | 127 | */ |
| 128 | - return apply_filters( $this->identifier . '_query_url', $url ); |
|
| 128 | + return apply_filters($this->identifier.'_query_url', $url); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * @return array |
| 135 | 135 | */ |
| 136 | 136 | protected function get_post_args() { |
| 137 | - if ( property_exists( $this, 'post_args' ) ) { |
|
| 137 | + if (property_exists($this, 'post_args')) { |
|
| 138 | 138 | return $this->post_args; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | 'blocking' => false, |
| 144 | 144 | 'body' => $this->data, |
| 145 | 145 | 'cookies' => $_COOKIE, |
| 146 | - 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), |
|
| 146 | + 'sslverify' => apply_filters('https_local_ssl_verify', false), |
|
| 147 | 147 | ); |
| 148 | 148 | |
| 149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param array $args |
| 153 | 153 | */ |
| 154 | - return apply_filters( $this->identifier . '_post_args', $args ); |
|
| 154 | + return apply_filters($this->identifier.'_post_args', $args); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // Don't lock up other requests while processing |
| 164 | 164 | session_write_close(); |
| 165 | 165 | |
| 166 | - check_ajax_referer( $this->identifier, 'nonce' ); |
|
| 166 | + check_ajax_referer($this->identifier, 'nonce'); |
|
| 167 | 167 | |
| 168 | 168 | $this->handle(); |
| 169 | 169 | |
@@ -17,8 +17,8 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | if ( ! class_exists( 'WP_Async_Request' ) ) { |
| 20 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php'; |
|
| 20 | + require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php'; |
|
| 21 | 21 | } |
| 22 | 22 | if ( ! class_exists( 'WP_Background_Process' ) ) { |
| 23 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php'; |
|
| 23 | + require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php'; |
|
| 24 | 24 | } |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | GitHub Branch: master |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | -if ( ! class_exists( 'WP_Async_Request' ) ) { |
|
| 20 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-async-request.php'; |
|
| 19 | +if ( ! class_exists('WP_Async_Request')) { |
|
| 20 | + require_once plugin_dir_path(__FILE__).'classes/wp-async-request.php'; |
|
| 21 | 21 | } |
| 22 | -if ( ! class_exists( 'WP_Background_Process' ) ) { |
|
| 23 | - require_once plugin_dir_path( __FILE__ ) . 'classes/wp-background-process.php'; |
|
| 22 | +if ( ! class_exists('WP_Background_Process')) { |
|
| 23 | + require_once plugin_dir_path(__FILE__).'classes/wp-background-process.php'; |
|
| 24 | 24 | } |