�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
Settings page * * @since 2.9 * @var array */ private $setting_defaults = array( 'auto-connect' => 0, 'sub-site-connection-override' => 1, ); /** * Constructor * * @since 2.9 */ private function __construct() { require_once ABSPATH . '/wp-admin/includes/plugin.php'; // For the is_plugin... check. /** * Sanity check to ensure the install is Multisite and we * are in Network Admin */ if ( is_multisite() && is_network_admin() ) { add_action( 'network_admin_menu', array( $this, 'add_network_admin_menu' ) ); add_action( 'network_admin_edit_jetpack-network-settings', array( $this, 'save_network_settings_page' ), 10, 0 ); add_filter( 'admin_body_class', array( $this, 'body_class' ) ); if ( isset( $_GET['page'] ) && 'jetpack' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This is view logic. add_action( 'admin_init', array( $this, 'jetpack_sites_list' ) ); } } /* * Things that should only run on multisite */ if ( is_multisite() && is_plugin_active_for_network( 'jetpack/jetpack.php' ) ) { add_action( 'wp_before_admin_bar_render', array( $this, 'add_to_menubar' ) ); add_filter( 'jetpack_disconnect_cap', array( $this, 'set_multisite_disconnect_cap' ) ); /* * If admin wants to automagically register new sites set the hook here * * This is a hacky way because xmlrpc is not available on wp_initialize_site */ if ( 1 === $this->get_option( 'auto-connect' ) ) { add_action( 'wp_initialize_site', array( $this, 'do_automatically_add_new_site' ) ); } } } /** * Sets a connection object. * * @param Automattic\Jetpack\Connection\Manager $connection the connection manager object. */ public function set_connection( Manager $connection ) { $this->connection = $connection; } /** * Registers new sites upon creation * * @since 2.9 * @since 7.4.0 Uses a WP_Site object. * @uses wp_initialize_site * * @param WP_Site $site the WordPress site object. **/ public function do_automatically_add_new_site( $site ) { if ( is_a( $site, 'WP_Site' ) ) { $this->do_subsiteregister( $site->id ); } } /** * Adds .network-admin class to the body tag * Helps distinguish network admin JP styles from regular site JP styles * * @since 2.9 * * @param String $classes current assigned body classes. * @return String amended class string. */ public function body_class( $classes ) { return trim( $classes ) . ' network-admin '; } /** * Provides access to an instance of Jetpack_Network * * This is how the Jetpack_Network object should *always* be accessed * * @since 2.9 * @return Jetpack_Network */ public static function init() { if ( ! self::$instance || ! is_a( self::$instance, 'Jetpack_Network' ) ) { self::$instance = new Jetpack_Network(); } return self::$instance; } /** * Registers the Multisite admin bar menu item shortcut. * This shortcut helps users quickly and easily navigate to the Jetpack Network Admin * menu from anywhere in their network. * * @since 2.9 */ public function register_menubar() { add_action( 'wp_before_admin_bar_render', array( $this, 'add_to_menubar' ) ); } /** * Runs when Jetpack is deactivated from the network admin plugins menu. * Each individual site will need to have Jetpack::disconnect called on it. * Site that had Jetpack individually enabled will not be disconnected as * on Multisite individually activated plugins are still activated when * a plugin is deactivated network wide. * * @since 2.9 **/ public function deactivate() { // Only fire if in network admin. if ( ! is_network_admin() ) { return; } $sites = get_sites(); foreach ( $sites as $s ) { switch_to_blog( (int) $s->blog_id ); $active_plugins = get_option( 'active_plugins' ); /* * If this plugin was activated in the subsite individually * we do not want to call disconnect. Plugins activated * individually (before network activation) stay activated * when the network deactivation occurs */ if ( ! in_array( 'jetpack/jetpack.php', $active_plugins, true ) ) { Jetpack::disconnect(); Jetpack_Options::delete_option( 'version' ); } restore_current_blog(); } } /** * Adds a link to the Jetpack Network Admin page in the network admin menu bar. * * @since 2.9 **/ public function add_to_menubar() { global $wp_admin_bar; // Don't show for logged out users or single site mode. if ( ! is_user_logged_in() || ! is_multisite() ) { return; } $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-jetpack', 'title' => 'Jetpack', 'href' => $this->get_url( 'network_admin_page' ), ) ); } /** * Returns various URL strings. Factory like * * $args can be a string or an array. * If $args is an array there must be an element called name for the switch statement * * Currently supports: * - subsiteregister: Pass array( 'name' => 'subsiteregister', 'site_id' => SITE_ID ) * - network_admin_page: Provides link to /wp-admin/network/JETPACK * - subsitedisconnect: Pass array( 'name' => 'subsitedisconnect', 'site_id' => SITE_ID ) * * @since 2.9 * * @param Mixed $args URL parameters. * * @return String **/ public function get_url( $args ) { $url = null; // Default url value. if ( is_string( $args ) ) { $name = $args; } elseif ( is_array( $args ) ) { $name = $args['name']; } else { return $url; } switch ( $name ) { case 'subsiteregister': if ( ! isset( $args['site_id'] ) ) { break; // If there is not a site id present we cannot go further. } $url = network_admin_url( 'admin.php?page=jetpack&action=subsiteregister&site_id=' . $args['site_id'] ); break; case 'network_admin_page': $url = network_admin_url( 'admin.php?page=jetpack' ); break; case 'subsitedisconnect': if ( ! isset( $args['site_id'] ) ) { break; // If there is not a site id present we cannot go further. } $url = network_admin_url( 'admin.php?page=jetpack&action=subsitedisconnect&site_id=' . $args['site_id'] ); break; } return $url; } /** * Adds the Jetpack menu item to the Network Admin area * * @since 2.9 */ public function add_network_admin_menu() { $icon = ( new Logo() )->get_base64_logo(); add_menu_page( 'Jetpack', 'Jetpack', 'jetpack_network_admin_page', 'jetpack', array( $this, 'wrap_network_admin_page' ), $icon, 3 ); $jetpack_sites_page_hook = add_submenu_page( 'jetpack', __( 'Jetpack Sites', 'jetpack' ), __( 'Sites', 'jetpack' ), 'jetpack_network_sites_page', 'jetpack', array( $this, 'wrap_network_admin_page' ) ); $jetpack_settings_page_hook = add_submenu_page( 'jetpack', __( 'Settings', 'jetpack' ), __( 'Settings', 'jetpack' ), 'jetpack_network_settings_page', 'jetpack-settings', array( $this, 'wrap_render_network_admin_settings_page' ) ); add_action( "load-$jetpack_sites_page_hook", array( $this, 'admin_init_network_page' ) ); add_action( "load-$jetpack_settings_page_hook", array( $this, 'admin_init_network_page' ) ); } /** * Provides functionality for the Jetpack > Sites page. * Does not do the display! * * @since 2.9 */ public function jetpack_sites_list() { Jetpack::init(); if ( isset( $_GET['action'] ) ) { switch ( $_GET['action'] ) { case 'subsiteregister': check_admin_referer( 'jetpack-subsite-register' ); Jetpack::log( 'subsiteregister' ); // If no site_id, stop registration and error. if ( ! isset( $_GET['site_id'] ) || empty( $_GET['site_id'] ) ) { /** * Log error to state cookie for display later. * * @todo Make state messages show on Jetpack NA pages */ Jetpack::state( 'missing_site_id', esc_html__( 'Site ID must be provided to register a sub-site.', 'jetpack' ) ); break; } // Send data to register endpoint and retrieve shadow blog details. $result = $this->do_subsiteregister(); $url = $this->get_url( 'network_admin_page' ); if ( is_wp_error( $result ) ) { $url = add_query_arg( 'action', 'connection_failed', $url ); } else { $url = add_query_arg( 'action', 'connected', $url ); } wp_safe_redirect( $url ); exit( 0 ); case 'subsitedisconnect': check_admin_referer( 'jetpack-subsite-disconnect' ); Jetpack::log( 'subsitedisconnect' ); if ( ! isset( $_GET['site_id'] ) || empty( $_GET['site_id'] ) ) { Jetpack::state( 'missing_site_id', esc_html__( 'Site ID must be provided to disconnect a sub-site.', 'jetpack' ) ); break; } $this->do_subsitedisconnect(); break; case 'connected': case 'connection_failed': add_action( 'jetpack_notices', array( $this, 'show_jetpack_notice' ) ); break; } } } /** * Set the disconnect capability for multisite. * * @param array $caps The capabilities array. */ public function set_multisite_disconnect_cap( $caps ) { // Can individual site admins manage their own connection? if ( ! is_super_admin() && ! $this->get_option( 'sub-site-connection-override' ) ) { /* * We need to update the option name -- it's terribly unclear which * direction the override goes. * * @todo: Update the option name to `sub-sites-can-manage-own-connections` */ return array( 'do_not_allow' ); } return $caps; } /** * Shows the Jetpack plugin notices. */ public function show_jetpack_notice() { if ( isset( $_GET['action'] ) && 'connected' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This is view logic. $notice = __( 'Site successfully connected.', 'jetpack' ); $classname = 'updated'; } elseif ( isset( $_GET['action'] ) && 'connection_failed' === $_GET['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- This is view logic. $notice = __( 'Site connection failed!', 'jetpack' ); $classname = 'error'; } ?> jetpack_sites_list()`) should check. $site_id = ( $site_id === null ) ? ( isset( $_GET['site_id'] ) ? (int) $_GET['site_id'] : null ) : $site_id; switch_to_blog( $site_id ); Jetpack::disconnect(); restore_current_blog(); } /** * Registers a subsite with the Jetpack servers * * @since 2.9 * @todo Break apart into easier to manage chunks that can be unit tested * @see Jetpack_Network::jetpack_sites_list(); * * @param int $site_id the site identifier. */ public function do_subsiteregister( $site_id = null ) { if ( ! current_user_can( 'jetpack_disconnect' ) ) { return; } if ( ( new Status() )->is_offline_mode() ) { return; } // Figure out what site we are working on. // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Caller (i.e. `$this->jetpack_sites_list()`) should check. $site_id = ( $site_id === null ) ? ( isset( $_GET['site_id'] ) ? (int) $_GET['site_id'] : null ) : $site_id; /* * Here we need to switch to the subsite * For the registration process we really only hijack how it * works for an individual site and pass in some extra data here */ switch_to_blog( $site_id ); add_filter( 'jetpack_register_request_body', array( $this, 'filter_register_request_body' ) ); add_action( 'jetpack_site_registered_user_token', array( $this, 'filter_register_user_token' ) ); // Save the secrets in the subsite so when the wpcom server does a pingback it // will be able to validate the connection. $result = $this->connection->register( 'subsiteregister' ); if ( is_wp_error( $result ) || ! $result ) { restore_current_blog(); return $result; } Jetpack::activate_default_modules( false, false, array(), false ); restore_current_blog(); } /** * Receives the registration response token. * * @param Object $token the received token. */ public function filter_register_user_token( $token ) { $is_connection_owner = ! $this->connection->has_connected_owner(); ( new Tokens() )->update_user_token( get_current_user_id(), sprintf( '%s.%d', $token->secret, get_current_user_id() ), $is_connection_owner ); } /** * Filters the registration request body to include additional properties. * * @param array $properties standard register request body properties. * @return array amended properties. */ public function filter_register_request_body( $properties ) { $blog_details = get_blog_details(); $network = get_network(); switch_to_blog( $network->blog_id ); // The blog id on WordPress.com of the primary network site. $network_wpcom_blog_id = Jetpack_Options::get_option( 'id' ); restore_current_blog(); /** * Both `state` and `user_id` need to be sent in the request, even though they are the same value. * Connecting via the network admin combines `register()` and `authorize()` methods into one step, * because we assume the main site is already authorized. `state` is used to verify the `register()` * request, while `user_id()` is used to create the token in the `authorize()` request. */ return array_merge( $properties, array( 'network_url' => $this->get_url( 'network_admin_page' ), 'network_wpcom_blog_id' => $network_wpcom_blog_id, 'user_id' => get_current_user_id(), /* * Use the subsite's registration date as the site creation date. * * This is in contrast to regular standalone sites, where we use the helper * `Jetpack::get_assumed_site_creation_date()` to assume the site's creation date. */ 'site_created' => $blog_details->registered, ) ); } /** * Initializes assets for network admin pages. * * @since 15.7 */ public function admin_init_network_page() { add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_network_admin_scripts' ) ); // Match the modernized single-site dashboards (e.g. Jetpack Forms): the // network Sites/Settings pages render as full-viewport AdminPage shells, // so strip core admin notices that would otherwise break the pinned // layout. Network Admin fires `network_admin_notices`/`all_admin_notices` // (not `admin_notices`). Jetpack's own notices use the `jetpack_notices` // hook and are unaffected. remove_all_actions( 'network_admin_notices' ); remove_all_actions( 'all_admin_notices' ); } /** * Enqueues the JS and CSS for the unified network admin header. * * @since 15.7 */ public function enqueue_network_admin_scripts() { $build_dir = JETPACK__PLUGIN_DIR . '_inc/build/'; $script_asset_path = $build_dir . 'network-admin.asset.php'; if ( ! file_exists( $script_asset_path ) ) { return; } $script_asset = require $script_asset_path; wp_enqueue_script( 'jetpack-network-admin', plugins_url( '_inc/build/network-admin.js', JETPACK__PLUGIN_FILE ), $script_asset['dependencies'], $script_asset['version'], true ); wp_enqueue_style( 'jetpack-network-admin', plugins_url( '_inc/build/network-admin.css', JETPACK__PLUGIN_FILE ), array(), $script_asset['version'] ); wp_set_script_translations( 'jetpack-network-admin', 'jetpack' ); wp_localize_script( 'jetpack-network-admin', 'JetpackNetworkAdminData', array( 'sitesUrl' => network_admin_url( 'admin.php?page=jetpack' ), 'settingsUrl' => network_admin_url( 'admin.php?page=jetpack-settings' ), ) ); } /** * Renders the Network Sites page with the unified admin header. */ public function wrap_network_admin_page() { echo '
'; echo ''; } /** * Handles the displaying of all sites on the network that are * dis/connected to Jetpack * * @since 2.9 * @see Jetpack_Network::jetpack_sites_list() */ public function network_admin_page() { global $current_site; $jp = Jetpack::init(); // We should be, but ensure we are on the main blog. switch_to_blog( $current_site->blog_id ); $main_active = $jp->is_connection_ready(); restore_current_blog(); // If we are in dev mode, just show the notice and bail. if ( ( new Status() )->is_offline_mode() ) { Jetpack::show_development_mode_notice(); return; } /* * Ensure the main blog is connected as all other subsite blog * connections will feed off this one */ if ( ! $main_active ) { $data = array( 'url' => $jp->build_connect_url() ); Jetpack::init()->load_view( 'admin/must-connect-main-blog.php', $data ); return; } require_once __DIR__ . '/class.jetpack-network-sites-list-table.php'; $network_sites_table = new Jetpack_Network_Sites_List_Table(); echo '

' . esc_html__( 'Sites', 'jetpack' ) . '

'; echo '
'; $network_sites_table->prepare_items(); $network_sites_table->display(); echo '
'; } /** * Stylized JP header formatting * * @since 2.9 */ public function network_admin_page_header() { $is_connected = Jetpack::is_connection_ready(); $data = array( 'is_connected' => $is_connected, ); Jetpack::init()->load_view( 'admin/network-admin-header.php', $data ); } /** * Fires when the Jetpack > Settings page is saved. * * @since 2.9 * @return never */ public function save_network_settings_page() { if ( ! isset( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'jetpack-network-settings' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized // No nonce, push back to settings page. wp_safe_redirect( add_query_arg( array( 'page' => 'jetpack-settings' ), network_admin_url( 'admin.php' ) ) ); exit( 0 ); } // Try to save the Protect allow list before anything else, since that action can result in errors. $allow_list = isset( $_POST['global-allow-list'] ) ? filter_var( wp_unslash( $_POST['global-allow-list'] ) ) : ''; $allow_list = str_replace( ' ', '', $allow_list ); $allow_list = explode( PHP_EOL, $allow_list ); $result = Brute_Force_Protection_Shared_Functions::save_allow_list( $allow_list, true ); if ( is_wp_error( $result ) ) { wp_safe_redirect( add_query_arg( array( 'page' => 'jetpack-settings', 'error' => 'jetpack_protect_whitelist', ), network_admin_url( 'admin.php' ) ) ); exit( 0 ); } /* * Fields * * auto-connect - Checkbox for global Jetpack connection * sub-site-connection-override - Allow sub-site admins to (dis)reconnect with their own Jetpack account */ $auto_connect = 0; if ( isset( $_POST['auto-connect'] ) ) { $auto_connect = 1; } $sub_site_connection_override = 0; if ( isset( $_POST['sub-site-connection-override'] ) ) { $sub_site_connection_override = 1; } $data = array( 'auto-connect' => $auto_connect, 'sub-site-connection-override' => $sub_site_connection_override, ); update_site_option( $this->settings_name, $data ); wp_safe_redirect( add_query_arg( array( 'page' => 'jetpack-settings', 'updated' => 'true', ), network_admin_url( 'admin.php' ) ) ); exit( 0 ); } /** * Renders the Network Settings page with the unified admin header. */ public function wrap_render_network_admin_settings_page() { echo '
'; echo ''; } /** * A hook rendering the admin settings page. */ public function render_network_admin_settings_page() { $options = wp_parse_args( get_site_option( $this->settings_name ), $this->setting_defaults ); $modules = array(); $module_slugs = Jetpack::get_available_modules(); foreach ( $module_slugs as $slug ) { $module = Jetpack::get_module( $slug ); $module['module'] = $slug; $modules[] = $module; } usort( $modules, array( 'Jetpack', 'sort_modules' ) ); if ( ! isset( $options['modules'] ) ) { $options['modules'] = $modules; } $data = array( 'modules' => $modules, 'options' => $options, 'jetpack_protect_whitelist' => Brute_Force_Protection_Shared_Functions::format_allow_list(), ); Jetpack::init()->load_view( 'admin/network-settings.php', $data ); } /** * Updates a site wide option * * @since 2.9 * * @param string $key option name. * @param mixed $value option value. * * @return boolean **/ public function update_option( $key, $value ) { $options = get_site_option( $this->settings_name, $this->setting_defaults ); $options[ $key ] = $value; return update_site_option( $this->settings_name, $options ); } /** * Retrieves a site wide option * * @since 2.9 * * @param string $name - Name of the option in the database. **/ public function get_option( $name ) { $options = get_site_option( $this->settings_name, $this->setting_defaults ); $options = wp_parse_args( $options, $this->setting_defaults ); if ( ! isset( $options[ $name ] ) ) { $options[ $name ] = null; } return $options[ $name ]; } }