@@ -89,7 +89,7 @@ public function getAccessToken( $refresh = false ) {
8989 return ;
9090 }
9191
92- if ( aioseo ()->cache ->get ( 'ai-access-token-error ' ) ) {
92+ if ( aioseo ()->core -> cache ->get ( 'ai-access-token-error ' ) ) {
9393 return ;
9494 }
9595
@@ -100,7 +100,7 @@ public function getAccessToken( $refresh = false ) {
100100 ] );
101101
102102 if ( is_wp_error ( $ response ) ) {
103- aioseo ()->cache ->update ( 'ai-access-token-error ' , true , 1 * HOUR_IN_SECONDS );
103+ aioseo ()->core -> cache ->update ( 'ai-access-token-error ' , true , 1 * HOUR_IN_SECONDS );
104104
105105 // Schedule another, one-time event in approx. 1 hour from now.
106106 aioseo ()->actionScheduler ->scheduleSingle ( $ this ->creditFetchAction , 1 * ( HOUR_IN_SECONDS + wp_rand ( 0 , 30 * MINUTE_IN_SECONDS ) ), [] );
@@ -111,7 +111,7 @@ public function getAccessToken( $refresh = false ) {
111111 $ body = wp_remote_retrieve_body ( $ response );
112112 $ data = json_decode ( $ body );
113113 if ( empty ( $ data ->accessToken ) ) {
114- aioseo ()->cache ->update ( 'ai-access-token-error ' , true , 1 * HOUR_IN_SECONDS );
114+ aioseo ()->core -> cache ->update ( 'ai-access-token-error ' , true , 1 * HOUR_IN_SECONDS );
115115
116116 // Schedule another, one-time event in approx. 1 hour from now.
117117 aioseo ()->actionScheduler ->scheduleSingle ( $ this ->creditFetchAction , 1 * ( HOUR_IN_SECONDS + wp_rand ( 0 , 30 * MINUTE_IN_SECONDS ) ), [] );
@@ -152,7 +152,7 @@ public function scheduleCreditFetchAction() {
152152 * @return void
153153 */
154154 public function updateCredits ( $ refresh = false ) {
155- if ( aioseo ()->cache ->get ( 'ai-credits-error ' ) && ! $ refresh ) {
155+ if ( aioseo ()->core -> cache ->get ( 'ai-credits-error ' ) && ! $ refresh ) {
156156 return ;
157157 }
158158
@@ -165,7 +165,7 @@ public function updateCredits( $refresh = false ) {
165165 ] );
166166
167167 if ( is_wp_error ( $ response ) ) {
168- aioseo ()->cache ->update ( 'ai-credits-error ' , true , HOUR_IN_SECONDS );
168+ aioseo ()->core -> cache ->update ( 'ai-credits-error ' , true , HOUR_IN_SECONDS );
169169
170170 // Schedule another, one-time event in approx. 1 hour from now.
171171 aioseo ()->actionScheduler ->scheduleSingle ( $ this ->creditFetchAction , 1 * ( HOUR_IN_SECONDS + wp_rand ( 0 , 30 * MINUTE_IN_SECONDS ) ), [] );
@@ -181,7 +181,7 @@ public function updateCredits( $refresh = false ) {
181181 aioseo ()->internalOptions ->internal ->ai ->accessToken = '' ;
182182 }
183183
184- aioseo ()->cache ->update ( 'ai-credits-error ' , true , HOUR_IN_SECONDS );
184+ aioseo ()->core -> cache ->update ( 'ai-credits-error ' , true , HOUR_IN_SECONDS );
185185
186186 // Schedule another, one-time event in approx. 1 hour from now.
187187 aioseo ()->actionScheduler ->scheduleSingle ( $ this ->creditFetchAction , 1 * ( HOUR_IN_SECONDS + wp_rand ( 0 , 30 * MINUTE_IN_SECONDS ) ), [] );
0 commit comments