| @@ -2,9 +2,8 @@ | ||
| 2 | 2 | namespace Depicter\Editor; |
| 3 | 3 | |
| 4 | 4 | |
| 5 | 5 | use Depicter\Editor\Migrations\JobsQueue; |
| 6 | -use Depicter\Services\UserAPIService; | |
| 7 | 6 | |
| 8 | 7 | |
| 9 | 8 | class Editor |
| 10 | 9 | { |
| @@ -16,9 +15,8 @@ | ||
| 16 | 15 | public function init() |
| 17 | 16 | { |
| 18 | 17 | add_action( 'admin_action_depicter', [ $this, 'make' ] ); |
| 19 | 18 | add_action( 'depicter/plugin/updated', [ $this, 'check_migration_tasks' ] ); |
| 20 | - add_action( 'depicter/editor/open', [ $this, 'renewTokens'] ); | |
| 21 | 19 | } |
| 22 | 20 | |
| 23 | 21 | public function make() |
| 24 | 22 | { |
| @@ -23,9 +21,9 @@ | ||
| 23 | 21 | public function make() |
| 24 | 22 | { |
| 25 | 23 | |
| 26 | 24 | if ( !current_user_can('access_depicter') ) { |
| 27 | - wp_die( esc_html__( 'Sorry, you are not allowed to access this page.', 'depicter' ), esc_html__( 'Depicter Error', 'depicter' ), array( | |
| 25 | + wp_die( __( 'Sorry, you are not allowed to access this page.', 'depicter' ), __( 'Depicter Error', 'depicter' ), array( | |
| 28 | 26 | 'response' => 403, |
| 29 | 27 | 'back_link' => false, |
| 30 | 28 | ) ); |
| 31 | 29 | } |
| @@ -141,19 +139,8 @@ | ||
| 141 | 139 | * Check migration tasks after plugin upgraded |
| 142 | 140 | */ |
| 143 | 141 | public function check_migration_tasks() { |
| 144 | 142 | ( new JobsQueue() )->migrate(); |
| 145 | - } | |
| 146 | - | |
| 147 | - /** | |
| 148 | - * Renew member tokens before expire date | |
| 149 | - * | |
| 150 | - * @return void | |
| 151 | - */ | |
| 152 | - public function renewTokens() { | |
| 153 | - if ( false === \Depicter::cache('base')->get( 'access_token' ) ) { | |
| 154 | - UserAPIService::renewTokens(); | |
| 155 | - } | |
| 156 | 143 | } |
| 157 | 144 | } |
| 158 | 145 | |
| 159 | 146 | |