�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
\n"; } $tags = array(); /** * Filter the minimum width of the images used in Jetpack Open Graph Meta Tags. * * @module sharedaddy, publicize * * @since 2.0.0 * * @param int 200 Minimum image width used in Jetpack Open Graph Meta Tags. */ $image_width = absint( apply_filters( 'jetpack_open_graph_image_width', 200 ) ); /** * Filter the minimum height of the images used in Jetpack Open Graph Meta Tags. * * @module sharedaddy, publicize * * @since 2.0.0 * * @param int 200 Minimum image height used in Jetpack Open Graph Meta Tags. */ $image_height = absint( apply_filters( 'jetpack_open_graph_image_height', 200 ) ); $description_length = 197; if ( is_home() || is_front_page() ) { $site_type = Jetpack_Options::get_option_and_ensure_autoload( 'open_graph_protocol_site_type', '' ); $tags['og:type'] = ! empty( $site_type ) ? $site_type : 'website'; $tags['og:title'] = get_bloginfo( 'name' ); $tags['og:description'] = get_bloginfo( 'description' ); $front_page_id = get_option( 'page_for_posts' ); if ( 'page' === get_option( 'show_on_front' ) && $front_page_id && is_home() ) { $tags['og:url'] = get_permalink( $front_page_id ); } else { $tags['og:url'] = home_url( '/' ); } // Associate a blog's root path with one or more Facebook accounts. $facebook_admins = Jetpack_Options::get_option_and_ensure_autoload( 'facebook_admins', array() ); if ( ! empty( $facebook_admins ) ) { $tags['fb:admins'] = $facebook_admins; } } elseif ( is_author() ) { $tags['og:type'] = 'profile'; $author = get_queried_object(); if ( is_a( $author, 'WP_User' ) ) { $tags['og:title'] = $author->display_name; if ( ! empty( $author->user_url ) ) { $tags['og:url'] = $author->user_url; } else { $tags['og:url'] = get_author_posts_url( $author->ID ); } $tags['og:description'] = $author->description; $tags['profile:first_name'] = get_the_author_meta( 'first_name', $author->ID ); $tags['profile:last_name'] = get_the_author_meta( 'last_name', $author->ID ); } } elseif ( is_archive() ) { $tags['og:type'] = 'website'; $tags['og:title'] = wp_get_document_title(); $archive = get_queried_object(); if ( $archive instanceof WP_Term ) { $tags['og:url'] = get_term_link( $archive->term_id, $archive->taxonomy ); $tags['og:description'] = $archive->description; } elseif ( ! empty( $archive ) && is_post_type_archive() ) { $tags['og:url'] = get_post_type_archive_link( $archive->name ); $tags['og:description'] = $archive->description; } } elseif ( is_singular() && is_a( $data, 'WP_Post' ) ) { $tags['og:type'] = 'article'; if ( empty( $data->post_title ) ) { $tags['og:title'] = ' '; } else { /** This filter is documented in core/src/wp-includes/post-template.php */ $tags['og:title'] = wp_kses( apply_filters( 'the_title', $data->post_title, $data->ID ), array() ); } $tags['og:url'] = get_permalink( $data->ID ); if ( ! post_password_required() ) { /* * If the post author set an excerpt, use that. * Otherwise, pick the post content that comes before the More tag if there is one. * Do not use the post content if it contains premium content. */ if ( ! empty( $data->post_excerpt ) ) { $tags['og:description'] = jetpack_og_get_description( $data->post_excerpt ); } elseif ( ! has_block( 'premium-content/container', $data->post_content ) ) { $excerpt = explode( '', $data->post_content )[0]; $tags['og:description'] = jetpack_og_get_description( $excerpt ); } } $tags['article:published_time'] = gmdate( 'c', strtotime( $data->post_date_gmt ) ); $tags['article:modified_time'] = gmdate( 'c', strtotime( $data->post_modified_gmt ) ); if ( post_type_supports( get_post_type( $data ), 'author' ) && isset( $data->post_author ) ) { $publicize_facebook_user = get_post_meta( $data->ID, '_publicize_facebook_user', true ); if ( ! empty( $publicize_facebook_user ) ) { $tags['article:author'] = esc_url( $publicize_facebook_user ); } } } elseif ( is_search() ) { if ( '' !== get_query_var( 's', '' ) ) { $tags['og:title'] = wp_get_document_title(); } } /** * Allow plugins to inject additional template-specific Open Graph tags. * * @module sharedaddy, publicize * * @since 3.0.0 * * @param array $tags Array of Open Graph Meta tags. * @param array $args Array of image size parameters. */ $tags = apply_filters( 'jetpack_open_graph_base_tags', $tags, compact( 'image_width', 'image_height' ) ); // Re-enable widont if we had disabled it. if ( $disable_widont ) { add_filter( 'the_title', 'widont' ); } /** * Do not return any Open Graph Meta tags if we don't have any info about a post. * * @module sharedaddy, publicize * * @since 3.0.0 * * @param bool true Do not return any Open Graph Meta tags if we don't have any info about a post. */ if ( empty( $tags ) && apply_filters( 'jetpack_open_graph_return_if_empty', true ) ) { return; } $tags['og:site_name'] = get_bloginfo( 'name' ); // Get image info and build tags. if ( ! post_password_required() ) { $image_info = jetpack_og_get_image( $image_width, $image_height ); $tags['og:image'] = $image_info['src']; if ( ! empty( $image_info['width'] ) ) { $tags['og:image:width'] = (int) $image_info['width']; } if ( ! empty( $image_info['height'] ) ) { $tags['og:image:height'] = (int) $image_info['height']; } // If we have an image, add the alt text even if it's empty. if ( ! empty( $image_info['src'] ) && isset( $image_info['alt_text'] ) ) { $tags['og:image:alt'] = esc_attr( $image_info['alt_text'] ); } } // Facebook whines if you give it an empty title. if ( empty( $tags['og:title'] ) ) { $tags['og:title'] = __( '(no title)', 'jetpack' ); } // Shorten the description if it's too long. if ( isset( $tags['og:description'] ) ) { $tags['og:description'] = strlen( $tags['og:description'] ) > $description_length ? mb_substr( $tags['og:description'], 0, $description_length ) . '…' : $tags['og:description']; } // Try to add OG locale tag if the WP->FB data mapping exists. if ( defined( 'JETPACK__GLOTPRESS_LOCALES_PATH' ) && file_exists( JETPACK__GLOTPRESS_LOCALES_PATH ) ) { require_once JETPACK__GLOTPRESS_LOCALES_PATH; $_locale = get_locale(); // We have to account for w.org vs WP.com locale divergence. if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) { $gp_locale = GP_Locales::by_field( 'slug', $_locale ); } else { $gp_locale = GP_Locales::by_field( 'wp_locale', $_locale ); } } if ( isset( $gp_locale->facebook_locale ) && ! empty( $gp_locale->facebook_locale ) ) { $tags['og:locale'] = $gp_locale->facebook_locale; } /** * Allow the addition of additional Open Graph Meta tags, or modify the existing tags. * * @module sharedaddy, publicize * * @since 2.0.0 * * @param array $tags Array of Open Graph Meta tags. * @param array $args Array of image size parameters. */ $tags = apply_filters( 'jetpack_open_graph_tags', $tags, compact( 'image_width', 'image_height' ) ); // secure_urls need to go right after each og:image to work properly so we will abstract them here. $tags['og:image:secure_url'] = ( empty( $tags['og:image:secure_url'] ) ) ? '' : $tags['og:image:secure_url']; $secure = $tags['og:image:secure_url']; unset( $tags['og:image:secure_url'] ); $secure_image_num = 0; $allowed_empty_tags = array( 'og:image:alt', ); foreach ( (array) $tags as $tag_property => $tag_content ) { // to accommodate multiple images. $tag_content = (array) $tag_content; $tag_content = array_unique( array_filter( $tag_content, 'is_scalar' ) ); foreach ( $tag_content as $tag_content_single ) { if ( empty( $tag_content_single ) && ! in_array( $tag_property, $allowed_empty_tags, true ) ) { continue; // Only allow certain empty tags. } switch ( $tag_property ) { case 'og:url': case 'og:image': case 'og:image:url': case 'og:image:secure_url': case 'og:audio': case 'og:audio:url': case 'og:audio:secure_url': case 'og:video': case 'og:video:url': case 'og:video:secure_url': $og_tag = sprintf( '', esc_attr( $tag_property ), esc_url( $tag_content_single ) ); break; default: $og_tag = sprintf( '', esc_attr( $tag_property ), esc_attr( $tag_content_single ) ); } /** * Filter the HTML Output of each Open Graph Meta tag. * * @module sharedaddy, publicize * * @since 2.0.0 * * @param string $og_tag HTML HTML Output of each Open Graph Meta tag. */ $og_output .= apply_filters( 'jetpack_open_graph_output', $og_tag ); $og_output .= "\n"; if ( 'og:image' === $tag_property ) { if ( is_array( $secure ) && ! empty( $secure[ $secure_image_num ] ) ) { $og_tag = sprintf( '', esc_url( $secure[ $secure_image_num ] ) ); /** This filter is documented in functions.opengraph.php */ $og_output .= apply_filters( 'jetpack_open_graph_output', $og_tag ); $og_output .= "\n"; } elseif ( ! is_array( $secure ) && ! empty( $secure ) ) { $og_tag = sprintf( '', esc_url( $secure ) ); /** This filter is documented in functions.opengraph.php */ $og_output .= apply_filters( 'jetpack_open_graph_output', $og_tag ); $og_output .= "\n"; } ++$secure_image_num; } } } if ( ! $is_amp_response ) { // Because AMP optimizes the order or the nodes in the head. $og_output .= "\n"; } $og_output .= "\n"; // This is trusted output or added by a filter. echo $og_output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } /** * Returns an image used in social shares. * * @since 2.0.0 * * @param int $width Minimum width for the image. Default is 200 based on Facebook's requirement. * @param int $height Minimum height for the image. Default is 200 based on Facebook's requirement. * @param null $deprecated Deprecated. * * @return array The source ('src'), 'width', and 'height' of the image. */ function jetpack_og_get_image( $width = 200, $height = 200, $deprecated = null ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, 'jetpack-6.6.0' ); } $image = array(); if ( is_singular() && ! is_home() ) { // Grab obvious image if post is an attachment page for an image. if ( is_attachment( get_the_ID() ) && str_starts_with( get_post_mime_type(), 'image' ) ) { $image['src'] = wp_get_attachment_url( get_the_ID() ); $image['alt_text'] = Images::get_alt_text( get_the_ID() ); } // Attempt to find something good for this post using our generalized PostImages code. if ( empty( $image ) ) { $post_image = Images::get_image( get_the_ID(), array( 'width' => $width, 'height' => $height, ) ); if ( ! empty( $post_image ) && is_array( $post_image ) ) { $image['src'] = $post_image['src']; if ( isset( $post_image['src_width'] ) && isset( $post_image['src_height'] ) ) { $image['width'] = $post_image['src_width']; $image['height'] = $post_image['src_height']; } if ( ! empty( $post_image['alt_text'] ) ) { $image['alt_text'] = $post_image['alt_text']; } } } } elseif ( is_author() ) { $author = get_queried_object(); if ( is_a( $author, 'WP_User' ) ) { $image['src'] = get_avatar_url( $author->user_email, array( 'size' => $width, ) ); $image['alt_text'] = $author->display_name; } } /* * Generate a fallback social image, * dynamically generated based on the site name, * a representative image of the site, * and a custom template used by our Social Image Generator. */ if ( empty( $image ) ) { $site_image = jetpack_og_get_fallback_social_image( $width, $height ); if ( ! empty( $site_image ) ) { $image['src'] = $site_image['src']; $image['width'] = $site_image['width']; $image['height'] = $site_image['height']; } } // If we didn't get an explicit alt tag from the image, set a default. if ( empty( $image['alt_text'] ) ) { /** * Filter the default Open Graph image alt text, used when the Open Graph image from the post does not have an alt text. * * @since 10.4 * * @param string $str Default Open Graph image alt text. */ $image['alt_text'] = apply_filters( 'jetpack_open_graph_image_default_alt_text', '' ); } return $image; } /** * Get a fallback social image for the site. * * @since 14.9 * * @param int $width The width of the image. * @param int $height The height of the image. * * @return array The source ('src'), 'width', 'height', and source type of the image. */ function jetpack_og_get_fallback_social_image( $width, $height ) { // Default template. $template = 'edge'; // Let's get the site's representative image. $site_image = jetpack_og_get_site_image( $width, $height ); /** * Define your own site's representative image, * to override any fallback image found by looking through site's logo, site icon, and blavatar. * This will allow you to overwrite the default fallback image generated dynamically. * * @since 15.0 * * @param array $site_image Your own site's representative image. * @param array $site_image The site's representative image picked by Jetpack. { * @type string $src The source of the image. * @type int $width The width of the image. * @type int $height The height of the image. * @type string $type The type of the image. * } */ $custom_site_image = apply_filters( 'jetpack_og_default_site_image', array(), $site_image ); if ( ! empty( $custom_site_image['src'] ) ) { return $custom_site_image; } if ( empty( $site_image['src'] ) ) { // When using the default blank image, use a different template in Social Image Generator. $template = 'highway'; $site_image['src'] = jetpack_og_get_site_fallback_blank_image(); } // Return the site image if we are in offline mode instead of attempting to generate a dynamic one. if ( ( new Status() )->is_offline_mode() ) { return $site_image; } /* * Only attempt to generate a dynamic fallback image * if we have a healthy connection to WPCOM. * and if the site has the right plan. */ if ( ( ( new Host() )->is_wpcom_simple() || ( new Connection_Manager() )->is_connected() ) && Current_Plan::supports( 'social-image-generator' ) ) { /** * Allow filtering the template to use with Social Image Generator. * Available templates: highway, dois, fullscreen, edge. * * @since 14.9 * * @param string $template The template to use. */ $template = apply_filters( 'jetpack_og_fallback_social_image_template', $template ); // Let's generate the image. $site_image = jetpack_og_generate_fallback_social_image( $site_image, $template ); } return $site_image; } /** * Get the site's representative image. * * @since 14.9 * * @param int $width The width of the image. * @param int $height The height of the image. * * @return array The source ('src'), 'width', 'height', and source type of the image. */ function jetpack_og_get_site_image( $width, $height ) { // First fall back, blavatar. if ( function_exists( 'blavatar_domain' ) ) { $blavatar_domain = blavatar_domain( site_url() ); if ( blavatar_exists( $blavatar_domain ) ) { return array( 'src' => blavatar_url( $blavatar_domain, 'img', $width, false, true ), 'width' => $width, 'height' => $height, 'type' => 'blavatar', ); } } // Second fall back, Site Logo. if ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) { $image_id = jetpack_get_site_logo( 'id' ); $logo = wp_get_attachment_image_src( $image_id, 'full' ); if ( isset( $logo[0] ) && isset( $logo[1] ) && isset( $logo[2] ) && ( _jetpack_og_get_image_validate_size( $logo[1], $logo[2], $width, $height ) ) ) { return array( 'src' => $logo[0], 'width' => $logo[1], 'height' => $logo[2], 'type' => 'site_logo', ); } } // Third fall back, Core's site logo. if ( has_custom_logo() ) { $custom_logo_id = get_theme_mod( 'custom_logo' ); $sl_details = wp_get_attachment_image_src( $custom_logo_id, 'full' ); if ( isset( $sl_details[0] ) && isset( $sl_details[1] ) && isset( $sl_details[2] ) && ( _jetpack_og_get_image_validate_size( $sl_details[1], $sl_details[2], $width, $height ) ) ) { return array( 'src' => $sl_details[0], 'width' => $sl_details[1], 'height' => $sl_details[2], 'alt_text' => Images::get_alt_text( $custom_logo_id ), ); } } // Fourth fall back, Core Site Icon, if valid in size. if ( has_site_icon() ) { $image_id = get_option( 'site_icon' ); $icon = wp_get_attachment_image_src( $image_id, 'full' ); if ( isset( $icon[0] ) && isset( $icon[1] ) && isset( $icon[2] ) && ( _jetpack_og_get_image_validate_size( $icon[1], $icon[2], $width, $height ) ) ) { return array( 'src' => $icon[0], 'width' => $icon[1], 'height' => $icon[2], 'type' => 'site_icon', ); } } return array( 'src' => '', 'width' => $width, 'height' => $height, 'type' => 'blank', ); } /** * Get the site's fallback image. * * @since 14.9 * * @return string */ function jetpack_og_get_site_fallback_blank_image() { /** * Filter the default Open Graph Image tag, used when no Image can be found in a post. * * @since 3.0.0 * * @param string $str Default Image URL. */ return apply_filters( 'jetpack_open_graph_image_default', 'https://s0.wp.com/i/blank.jpg' ); } /** * Get available templates for Social Image Generator. * * @since 14.9 * * @return array The available templates. */ function jetpack_og_get_available_templates() { if ( ! class_exists( '\Automattic\Jetpack\Publicize\Social_Image_Generator\Templates' ) ) { return array(); } return \Automattic\Jetpack\Publicize\Social_Image_Generator\Templates::TEMPLATES; } /** * Get a social image token from Social Image Generator. * * @since 14.9 * * @param string $site_title The site title. * @param string $image_url The image URL. * @param string $template The template to use. * * @return string|WP_Error The social image token, or a WP_Error if the token could not be generated. */ function jetpack_og_get_social_image_token( $site_title, $image_url, $template ) { // Let's check if we have a cached token. $cache_key = wp_hash( $site_title . $image_url . $template ); $transient_name = 'jetpack_og_social_image_token_' . $cache_key; $cached_token = get_transient( $transient_name ); if ( ! empty( $cached_token ) ) { return $cached_token; } /** * Filter the social image token for testing purposes. * * @since 14.9 * * @param string|WP_Error|null $token The token to return, or null to use default behavior. */ $token = apply_filters( 'jetpack_og_get_social_image_token', null ); if ( null !== $token ) { return $token; } if ( ! function_exists( '\Automattic\Jetpack\Publicize\Social_Image_Generator\fetch_token' ) ) { return new WP_Error( 'jetpack_og_get_social_image_token_error', __( 'Social Image Generator is not available.', 'jetpack' ) ); } $token = \Automattic\Jetpack\Publicize\Social_Image_Generator\fetch_token( $site_title, $image_url, $template ); /* * We want to cache 2 types of responses: * - Successful responses with a token. * - WP_Error responses that denote a WordPress.com connection issue. */ if ( ! is_wp_error( $token ) || ( is_wp_error( $token ) && 'invalid_user_permission_publicize' === $token->get_error_code() ) ) { set_transient( $transient_name, $token, DAY_IN_SECONDS ); } return $token; } /** * Generate and create a fallback social image. * * @since 14.9 * * @param array $representative_image The representative image of the site. * @param string $template The template to use. * * @return array The source ('src'), 'width', and 'height' of the image. */ function jetpack_og_generate_fallback_social_image( $representative_image, $template ) { $site_title = get_bloginfo( 'name' ); $fallback_image = array( 'src' => $representative_image['src'], 'width' => $representative_image['width'], 'height' => $representative_image['height'], ); // Ensure that we use a valid template. if ( ! in_array( $template, jetpack_og_get_available_templates(), true ) ) { $template = 'edge'; } // Let's generate the token matching the image.. $token = jetpack_og_get_social_image_token( $site_title, $representative_image['src'], $template ); if ( is_wp_error( $token ) ) { return $fallback_image; } // Build the image URL and return it. return array( 'src' => sprintf( 'https://s0.wp.com/_si/?t=%s', $token ), 'width' => 1200, 'height' => 630, ); } /** * Validate the width and height against required width and height * * @param int $width Width of the image. * @param int $height Height of the image. * @param int $req_width Required width to pass validation. * @param int $req_height Required height to pass validation. * * @return bool - True if the image passed the required size validation */ function _jetpack_og_get_image_validate_size( $width, $height, $req_width, $req_height ) { if ( ! $width || ! $height ) { return false; } $valid_width = ( $width >= $req_width ); $valid_height = ( $height >= $req_height ); $is_image_acceptable = $valid_width && $valid_height; return $is_image_acceptable; } /** * Gets a gravatar URL of the specified size. * * @param string $email E-mail address to get gravatar for. * @param int $width Size of returned gravatar. * @return array|bool|mixed|string */ function jetpack_og_get_image_gravatar( $email, $width ) { return get_avatar_url( $email, array( 'size' => $width, ) ); } /** * Clean up text meant to be used as Description Open Graph tag. * * There should be: * - no links * - no shortcodes * - no html tags or their contents * - no content within wp:query blocks * - not too many words. * * @param string $description Text coming from WordPress (autogenerated or manually generated by author). * @param WP_Post|null $data Information about our post. * * @return string $description Cleaned up description string. */ function jetpack_og_get_description( $description = '', $data = null ) { // Remove content within wp:query blocks. $description = jetpack_og_remove_query_blocks( $description ); // Remove tags such as