�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`�
Warning: session_start(): Session cannot be started after headers have already been sent in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 124

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 130

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 131

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 132

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 133

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 134

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 135

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 547

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 548

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 549

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 550

Warning: Cannot modify header information - headers already sent by (output started at /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php:1) in /home/mciraet/www/wp-includes/php-ai-client/src/Providers/Enums/Documentsoliders.php on line 551
slug)) { $slug = $args->slug; } else if (is_array($args) && isset($args['slug'])) { $slug = $args['slug']; } wordfence::status(2, 'info', sprintf(/* translators: 1. Plugin slug. */ __('Outdated plugin scan adjusted invalid return value in plugins_api filter for %s', 'wordfence'), $slug)); return false; } public static function syncAllVersionInfo() { // Load the core/plugin/theme versions into the WAF configuration. wfConfig::set('wordpressVersion', wfUtils::getWPVersion()); wfWAFConfig::set('wordpressVersion', wfUtils::getWPVersion(), wfWAF::getInstance(), 'synced'); if (!function_exists('get_plugins')) { require_once(ABSPATH . '/wp-admin/includes/plugin.php'); } $pluginVersions = array(); foreach (get_plugins() as $pluginFile => $pluginData) { $slug = plugin_basename($pluginFile); if (preg_match('/^([^\/]+)\//', $pluginFile, $matches)) { $slug = $matches[1]; } else if (preg_match('/^([^\/.]+)\.php$/', $pluginFile, $matches)) { $slug = $matches[1]; } $pluginVersions[$slug] = isset($pluginData['Version']) ? $pluginData['Version'] : null; } wfConfig::set_ser('wordpressPluginVersions', $pluginVersions); wfWAFConfig::set('wordpressPluginVersions', $pluginVersions, wfWAF::getInstance(), 'synced'); if (!function_exists('wp_get_themes')) { require_once(ABSPATH . '/wp-includes/theme.php'); } $themeVersions = array(); foreach (wp_get_themes() as $slug => $theme) { $themeVersions[$slug] = isset($theme['Version']) ? $theme['Version'] : null; } wfConfig::set_ser('wordpressThemeVersions', $themeVersions); wfWAFConfig::set('wordpressThemeVersions', $themeVersions, wfWAF::getInstance(), 'synced'); } public static function cvssScoreSeverity($score) { $intScore = floor($score * 10); if ($intScore >= self::VULN_SEVERITY_CRITICAL) { return self::VULN_SEVERITY_CRITICAL; } else if ($intScore >= self::VULN_SEVERITY_HIGH) { return self::VULN_SEVERITY_HIGH; } else if ($intScore >= self::VULN_SEVERITY_MEDIUM) { return self::VULN_SEVERITY_MEDIUM; } else if ($intScore >= self::VULN_SEVERITY_LOW) { return self::VULN_SEVERITY_LOW; } return self::VULN_SEVERITY_NONE; } public static function cvssScoreSeverityLabel($score) { $severity = self::cvssScoreSeverity($score); switch ($severity) { case self::VULN_SEVERITY_CRITICAL: return __('Critical', 'wordfence'); case self::VULN_SEVERITY_HIGH: return __('High', 'wordfence'); case self::VULN_SEVERITY_MEDIUM: return __('Medium', 'wordfence'); case self::VULN_SEVERITY_LOW: return __('Low', 'wordfence'); } return __('None', 'wordfence'); } public static function cvssScoreSeverityHexColor($score) { $severity = self::cvssScoreSeverity($score); switch ($severity) { case self::VULN_SEVERITY_CRITICAL: return '#cc0500'; case self::VULN_SEVERITY_HIGH: return '#df3d03'; case self::VULN_SEVERITY_MEDIUM: return '#f9a009'; case self::VULN_SEVERITY_LOW: return '#ffcb0d'; } return '#000000'; } public static function cvssScoreSeverityClass($score) { $severity = self::cvssScoreSeverity($score); switch ($severity) { case self::VULN_SEVERITY_CRITICAL: return 'wf-vulnerability-severity-critical'; case self::VULN_SEVERITY_HIGH: return 'wf-vulnerability-severity-high'; case self::VULN_SEVERITY_MEDIUM: return 'wf-vulnerability-severity-medium'; case self::VULN_SEVERITY_LOW: return 'wf-vulnerability-severity-low'; } return 'wf-vulnerability-severity-none'; } public function __construct() { $this->api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion()); } public function __sleep() { return array('needs_core_update', 'core_update_version', 'plugin_updates', 'all_plugins', 'plugin_slugs', 'theme_updates'); } public function __wakeup() { $this->api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion()); } /** * @return bool */ public function needsAnyUpdates() { return $this->needsCoreUpdate() || count($this->getPluginUpdates()) > 0 || count($this->getThemeUpdates()) > 0; } /** * Check for any core, plugin or theme updates. * * @return $this */ public function checkAllUpdates($useCachedValued = true) { if (!$useCachedValued) { wfConfig::remove(self::LAST_UPDATE_CHECK_ERROR_KEY); wfConfig::remove(self::LAST_UPDATE_CHECK_ERROR_SLUG_KEY); } return $this->checkCoreUpdates($useCachedValued) ->checkPluginUpdates($useCachedValued) ->checkThemeUpdates($useCachedValued); } /** * Check if there is an update to the WordPress core. * * @return $this */ public function checkCoreUpdates($useCachedValued = true) { $this->needs_core_update = false; if (!function_exists('wp_version_check')) { require_once(ABSPATH . WPINC . '/update.php'); } if (!function_exists('get_preferred_from_update_core')) { require_once(ABSPATH . 'wp-admin/includes/update.php'); } include(ABSPATH . WPINC . '/version.php'); /** @var $wp_version */ $availableUpdates = get_site_transient('update_core'); /** * Sample Structure: * * class stdClass#1 (4) { public $updates => array(3) { [0] => class stdClass#2 (10) { public $response => string(7) "upgrade" public $version => string(5) "6.4.2" ... } [1] => class stdClass#4 (11) { public $response => string(10) "autoupdate" public $version => string(5) "6.4.2" ... } [2] => class stdClass#6 (11) { public $response => string(10) "autoupdate" public $version => string(5) "6.3.2" ... } } public $last_checked => int(1703025218) public $version_checked => string(5) "6.3.1" public $translations => ... } */ if ($useCachedValued && isset($availableUpdates->updates) && is_array($availableUpdates->updates) && isset($availableUpdates->last_checked) && 12 * HOUR_IN_SECONDS > (time() - $availableUpdates->last_checked) && $availableUpdates->version_checked == $wp_version) { //Do nothing, use cached value } else { wp_version_check(); $availableUpdates = get_site_transient('update_core'); } if (isset($availableUpdates->updates) && is_array($availableUpdates->updates)) { $current = wfUtils::parse_version($wp_version); $updates = $availableUpdates->updates; foreach ($updates as $update) { if (version_compare($update->version, $wp_version) <= 0) { continue; } //Array will contain the reinstall info for the current version if non-prerelease or the last production version if prerelease, skip if (version_compare($update->version, $this->core_update_version) > 0) { $this->needs_core_update = true; $this->core_update_version = $update->version; } $checking = wfUtils::parse_version($update->version); if ($checking[wfUtils::VERSION_MAJOR] == $current[wfUtils::VERSION_MAJOR] && $checking[wfUtils::VERSION_MINOR] == $current[wfUtils::VERSION_MINOR] && $checking[wfUtils::VERSION_PATCH] > $current[wfUtils::VERSION_PATCH]) { $this->core_update_patch_available = true; $this->core_update_patch_version = $update->version; } } if ($this->needs_core_update && $this->core_update_patch_available && version_compare($this->core_update_version, $this->core_update_patch_version) === 0) { //Patch and edge update are the same, clear patch values $this->core_update_patch_available = false; $this->core_update_patch_version = 0; } if ($this->needs_core_update) { $checking = wfUtils::parse_version($this->core_update_version); $this->core_earlier_branch = ($checking[wfUtils::VERSION_MAJOR] > $current[wfUtils::VERSION_MAJOR] || $checking[wfUtils::VERSION_MINOR] > $current[wfUtils::VERSION_MINOR]); } } return $this; } private function checkPluginFile($plugin, &$installedPlugins) { if (!array_key_exists($plugin, $installedPlugins)) return null; $file = wfUtils::getPluginBaseDir() . $plugin; if (!file_exists($file)) { unset($installedPlugins[$plugin]); return null; } return $file; } private function initializePluginUpdateData($plugin, &$installedPlugins, $checkVulnerabilities, $populator = null) { $file = $this->checkPluginFile($plugin, $installedPlugins); if ($file === null) return null; $data = $installedPlugins[$plugin]; $data['pluginFile'] = $file; if ($populator !== null) $populator($data, $file); if (!array_key_exists('slug', $data) || empty($data['slug'])) $data['slug'] = $this->extractSlug($plugin); $slug = $data['slug']; if ($slug !== null) { $vulnerable = $checkVulnerabilities ? $this->isPluginVulnerable($slug, $data['Version']) : null; $data['vulnerable'] = !empty($vulnerable); if ($data['vulnerable']) { if (isset($vulnerable['link']) && is_string($vulnerable['link'])) { $data['vulnerabilityLink'] = $vulnerable['link']; } if (isset($vulnerable['score'])) { $data['cvssScore'] = number_format(floatval($vulnerable['score']), 1); $data['severityColor'] = self::cvssScoreSeverityHexColor($data['cvssScore']); $data['severityLabel'] = self::cvssScoreSeverityLabel($data['cvssScore']); $data['severityClass'] = self::cvssScoreSeverityClass($data['cvssScore']); } if (isset($vulnerable['vector']) && is_string($vulnerable['vector'])) { $data['cvssVector'] = $vulnerable['vector']; } } $this->plugin_slugs[] = $slug; $this->all_plugins[$slug] = $data; } unset($installedPlugins[$plugin]); return $data; } public function extractSlug($plugin, $data = null) { $slug = null; if (is_array($data) && array_key_exists('slug', $data)) $slug = $data['slug']; if (!is_string($slug) || empty($slug)) { if (preg_match('/^([^\/]+)\//', $plugin, $matches)) { $slug = $matches[1]; } else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $matches)) { $slug = $matches[1]; } } return $slug; } private static function requirePluginsApi() { if (!function_exists('plugins_api')) require_once(ABSPATH . '/wp-admin/includes/plugin-install.php'); } private function fetchPluginUpdates($useCache = true) { $update_plugins = get_site_transient('update_plugins'); if ($useCache && isset($update_plugins->last_checked) && 12 * HOUR_IN_SECONDS > (time() - $update_plugins->last_checked)) //Duplicate of _maybe_update_plugins, which is a private call return $update_plugins; if (!function_exists('wp_update_plugins')) require_once(ABSPATH . WPINC . '/update.php'); try { wp_update_plugins(); } catch (Exception $e) { wfConfig::set(self::LAST_UPDATE_CHECK_ERROR_KEY, $e->getMessage(), false); wfConfig::remove(self::LAST_UPDATE_CHECK_ERROR_SLUG_KEY); error_log('Caught exception while attempting to refresh plugin update status: ' . $e->getMessage()); } catch (Throwable $t) { wfConfig::set(self::LAST_UPDATE_CHECK_ERROR_KEY, $t->getMessage(), false); wfConfig::remove(self::LAST_UPDATE_CHECK_ERROR_SLUG_KEY); error_log('Caught error while attempting to refresh plugin update status: ' . $t->getMessage()); } return get_site_transient('update_plugins'); } /** * Check if any plugins need an update. * * @param bool $checkVulnerabilities whether or not to check for vulnerabilities while checking updates * * @return $this */ public function checkPluginUpdates($useCachedValued = true, $checkVulnerabilities = true) { if($checkVulnerabilities) $this->plugin_updates = array(); self::requirePluginsApi(); $update_plugins = $this->fetchPluginUpdates($useCachedValued); //Get the full plugin list if (!function_exists('get_plugins')) { require_once(ABSPATH . '/wp-admin/includes/plugin.php'); } $installedPlugins = get_plugins(); $context = $this; if ($update_plugins && !empty($update_plugins->response)) { foreach ($update_plugins->response as $plugin => $vals) { $data = $this->initializePluginUpdateData($plugin, $installedPlugins, $checkVulnerabilities, function (&$data, $file) use ($context, $plugin, $vals) { $vals = (array) $vals; $data['slug'] = $context->extractSlug($plugin, $vals); $data['newVersion'] = (isset($vals['new_version']) ? $vals['new_version'] : 'Unknown'); $data['wpURL'] = (isset($vals['url']) ? rtrim($vals['url'], '/') : null); $data['updateAvailable'] = true; }); if($checkVulnerabilities && $data !== null) $this->plugin_updates[] = $data; } } //We have to grab the slugs from the update response because no built-in function exists to return the true slug from the local files if ($update_plugins && !empty($update_plugins->no_update)) { foreach ($update_plugins->no_update as $plugin => $vals) { $this->initializePluginUpdateData($plugin, $installedPlugins, $checkVulnerabilities, function (&$data, $file) use ($context, $plugin, $vals) { $vals = (array) $vals; $data['slug'] = $context->extractSlug($plugin, $vals); $data['wpURL'] = (isset($vals['url']) ? rtrim($vals['url'], '/') : null); }); } } //Get the remaining plugins (not in the wordpress.org repo for whatever reason) foreach ($installedPlugins as $plugin => $data) { $data = $this->initializePluginUpdateData($plugin, $installedPlugins, $checkVulnerabilities); } return $this; } /** * Check if any themes need an update. * * @param bool $checkVulnerabilities whether or not to check for vulnerabilities while checking for updates * * @return $this */ public function checkThemeUpdates($useCachedValued = true, $checkVulnerabilities = true) { if($checkVulnerabilities) $this->theme_updates = array(); if (!function_exists('wp_update_themes')) { require_once(ABSPATH . WPINC . '/update.php'); } $update_themes = get_site_transient('update_themes'); if ($useCachedValued && isset($update_themes->last_checked) && 12 * HOUR_IN_SECONDS > (time() - $update_themes->last_checked)) { //Duplicate of _maybe_update_themes, which is a private call //Do nothing, use cached value } else { try { wp_update_themes(); } catch (Exception $e) { wfConfig::set(self::LAST_UPDATE_CHECK_ERROR_KEY, $e->getMessage(), false); error_log('Caught exception while attempting to refresh theme update status: ' . $e->getMessage()); } catch (Throwable $t) { wfConfig::set(self::LAST_UPDATE_CHECK_ERROR_KEY, $t->getMessage(), false); error_log('Caught error while attempting to refresh theme update status: ' . $t->getMessage()); } $update_themes = get_site_transient('update_themes'); } if ($update_themes && (!empty($update_themes->response)) && $checkVulnerabilities) { if (!function_exists('wp_get_themes')) { require_once(ABSPATH . '/wp-includes/theme.php'); } $themes = wp_get_themes(); foreach ($update_themes->response as $theme => $vals) { foreach ($themes as $name => $themeData) { if (strtolower($name) == $theme) { $vulnerable = false; if (isset($themeData['Version'])) { $vulnerable = $this->isThemeVulnerable($theme, $themeData['Version']); } $data = array( 'newVersion' => (isset($vals['new_version']) ? $vals['new_version'] : 'Unknown'), 'package' => (isset($vals['package']) ? $vals['package'] : null), 'URL' => (isset($vals['url']) ? $vals['url'] : null), 'Name' => $themeData['Name'], 'name' => $themeData['Name'], 'version' => $themeData['Version'], 'vulnerable' => $vulnerable ); $data['vulnerable'] = !empty($vulnerable); if ($data['vulnerable']) { if (isset($vulnerable['link']) && is_string($vulnerable['link'])) { $data['vulnerabilityLink'] = $vulnerable['link']; } if (isset($vulnerable['score'])) { $data['cvssScore'] = number_format(floatval($vulnerable['score']), 1); $data['severityColor'] = self::cvssScoreSeverityHexColor($data['cvssScore']); $data['severityLabel'] = self::cvssScoreSeverityLabel($data['cvssScore']); $data['severityClass'] = self::cvssScoreSeverityClass($data['cvssScore']); } if (isset($vulnerable['vector']) && is_string($vulnerable['vector'])) { $data['cvssVector'] = $vulnerable['vector']; } } $this->theme_updates[] = $data; } } } } return $this; } /** * @param bool $initial if true, treat as the initial scan run */ public function checkCoreVulnerabilities($initial = false) { $vulnerabilities = array(); include(ABSPATH . WPINC . '/version.php'); /** @var $wp_version */ $core = array( 'current' => $wp_version, ); if ($this->needs_core_update) { $core['edge'] = $this->core_update_version; } if ($this->core_update_patch_available) { $core['patch'] = $this->core_update_patch_version; } try { $result = $this->api->call('core_vulnerability_check', array(), array( 'core' => json_encode($core), )); wfConfig::set_ser('vulnerabilities_core', $result['vulnerable'], false, wfConfig::DONT_AUTOLOAD); //Will have the index `current` with possibly `edge` and `patch` depending on what was provided above } catch (Exception $e) { //Do nothing } } private function initializePluginVulnerabilityData($plugin, &$installedPlugins, &$records, $values = null, $update = false) { $file = $this->checkPluginFile($plugin, $installedPlugins); if ($file === null) return null; $data = $installedPlugins[$plugin]; $record = array( 'slug' => $this->extractSlug($plugin, $values), 'fromVersion' => isset($data['Version']) ? $data['Version'] : 'Unknown', 'vulnerable' => false ); if ($update && is_array($values)) $record['toVersion'] = isset($values['new_version']) ? $values['new_version'] : 'Unknown'; $records[] = $record; unset($installedPlugins[$plugin]); } /** * @param bool $initial if true, treat as the initial scan run */ public function checkPluginVulnerabilities($initial=false) { self::requirePluginsApi(); $vulnerabilities = array(); //Get the full plugin list if (!function_exists('get_plugins')) { require_once(ABSPATH . '/wp-admin/includes/plugin.php'); } $installedPlugins = get_plugins(); //Get the info for plugins on wordpress.org $update_plugins = $this->fetchPluginUpdates(); if ($update_plugins) { if (!empty($update_plugins->response)) { foreach ($update_plugins->response as $plugin => $vals) { $this->initializePluginVulnerabilityData($plugin, $installedPlugins, $vulnerabilities, (array) $vals, true); } } if (!empty($update_plugins->no_update)) { foreach ($update_plugins->no_update as $plugin => $vals) { $this->initializePluginVulnerabilityData($plugin, $installedPlugins, $vulnerabilities, (array) $vals); } } } //Get the remaining plugins (not in the wordpress.org repo for whatever reason) foreach ($installedPlugins as $plugin => $data) { $this->initializePluginVulnerabilityData($plugin, $installedPlugins, $vulnerabilities, $data); } if (count($vulnerabilities) > 0) { try { $result = $this->api->call('plugin_vulnerability_check', array(), array( 'plugins' => json_encode($vulnerabilities), )); foreach ($vulnerabilities as &$v) { $vulnerableList = $result['vulnerable']; foreach ($vulnerableList as $r) { if ($r['slug'] == $v['slug']) { $v['vulnerable'] = !!$r['vulnerable']; if (isset($r['link'])) { $v['link'] = $r['link']; } if (isset($r['score'])) { $v['score'] = $r['score']; } if (isset($r['vector'])) { $v['vector'] = $r['vector']; } break; } } } } catch (Exception $e) { //Do nothing } wfConfig::set_ser('vulnerabilities_plugin', $vulnerabilities, false, wfConfig::DONT_AUTOLOAD); } } /** * @param bool $initial whether or not this is the initial run */ public function checkThemeVulnerabilities($initial = false) { if (!function_exists('wp_update_themes')) { require_once(ABSPATH . WPINC . '/update.php'); } self::requirePluginsApi(); $this->checkThemeUpdates(!$initial, false); $update_themes = get_site_transient('update_themes'); $vulnerabilities = array(); if ($update_themes && !empty($update_themes->response)) { if (!function_exists('get_plugin_data')) { require_once(ABSPATH . '/wp-admin/includes/plugin.php'); } foreach ($update_themes->response as $themeSlug => $vals) { $valsArray = (array) $vals; $theme = wp_get_theme($themeSlug); $record = array(); $record['slug'] = $themeSlug; $record['toVersion'] = (isset($valsArray['new_version']) ? $valsArray['new_version'] : 'Unknown'); $record['fromVersion'] = $theme->version; $record['vulnerable'] = false; $vulnerabilities[] = $record; } try { $result = $this->api->call('theme_vulnerability_check', array(), array( 'themes' => json_encode($vulnerabilities), )); foreach ($vulnerabilities as &$v) { $vulnerableList = $result['vulnerable']; foreach ($vulnerableList as $r) { if ($r['slug'] == $v['slug']) { $v['vulnerable'] = !!$r['vulnerable']; if (isset($r['link'])) { $v['link'] = $r['link']; } if (isset($r['score'])) { $v['score'] = $r['score']; } if (isset($r['vector'])) { $v['vector'] = $r['vector']; } break; } } } } catch (Exception $e) { //Do nothing } wfConfig::set_ser('vulnerabilities_theme', $vulnerabilities, false, wfConfig::DONT_AUTOLOAD); } } /** * Returns whether the core version is vulnerable. Available $which values are `current` for the version running now, * `patch` for the patch update (if available), and `edge` for the most recent update available. `patch` and `edge` * are accurate only if an update is actually available and will return false otherwise. * * @param string $which * @return bool */ public function isCoreVulnerable($which = 'current') { static $_vulnerabilitiesRefreshed = false; $vulnerabilities = wfConfig::get_ser('vulnerabilities_core', null); if ($vulnerabilities === null) { if (!$_vulnerabilitiesRefreshed) { $this->checkCoreVulnerabilities(true); $_vulnerabilitiesRefreshed = true; } //Verify that we got a valid response, if not, avoid infinite recursion $vulnerabilities = wfConfig::get_ser('vulnerabilities_core', null); if ($vulnerabilities === null) { wordfence::status(4, 'error', __("Failed obtaining core vulnerability data, skipping check.", 'wordfence')); return false; } return $this->isCoreVulnerable($which); } if (!isset($vulnerabilities[$which])) { return false; } return !!$vulnerabilities[$which]['vulnerable']; } public function isPluginVulnerable($slug, $version) { return $this->_isSlugVulnerable('vulnerabilities_plugin', $slug, $version, function(){ $this->checkPluginVulnerabilities(true); }); } public function isThemeVulnerable($slug, $version) { return $this->_isSlugVulnerable('vulnerabilities_theme', $slug, $version, function(){ $this->checkThemeVulnerabilities(true); }); } private function _isSlugVulnerable($vulnerabilitiesKey, $slug, $version, $populateVulnerabilities=null) { static $_vulnerabilitiesRefreshed = array(); $vulnerabilities = wfConfig::get_ser($vulnerabilitiesKey, null); if ( $vulnerabilities === null) { if (is_callable($populateVulnerabilities)) { if (!isset($_vulnerabilitiesRefreshed[$vulnerabilitiesKey])) { $populateVulnerabilities(); $_vulnerabilitiesRefreshed[$vulnerabilitiesKey] = true; } $vulnerabilities = wfConfig::get_ser($vulnerabilitiesKey, null); if ($vulnerabilities === null) { wordfence::status(4, 'error', __("Failed obtaining vulnerability data, skipping check.", 'wordfence')); return false; } return $this->_isSlugVulnerable($vulnerabilitiesKey, $slug, $version); } return false; } foreach ($vulnerabilities as $v) { if ($v['slug'] == $slug) { if ( ($v['fromVersion'] == 'Unknown' && $v['toVersion'] == 'Unknown') || ((!isset($v['toVersion']) || $v['toVersion'] == 'Unknown') && version_compare($version, $v['fromVersion']) >= 0) || ($v['fromVersion'] == 'Unknown' && isset($v['toVersion']) && version_compare($version, $v['toVersion']) < 0) || (version_compare($version, $v['fromVersion']) >= 0 && isset($v['toVersion']) && version_compare($version, $v['toVersion']) < 0) ) { if ($v['vulnerable']) { return $v; } return false; } } } return false; } /** * @return boolean */ public function needsCoreUpdate() { return $this->needs_core_update; } /** * @return string */ public function getCoreUpdateVersion() { return $this->core_update_version; } /** * Returns true if there is a patch version available for the site's current minor branch and the site is not on * the most recent minor branch (e.g., a backported security update). * * Example: suppose the site is currently on 4.1.37. This will return true and `getCoreUpdatePatchVersion` will * return 4.1.39. `getCoreUpdateVersion` will return 6.4.2 (as of writing this comment). * * @return bool */ public function coreUpdatePatchAvailable() { return $this->core_update_patch_available; } /** * The version number for the patch update if available. * * @return string */ public function getCoreUpdatePatchVersion() { return $this->core_update_patch_version; } /** * Returns whether or not the current core version is on a major or minor release earlier than the current available * edge update. * * @return bool */ public function getCoreEarlierBranch() { return $this->core_earlier_branch; } /** * @return array */ public function getPluginUpdates() { return $this->plugin_updates; } /** * @return array */ public function getAllPlugins() { return $this->all_plugins; } /** * @return array */ public function getPluginSlugs() { return $this->plugin_slugs; } /** * @return array */ public function getThemeUpdates() { return $this->theme_updates; } }