get_error_message(); add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'show_wp_error', ] ); break; case 'waiting': if ( ! apply_filters( 'github_updater_disable_wpcron', false ) ) { add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'waiting' ] ); } // no break. case 'git': default: add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'show_403_error_message', ] ); add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'show_401_error_message', ] ); } } return true; } /** * Create error message for 403 error. * Usually 403 as API rate limit max out. */ public function show_403_error_message() { $_403 = false; $error_code = $this->get_error_codes(); foreach ( (array) $error_code as $repo ) { if ( ( ! $_403 && isset( $repo['code'], $repo['git'] ) ) && 403 === $repo['code'] && 'github' === $repo['git'] ) { $_403 = true; if ( ! \PAnD::is_admin_notice_active( '403-error-1' ) ) { return; } ?>
';
printf(
/* translators: %s: GitHub personal access token URL */
wp_kses_post( __( 'It looks like you are running into GitHub API rate limits. Be sure and configure a Personal Access Token to avoid this issue.', 'github-updater' ) ),
esc_url( 'https://help.github.com/articles/creating-an-access-token-for-command-line-use/' )
);
?>