$this ) ); } /** * Return the current upgrade action. * * @since 1.3.0 * @version 1.8.9.1 * * @return false|string False if no action was specified. */ public function get_action() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter if ( ! isset( $_GET['charitable-upgrade'] ) ) { return false; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter return sanitize_text_field( wp_unslash( $_GET['charitable-upgrade'] ) ); } /** * Return the current upgrade step. * * @since 1.3.0 * @version 1.8.9.1 * * @return int */ public function get_step() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter if ( ! isset( $_GET['step'] ) ) { return 1; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter return absint( wp_unslash( $_GET['step'] ) ); } /** * Return the total number of records to be updated. * * @since 1.3.0 * @version 1.8.9.1 * * @return false|int */ public function get_total() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter if ( ! isset( $_GET['total'] ) ) { return false; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter return absint( wp_unslash( $_GET['total'] ) ); } /** * Return the... number? * * @since 1.3.0 * @version 1.8.9.1 * * @return int */ public function get_number() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter if ( ! isset( $_GET['number'] ) ) { return 100; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter return absint( wp_unslash( $_GET['number'] ) ); } /** * Return the nonce * * @since 1.8.1 * @version 1.8.9.1 * * @return false|string */ public function get_nonce() { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter if ( ! isset( $_GET['nonce'] ) ) { return false; } // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Display/routing parameter return sanitize_text_field( wp_unslash( $_GET['nonce'] ) ); } /** * Return the total number of steps. * * @since 1.3.0 * * @param int $total The total number of records to update. * @param int $number The number to update in a single step. * @return int */ public function get_steps( $total, $number ) { return round( ( $total / $number ), 0 ); } } endif;