| @@ -33,15 +33,17 @@ | ||
| 33 | 33 | * @return void |
| 34 | 34 | */ |
| 35 | 35 | public function start( $screen ) { |
| 36 | 36 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 37 | - if ( 'plugin-install' === $screen->base && ( ! isset( $_GET['paged'] ) || 1 === intval( $_GET['paged'] ) ) ) { | |
| 38 | - add_filter( 'plugins_api_result', array( $this, 'inject_suggestion' ), 10, 3 ); | |
| 39 | - add_filter( 'self_admin_url', array( $this, 'plugin_details' ) ); | |
| 40 | - add_filter( 'plugin_install_action_links', array( $this, 'insert_related_links' ), 10, 2 ); | |
| 41 | - add_action( 'admin_enqueue_scripts', array( $this, 'load_plugins_search_script' ) ); | |
| 42 | - $this->maybe_dismiss(); | |
| 37 | + if ( 'plugin-install' !== $screen->base || ( isset( $_GET['paged'] ) && 1 !== intval( $_GET['paged'] ) ) ) { | |
| 38 | + return; | |
| 43 | 39 | } |
| 40 | + | |
| 41 | + add_filter( 'plugins_api_result', array( $this, 'inject_suggestion' ), 10, 3 ); | |
| 42 | + add_filter( 'self_admin_url', array( $this, 'plugin_details' ) ); | |
| 43 | + add_filter( 'plugin_install_action_links', array( $this, 'insert_related_links' ), 10, 2 ); | |
| 44 | + add_action( 'admin_enqueue_scripts', array( $this, 'load_plugins_search_script' ) ); | |
| 45 | + $this->maybe_dismiss(); | |
| 44 | 46 | } |
| 45 | 47 | |
| 46 | 48 | /** |
| 47 | 49 | * Intercept the plugins API response and add in an appropriate card. |
| @@ -344,9 +346,9 @@ | ||
| 344 | 346 | |
| 345 | 347 | // Dismiss link. |
| 346 | 348 | $dismiss = add_query_arg( array( 'frm-dismiss' => $plugin['id'] ) ); |
| 347 | 349 | $links[] = '<a |
| 348 | - href="' . $dismiss . '" | |
| 350 | + href="' . esc_url( $dismiss ) . '" | |
| 349 | 351 | class="frm-plugin-search__dismiss" |
| 350 | 352 | data-addon="' . esc_attr( $plugin['addon'] ) . '" |
| 351 | 353 | >' . esc_html__( 'Hide this suggestion', 'formidable' ) . '</a>'; |
| 352 | 354 | |