Giter Site home page Giter Site logo

pronamic / wp-pronamic-reviews-ratings Goto Github PK

View Code? Open in Web Editor NEW
2.0 6.0 1.0 668 KB

The Pronamic Reviews Ratings plugin for WordPress is a powerful, extendable reviews and ratings plugin.

Home Page: https://www.pronamic.eu/plugins/pronamic-reviews-ratings/

JavaScript 11.03% PHP 88.70% SCSS 0.27%
pronamic wordpress wordpress-plugin review reviews rating ratings rating-stars

wp-pronamic-reviews-ratings's Introduction

The Pronamic Reviews Ratings plugin for WordPress is a powerful, extendable reviews and ratings plugin.

Register Rating Type

<?php

function prefix_reviews_ratings_init() {
	pronamic_register_rating_type( 'trustworthy', __( 'Trustworthy', 'text_domain' ) );
	pronamic_register_rating_type( 'objective', __( 'Objective', 'text_domain' ) );
	pronamic_register_rating_type( 'complete', __( 'Complete', 'text_domain' ) );
	pronamic_register_rating_type( 'well_written', __( 'Well-written', 'text_domain' ) );
}

add_action( 'pronamic_reviews_ratings_init', 'prefix_reviews_ratings_init' );

Post Type Support

<?php

function prefix_reviews_ratings_init() {
	add_post_type_support( 'page', 'pronamic_ratings' );
}

add_action( 'pronamic_reviews_ratings_init', 'prefix_reviews_ratings_init' );

Post Type Rating Types Support

<?php

function prefix_init() {
	register_post_type( 'book', array(
		'public'                => true,
		'label'                 => __( 'Books', 'text_domain' ),
		'pronamic_rating_types' => array(
			'trustworthy',
			'objective',
			'complete',
			'well_written',
		),
	) );

	register_post_type( 'magazine', array(
		'public'                => true,
		'label'                 => __( 'Magazines', 'text_domain' ),
		'pronamic_rating_types' => array(
			'trustworthy',
			'well_written',
		),
	) );
}

add_action( 'init', 'prefix_init' );

Reviews Ratings Scores

<?php

function prefix_pronamic_reviews_ratings_scores( $scores ) {
	$scores = array( 10, 8, 6, 4, 2 );

	return $scores;
}

add_filter( 'pronamic_reviews_ratings_scores', 'prefix_pronamic_reviews_ratings_scores' );

Metadata

All the rating values are stored as meta data with the WordPress metadata API.

_pronamic_rating_value_$name
_pronamic_rating_count_$name

Schema.org

Tools for testing Schema.org markup

WooCommerce Reviews and Ratings solution

Other WordPress Reviews and Ratings solutions

JavaScript solutions

wp-pronamic-reviews-ratings's People

Contributors

colin-feringa avatar jelkeboonstra avatar remcotolsma avatar rvdsteege avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

dexit

wp-pronamic-reviews-ratings's Issues

Blok 'Star ratings' toont onjuiste waarde op front-end op product-pagina

Als het blokje 'Star rating' wordt toegevoegd aan een pagina en een review type heeft geselecteerd toont deze een 'gemiddelde beoordeling'. Echter is dit (vermoedelijk) de gemiddelde beoordeling van dat hele onderdeel en niet alleen de waarde van het bewuste product.

In de structured data van het bewuste product staat wel de juiste waarde.

Schermafbeelding 2022-05-04 om 12 36 10

Blok 'Star ratings' optie 'Show text' corrigeren

Bij het 'Star ratings' blok kan worden aangegeven of de tekst wel/niet moet worden getoond.

Als de optie 'Show text' staat uit gevinkt moet deze ook daadwerkelijk geen tekst tonen.
Zodra deze is aan gevinkt staat, moet de default tekst worden getoond, die overschreven kan worden.

Schermafbeelding 2022-05-04 om 12 40 31

Filteren op custom taxonomie niet mogelijk met Query Loop-blok

We hadden bedacht om de reviews op bijvoorbeeld de pagina van een product te gaan tonen m.b.v. het Query Loop-blok. Om de reviews voor dat specifieke product op te vragen (waarvan de post ID in de meta van reviews wordt bewaard als _pronamic_review_product_id), loop ik eigenlijk tegen een beperking van het Query Loop-blok aan. De filters zijn namelijk beperkt (categorie, tags, auteur, zoekwoord):

query-loop-filters

Ik heb het nu zo gemaakt dat de standaard taxonomie voor categorieën wordt gebruikt (slug = product post ID, naam = product post titel), maar mooier zou zijn als we een custom taxonomie kunnen gebruiken of de waarde uit de meta. Dat is echter (nog) niet mogelijk, blijkt ook uit een open issue in WordPress/gutenberg:

#34977 Query Loop: Add custom taxonomies to the Filters options

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.