| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\Usage; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Modules\System_Info\Reporters\Base; |
| 5 | -use Elementor\Utils; | |
| 6 | 5 | |
| 7 | 6 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | 7 | exit; // Exit if accessed directly. |
| 9 | 8 | } |
| @@ -18,9 +17,9 @@ | ||
| 18 | 17 | |
| 19 | 18 | const RECALC_ACTION = 'elementor_usage_recalc'; |
| 20 | 19 | |
| 21 | 20 | public function get_title() { |
| 22 | - return esc_html__( 'Elements Usage', 'elementor' ); | |
| 21 | + return __( 'Elements Usage', 'elementor' ); | |
| 23 | 22 | } |
| 24 | 23 | |
| 25 | 24 | public function get_fields() { |
| 26 | 25 | return [ |
| @@ -37,9 +36,9 @@ | ||
| 37 | 36 | self::RECALC_ACTION => 1, |
| 38 | 37 | '_wpnonce' => $nonce, |
| 39 | 38 | ] ); |
| 40 | 39 | |
| 41 | - $title .= '<a id="elementor-usage-recalc" href="' . esc_url( $url ) . '#elementor-usage-recalc" class="box-title-tool">' . esc_html__( 'Recalculate', 'elementor' ) . '</a>'; | |
| 40 | + $title .= '<a id="elementor-usage-recalc" href="' . esc_url( $url ) . '#elementor-usage-recalc" class="box-title-tool">Recalculate</a>'; | |
| 42 | 41 | } else { |
| 43 | 42 | $title .= $this->get_remove_recalc_query_string_script(); |
| 44 | 43 | } |
| 45 | 44 | |
| @@ -50,12 +49,9 @@ | ||
| 50 | 49 | /** @var Module $module */ |
| 51 | 50 | $module = Module::instance(); |
| 52 | 51 | |
| 53 | 52 | if ( ! empty( $_GET[ self::RECALC_ACTION ] ) ) { |
| 54 | - // phpcs:ignore | |
| 55 | - $nonce = Utils::get_super_global_value( $_GET, '_wpnonce' ); | |
| 56 | - | |
| 57 | - if ( ! wp_verify_nonce( $nonce, self::RECALC_ACTION ) ) { | |
| 53 | + if ( empty( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], self::RECALC_ACTION ) ) { | |
| 58 | 54 | wp_die( 'Invalid Nonce', 'Invalid Nonce', [ |
| 59 | 55 | 'back_link' => true, |
| 60 | 56 | ] ); |
| 61 | 57 | } |