Git Product home page Git Product logo

oc-reviews-plugin's Introduction

Review plugin for OctoberCMS

Build Status Codacy License

Show reviews, ratings or testimonials of your customers. No other plugin dependency. Tested with latest OctoberCMS build 389.

  • reviews management with sort order and bulk actions
  • rating by stars, sorting to categories
  • component build with HTML5 markup using <figure> and <cite>
  • internal methods for creating new reviews, get approved reviews etc.

Show reviews

Just place component Reviews to your page.

[reviews]
==
{% if reviews is not empty %}
<div class="reviews">
    <h3>What our customers say about us?</h3>
    <div class="stories">
        {% component 'reviews' %}
    </div>
</div>
{% endif %}

Dependencies

This plugin using https://fontawesome.com/ classes to show stars at Reviews front-end component. You have to include this library or override Reviews component to use your own icons.

Public facade

You can use plugin's facade vojtasvoboda.reviews.facade with this public methods:

$facade = App::make('vojtasvoboda.reviews.facade');
$facade->storeReview(array $data);
$facade->getApprovedReviews();
$facede->getNonApprovedReviews();
$facade->findOne($value, $key);

When using storeReview, check Review validation rules has to be satisfied.

TODO

  • frontend form for adding new review
  • config for stars order (ltr, rtl)
  • config for number of stars
  • avarage reviews graph (above the reviews listing)
  • graph of non approved reviews
  • email when new review created and needs to be approved

Contributing

Please send Pull Request to the master branch.

License

Reviews plugin is open-sourced software licensed under the MIT license same as OctoberCMS platform.

oc-reviews-plugin's People

Contributors

vojtasvoboda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

oc-reviews-plugin's Issues

Star rating field is not always displayed on OSMS v3

The rating field is not displayed when going to the create/update review backend controller page. It only appears after the page is reloaded. The problem occurs when turbo router is enabled in the backend configuration.

Tested on Google Chrome Latest, October CMS 3.0.76
Снимок экрана 2023-01-18 в 20 59 46

Where are the icons coming from?

The plugin uses .icon, .star-icon, and .star-icon-empty classes but I don't have these in my theme. Can you tell me where to get these icons?

Feedback form

Hi, vojtasvoboda.

Please help with the form, I can not even take it from the reservation plugin.
I do not know how plugins are made.
And with this complexity.

Thanks.

Need a Frontend form for collecting Client Reviews.

If you can have a component to collect reviews from the visitors of the website and let the review appear after approval. If this facility is provided this review system will be flawless and will be a big hit.

We can even make or add an option of reviews collected from different pages. Just an value addition to this.

Error in backend area

Hello! When i try to create new review in /backend/vojtasvoboda/reviews/reviews/create
there is SystemException in /modules/system/traits/ViewMaker.php line 65 with message
"The partial '_field_starrating.htm' is not found.".
If i comment this lines:
if (!File::exists($partialPath)) {
if ($throwException) {
throw new SystemException(Lang::get('backend::lang.partial.not_found_name', ['name' => $partialPath]));
}
else {
return false;
}
}

than new review is opened but without stars area. System build is 365.
Did you have such problem?
Also review is saved in DB, but not render in frontend. The piece of code is the same as plugin documentation.
Thanks for reply and mary Christmas!

Getting error page.

Hi I have just installed your plugin and so far its seems to have installed correctly and I am able to create a review and add the component to the page correctly, however, I am getting the error page when loading the /reviews page.

I looked in the logs and I am getting this error exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'syntax error, unexpected '<', expecting function (T_FUNCTION)' in /home/account/mydomain.org/mydomain/storage/cms/cache/54/34/reviews.htm.php:4

Please advise. Thanks

Cannot update to version 1.0.6.

I'm still using version 473 of OctoberCMS and I'm using the Review plugin version 1.0.5.

Now I have seen that there is an update available to version 1.0.6.

When I try to update the plugin in the backend > System > Updates everything runs as expected at first.

A progress indicator shows that data is being downloaded. Also the message "Update successful" appears.

Unfortunately, however, I see that when I click on "Check updates" the same update is available over and over again.

How do I insert data / add a review from a form?

Trying to insert data using a form. The following works in the sense that I can see the inserted variables after the form is submitted, but I'm getting an error upon submitting (which I cannot see with my current setup) unless I comment out the line with $reviews->storeReview:

function test_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}

function onStart() {
    $reviews = App::make('vojtasvoboda.reviews.facade');
    $this["reviews"] = $reviews->getApprovedReviews();
    
    if (isset($_POST["rating"]) && $_POST["rating"] != ""){
        $rating = (int)$_POST["rating"];
        if (is_int($rating) && $rating >= 0 && $rating <= 5)
            $this["rating"] = $rating;
    }
    if (isset($_POST["name"]) && $_POST["name"] != ""){
        $this["name"] = $_POST["name"];
    }
    if (isset($_POST["title"]) && $_POST["title"] != ""){
        $this["title"] = $_POST["title"];
    }
    if (isset($_POST["content"]) && $_POST["content"] != ""){
        $this["content"] = $_POST["content"];
    }    
    if (isset($_POST["email"])){
        $email = $this->test_input($_POST["email"]);
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
          $emailErr = "Invalid email format";
        }
        if (!isset($emailErr)) $this['email'] = $email;                
    }
    if (!isset($emailErr) && isset($this["email"]) && isset($this["name"]) && isset($this["title"]) && isset($this["rating"]) && isset($this["content"])){
       $reviews->storeReview(["name" => $this["name"], "email" => $this["email"], "rating" => $this["rating"], "title" => $this["title"], "content" => $this["content"]]);
        
    }

}

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.