Bulk actions from the top dropdown. * action2 => Bulk actions from the bottom dropdown. */ public function check_nonce() { if ( ! isset( $_POST['el-action'] ) && ! isset( $_REQUEST['action'] ) && ! isset( $_REQUEST['action2'] ) ) { return; } if ( isset( $_POST['el-action'] ) ) { $action = sanitize_text_field( wp_unslash($_POST['el-action']) ); $allowed_actions = [ 'el-download-system-info', 'el_license_activate', 'el_license_deactivate', 'el_bundle_license_activate', 'el_bundle_license_deactivate', 'el-log-list-export', 'el-log-list-export-all', 'el-export-logs-with-columns' ]; if ( ! in_array( $action, $allowed_actions ) ) { return; } if ( ! isset( $_POST[ $action . '_nonce' ] ) ) { return; } if ( ! wp_verify_nonce( sanitize_text_field(wp_unslash($_POST[ $action . '_nonce' ] ?? '')), $action ) ) { return; } } if ( isset( $_REQUEST['action'] ) || isset( $_REQUEST['action2'] ) ) { $action = sanitize_text_field( wp_unslash($_REQUEST['action']) ); if ( '-1' === $action ) { if ( ! isset( $_REQUEST['action2'] ) ) { return; } $action = sanitize_text_field( wp_unslash($_REQUEST['action2']) ); } if ( strpos( $action, 'el-log-list-' ) !== 0 && strpos( $action, 'el-cron-' ) !== 0 ) { return; } if ( strpos( $action, 'el-log-list-' ) === 0 ) { if ( ! isset( $_REQUEST[ LogListPage::LOG_LIST_ACTION_NONCE_FIELD ] ) ) { return; } if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash($_REQUEST[ LogListPage::LOG_LIST_ACTION_NONCE_FIELD ] ?? '')), LogListPage::LOG_LIST_ACTION_NONCE ) ) { return; } } if ( strpos( $action, 'el-cron-' ) === 0 ) { if ( ! isset( $_REQUEST[ $action . '-nonce-field' ] ) ) { return; } if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash($_REQUEST[ $action . '-nonce-field' ] ?? '' )), $action . '-nonce' ) ) { return; } } } /** * Perform `el` action. * Nonce check has already happened at this point. * * @since 2.0.0 * * @param string $action Action name. * @param array $_REQUEST Request data. */ do_action( 'el_action', $action, $_REQUEST ); /** * Perform `el` action. * Nonce check has already happened at this point. * * @since 2.0.0 * * @param array $_REQUEST Request data. */ do_action( $action, $_REQUEST ); } }