Support » Plugin: Rich Reviews by Starfish » Plugin not supported; open to malware – uninstall now!

Viewing 4 replies - 1 through 4 (of 4 total)
  • the9mm

    (@the9mm)

    I am not using an alternative plugin. I have instead decided to adopt a custom approach using custom post types, a custom taxonomy, and advanced custom fields.

    Here’s what I did:

    1. Defined a custom post type & taxonomy for reviews. They look like this in the child theme functions.php:

    // Register Rich Review Custom Post Type
    function rich_review() {
    
    	$labels = array(
    		'name'                  => _x( 'Reviews', 'Post Type General Name', 'text_domain' ),
    		'singular_name'         => _x( 'Review', 'Post Type Singular Name', 'text_domain' ),
    		'menu_name'             => __( 'Reviews', 'text_domain' ),
    		'name_admin_bar'        => __( 'Reviews', 'text_domain' ),
    		'archives'              => __( 'Review Archives', 'text_domain' ),
    		'attributes'            => __( 'Review Attributes', 'text_domain' ),
    		'parent_item_colon'     => __( 'Parent Item:', 'text_domain' ),
    		'all_items'             => __( 'All Items', 'text_domain' ),
    		'add_new_item'          => __( 'Add New Item', 'text_domain' ),
    		'add_new'               => __( 'Add New', 'text_domain' ),
    		'new_item'              => __( 'New Item', 'text_domain' ),
    		'edit_item'             => __( 'Edit Item', 'text_domain' ),
    		'update_item'           => __( 'Update Item', 'text_domain' ),
    		'view_item'             => __( 'View Item', 'text_domain' ),
    		'view_items'            => __( 'View Items', 'text_domain' ),
    		'search_items'          => __( 'Search Item', 'text_domain' ),
    		'not_found'             => __( 'Not found', 'text_domain' ),
    		'not_found_in_trash'    => __( 'Not found in Trash', 'text_domain' ),
    		'featured_image'        => __( 'Featured Image', 'text_domain' ),
    		'set_featured_image'    => __( 'Set featured image', 'text_domain' ),
    		'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),
    		'use_featured_image'    => __( 'Use as featured image', 'text_domain' ),
    		'insert_into_item'      => __( 'Insert into item', 'text_domain' ),
    		'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),
    		'items_list'            => __( 'Items list', 'text_domain' ),
    		'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),
    		'filter_items_list'     => __( 'Filter items list', 'text_domain' ),
    	);
    	$args = array(
    		'label'                 => __( 'Review', 'text_domain' ),
    		'description'           => __( 'Rich reviews', 'text_domain' ),
    		'labels'                => $labels,
    		'supports'              => array( 'title', 'editor' ),
    		'taxonomies'            => 'rich_review_tax',
    		'hierarchical'          => false,
    		'public'                => false,
    		'show_ui'               => true,
    		'show_in_menu'          => true,
    		'menu_position'         => 5,
    		'show_in_admin_bar'     => true,
    		'show_in_nav_menus'     => true,
    		'can_export'            => true,
    		'has_archive'           => true,
    		'exclude_from_search'   => false,
    		'publicly_queryable'    => true,
    		'capability_type'       => 'page',
    	);
    	register_post_type( 'reviews', $args );
    
    }
    add_action( 'init', 'rich_review', 0 );
    
    // Register Custom Taxonomy
    function rich_review_tax() {
    
    	$labels = array(
    		'name'                       => _x( 'Review Category/Source', 'Taxonomy General Name', 'text_domain' ),
    		'singular_name'              => _x( 'Review', 'Taxonomy Singular Name', 'text_domain' ),
    		'menu_name'                  => __( 'Review Category/Source', 'text_domain' ),
    		'all_items'                  => __( 'All Items', 'text_domain' ),
    		'parent_item'                => __( 'Parent Item', 'text_domain' ),
    		'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),
    		'new_item_name'              => __( 'New Item Name', 'text_domain' ),
    		'add_new_item'               => __( 'Add New Item', 'text_domain' ),
    		'edit_item'                  => __( 'Edit Item', 'text_domain' ),
    		'update_item'                => __( 'Update Item', 'text_domain' ),
    		'view_item'                  => __( 'View Item', 'text_domain' ),
    		'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
    		'add_or_remove_items'        => __( 'Add or remove items', 'text_domain' ),
    		'choose_from_most_used'      => __( 'Choose from the most used', 'text_domain' ),
    		'popular_items'              => __( 'Popular Items', 'text_domain' ),
    		'search_items'               => __( 'Search Items', 'text_domain' ),
    		'not_found'                  => __( 'Not Found', 'text_domain' ),
    		'no_terms'                   => __( 'No items', 'text_domain' ),
    		'items_list'                 => __( 'Items list', 'text_domain' ),
    		'items_list_navigation'      => __( 'Items list navigation', 'text_domain' ),
    	);
    	$args = array(
    		'labels'                     => $labels,
    		'hierarchical'               => true,
    		'public'                     => false,
    		'show_ui'                    => true,
    		'show_admin_column'          => true,
    		'show_in_nav_menus'          => true,
    		'show_tagcloud'              => true,
    	);
    	register_taxonomy( 'rich_review_tax', array( 'reviews' ), $args );
    
    }
    add_action( 'init', 'rich_review_tax', 0 );

    2. Set up some special fields using advanced custom fields for “star rating” and other items I wanted to appear on my reviews. I’ve set up fields for “reviewer name” (reviewer_name) and “star rating” (star_rating).
    3. Created a bit of shortcode to print my reviews with the necessary inline schema which will create rich snippets. It looks like this:

    // Shortcode for Reviews
      function reviews_shortcode( $atts ) {
        		$args = array(
                'post_type' => 'reviews',
                'post_status' => 'publish',
    			'orderby' => 'rand',
    			'order' => 'desc',
    			'posts_per_page' => 10,
            );
    			$query = new WP_Query( $args );
      ob_start();
      while ( $query->have_posts() ) : $query->the_post();
           echo '<article id="post-';
    	  the_ID();
    	  echo '"';
    	  post_class();
            echo ' class="reviews" itemscope itemtype="https://schema.org/Review"><div itemprop="itemReviewed" itemscope itemtype="https://schema.org/LocalBusiness">';
    	  echo '<div class="hidden"><img itemprop="image" src="https://www.urltocompanylogo.com/logo.png" alt="Company Logo"/>
        <span itemprop="name">Company name/span>
        <span itemprop="telephone">Phone number of company</span>
        <span itemprop="address">Address of company</span>
    	<span itemprop="priceRange">$$</span></div>';
    	  echo '<a href="';
    	  the_permalink();
    	  echo '" title="';
            the_title();
    	  echo '">';
            echo '</a></div><div class="review-content"><header class="entry-header review-header"><h4 class="entry-title review-title"><a href="';
    	  the_permalink();
            echo '" rel="bookmark">';
    	  the_title();
    	  echo '</a></h4></header><div class="starrating" itemprop="reviewRating" itemscope itemtype="https://schema.org/Rating">Star Rating: <span itemprop="ratingValue">';
    	  the_field('star_rating');  
    	  echo '</span> of <span itemprop="bestRating">5</span></div><div class="revieww-content" itemprop="reviewBody">';
    	  the_content();
    	  echo '</div><div class="author" itemprop="author" itemscope itemtype="https://schema.org/Person">– <span itemprop="name">';
    	  the_field('reviewer_name');
    	  echo'</span></div></div></article>';
      endwhile;
     wp_reset_postdata();
     return ob_get_clean();
    }
    add_shortcode('reviews', 'reviews_shortcode');

    The particular code I wrote displays 10 reviews at random, but you can change it to display all reviews, more reviews, in ascending order or descending order. It also requires an addition of some small css in style.css to make sure the company info doesn’t print on the front end with every review (but is still visible to Google and other crawlers):

    .hidden {
    display: none;
    }

    You’ll likely have to do some other styling to make it look as you want it to.

    I’m sure there are better/different ways to go about this – such as using get_template_part or using the WP taxonomy for theme files if you want a dedicated reviews page, but I just needed some shortcode I could call from anywhere.

    Hope this helps you folks a bit!

    Plugin Contributor Nuanced Media

    (@nuanced-media)

    Hi all,
    We’ve been working on an overall rewrite of this plugin for a while now, but someone out there apparently wanted us to work faster on it, and decided to exploit our plugin to get some malware out there. We’re now going double-quick on it, and hope to have it back up (and newly cozy and secure) within the next two weeks.

    the9mm

    (@the9mm)

    Thanks Nuanced Media! Hope to see the plugin back on the repository soon.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    To other people posting here: If you need support then per the forum guidelines please start your own topic.

    https://wordpress.org/support/forum-user-guide/faq/#i-have-the-same-problem-can-i-just-reply-to-someone-elses-post-with-me-too

    You can do so here.

    https://wordpress.org/support/plugin/rich-reviews/#new-post

    If you need to delouse your hacked system:

    Please remain calm and give this a good read.

    https://wordpress.org/support/article/faq-my-site-was-hacked/

    When you have successfully deloused your site then consider giving this a read too.

    https://wordpress.org/support/article/hardening-wordpress/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Plugin not supported; open to malware – uninstall now!’ is closed to new replies.