PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/integrations/third-party/wincher-publish.php +2 -11 18.1 → trunk View file →
@@ -101,17 +101,8 @@
101 101 ];
102 102 }
103 103
104 104 /**
105 - * Determines whether the current request is a REST request.
106 - *
107 - * @return bool Whether the request is a REST request.
108 - */
109 - public function is_rest_request() {
110 - return \defined( 'REST_REQUEST' ) && \REST_REQUEST;
111 - }
112 -
113 - /**
114 105 * Sends the keyphrases associated with the post to Wincher for automatic tracking.
115 106 *
116 107 * @param WP_Post $post The post to extract the keyphrases from.
117 108 *
@@ -117,9 +108,9 @@
117 108 *
118 109 * @return void
119 110 */
120 111 public function track_request( $post ) {
121 - if ( ! $post instanceof \WP_Post ) {
112 + if ( ! $post instanceof WP_Post ) {
122 113 return;
123 114 }
124 115
125 116 // Filter out empty entries.
@@ -152,9 +143,9 @@
152 143 *
153 144 * @return void
154 145 */
155 146 public function track_after_post_request( $post_id, $post ) {
156 - if ( $this->is_rest_request() ) {
147 + if ( \wp_is_serving_rest_request() ) {
157 148 return;
158 149 }
159 150
160 151 $this->track_request( $post );