/** * General Functions * */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly /** * Get the components of theme mobile header */ if( ! function_exists( 'tie_mobile_header_components' ) ) { function tie_mobile_header_components( $area ){ $mobile_header_components = array( 'menu' => tie_mobile_menu_icon(), 'search' => ' '. esc_html__( 'Search for', TIELABS_TEXTDOMAIN ) .' ', 'skin' => ' '. esc_html__( 'Switch skin', TIELABS_TEXTDOMAIN ) .' ', ); // Login and user account if( is_user_logged_in() ){ ob_start(); tie_login_form(); $login_form = ob_get_clean(); $current_user = wp_get_current_user(); $mobile_header_components['login'] = ' '. get_avatar( $current_user->ID, apply_filters( 'TieLabs/Login/avatar_size', 30 ) ) .' '. esc_html__( 'Your Profile', TIELABS_TEXTDOMAIN ) .'
'. $login_form .'
'; } else { $mobile_header_components['login'] = ' '. esc_html__( 'Log In', TIELABS_TEXTDOMAIN ) .' '; } // WooCommerce Cart if ( TIELABS_WOOCOMMERCE_IS_ACTIVE ){ $mobile_header_components['cart'] = tie_component_button_cart(); } // BuddyPress if ( TIELABS_BUDDYPRESS_IS_ACTIVE ){ $mobile_header_components['bp_notifications'] = tie_component_button_bp_notifications(); } // Check the active components $components = array(); foreach ( $mobile_header_components as $key => $html ) { if( tie_get_option( 'mobile_header_components_'.$key ) == $area ){ $components[ $key ] = ''; } } // $components = apply_filters( 'TieLabs/Mobile/Header/Components', $components, $area ); if( ! empty( $components ) ){ echo '
'; echo ''; echo '
'; } // If Header layout is centered we need to place the div even if it is empty || FLEX elseif ( tie_get_option( 'mobile_header' ) == 'centered' ) { echo '
'; } return false; } } /** * Mobile Menu icon */ if( ! function_exists( 'tie_mobile_menu_icon' ) ) { function tie_mobile_menu_icon(){ if( ! tie_get_option( 'mobile_header_components_menu' ) ){ return false; } $menu_icon = tie_get_option( 'mobile_menu_icon', 1 ); $class = 'tie-mobile-menu-icon '; if( is_numeric( $menu_icon ) ){ $class .= "nav-icon is-layout-$menu_icon"; } else{ $class .= "tie-icon-$menu_icon"; } $class_wrapper = tie_get_option( 'mobile_menu_text' ) ? 'menu-text-wrapper' : ''; $mobile_icon = ''; $mobile_icon .= ''; if( tie_get_option( 'mobile_menu_text' ) ){ $mobile_icon .= ''. esc_html__( 'Menu', TIELABS_TEXTDOMAIN ) .''; } else{ $mobile_icon .= ''. esc_html__( 'Menu', TIELABS_TEXTDOMAIN ) .''; } $mobile_icon .= ''; return $mobile_icon; } } /** * Mobile Header Components Main area */ if( ! function_exists( 'tie_mobile_header_components_area_1' ) ) { add_action( 'TieLabs/Logo/before', 'tie_mobile_header_components_area_1' ); function tie_mobile_header_components_area_1(){ tie_mobile_header_components( 'area_1' ); } } /** * Mobile Header Components */ if( ! function_exists( 'tie_mobile_header_components_area_2' ) ) { add_action( 'TieLabs/Logo/after', 'tie_mobile_header_components_area_2' ); function tie_mobile_header_components_area_2(){ tie_mobile_header_components( 'area_2' ); } }/** * Filters * */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly class TIELABS_FILTERS { /** * Runs on class initialization. Adds filters and actions. */ function __construct() { // Add Support for Shortcodes in the terms descriptions add_filter( 'term_description', 'do_shortcode' ); add_action( 'init', array( $this, 'init_hook' ) ); add_action( 'init', array( $this, 'redirect_random_post' ) ); add_action( 'wp_head', array( $this, 'meta_description' ) ); add_action( 'wp_head', array( $this, 'meta_generator' ) ); add_action( 'wp_head', array( $this, 'x_ua_compatible' ) ); add_action( 'wp_footer', array( $this, 'footer_inline_scripts' ), 999 ); add_action( 'wp_footer', array( $this, 'footer_misc' ) ); add_action( 'wp_footer', array( $this, 'popup_module' ) ); add_action( 'comment_class', array( $this, 'is_avatar_enabled' ) ); add_filter( 'pre_get_posts', array( $this, 'search_filters' ) ); add_filter( 'pre_get_posts', array( $this, 'category_posts_order' ) ); add_filter( 'TieLabs/cache_key', array( $this, 'cache_key' ) ); add_filter( 'widget_tag_cloud_args', array( $this, 'tag_widget_limit' ) ); add_filter( 'widget_title', array( $this, 'tagcloud_widget_title' ), 10, 3 ); add_filter( 'login_headerurl', array( $this, 'dashboard_login_logo_url' ) ); add_filter( 'login_head', array( $this, 'dashboard_login_logo' ) ); add_filter( 'get_the_archive_title', array( $this, 'archive_title' ), 15 ); add_filter( 'wp_link_pages_args', array( $this, 'pages_next_and_number' ) ); add_filter( 'excerpt_more', array( $this, 'excerpt_more' ) ); add_filter( 'get_the_excerpt', array( $this, 'post_excerpt' ), 9 ); add_filter( 'has_post_thumbnail', array( $this, 'has_post_thumbnail' ) ); add_filter( 'post_thumbnail_html', array( $this, 'default_featured_image' ), 10, 5 ); add_filter( 'TieLabs/exclude_content', 'TIELABS_HELPER::strip_shortcodes' ); add_filter( 'wp_get_attachment_image_src', array( $this, 'gif_image' ), 10, 4 ); add_filter( 'wp_get_attachment_image_attributes', array( $this, 'small_thumb_image_class' ), 10, 3 ); add_filter( 'TieLabs/Primary_Category/custom', array( $this, 'yoast_seo_primary_category' ) ); // Translations if( tie_get_option( 'translations' ) ){ add_filter( 'gettext', array( $this, 'theme_translation' ), 10, 3 ); } if( tie_get_option( 'translation_numbers' ) ){ add_filter( 'get_the_date', array( $this, 'translate_numbers' ), 55 ); add_filter( 'get_comment_date', array( $this, 'translate_numbers' ), 55 ); add_filter( 'get_comment_time', array( $this, 'translate_numbers' ), 55 ); add_filter( 'comments_number', array( $this, 'translate_numbers' ), 55 ); add_filter( 'wp_list_categories', array( $this, 'translate_numbers' ), 55 ); add_filter( 'TieLabs/number_format', array( $this, 'translate_numbers' ), 55 ); add_filter( 'TieLabs/post_date', array( $this, 'translate_numbers' ), 55 ); add_filter( 'TieLabs/reading_time', array( $this, 'translate_numbers' ), 55 ); add_filter( 'TieLabs/post_views_number', array( $this, 'translate_numbers' ), 55 ); add_filter( 'TieLabs/Social_Counters/number', array( $this, 'translate_numbers' ), 55 ); add_filter( 'TieLabs/Weather/number', array( $this, 'translate_numbers' ), 55 ); } } /** * init_hook */ function init_hook(){ /*if( current_user_can( 'manage_options' ) ){ add_filter( 'the_content', array( $this, 'shortcodes_notice' ) ); } */ //WordPress doesn't recognize it as RTL language because there is an error in the main translation file of the Sindhi language! if( get_locale() == 'snd' && ! is_rtl() ){ global $wp_locale; $wp_locale->text_direction = 'rtl'; } } /** * Add notice for the shortcodes plugin */ function shortcodes_notice( $content ){ // Don't show the message if this is excerpt OR backend OR AMP if( is_admin() || ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) || in_array( 'parse_request', $GLOBALS['wp_current_filter'] ) || in_array( 'get_the_excerpt', $GLOBALS['wp_current_filter'] ) ){ return $content; } $message = ''; // Timetable and Event Schedule Plugin if( ! TIELABS_MPTIMETABLE_IS_ACTIVE ){ if( strpos( $content, '[mp-timetable' ) !== false ){ $message .= TIELABS_HELPER::notice_message( sprintf( esc_html__( 'This section contains some shortcodes that requries the %2$s%1$s%3$s Plugin.', TIELABS_TEXTDOMAIN ), 'Timetable and Event Schedule', '', '' ), false ); } } // Contact Form 7 Plugin if( ! class_exists( 'WPCF7' ) ){ if( strpos( $content, '[contact-form-7' ) !== false ){ $message .= TIELABS_HELPER::notice_message( sprintf( esc_html__( 'This section contains some shortcodes that requries the %2$s%1$s%3$s Plugin.', TIELABS_TEXTDOMAIN ), 'Contact Form 7', '', '' ), false) ; } } // Return the content with message return apply_filters( 'TieLabs/shortcodes_check', $message, $content ) . $content; } /** * x_ua_compatible */ function x_ua_compatible(){ echo ''; } /** * meta_escription */ function meta_description(){ // Return if the description option is disabled or the Yoast SEO or Rank Math SEO plugins are active if( ! tie_get_option( 'post_meta_escription' ) || class_exists( 'WPSEO_Frontend' ) || class_exists( 'RankMath' ) ){ return; } // Single Page doesn't have a builder if( is_singular() && ! TIELABS_HELPER::has_builder() ){ $post = get_post(); if( ! empty( $post->post_content ) ){ $description = apply_filters( 'TieLabs/exclude_content', $post->post_content ); } } // Archives elseif( get_the_archive_description() ){ $description = get_the_archive_description(); } // Default if( empty( $description ) ){ $description = get_bloginfo( 'description' ); } if( ! empty( $description ) ){ $description = strip_tags( strip_shortcodes( $description ) ); echo ' '; } } /** * Theme translations */ function theme_translation( $translation, $text, $domain ){ if( $domain == TIELABS_TEXTDOMAIN || $domain == 'amp' ){ $translations = tie_get_option( 'translations' ); if( ! empty( $translations ) ){ // To minimize the calls of sanitize_title $sanitize_text = sanitize_title( htmlspecialchars( $text ) ); if( ! empty( $translations[ $sanitize_text ] ) ){ return htmlspecialchars_decode( $translations[ $sanitize_text ] ); } } } return $translation; } /** * Add the inline scripts to the Footer */ function footer_inline_scripts(){ // Check if we are in an AMP page if( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ){ return; } // Print the inline scripts if the BWP is active if( ! empty( $GLOBALS['tie_inline_scripts'] ) && TIELABS_HELPER::is_js_minified() ){ echo ''; } } /** * Add Misc Footer Conetnt */ function footer_misc(){ // Check if we are in an AMP page if( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ){ return; } // Custom Footer Code if ( tie_get_option( 'footer_code' ) ){ echo do_shortcode( apply_filters( 'TieLabs/footer_code', tie_get_option( 'footer_code' ) ) ); } // Reading Position Indicator if ( tie_get_option( 'reading_indicator' ) && is_single() && ! tie_get_option( 'autoload_posts' ) ){ echo '
'; } // Live Search if( tie_menu_has_search( 'top_nav', true ) || tie_menu_has_search( 'main_nav', true ) || ( tie_get_option( 'mobile_header_components_search') && tie_get_option( 'mobile_header_live_search') ) ){ echo '
'; } // Scrollbar - Used to get the default scrollbar width. echo '
'; // Facebook buttons echo '
'; } /** * Add the Popup module to the footer */ function popup_module(){ // Check if we are in an AMP page if( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ){ return; } TIELABS_HELPER::get_template_part( 'templates/popup' ); } /** * Add an extra class to the comment item if the avatar is active */ function is_avatar_enabled( $classes ){ if( is_array( $classes ) && get_option( 'show_avatars' ) ){ $classes[] = 'has-avatar'; } return $classes; } /** * Exclude post types and categories From Search results */ function search_filters( $query ){ if( is_admin() || isset( $_GET['post_type'] ) ){ return $query; } if( is_search() && $query->is_main_query() ){ // Exclude Post types from search if ( ($exclude_post_types = tie_get_option( 'search_exclude_post_types' )) && is_array( $exclude_post_types ) ){ $args = array( 'public' => true, 'exclude_from_search' => false, ); $post_types = get_post_types( $args ); foreach ( $exclude_post_types as $post_type ){ unset( $post_types[ $post_type ] ); } $query->set( 'post_type', $post_types ); } // Exclude specific categoies from search if ( tie_get_option( 'search_cats' ) ){ $query->set( 'cat', tie_get_option( 'search_cats' ) ); } } return $query; } /** * Change the posts order in the category page */ function category_posts_order( $query ){ if( ! is_admin() && is_category() && $query->is_main_query() ){ $current_category = get_queried_object(); if( ! empty( $current_category->term_id ) ){ $posts_order = tie_get_category_option( 'posts_order', $current_category->term_id ); // Posts Order if( ! empty( $posts_order ) ){ if( $posts_order == 'views' && tie_get_option( 'tie_post_views' ) ){ // Most Viewd posts $query->set( 'orderby', 'meta_value_num' ); $query->set( 'meta_key', apply_filters( 'TieLabs/views_meta_field', 'tie_views' ) ); } elseif( $posts_order == 'popular' ){ // Popular Posts by comments $query->set( 'orderby', 'comment_count' ); } elseif( $posts_order == 'title' ){ $query->set( 'orderby', 'title' ); $query->set( 'order', 'ASC' ); } else{ $query->set( 'orderby', $posts_order ); } } } } return $query; } /** * Random Article */ function redirect_random_post(){ if( wp_doing_ajax() ){ return; } if( isset( $_GET['random-post'] ) && ( tie_get_option( 'top-nav-components_random' ) || tie_get_option( 'main-nav-components_random' ) ) ) { $args = array( 'posts_per_page' => 1, 'orderby' => 'rand', 'fields' => 'ids', 'no_found_rows' => true, 'ignore_sticky_posts' => true, ); $random_post = new WP_Query ( $args ); while ( $random_post->have_posts () ){ $random_post->the_post(); wp_redirect( get_permalink() ); exit; } } } /** * Widgets Small Image Class * * By default WordPress uses 2 classes attachment-{size} size-{size} * we need to add a general class doesn't linked with the thumb name */ function small_thumb_image_class( $attr, $attachment, $size = false ) { if( ! empty( $size ) && $size == TIELABS_THEME_SLUG.'-image-small' ){ $attr['class'] .= ' tie-small-image'; } return $attr; } /** * Gif images */ function gif_image( $image, $attachment_id, $size, $icon ){ if( ! tie_get_option( 'disable_featured_gif' ) ){ $file_type = ! empty( $image[0] ) ? wp_check_filetype( $image[0] ) : false; if( ! empty( $file_type ) && $file_type['ext'] == 'gif' && $size != 'full' ){ $full_image = wp_get_attachment_image_src( $attachment_id, $size = 'full', $icon ); // For the avatars we need to keep the original width and height if( ! empty( $full_image ) && in_array( 'get_avatar', $GLOBALS['wp_current_filter'] ) ){ $full_image[1] = $image[1]; $full_image[2] = $image[2]; } return $full_image; } } return $image; } /** * Modify Excerpts */ function post_excerpt( $text = '' ){ $raw_excerpt = $text; if ( '' == $text ){ //$text = get_the_content( '' ); // Causes issues with the new Posts List Blocks $_post = get_post(); $text = ! empty( $_post->post_content ) ? $_post->post_content : ''; $text = apply_filters( 'TieLabs/exclude_content', $text ); /** * If images with class wp-image-{ID} exists in the conetnt, WordPress make a DB request to get andd add the srcset * Since we are in excerpt we don't need that, Great affect on archives pages */ $text = str_replace( 'wp-image-', 'tie-image', $text ); $text = strip_shortcodes( $text ); $text = apply_filters( 'the_content', $text ); $text = str_replace( ']]>', ']]>', $text ); $excerpt_length = apply_filters( 'excerpt_length', 55 ); $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[…]' ); $text = wp_trim_words( $text, $excerpt_length, $excerpt_more ); } return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt ); } /** * Global Cache Key */ function cache_key( $key ){ return 'tie-cache-'. TIELABS_HELPER::get_locale() . $key; } /** * Change the number of tags in the cloud tags */ function tag_widget_limit( $args ){ if( isset($args['taxonomy']) && $args['taxonomy'] == 'post_tag' ){ $args['number'] = 18; } return $args; } /** * Remove the default Tag CLoud titles if the title field is empty */ function tagcloud_widget_title( $title = false, $instance = false, $id_base = false ){ if( $id_base == 'tag_cloud' && empty( $instance['title'] ) ){ return false; } return $title; } /** * Custom Dashboard login URL */ function dashboard_login_logo_url(){ if( tie_get_option( 'dashboard_logo_url' ) ){ return tie_get_option( 'dashboard_logo_url' ); } } /** * Custom Dashboard login page logo */ function dashboard_login_logo(){ if( tie_get_option( 'dashboard_logo' ) ){ echo ''; } } /** * Remove anything that looks like an archive title prefix ("Archive:", "Foo:", "Bar:"). */ function archive_title( $title ){ if ( is_category() ) { return single_cat_title( '', false ); } elseif ( is_tag() ) { return single_tag_title( '', false ); } elseif ( is_author() ) { return '' . get_the_author() . ''; } elseif ( is_post_type_archive() ) { return post_type_archive_title( '', false ); } elseif ( is_tax() ) { return single_term_title( '', false ); } return $title; } /** * Add Number and Next / prev multiple post pages */ function pages_next_and_number( $args ){ if( $args['next_or_number'] == 'next_and_number' ){ global $page, $numpages, $multipage, $more; $args['next_or_number'] = 'number'; $prev = ''; $next = ''; if ( $multipage && $more ){ $i = $page - 1; if ( $i && $more ){ $prev .= _wp_link_page($i); $prev .= $args['link_before']. $args['previouspagelink'] . $args['link_after'] . ''; } $i = $page + 1; if ( $i <= $numpages && $more ){ $next .= _wp_link_page($i); $next .= $args['link_before']. $args['nextpagelink'] . $args['link_after'] . ''; } } $args['before'] = $args['before'].$prev; $args['after'] = $next.$args['after']; } return $args; } /** * Excerpt More */ function excerpt_more( $more ){ return ' …'; } /** * Theme Generator Meta */ function meta_generator(){ $active_theme = wp_get_theme(); if ( is_child_theme() ) { $active_theme = wp_get_theme( $active_theme->Template ); } if( ! empty( $active_theme->Name ) ){ $theme_info = apply_filters( 'TieLabs/theme_meta_generator', $active_theme->Name .' '. TIELABS_DB_VERSION ); if( ! empty( $theme_info ) ){ echo "\n" . "" . "\n"; } } } /** * If the post doesn't have a Primary Category, use the Primary Category of Yoast if it is available */ function yoast_seo_primary_category( $category = false ){ if( class_exists( 'WPSEO_Meta' ) ){ $wpseo_primary_term = get_post_meta( get_the_id(), WPSEO_Meta::$meta_prefix . 'primary_category', true ); if( ! empty( $wpseo_primary_term ) ){ $get_the_category = TIELABS_WP_HELPER::get_term_by( 'id', $wpseo_primary_term, 'category' ); if ( ! empty( $get_the_category ) && ! is_wp_error( $get_the_category ) ) { return $get_the_category; } } } return false; } /** * Always return true, If there is a default featured image */ function has_post_thumbnail( $has_thumbnail ) { if( tie_get_option( 'default_featured_image' ) && tie_get_option( 'default_featured_image_id' ) ){ $has_thumbnail = true; } return $has_thumbnail; } /** * Set a default featured image if it is missing */ function default_featured_image( $html, $post_id, $post_thumbnail_id, $size, $attr ) { // Return if the post has a featured image if( ! empty( $html ) ){ return $html; } // Check if the default eatured image option is active if( ! tie_get_option( 'default_featured_image' ) || ! tie_get_option( 'default_featured_image_id' ) ){ return $html; } $default_thumbnail_id = tie_get_option( 'default_featured_image_id' ); // select the default thumb. return wp_get_attachment_image( $default_thumbnail_id, $size, false, $attr ); } /** * Translate numbers */ function translate_numbers( $the_number ) { if( ! ( is_admin() && ! wp_doing_ajax() ) ) { $translated_numbers = tie_get_option( 'translation_numbers' ); if( ! empty( $translated_numbers ) && is_array( $translated_numbers ) && count( $translated_numbers ) == 10 ){ $original_numbers = array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ); return str_replace( $original_numbers, $translated_numbers, $the_number ); } } return $the_number; } } // Single instance. $TIELABS_FILTERS = new TIELABS_FILTERS();/** * Taqyeem Class * */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly if( ! class_exists( 'TIELABS_TAQYEEM' ) ) { class TIELABS_TAQYEEM{ /** * __construct * * Class constructor where we will call our filter and action hooks. */ function __construct(){ // Disable if the Taqyeem plugin is not active if( ! TIELABS_TAQYEEM_IS_ACTIVE ){ return; } // Disable the Custom Styles and Typofraphy options add_filter( 'taqyeem_custom_styles', '__return_false' ); // Disable Updater and Verification add_filter( 'Taqyeem/Updater/disable', '__return_true' ); add_filter( 'Taqyeem/Verification/disable', '__return_true' ); // Disable the plugin Rich Snippets add_filter( 'tie_taqyeem_rich_snippets', '__return_false' ); // Remove Shortcodes code and Keep the content add_filter( 'taqyeem_exclude_content', 'TIELABS_HELPER::strip_shortcodes' ); // Dequeue Scripts and Styles add_filter( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ), 50 ); // Dequeue Scripts and Styles add_filter( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ), 50 ); // Change the reviews head box class add_filter( 'taqyeem_reviews_head_classes', array( $this, 'review_head_class' ) ); // Alter the Queries add_filter( 'TieLabs/Query/args', array( $this, 'best_reviews_query' ), 10, 2 ); // Alter the Related Posts Query add_filter( 'TieLabs/related_posts_query', array( $this, 'related_posts_query' ) ); // Alter the Check Also box Query add_filter( 'TieLabs/checkalso_query', array( $this, 'checkalso_query' ) ); // Default Widgets Posts Thumb Size add_filter( 'tie_taqyeem_widget_thumb_size', array( $this, 'reviews_thumb_size' ) ); // Allow the Rview Rich Snippet on Pages add_filter( 'TieLabs/is_page_rich_snippet', array( $this, 'rich_snippet_for_page' ) ); // Change the Review Rich Snippet add_filter( 'TieLabs/rich_snippet_schema', array( $this, 'review_rich_snippet' ) ); // Add Best Reviews to the post order option menu. add_filter( 'TieLabs/Options/Related/post_order_args', array( $this, 'posts_order_args' ) ); add_filter( 'TieLabs/Options/Checkalso/post_order_args', array( $this, 'posts_order_args' ) ); add_filter( 'TieLabs/Builder/Block/post_order_args', array( $this, 'posts_order_args' ) ); add_filter( 'TieLabs/Settings/Category/posts_order', array( $this, 'posts_order_args' ) ); add_filter( 'TieLabs/Widget/Slider/post_order_args', array( $this, 'posts_order_args' ) ); add_filter( 'TieLabs/Widget/Posts/post_order_args', array( $this, 'posts_order_args_2' ) ); // Prevent Taqyeem from displaying the review box in the content block in the builder add_action( 'TieLabs/Builder/before', array( $this, 'remove_review_block' ) ); // Replace the old icon classes with the new classes of Font Awesome 5.0 add_filter( 'taqyeem_buttons_icon', array( $this, 'replace_icon_fa5' ) ); } /** * Allow the Rview Rich Snippet on Pages */ function rich_snippet_for_page(){ if( tie_get_postdata( 'taq_review_position' ) ){ return true; } } /** * Change the Review Rich Snippet */ function review_rich_snippet( $schema ){ // Check if the Taqyeem Structured Data is active, current post has review and the Taqyeem version is >= 2.3.0 if( ! taqyeem_get_option( 'structured_data' ) || ! tie_get_postdata( 'taq_review_position' ) || ! function_exists( 'taqyeem_review_get_rich_snippet' ) ){ return $schema; } // Unset some data unset( $schema['articleBody'] ); unset( $schema['articleSection'] ); // Get the Review structure data $review_rich_snippet = taqyeem_review_get_rich_snippet(); if( $review_rich_snippet['@type'] == 'product' ){ $schema = $review_rich_snippet; } else{ // Add the data to the post structure data $schema['@type'] = 'review'; $schema['itemReviewed'] = $review_rich_snippet['itemReviewed']; $schema['reviewBody'] = $review_rich_snippet['reviewBody']; $schema['reviewRating'] = $review_rich_snippet['reviewRating']; } // return the modefied data return $schema; } /** * Change the reviews head box class */ function review_head_class( $class ){ return tie_get_box_class( $class ); } /** * Alter the query for the best reviews */ function best_reviews_query( $args, $block ){ if( ! empty( $block['order'] ) && $block['order'] == 'best' ){ $args['orderby'] = 'meta_value_num'; $args['meta_key'] = 'taq_review_score'; } return $args; } /** * Alter the Related Posts Query */ function related_posts_query( $args ){ if( tie_get_option( 'related_order' ) == 'best' ){ $args['orderby'] = 'meta_value_num'; $args['meta_key'] = 'taq_review_score'; } return $args; } /** * Alter the Check Also Query */ function checkalso_query( $args ){ if( tie_get_option( 'check_also_order' ) == 'best' ){ $args['orderby'] = 'meta_value_num'; $args['meta_key'] = 'taq_review_score'; } return $args; } /** * Add Best Reviews to the post order option menu. */ function posts_order_args( $args ){ $args['best'] = esc_html__( 'Best Reviews', TIELABS_TEXTDOMAIN ); return $args; } /** * Add Best Reviews to the post order option menu. */ function posts_order_args_2( $args ){ $args['standard']['best'] = esc_html__( 'Best Reviews', TIELABS_TEXTDOMAIN ); return $args; } /** * Default Widgets Posts Thumb Size */ function reviews_thumb_size(){ return TIELABS_THEME_SLUG.'-image-small'; } /** * Prevent Taqyeem from displaying the review box in the content block in the builder */ function remove_review_block(){ remove_filter( 'the_content', 'taqyeem_insert_review' ); } /** * Dequeue Scripts and Styles */ function enqueue_scripts(){ wp_dequeue_script( 'taqyeem-main' ); wp_dequeue_style( 'taqyeem-style' ); wp_enqueue_style( 'taqyeem-styles', TIELABS_TEMPLATE_URL.'/assets/css/plugins/taqyeem'. TIELABS_STYLES::is_minified() .'.css', array(), TIELABS_DB_VERSION, 'all' ); if( ! is_admin() ){ wp_dequeue_style( 'taqyeem-fontawesome' ); } } /** * Dequeue Scripts and Styles from admin */ function admin_enqueue_scripts(){ // Don't Load the main Font Awesome file of the theme in the add/edit posts screens, avoid issue with Taqyeem Button which uses v4.0 if( function_exists( 'tie_taqyeem_button_output' ) && get_post_type() ){ wp_dequeue_style( 'tie-fontawesome' ); } } /** * Replace the old icon classes with the new classes of Font Awesome 5.0 */ function replace_icon_fa5( $icon ){ return tie_fa4_to_fa5_value_migration( $icon ); } } // Instantiate the class new TIELABS_TAQYEEM(); } Comparing Online Review Sites for Better Results – Baghdad Time
/** * The template part for displaying the post contents * * This template can be overridden by copying it to your-child-theme/templates/single-post/content.php. * * HOWEVER, on occasion TieLabs will need to update template files and you * will need to copy the new files to your child theme to maintain compatibility. * * @author TieLabs * @version 2.1.0 */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly ?>
/** * Post Head Area * * This template can be overridden by copying it to your-child-theme/templates/single-post/head.php. * * HOWEVER, on occasion TieLabs will need to update template files and you * will need to copy the new files to your child theme to maintain compatibility. * * @author TieLabs * @version 5.0.0 */ defined( 'ABSPATH' ) || exit; // Exit if accessed directly /** * TieLabs/before_post_head hook. * */ do_action( 'TieLabs/before_post_head' ); ?>
Finance

Comparing Online Review Sites for Better Results

Above Article Content Ad

All of us do quite a lot of procuring sight unseen. We like to go to new bars and eating places. We want house restore work performed by an expert and don’t have the slightest thought who to rent.

What can we do?

We go to on-line evaluation websites.

Whether or not it’s buying a brand new product, hiring a brand new service, experiencing a brand new meals or visiting a brand new leisure venue, most individuals don’t wish to put their cash down with out some thought of what they’re stepping into. In order that they flip to on-line critiques. These sometimes supply a rating on a five-point scale that’s calculated from the common buyer ranking, together with buyer feedback.

However how dependable are all these buyer critiques and rankings? The reply is totally different relying on which evaluation web site you employ.

The very fact is that enterprise and product ranking websites will not be themselves rated by anybody, and there are literally thousands of tales informed about how unfavourable rankings disappear from the view of others.

On this publish, we’ll cowl:

What to Contemplate When You Use Ranking Companies

If you happen to’re skeptical about evaluation web sites, nice. That’s the suitable place to start out, as a result of regardless of how respected a rankings service is, there may be alternative for error or abuse. To not point out the wide selection of insurance policies, procedures, and qc.

Listed below are some issues to consider when attempting to find out how a lot to belief buyer critiques and rankings.

  • Are you able to see what number of whole rankings or critiques have been collected? A low variety of buyer critiques will likely be a much less dependable gauge to go on.
  • How clear are insurance policies and procedures? Are you able to simply discover details about privateness insurance policies, how rankings are calculated and different qc?
  • If the evaluation website or service conducts its personal evaluations and doesn’t rely 100% on buyer critiques, are their standards clearly defined?
  • What stage of accountability is there, if any, to encourage sincere, helpful, and correct buyer critiques and rankings? Are there procedures in place to discourage paid reviewers who can tip the dimensions?
  • What’s performed to stop or reduce faux critiques? Is there any type of screening course of?  Do people get entangled, or is every little thing primarily based on algorithms? There’s no agency reply about which is healthier, so that you’ll have to evaluate for your self. Algorithms may be manipulated, however people are, nicely, human.
  • Is there a process for disputing a unfavourable evaluation somebody thinks is unfair or inaccurate?
  • Can clients touch upon posted critiques? Opposite opinions can add context and knowledge – and be considerably of a test on faux or careless critiques.
  • If the evaluation website accepts promoting from the identical companies it charges, does its FAQ part supply transparency about this? Or are you left to wonder if advertisers get most well-liked remedy?

Again to high ↑

Assessing the Ranking Companies: Execs, Cons and What to Know

Right here’s a snapshot of eight on-line evaluation websites and providers that stand out due to recognition, site visitors, longevity or all three. They’re well-established sufficient to have a monitor document and a deep nicely of knowledge. We’ve checked their insurance policies and practices that can assist you use them well.

  What’s rated? Who’s ranking? Good for Good to know
Higher Enterprise Bureau (BBB) Residence providers, legal professionals, auto restore, eating places The BBB and clients Discovering a trusted service supplier in your space Additionally accredits and grades companies
Yelp Virtually any type of enterprise you possibly can consider Clients Insights right into a services or products you are searching for Gives some client providers, too
Amazon Something bought through Amazon Clients Selecting amongst Amazon product choices Additionally critiques from trusted panels referred to as Amazon Vine
Google Taking part distributors Clients See rankings, critiques of merchandise you are contemplating Clients invited to put in writing critiques after buy
Fb Any enterprise with a Fb Enterprise Web page Fb members Information a few enterprise you need to strive Search for the Critiques tab on a enterprise web page
Angi Residence upkeep and restore providers Clients Discovering contractors and providers in your space Was Angie’s Listing and is now not subscription-based
Residence Advisor Taking part house upkeep and restore providers Clients Discovering contractors and providers in your space Set your value and get a listing of leads
Tripadvisor Journey lodging and providers Clients Planning a visit Suggestions are sorted by detailed standards

Higher Enterprise Bureau (BBB)

Lengthy earlier than the invention of the web, even earlier than the Nice Despair of the Nineteen Thirties, the Higher Enterprise Bureau (BBB) supplied details about how American firms carried out in response to the individuals who purchased their services and products. Ultimately, the BBB additionally created an arbitration program to assist resolve client complaints, to the betterment of each shoppers and the businesses serving these shoppers.

The BBB’s primary goal is to accredit companies for a suitable stage of competence and integrity. It has Requirements of Belief and BBB Accreditation Requirements, making it probably the most critical of all ranking providers. Firms can obtain a BBB Accredited Enterprise if it meets the requirements. The BBB specializes typically contractors, legal professionals, auto restore providers and eating places.

What’s rated? Residence development, restore and upkeep providers; legal professionals; auto restore providers; eating places.

Who’s doing the ranking? The BBB and clients who’re registered customers.

The way it works: Search for a selected enterprise or search by the kind of service you’re looking for. Listed companies may have a grade from A+ to F and a BBB accreditation, which requires a background test, compliance with BBB  requirements, and an annual charge. Many even have buyer rankings and critiques.

How BBB handles unfavourable critiques: The BBB kind for submitting a criticism asks for particulars. Does the complainant need to warn others in regards to the unhealthy expertise that they had? Or are they requesting assist resolving a battle? The BBB then seems to be into the criticism and determines whether or not to get entangled. The BBB additionally affords a evaluation course of, engaged on a 5-point scale. The evaluation web page affords the variety of complaints acquired within the final three years, which can be found to be learn. The complaints do want to suit the corporate requirements. The BBB additionally accepts critiques of accredited firms.

Execs: Goes past buyer rankings by accrediting and grading companies. Additionally a clearinghouse for client complaints. Dependable and clear.

Cons: Some companies have a low variety of buyer rankings.

What else to know: As a lot as every other service, the BBB gives probably the most clearly acknowledged system for reviewing firms. The BBB affords no assure of an organization’s service or product, however it serves no different goal however to guard the buyer from making poor selections.

Again to high ↑

Two women look displeased as they have coffee and look at a phone.
Getty Photos

Yelp

Began in 2004, Yelp started as a buyer evaluation website however has grown considerably to supply different client providers. It started publicly buying and selling inventory in 2012.

At the moment, Yelp customers fee companies and may see how these companies have been rated by previous reviewers. Though many alternative firms may be discovered on the positioning, Yelp promotes its critiques for plumbers, eating places, house providers, supply providers and black-owned companies. Yelp has been concerned in dozens of lawsuits alleging the posting of false critiques, each constructive by a enterprise reviewed and unfavourable by opponents of companies, and has fielded complaints that firms paying to promote on Yelp get favored remedy within the type of deleting unfavourable critiques.

What’s rated? Virtually any type of enterprise you possibly can consider.

Who’s doing the ranking? Clients who’re registered customers.

The way it works: Seek for a enterprise and discover a record of suggestions with star rankings and critiques.

How Yelp handles unfavourable critiques: Yelp permits companies to contact shoppers who publish unfavourable critiques, and permits for these critiques to be up to date and sure improved on account of the contact from the enterprise.

Execs: Sufficient site visitors from customers to supply a extra dependable sampling. Huge choice of companies.

Cons: Some complaints about faux critiques, regardless of an algorithm designed to filter them out. Some questions on preferential remedy for advertisers.

What else to know: It’s estimated that Yelp will get 142 million visits a month, both from these posting critiques or these studying critiques. There are roughly 487,500 companies listed on the positioning.

Again to high ↑

Amazon Product Critiques and Scores

Amazon provides clients the chance to fee the objects they buy from its web site, and to learn critiques of things prior to creating a purchase order.

Firms signal as much as have their services and products listed in a search on amazon.com. As soon as an merchandise is bought on account of an Amazon search, the acquisition is requested to fee the product as soon as it’s acquired. Nevertheless, many individuals do the preliminary search on Amazon, then go on to the corporate web site to make the acquisition. The rankings solely exist when the buyer goes to Amazon, clicks on the corporate web page from there, and makes a purchase order.

What’s rated? Something bought through Amazon.

Who’s doing the ranking? Registered members who’ve made a purchase order.

The way it works: Whenever you store on Amazon you’ll see a star ranking and feedback in regards to the merchandise you’re viewing.

How Amazon handles unfavourable critiques: To Amazon’s credit score, it gives an intensive record of do’s and don’ts for its buyer critiques. Amazon says it’s going to take away any evaluation, both constructive or unfavourable, whether it is judged to be from an occasion, whether or not that be somebody within the make use of of the corporate whose product is being reviewed, or within the make use of of a competitor.

Execs: Large viewers means a extra dependable sampling. Has insurance policies to discourage deceptive or manipulative critiques. Additionally affords Amazon Vine critiques from trusted panels.

Cons: Large viewers additionally means extra alternative for abuse. Regardless of efforts, faux or paid critiques nonetheless slip by means of.

What else to know: If patrons search on Amazon then buy from the seller web site, their rankings gained’t be counted.

Again to high ↑

A woman unboxes things she bought online.
Getty Photos

Google Buyer Critiques and Product Scores

When a enterprise creates a Google Service provider account, it has the choice of collaborating in Google Buyer Critiques and Google Product Scores. The Google buyer evaluation seems on the enterprise’s web site after a purchase order is made.

Whenever you make a purchase order by means of an organization that’s aligned with the Google evaluation program, you’re given the prospect to opt-in to the evaluation program. When you try this, you’ll obtain an e-mail a number of days after your order with directions on find out how to evaluation the services or products you bought. The evaluation course of is designed to think about the whole buying course of. If you happen to used your private Google account data within the course of of constructing your buy from Google, all of your public Google account data will likely be revealed. Customers can then go into the person critiques and delete them if you want.

What’s rated? Services or products from companies that take part in this system.

Who’s doing the ranking? Registered clients who’ve made a purchase order.

The way it works: If you happen to store on the Google Procuring website or on a enterprise website that’s a part of the Google Service provider program, you’ll see Google critiques and star rankings there.
How Google handles unfavourable critiques: Google retailers are allowed to work together with reviewers, who can solely depart critiques if they supply their e-mail deal with. Google has a nine-point customary for inappropriate critiques, however relies upon upon the service provider to seek out such critiques and report them. Google might select NOT to take away a evaluation if it doesn’t violate one in all its requirements, wherein case it encourages retailers to reply on to the buyer to debate the issue.

Execs: Designed to think about the whole buying course of. Reviewers are invited to put in writing a evaluation after making a purchase order, can’t be nameless, and are requested to adjust to requirements.

Cons: Complaints from retailers that they haven’t any recourse once they really feel critiques are unfair.
What else to know: Pushed by algorithms. Google has a nine-point customary for inappropriate critiques, however will depend on retailers to report them.

Again to high ↑

Fb Enterprise Web page Suggestions

In 2018, Fb modified its “enterprise critiques” system to “enterprise suggestions,” hoping to keep away from the battle concerning faux critiques and unfavourable critiques.

Fb Enterprise Web page Suggestions kicks in when somebody visits a Fb enterprise web page and clicks on the Critiques periods, the place guests can click on a “do you advocate?” sure/no button. The responses are compiled right into a ranking rating much like what was provided below the earlier system, and rankings are calculated utilizing earlier responses.

What’s rated? Any enterprise with a Fb Enterprise Web page.

Who’s doing the ranking? Any registered Fb consumer who visits a Enterprise Web page.

The way it works: Discover a mean star ranking together with feedback and photographs on the “critiques” space of a Enterprise Web page.
How Fb handles unfavourable critiques: It doesn’t. Fb Critiques can’t be eliminated. The one approach an organization can take away a foul evaluation is to show off the Critiques operate on its firm web page.

Execs: Straightforward to have interaction with the enterprise and different reviewers. Not nameless, which discourages faux critiques.

Cons: Critiques aren’t vetted or managed. No simple solution to know if a evaluation is genuine. Not all pages have a excessive quantity of exercise.
What else to know: Fb has 2.89 million month-to-month customers, and Fb estimates that one in all three Fb customers go to firm pages to seek out services and products.  

Again to high ↑

A plumber fixes underneath a kitchen sink
Getty Photos

Angi

Angi, previously referred to as Angie’s Listing, was created in 1995 to supply rankings and proposals for house and garden upkeep and restore professionals. Initially designed as a subscription service, it’s now free to the general public.

Plumbing, handyman, garden care, roofing, electrical and reworking are the matters Angi affords on its web site entrance web page, however you possibly can seek for different house service matters as nicely. Any work performed across the house that you’re keen to pay somebody to do is roofed right here. Contractors can get listed on Angi without cost, however they pay a charge for each job lead they obtain. Shoppers can enter details about the job they need to rent somebody for and get a listing of companies; once they click on on a enterprise, these companies get data to contact them and supply a quote.

What’s rated? Residence upkeep and restore providers.

Who’s doing the ranking? Clients who’re registered customers.

The way it works: Enter data in regards to the job you need performed and get a listing of companies, with star rankings and critiques. Companies get data about find out how to contact you.

How Angi handles unfavourable critiques: In keeping with the Angi web site, no buyer critiques are posted till they’re reviewed both by means of an algorithm or by human eyes. Firms listed on Angi can not take away unfavourable critiques that get posted, though they’ll contact clients who publish unfavourable critiques with the intention to right conflicts.

Execs: Detailed rankings primarily based on standards corresponding to value, responsiveness, and professionalism. Buyer critiques are vetted. One of many first nationwide house service suggestion websites.

Cons: Since you should present contact data, you could possibly get plenty of calls, texts and emails from companies replying to your question.
What else to know: As Angie’s Listing, Angi was one of many first nationwide house service suggestion web sites.

Again to high ↑

HomeAdvisor

Previously referred to as ServiceMagic, HomeAdvisor was created in 1998, however finally was bought by the identical firm that owns Angi.

HomeAdvisor gives shoppers with suggestions for house upkeep and restore providers. Contractors pay a charge (roughly $300 per yr) to be listed and pay a charge for each job lead that’s generated. For shoppers, HomeAdvisor affords a fixed-price device: You set the value to your job on the outset. That provide is shared with its group of execs, and anybody keen to do the job for that value will contact you. HomeAdvisor additionally gives video tutorials on sure jobs in addition to a True Value Information, which estimates how a lot a mission ought to price.

What’s rated? Residence upkeep and restore providers.

Who’s doing the ranking? Clients who’re registered customers.

The way it works: Set a value for the job you need performed and get a listing of firms, every with star rankings and critiques.

How HomeAdvisor handles unfavourable critiques: Right here is the place Residence Advisor stands out. It posts an e-mail deal with — [email protected] — for buyer complaints. These complaints are learn by people and a decision is between buyer and the corporate earlier than that unfavourable evaluation is posted. HomeAdvisor says an organization receiving frequent complaints can and will likely be faraway from its record of succesful professionals.

Execs: Value estimator and how-to home-repair movies. Good coverage for dealing with buyer complaints. Firms with frequent complaints are eliminated.

Cons: Contains solely companies that pay to be listed, which might restrict your choice.

What else to know: The Higher Enterprise Bureau provides HomeAdvisor a ranking of two.95 stars out of 5, however complaints come primarily from companies who enroll with HomeAdvisor saying that leads don’t pan out sufficient to pay for the service. There are few complaints from shoppers.

Again to high ↑

A man types on his phone underwater.
Getty Photos

Tripadvisor

Tripadvisor, created in 2000, is a journey lodging rankings and reserving service.

Tripadvisor affords critiques of resorts, trip leases, and eating places and rankings for airways, automotive rental firms, cruise strains and different travel-related companies. It additionally suggests actions at your vacation spot.Tripadvisor doesn’t solicit companies to look on its website, nor does it cost for showing on the positioning. Tripadvisor additionally affords reserving providers to the entire journey lodging it has listed on its website.

What’s rated? Journey lodging and providers: resorts, trip leases, eating places, airways, automotive rental firms, cruise strains and extra.

Who’s doing the ranking? Clients who’re registered customers.

The way it works: Enter your vacation spot and search standards to get suggestions with star rankings and critiques.

How Tripadvisor handles unfavourable evaluation:  Tripadvisor encourages companies to contact clients who’re sad with their journey expertise.  

Execs: Detailed rankings and proposals primarily based on standards corresponding to cleanliness, finest worth, value and extra. Transparency about insurance policies and practices. A system for discouraging faux critiques. At 860 million critiques, an intensive database.

Cons: Not many. Most complaints contain the reserving providers it affords, not the ranking providers.

What else to know: Tripadvisor has 860 million critiques of 8.7 million journey lodging. It claims 463 million guests per 30 days.

Kent McDill is a veteran journalist who has specialised in private finance matters since 2013. He’s a contributor to The BaghdadTime.




Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *