�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
0; if ( Jetpack_Plan::supports( 'akismet' ) || Jetpack_Plan::supports( 'antispam' ) || $has_anti_spam_product ) { // Prevent Akismet from adding a menu item. add_action( 'admin_menu', function () { remove_action( 'admin_menu', array( 'Akismet_Admin', 'admin_menu' ), 5 ); }, 4 ); // Add an Anti-spam menu item for Jetpack. This is handled automatically by the Admin_Menu as long as it has been initialized. Admin_Menu::init(); } // Render the unified Jetpack header/footer chrome on Akismet's admin pages by // consuming Akismet's `akismet_header` / `akismet_footer` action hooks. This does // not modify the Akismet plugin; it only registers callbacks on its own hooks. require_once JETPACK__PLUGIN_DIR . '_inc/lib/admin-pages/class-akismet-admin-chrome.php'; $akismet_admin_chrome = new Akismet_Admin_Chrome(); $akismet_admin_chrome->init_hooks(); } // Ensure an Additional CSS menu item is added to the Appearance menu whenever Jetpack is connected. add_action( 'admin_menu', array( $this, 'additional_css_menu' ) ); add_filter( 'jetpack_display_jitms_on_screen', array( $this, 'should_display_jitms_on_screen' ), 10, 2 ); // Register Jetpack partner coupon hooks. Jetpack_Partner_Coupon::register_coupon_admin_hooks( 'jetpack', Jetpack::admin_url() ); // Remove default WordPress admin footer on Jetpack pages only. add_filter( 'admin_footer_text', array( $this, 'maybe_remove_admin_footer_text' ) ); add_filter( 'update_footer', array( $this, 'maybe_remove_admin_footer_version' ), 11 ); add_filter( 'admin_body_class', array( $this, 'add_jetpack_admin_body_class' ) ); add_action( 'admin_head', array( $this, 'add_footer_removal_styles' ) ); // Make WPDS design tokens resolve at runtime on the legacy/wrap_ui Jetpack // admin pages (Dashboard, Settings, Debugger) that don't ship their own // `:root{--wpds-*}` source. Delegates to Admin_Menu's shared enqueue API. add_action( 'admin_enqueue_scripts', array( $this, 'maybe_enqueue_design_tokens' ) ); } /** * Handle our Additional CSS menu item and legacy page declaration. * * @since 11.0 . Prior to that, this function was located in custom-css-4.7.php (now custom-css.php). */ public static function additional_css_menu() { /* * Custom CSS for the Customizer is deprecated for block themes as of WP 6.1, so we only expose it with a menu * if the site already has existing CSS code. */ if ( wp_is_block_theme() ) { $styles = wp_get_custom_css(); if ( ! $styles ) { return; } } // If the site is a WoA site and the custom-css feature is not available, return. // See https://github.com/Automattic/jetpack/pull/19965 for more on how this menu item is dealt with on WoA sites. if ( ( new Host() )->is_woa_site() && ! ( in_array( 'custom-css', Jetpack::get_available_modules(), true ) ) ) { return; } elseif ( class_exists( 'Jetpack' ) && ( Jetpack::is_module_active( 'custom-css' ) || // If the Custom CSS module is enabled, add the Additional CSS menu item and link to the Customizer. ( wp_is_block_theme() && ! empty( wp_get_custom_css() ) ) // Do the same if the theme is block-based but has existing custom CSS. ) ) { // Add in our legacy page to support old bookmarks and such. add_submenu_page( '', __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss', array( __CLASS__, 'customizer_redirect' ) ); // Add in our new page slug that will redirect to the customizer. $hook = add_theme_page( __( 'CSS', 'jetpack' ), __( 'Additional CSS', 'jetpack' ), 'edit_theme_options', 'editcss-customizer-redirect', array( __CLASS__, 'customizer_redirect' ) ); add_action( "load-{$hook}", array( __CLASS__, 'customizer_redirect' ) ); } } /** * Handle the redirect for the customizer. This is necessary because * we can't directly add customizer links to the admin menu. * * @since 11.0 . Prior to that, this function was located in custom-css-4.7.php (now custom-css.php). * * There is a core patch in trac that would make this unnecessary. * * @link https://core.trac.wordpress.org/ticket/39050 * * @return never */ public static function customizer_redirect() { wp_safe_redirect( self::customizer_link( array( 'return_url' => wp_get_referer(), ) ) ); exit( 0 ); } /** * Build the URL to deep link to the Customizer. * * You can modify the return url via $args. * * @since 11.0 in this file. This method is also located in custom-css-4.7.php to cover legacy scenarios. * * @param array $args Array of parameters. * @return string */ public static function customizer_link( $args = array() ) { if ( isset( $_SERVER['REQUEST_URI'] ) ) { $args = wp_parse_args( $args, array( 'return_url' => rawurlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ) ); } return add_query_arg( array( array( 'autofocus' => array( 'section' => 'custom_css', ), ), 'return' => $args['return_url'], ), admin_url( 'customize.php' ) ); } /** * Sort callback to put modules with `requires_connection` last. * * @param array $module1 Module data. * @param array $module2 Module data. * @return int Indicating the relative ordering of module1 and module2. */ public static function sort_requires_connection_last( $module1, $module2 ) { return ( (bool) $module1['requires_connection'] ) <=> ( (bool) $module2['requires_connection'] ); } /** * Produce JS understandable objects of modules containing information for * presentation like description, name, configuration url, etc. */ public function get_modules() { include_once JETPACK__PLUGIN_DIR . 'modules/module-info.php'; $available_modules = Jetpack::get_available_modules(); $active_modules = Jetpack::get_active_modules(); $modules = array(); $jetpack_active = Jetpack::is_connection_ready() || ( new Status() )->is_offline_mode(); $overrides = Jetpack_Modules_Overrides::instance(); foreach ( $available_modules as $module ) { $module_array = Jetpack::get_module( $module ); if ( $module_array ) { /** * Filters each module's short description. * * @since 3.0.0 * * @param string $module_array['description'] Module description. * @param string $module Module slug. */ $short_desc = apply_filters( 'jetpack_short_module_description', $module_array['description'], $module ); // Fix: correct multibyte strings truncate with checking for mbstring extension. $short_desc_trunc = ( function_exists( 'mb_strlen' ) ) ? ( ( mb_strlen( $short_desc ) > 143 ) ? mb_substr( $short_desc, 0, 140 ) . '...' : $short_desc ) : ( ( strlen( $short_desc ) > 143 ) ? substr( $short_desc, 0, 140 ) . '...' : $short_desc ); $module_array['module'] = $module; $is_available = self::is_module_available( $module_array ); $module_array['activated'] = ( $jetpack_active ? in_array( $module, $active_modules, true ) : false ); $module_array['deactivate_nonce'] = wp_create_nonce( 'jetpack_deactivate-' . $module ); $module_array['activate_nonce'] = wp_create_nonce( 'jetpack_activate-' . $module ); $module_array['available'] = $is_available; $module_array['unavailable_reason'] = $is_available ? false : self::get_module_unavailable_reason( $module_array ); $module_array['short_description'] = $short_desc_trunc; $module_array['configure_url'] = Jetpack::module_configuration_url( $module ); $module_array['override'] = $overrides->get_module_override( $module ); $module_array['disabled'] = $is_available ? '' : 'disabled="disabled"'; ob_start(); /** * Allow the display of a "Learn More" button. * The dynamic part of the action, $module, is the module slug. * * @since 3.0.0 */ do_action( 'jetpack_learn_more_button_' . $module ); $module_array['learn_more_button'] = ob_get_clean(); ob_start(); /** * Allow the display of information text when Jetpack is connected to WordPress.com. * The dynamic part of the action, $module, is the module slug. * * @since 3.0.0 */ do_action( 'jetpack_module_more_info_' . $module ); /** * Filter the long description of a module. * * @since 3.5.0 * * @param string ob_get_clean() The module long description. * @param string $module The module name. */ $module_array['long_description'] = apply_filters( 'jetpack_long_module_description', ob_get_clean(), $module ); ob_start(); /** * Filter the search terms for a module * * Search terms are typically added to the module headers, under "Additional Search Queries". * * Use syntax: * function jetpack_$module_search_terms( $terms ) { * $terms = _x( 'term 1, term 2', 'search terms', 'jetpack' ); * return $terms; * } * add_filter( 'jetpack_search_terms_$module', 'jetpack_$module_search_terms' ); * * @since 3.5.0 * * @param string The search terms (comma-separated). */ echo apply_filters( 'jetpack_search_terms_' . $module, $module_array['additional_search_queries'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $module_array['search_terms'] = ob_get_clean(); $module_array['configurable'] = false; if ( current_user_can( 'manage_options' ) && /** * Allow the display of a configuration link in the Jetpack Settings screen. * * @since 3.0.0 * * @param string $module Module name. * @param bool false Should the Configure module link be displayed? Default to false. */ apply_filters( 'jetpack_module_configurable_' . $module, false ) ) { $module_array['configurable'] = sprintf( '%2$s', esc_url( $module_array['configure_url'] ), __( 'Configure', 'jetpack' ) ); } $modules[ $module ] = $module_array; } } uasort( $modules, array( 'Jetpack', 'sort_modules' ) ); if ( ! Jetpack::is_connection_ready() ) { uasort( $modules, array( __CLASS__, 'sort_requires_connection_last' ) ); } return $modules; } /** * Check if a module is available. * * @param array $module Module data. */ public static function is_module_available( $module ) { if ( ! is_array( $module ) || empty( $module ) ) { return false; } /** * We never want to show VaultPress as activatable through Jetpack. */ if ( 'vaultpress' === $module['module'] ) { return false; } /* * WooCommerce Analytics should only be available * when running WooCommerce 3+ */ if ( 'woocommerce-analytics' === $module['module'] && ( ! class_exists( 'WooCommerce' ) || version_compare( WC_VERSION, '3.0', '<' ) ) ) { return false; } /* * In Offline mode, modules that require a site or user * level connection should be unavailable. */ if ( ( new Status() )->is_offline_mode() ) { return ! ( $module['requires_connection'] || $module['requires_user_connection'] ); } /* * Jetpack not connected. */ if ( ! Jetpack::is_connection_ready() ) { return false; } /* * Jetpack connected at a site level only. Make sure to make * modules that require a user connection unavailable. */ if ( ! Jetpack::connection()->has_connected_owner() && $module['requires_user_connection'] ) { return false; } return Jetpack_Plan::supports( $module['module'] ); } /** * Returns why a module is unavailable. * * @param array $module The module. * @return string|false A string stating why the module is not available or false if the module is available. */ public static function get_module_unavailable_reason( $module ) { if ( ! is_array( $module ) || empty( $module ) ) { return false; } if ( self::is_module_available( $module ) ) { return false; } /** * We never want to show VaultPress as activatable through Jetpack so return an empty string. */ if ( 'vaultpress' === $module['module'] ) { return ''; } /* * WooCommerce Analytics should only be available * when running WooCommerce 3+ */ if ( 'woocommerce-analytics' === $module['module'] && ( ! class_exists( 'WooCommerce' ) || version_compare( WC_VERSION, '3.0', '<' ) ) ) { return __( 'Requires WooCommerce 3+ plugin', 'jetpack' ); } /* * In Offline mode, modules that require a site or user * level connection should be unavailable. */ if ( ( new Status() )->is_offline_mode() ) { if ( $module['requires_connection'] || $module['requires_user_connection'] ) { return __( 'Unavailable in Offline mode', 'jetpack' ); } } /* * Jetpack not connected. */ if ( ! Jetpack::is_connection_ready() ) { return __( 'Jetpack is not connected', 'jetpack' ); } /* * Jetpack connected at a site level only and module requires a user connection. */ if ( ! Jetpack::connection()->has_connected_owner() && $module['requires_user_connection'] ) { return __( 'Requires a connected WordPress.com account', 'jetpack' ); } /* * Plan restrictions. */ if ( ! Jetpack_Plan::supports( $module['module'] ) ) { return __( 'Not supported by current plan', 'jetpack' ); } return ''; } /** * Handle an unrecognized action. * * @param string $action Action. */ public function handle_unrecognized_action( $action ) { switch ( $action ) { case 'bulk-activate': check_admin_referer( 'bulk-jetpack_page_jetpack_modules' ); if ( ! current_user_can( 'jetpack_activate_modules' ) ) { break; } $modules = isset( $_GET['modules'] ) ? array_map( 'sanitize_key', wp_unslash( (array) $_GET['modules'] ) ) : array(); foreach ( $modules as $module ) { Jetpack::log( 'activate', $module ); Jetpack::activate_module( $module, false ); } // The following two lines will rarely happen, as Jetpack::activate_module normally exits at the end. wp_safe_redirect( wp_get_referer() ); exit( 0 ); case 'bulk-deactivate': check_admin_referer( 'bulk-jetpack_page_jetpack_modules' ); if ( ! current_user_can( 'jetpack_deactivate_modules' ) ) { break; } $modules = isset( $_GET['modules'] ) ? array_map( 'sanitize_key', wp_unslash( (array) $_GET['modules'] ) ) : array(); foreach ( $modules as $module ) { Jetpack::log( 'deactivate', $module ); Jetpack::deactivate_module( $module ); Jetpack::state( 'message', 'module_deactivated' ); } Jetpack::state( 'module', $modules ); wp_safe_redirect( wp_get_referer() ); exit( 0 ); default: return; } } /** * Fix redirect. * * Apparently we redirect to the referrer instead of whatever WordPress * wants to redirect to when activating and deactivating modules. * * @param string $module Module slug. * @param bool $redirect Should we exit after the module has been activated. Default to true. */ public function fix_redirect( $module, $redirect = true ) { if ( ! $redirect ) { return; } if ( wp_get_referer() ) { add_filter( 'wp_redirect', 'wp_get_referer' ); } } /** * Add debugger admin menu. */ public function admin_menu_debugger() { require_once JETPACK__PLUGIN_DIR . '_inc/lib/debugger.php'; Jetpack_Debugger::disconnect_and_redirect(); $debugger_hook = add_submenu_page( '', __( 'Debugging Center', 'jetpack' ), '', 'manage_options', 'jetpack-debugger', array( $this, 'wrap_debugger_page' ) ); add_action( "admin_head-$debugger_hook", array( 'Jetpack_Debugger', 'jetpack_debug_admin_head' ) ); } /** * Wrap debugger page. */ public function wrap_debugger_page() { nocache_headers(); if ( ! current_user_can( 'manage_options' ) ) { die( '-1' ); } Jetpack_Admin_Page::wrap_ui( array( $this, 'debugger_page' ), array( 'is-wide' => true, 'show-nav' => false, ) ); } /** * Display debugger page. */ public function debugger_page() { require_once JETPACK__PLUGIN_DIR . '_inc/lib/debugger.php'; Jetpack_Debugger::jetpack_debug_display_handler(); } /** * Determines if JITMs should display on a particular screen. * * @param bool $value The default value of the filter. * @param string $screen_id The ID of the screen being tested for JITM display. * * @return bool True if JITMs should display, false otherwise. */ public function should_display_jitms_on_screen( $value, $screen_id ) { // Disable all JITMs on these pages. if ( in_array( $screen_id, array( 'jetpack_page_akismet-key-config', 'admin_page_jetpack_modules', ), true ) ) { return false; } return $value; } /** * Check if we're on a Jetpack admin page. * * Similar to how WooCommerce checks for its admin pages by comparing * against known screen ID patterns. * * @return bool True if on a Jetpack admin page, false otherwise. */ private function is_jetpack_admin_page() { $screen = get_current_screen(); if ( ! $screen ) { return false; } // Check for Jetpack admin pages: // - toplevel_page_jetpack (main Jetpack menu page) // - toplevel_page_jetpack-network (Jetpack Network Admin menu page) // - jetpack_page_* (Jetpack submenu pages) // - admin_page_jetpack* (legacy/special Jetpack pages) // Or check if parent_base is 'jetpack' or 'jetpack-network' (submenu pages) return ( $screen->id === 'toplevel_page_jetpack' || $screen->id === 'toplevel_page_jetpack-network' || str_starts_with( $screen->id, 'jetpack_page_' ) || str_starts_with( $screen->id, 'admin_page_jetpack' ) || $screen->parent_base === 'jetpack' || $screen->parent_base === 'jetpack-network' ); } /** * Add a body class to Jetpack admin pages. * * @param string $classes Space-separated list of CSS classes. * @return string Modified class list. */ public function add_jetpack_admin_body_class( $classes ) { if ( $this->is_jetpack_admin_page() ) { return trim( $classes ) . ' jetpack-admin-page '; } return $classes; } /** * Add inline styles to remove footer padding on Jetpack pages. * * This needs to be inline because jetpack-admin.css is not loaded on * React-powered admin pages (they use load_wrapper_styles instead). */ public function add_footer_removal_styles() { if ( ! $this->is_jetpack_admin_page() ) { return; } echo ''; } /** * Enqueues the shared WPDS design-tokens stylesheet on the legacy/wrap_ui pages. * * This is the admin_enqueue_scripts callback for the legacy Jetpack admin * pages. The admin-ui package owns the handle and enqueues it on the * modernized dashboards it registers; the legacy/wrap_ui pages (Dashboard, * Settings, Debugger) aren't registered through Admin_Menu, so we cover them * here via the central is_jetpack_admin_page() gate. The actual enqueue is * delegated to the reusable Admin_Menu::enqueue_design_tokens() API so there * is a single owner of the handle and no duplicated register/enqueue logic. * * @return void */ public function maybe_enqueue_design_tokens() { if ( ! $this->is_jetpack_admin_page() ) { return; } // Guard against an older admin-ui being loaded ahead of this one by the // package autoloader's version-precedence resolution. if ( ! method_exists( Admin_Menu::class, 'enqueue_design_tokens' ) ) { return; } Admin_Menu::enqueue_design_tokens(); } /** * Remove the admin footer text on Jetpack pages. * * @param string $content The default footer text. * @return string Empty string on Jetpack pages, original content otherwise. */ public function maybe_remove_admin_footer_text( $content ) { return $this->is_jetpack_admin_page() ? '' : $content; } /** * Remove the admin footer version on Jetpack pages. * * @param string $content The default footer version text. * @return string Empty string on Jetpack pages, original content otherwise. */ public function maybe_remove_admin_footer_version( $content ) { return $this->is_jetpack_admin_page() ? '' : $content; } } Jetpack_Admin::init();