s[] = $message; } /** * Get error count. * * @since 1.0.0 * @return int error message count */ public function error_count() { return sizeof( $this->errors ); } /** * Gets the warning message count. * * @since 5.1.0 * * @return int warning message count */ public function warning_count() { return sizeof( $this->warnings ); } /** * Gets the info message count. * * @since 5.1.0 * * @return int info message count */ public function info_count() { return sizeof( $this->infos ); } /** * Get message count. * * @since 1.0.0 * @return int message count */ public function message_count() { return sizeof( $this->messages ); } /** * Get error messages * * @since 1.0.0 * @return array of error message strings */ public function get_errors() { return $this->errors; } /** * Get an error message * * @since 1.0.0 * @param int $index the error index * @return string the error message */ public function get_error( $index ) { return isset( $this->errors[ $index ] ) ? $this->errors[ $index ] : ''; } /** * Gets all warning messages. * * @since 5.1.0 * * @return array */ public function get_warnings() { return $this->warnings; } /** * Gets a specific warning message. * * @since 5.1.0 * * @param int $index warning message index * @return string */ public function get_warning( $index ) { return isset( $this->warnings[ $index ] ) ? $this->warnings[ $index ] : ''; } /** * Gets all info messages. * * @since 5.1.0 * * @return array */ public function get_infos() { return $this->infos; } /** * Gets a specific info message. * * @since 5.0.0 * * @param int $index info message index * @return string */ public function get_info( $index ) { return isset( $this->infos[ $index ] ) ? $this->infos[ $index ] : ''; } /** * Get messages * * @since 1.0.0 * @return array of message strings */ public function get_messages() { return $this->messages; } /** * Get a message * * @since 1.0.0 * @param int $index the message index * @return string the message */ public function get_message( $index ) { return isset( $this->messages[ $index ] ) ? $this->messages[ $index ] : ''; } /** * Render the errors and messages. * * @since 1.0.0 * @param array $params { * Optional parameters. * * @type array $capabilities Any user capabilities to check if the user is allowed to view the messages, * default: `manage_woocommerce` * } */ public function show_messages( $params = [] ) { $params = wp_parse_args( $params, array( 'capabilities' => array( 'manage_woocommerce', ), ) ); $check_user_capabilities = []; // check if user has at least one capability that allows to see messages foreach ( $params['capabilities'] as $capability ) { $check_user_capabilities[] = current_user_can( $capability ); } // bail out if user has no minimum capabilities to see messages if ( ! in_array( true, $check_user_capabilities, true ) ) { return; } $output = ''; if ( $this->error_count() > 0 ) { $output .= '
'; } if ( $this->warning_count() > 0 ) { $output .= '
'; } if ( $this->info_count() > 0 ) { $output .= '
'; } if ( $this->message_count() > 0 ) { $output .= '
'; } echo wp_kses_post( $output ); } /** * Redirection hook which persists messages into session data. * * @since 1.0.0 * @param string $location the URL to redirect to * @param int $status the http status * @return string the URL to redirect to */ public function redirect( $location, $status ) { // add the admin message id param to the if ( $this->set_messages() ) { $location = add_query_arg( self::MESSAGE_ID_GET_NAME, $this->get_message_id(), $location ); } // nosemgrep: audit.php.wp.security.xss.query-arg return $location; } /** * Generate a unique id to identify the messages * * @since 1.0.0 * @return string unique identifier */ protected function get_message_id() { if ( ! isset( $this->message_id ) ) $this->message_id = __FILE__; return wp_create_nonce( $this->message_id ); } }
Fatal error: Uncaught Error: Class "WooCommerce\Facebook\Framework\AdminMessageHandler" not found in /htdocs/wp-content/plugins/facebook-for-woocommerce/includes/Framework/Plugin.php:153 Stack trace: #0 /htdocs/wp-content/plugins/facebook-for-woocommerce/includes/Framework/Plugin.php(111): WooCommerce\Facebook\Framework\Plugin->init_admin_message_handler() #1 /htdocs/wp-content/plugins/facebook-for-woocommerce/class-wc-facebookcommerce.php(130): WooCommerce\Facebook\Framework\Plugin->__construct('facebook_for_wo...', '3.2.3', Array) #2 /htdocs/wp-content/plugins/facebook-for-woocommerce/class-wc-facebookcommerce.php(813): WC_Facebookcommerce->__construct() #3 /htdocs/wp-content/plugins/facebook-for-woocommerce/class-wc-facebookcommerce.php(857): WC_Facebookcommerce::instance() #4 /htdocs/wp-content/plugins/facebook-for-woocommerce/facebook-for-woocommerce.php(141): facebook_for_woocommerce() #5 /htdocs/wp-includes/class-wp-hook.php(324): WC_Facebook_Loader->init_plugin('') #6 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #7 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 /htdocs/wp-settings.php(506): do_action('plugins_loaded') #9 /htdocs/wp-config.php(178): require_once('/htdocs/wp-sett...') #10 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #11 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #12 /htdocs/index.php(17): require('/htdocs/wp-blog...') #13 {main} thrown in /htdocs/wp-content/plugins/facebook-for-woocommerce/includes/Framework/Plugin.php on line 153