���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC ID ); $dimensions = self::get_svg_dimensions( $svg_path ); $response['sizes'] = array( 'full' => array( 'url' => $response['url'], 'width' => $dimensions->width, 'height' => $dimensions->height, 'orientation' => $dimensions->width > $dimensions->height ? 'landscape' : 'portrait', ), ); return $response; } /** * Get SVG Dimensions * * @since 1.1.5 * * @param string $svg SVG file path. * @return array Return SVG file height & width for valid SVG file. */ public static function get_svg_dimensions( $svg ) { $svg = simplexml_load_file( $svg ); if ( false === $svg ) { $width = '0'; $height = '0'; } else { $attributes = $svg->attributes(); $width = (string) $attributes->width; $height = (string) $attributes->height; } return (object) array( 'width' => $width, 'height' => $height, ); } /** * Custom Menu Widget * * In widget export we set the nav menu slug instead of ID. * So, In import process we check get menu id by slug and set * it in import widget process. * * @since 1.0.7 * * @param object $all_sidebars Widget data. * @return object Set custom menu id by slug. */ public function custom_menu_widget( $all_sidebars ) { // Get current menu ID & Slugs. $menu_locations = array(); $nav_menus = (object) wp_get_nav_menus(); if ( isset( $nav_menus ) ) { foreach ( $nav_menus as $menu_key => $menu ) { if ( is_object( $menu ) ) { $menu_locations[ $menu->term_id ] = $menu->slug; } } } // Import widget data. $all_sidebars = (object) $all_sidebars; foreach ( $all_sidebars as $widgets_key => $widgets ) { foreach ( $widgets as $widget_key => $widget ) { // Found slug in current menu list. if ( isset( $widget->nav_menu ) ) { $menu_id = array_search( $widget->nav_menu, $menu_locations, true ); if ( ! empty( $menu_id ) ) { $all_sidebars->$widgets_key->$widget_key->nav_menu = $menu_id; } } } } return $all_sidebars; } /** * Download File Into Uploads Directory * * @since 2.1.0 Added $overrides argument to override the uploaded file actions. * * @param string $file Download File URL. * @param array $overrides Upload file arguments. * @param int $timeout_seconds Timeout in downloading the XML file in seconds. * @return array Downloaded file data. */ public static function download_file( $file = '', $overrides = array(), $timeout_seconds = 300 ) { // Gives us access to the download_url() and wp_handle_sideload() functions. require_once ABSPATH . 'wp-admin/includes/file.php'; // Download file to temp dir. $temp_file = download_url( $file, $timeout_seconds ); // WP Error. if ( is_wp_error( $temp_file ) ) { return array( 'success' => false, 'data' => $temp_file->get_error_message(), ); } // Array based on $_FILE as seen in PHP file uploads. $file_args = array( 'name' => basename( $file ), 'tmp_name' => $temp_file, 'error' => 0, 'size' => filesize( $temp_file ), ); $defaults = array( // Tells WordPress to not look for the POST form // fields that would normally be present as // we downloaded the file from a remote server, so there // will be no form fields // Default is true. 'test_form' => false, // Setting this to false lets WordPress allow empty files, not recommended. // Default is true. 'test_size' => true, // A properly uploaded file will pass this test. There should be no reason to override this one. 'test_upload' => true, 'mimes' => array( 'xml' => 'text/xml', 'json' => 'text/plain', ), ); $overrides = wp_parse_args( $overrides, $defaults ); // Move the temporary file into the uploads directory. $results = wp_handle_sideload( $file_args, $overrides ); astra_sites_error_log( wp_json_encode( $results ) ); if ( isset( $results['error'] ) ) { return array( 'success' => false, 'data' => $results, ); } // Success. return array( 'success' => true, 'data' => $results, ); } /** * Downloads an image from the specified URL. * * Taken from the core media_sideload_image() function and * modified to return an array of data instead of html. * * @since 1.0.10 * * @param string $file The image file path. * @return array An array of image data. */ public static function sideload_image( $file ) { $data = new stdClass(); if ( ! function_exists( 'media_handle_sideload' ) ) { require_once ABSPATH . 'wp-admin/includes/media.php'; require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; } if ( ! empty( $file ) ) { // Set variables for storage, fix file filename for query strings. preg_match( '/[^\?]+\.(jpe?g|jpe|svg|gif|png)\b/i', $file, $matches ); $file_array = array(); $file_array['name'] = basename( $matches[0] ); // Download file to temp location. $file_array['tmp_name'] = download_url( $file ); // If error storing temporarily, return the error. if ( is_wp_error( $file_array['tmp_name'] ) ) { return $file_array['tmp_name']; } // Do the validation and storage stuff. $id = media_handle_sideload( $file_array, 0 ); // If error storing permanently, unlink. if ( is_wp_error( $id ) ) { unlink( $file_array['tmp_name'] ); //phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.file_ops_unlink -- Deleting the file from temp location. return $id; } // Build the object to return. $meta = wp_get_attachment_metadata( $id ); $data->attachment_id = $id; $data->url = wp_get_attachment_url( $id ); $data->thumbnail_url = wp_get_attachment_thumb_url( $id ); $data->height = isset( $meta['height'] ) ? $meta['height'] : ''; $data->width = isset( $meta['width'] ) ? $meta['width'] : ''; } return $data; } /** * Extract image URLs and other URLs from a given HTML content. * * @since 2.6.10 * * @param string $content HTML content string. * @return array Array of URLS. */ public static function extract_segregated_urls( $content ) { // Extract all links. preg_match_all( '#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $content, $match ); $extracts = array( 'image' => array(), 'other' => array(), ); $all_links = array_unique( $match[0] ); // Not have any link. if ( empty( $all_links ) ) { return array(); } $image_links = array(); $other_links = array(); // Extract normal and image links. foreach ( $all_links as $key => $link ) { if ( preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-]+\.(jpg|png|gif|jpeg)\/?$/i', $link ) ) { // Get all image links. // Avoid *-150x, *-300x and *-1024x images. if ( false === strpos( $link, '-150x' ) && false === strpos( $link, '-300x' ) && false === strpos( $link, '-1024x' ) ) { $image_links[] = $link; } } else { // Collect other links. $other_links[] = $link; } } $extracts['image'] = $image_links; $extracts['other'] = $other_links; return $extracts; } /** * Get the client IP address. * * @since 2.6.4 */ public static function get_client_ip() { $ipaddress = ''; if ( getenv( 'HTTP_CLIENT_IP' ) ) { $ipaddress = getenv( 'HTTP_CLIENT_IP' ); } elseif ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) { $ipaddress = getenv( 'HTTP_X_FORWARDED_FOR' ); } elseif ( getenv( 'HTTP_X_FORWARDED' ) ) { $ipaddress = getenv( 'HTTP_X_FORWARDED' ); } elseif ( getenv( 'HTTP_FORWARDED_FOR' ) ) { $ipaddress = getenv( 'HTTP_FORWARDED_FOR' ); } elseif ( getenv( 'HTTP_FORWARDED' ) ) { $ipaddress = getenv( 'HTTP_FORWARDED' ); } elseif ( getenv( 'REMOTE_ADDR' ) ) { $ipaddress = getenv( 'REMOTE_ADDR' ); } else { $ipaddress = 'UNKNOWN'; } return $ipaddress; } } /** * Kicking this off by calling 'get_instance()' method */ Astra_Sites_Helper::get_instance(); endif;