| @@ -92,10 +92,12 @@ | ||
| 92 | 92 | ); |
| 93 | 93 | $button_text = esc_html__( 'Activate Elementor', 'shopbuilder' ); |
| 94 | 94 | |
| 95 | 95 | } else { |
| 96 | - $activation_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), | |
| 97 | - 'install-plugin_elementor' ); | |
| 96 | + $activation_url = wp_nonce_url( | |
| 97 | + self_admin_url( 'update.php?action=install-plugin&plugin=elementor' ), | |
| 98 | + 'install-plugin_elementor' | |
| 99 | + ); | |
| 98 | 100 | $message = sprintf( |
| 99 | 101 | '<strong>%s</strong> %s <strong>%s</strong> %s', |
| 100 | 102 | esc_html( self::PLUGIN_NAME ), |
| 101 | 103 | esc_html__( 'requires', 'shopbuilder' ), |
| @@ -126,9 +128,10 @@ | ||
| 126 | 128 | /** |
| 127 | 129 | * Admin Notice For Required PHP Version |
| 128 | 130 | */ |
| 129 | 131 | public function minimum_php_version() { |
| 130 | - if ( isset( $_GET['activate'] ) ) { | |
| 132 | + // Protect plugin Activation with error. | |
| 133 | + if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 131 | 134 | unset( $_GET['activate'] ); |
| 132 | 135 | } |
| 133 | 136 | $message = sprintf( |
| 134 | 137 | /* translators: 1: Plugin name 2: PHP 3: Required PHP version */ |
| @@ -136,9 +139,9 @@ | ||
| 136 | 139 | '<strong>' . esc_html__( 'ShopBuilder', 'shopbuilder' ) . '</strong>', |
| 137 | 140 | '<strong>' . esc_html__( 'PHP', 'shopbuilder' ) . '</strong>', |
| 138 | 141 | self::MINIMUM_PHP_VERSION |
| 139 | 142 | ); |
| 140 | - printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', $message ); | |
| 143 | + printf( '<div class="notice notice-warning is-dismissible"><p>%1$s</p></div>', wp_kses_post( $message ) ); | |
| 141 | 144 | } |
| 142 | 145 | |
| 143 | 146 | /** |
| 144 | 147 | * Adds admin notice. |
| @@ -146,12 +149,12 @@ | ||
| 146 | 149 | public function _missing_plugins_warning() { |
| 147 | 150 | $missingPlugins = ''; |
| 148 | 151 | $counter = 0; |
| 149 | 152 | foreach ( $this->missing as $plugin ) { |
| 150 | - $counter ++; | |
| 151 | - if ( $counter == sizeof( $this->missing ) ) { | |
| 153 | + $counter++; | |
| 154 | + if ( $counter == count( $this->missing ) ) { | |
| 152 | 155 | $sep = ''; |
| 153 | - } elseif ( $counter == sizeof( $this->missing ) - 1 ) { | |
| 156 | + } elseif ( $counter == count( $this->missing ) - 1 ) { | |
| 154 | 157 | $sep = ' ' . esc_html__( 'and', 'shopbuilder' ) . ' '; |
| 155 | 158 | } else { |
| 156 | 159 | $sep = ', '; |
| 157 | 160 | } |
| @@ -174,7 +177,5 @@ | ||
| 174 | 177 | $installed_plugins_list = get_plugins(); |
| 175 | 178 | |
| 176 | 179 | return isset( $installed_plugins_list[ $plugin_file_path ] ); |
| 177 | 180 | } |
| 178 | - | |
| 179 | - | |
| 180 | 181 | } |