Version Description
- Dropped import support for old gd star
Download this release
Release Info
Developer | Dudo |
Plugin | Yasr – Yet Another Stars Rating |
Version | 1.3.9 |
Comparing to | |
See all releases |
Code changes from version 1.3.8 to 1.3.9
- css/yasr-admin.css +0 -13
- lib/yasr-ajax-functions.php +0 -149
- lib/yasr-db-functions.php +1 -0
- lib/yasr-functions.php +2 -2
- lib/yasr-settings-functions.php +0 -299
- readme.txt +5 -8
- yasr-settings-page.php +0 -69
- yet-another-stars-rating.php +2 -2
css/yasr-admin.css
CHANGED
@@ -391,19 +391,6 @@ div.bigstars .rateit-selected
|
|
391 |
}
|
392 |
|
393 |
|
394 |
-
/*** Rules for import data from gd star rating ***/
|
395 |
-
|
396 |
-
.yasr-result-step-1{
|
397 |
-
padding-left: 25px;
|
398 |
-
padding-top: 10px;
|
399 |
-
}
|
400 |
-
|
401 |
-
.yasr-result-step-2{
|
402 |
-
padding-left: 45px;
|
403 |
-
}
|
404 |
-
|
405 |
-
/*** End rules import gd star data ***/
|
406 |
-
|
407 |
|
408 |
/*** Rules for Multi set page ***/
|
409 |
|
391 |
}
|
392 |
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
|
395 |
/*** Rules for Multi set page ***/
|
396 |
|
lib/yasr-ajax-functions.php
CHANGED
@@ -611,155 +611,6 @@ if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // E
|
|
611 |
|
612 |
|
613 |
|
614 |
-
/********* IMPORT FUNCTIONS *********/
|
615 |
-
|
616 |
-
add_action( 'plugins_loaded', 'add_action_import_gdstar_1' );
|
617 |
-
|
618 |
-
function add_action_import_gdstar_1() {
|
619 |
-
if ( current_user_can( 'manage_options' ) ) {
|
620 |
-
add_action( 'wp_ajax_yasr_import_step1', 'yasr_import_step1_callback' );
|
621 |
-
}
|
622 |
-
}
|
623 |
-
|
624 |
-
function yasr_import_step1_callback () {
|
625 |
-
|
626 |
-
//Since version 0.05 for pro and 0.6.5 for lite
|
627 |
-
$gdsr_logs_imported = get_option('yasr-gdstar-logs-imported');
|
628 |
-
|
629 |
-
if (!$gdsr_logs_imported) {
|
630 |
-
|
631 |
-
//Import logs from GD star
|
632 |
-
$logs = yasr_import_gdstar_logs();
|
633 |
-
|
634 |
-
//Insert logs if exists
|
635 |
-
$insert_logs = yasr_insert_gdstar_logs($logs);
|
636 |
-
|
637 |
-
if ($insert_logs) {
|
638 |
-
update_option('yasr-gdstar-logs-imported', '1');
|
639 |
-
}
|
640 |
-
|
641 |
-
}
|
642 |
-
|
643 |
-
//Import reviews from GD star
|
644 |
-
$reviews=yasr_import_gdstar_data();
|
645 |
-
|
646 |
-
//Insert GD star review in yasr votes table
|
647 |
-
$check_query_success = yasr_insert_gdstar_data($reviews);
|
648 |
-
|
649 |
-
?>
|
650 |
-
|
651 |
-
<div class="yasr-result-step-1">
|
652 |
-
<?php
|
653 |
-
if ($check_query_success) {
|
654 |
-
_e( "Reviews and Visitor Votes have been successfull imported.", 'yet-another-stars-rating');
|
655 |
-
|
656 |
-
update_option('yasr-gdstar-imported', '1');
|
657 |
-
|
658 |
-
?>
|
659 |
-
<br />
|
660 |
-
<?php _e ("Step2: I will check if you used Multiple Sets and if so I will import them. THIS MAY TAKE A WHILE!", 'yet-another-stars-rating'); ?>
|
661 |
-
<br />
|
662 |
-
<button href="#" class="button-primary" id="import-button-step2"> <?php _e('Proceed Step 2', 'yet-another-stars-rating');?> </button>
|
663 |
-
<span id="yasr-loader-importer2" style="display:none;" > <img src="<?php echo YASR_IMG_DIR . "loader.gif" ?>">
|
664 |
-
</span>
|
665 |
-
<?php
|
666 |
-
}
|
667 |
-
|
668 |
-
else {
|
669 |
-
_e( "Something goes wrong! Refresh the page and try again!", 'yet-another-stars-rating');
|
670 |
-
}
|
671 |
-
|
672 |
-
?>
|
673 |
-
|
674 |
-
</div>
|
675 |
-
|
676 |
-
<?php
|
677 |
-
|
678 |
-
die ();
|
679 |
-
} //End import step 1
|
680 |
-
|
681 |
-
|
682 |
-
add_action( 'plugins_loaded', 'add_action_import_gdstar_2' );
|
683 |
-
|
684 |
-
function add_action_import_gdstar_2() {
|
685 |
-
if ( current_user_can( 'manage_options' ) ) {
|
686 |
-
add_action( 'wp_ajax_yasr_import_multi_set', 'yasr_check_import_set_callback' );
|
687 |
-
}
|
688 |
-
}
|
689 |
-
|
690 |
-
function yasr_check_import_set_callback () {
|
691 |
-
$multi_set_names=yasr_import_gdstar_multi_set();
|
692 |
-
|
693 |
-
echo "<div class=\"yasr-result-step-2\">";
|
694 |
-
|
695 |
-
//If multiple set are found
|
696 |
-
if($multi_set_names) {
|
697 |
-
echo "<br /><strong>";
|
698 |
-
_e("I've found Multiple Set! Importing..." , 'yet-another-stars-rating');
|
699 |
-
echo "</strong><br />";
|
700 |
-
|
701 |
-
//If multi set are found write in yasr_multi_set table
|
702 |
-
$insert_multi_set=yasr_insert_gdstar_multi_set($multi_set_names);
|
703 |
-
|
704 |
-
//If insert succes, go ahed
|
705 |
-
if ($insert_multi_set) {
|
706 |
-
echo " ";
|
707 |
-
_e("Multi Set's name has been successfull imported.", 'yet-another-stars-rating');
|
708 |
-
echo "<br /><strong>";
|
709 |
-
_e("Now I'm going to import Multi Set data", 'yet-another-stars-rating');
|
710 |
-
echo "</strong> <br />";
|
711 |
-
|
712 |
-
//Import multiple set's values from GD star rating
|
713 |
-
$multi_data=yasr_import_gdstar_multi_value();
|
714 |
-
|
715 |
-
//If set values are found, insert Gd Star multi values in yasr_multi_values
|
716 |
-
if($multi_data) {
|
717 |
-
$insert_multidata=yasr_insert_gdstar_multi_value($multi_data);
|
718 |
-
if ($insert_multidata) {
|
719 |
-
echo " ";
|
720 |
-
_e( "All votes has been successfull imported.", 'yet-another-stars-rating');
|
721 |
-
echo "<br />";
|
722 |
-
echo "<button href=\"#\" class=\"button-delete\" id=\"end-import\">" . __('Done', 'yet-another-stars-rating') . "</button>";
|
723 |
-
|
724 |
-
}
|
725 |
-
else {
|
726 |
-
echo " ";
|
727 |
-
_e("I've found Multiple Set's votes but I couldn't insert into db", 'yet-another-stars-rating');
|
728 |
-
echo "<br />";
|
729 |
-
}
|
730 |
-
} //End if $multi_data
|
731 |
-
|
732 |
-
//Multiple set are found, but there is not data
|
733 |
-
else {
|
734 |
-
echo " ";
|
735 |
-
_e( "I've found Multi Set but with no data", 'yet-another-stars-rating');
|
736 |
-
echo "<br />";
|
737 |
-
}
|
738 |
-
|
739 |
-
} //End if $insert_multi_set
|
740 |
-
|
741 |
-
//Query failed insert set name
|
742 |
-
else {
|
743 |
-
echo " ";
|
744 |
-
_e("I've found Multi Sets names but I couldn't insert into db", 'yet-another-stars-rating');
|
745 |
-
echo "<br />";
|
746 |
-
}
|
747 |
-
|
748 |
-
} //End if $multi_set_names
|
749 |
-
|
750 |
-
else {
|
751 |
-
echo " ";
|
752 |
-
_e ("Multisets were not found. Imported is done!", 'yet-another-stars-rating');
|
753 |
-
}
|
754 |
-
|
755 |
-
echo "</div>";
|
756 |
-
|
757 |
-
die ();
|
758 |
-
|
759 |
-
} //End function
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
|
764 |
/****** Display recent votes on dashboard, called from function yasr_display_dashboard_log_wiget,
|
765 |
declared on yasr-db-function ******/
|
611 |
|
612 |
|
613 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
|
615 |
/****** Display recent votes on dashboard, called from function yasr_display_dashboard_log_wiget,
|
616 |
declared on yasr-db-function ******/
|
lib/yasr-db-functions.php
CHANGED
@@ -305,6 +305,7 @@ function yasr_get_multi_set_visitor ($post_id, $set_type) {
|
|
305 |
|
306 |
/****** Get visitor votes ******/
|
307 |
function yasr_get_visitor_votes ($post_id=FALSE, $create_transient=TRUE) {
|
|
|
308 |
global $wpdb;
|
309 |
|
310 |
//if values it's not passed get the post id, most of cases and default one
|
305 |
|
306 |
/****** Get visitor votes ******/
|
307 |
function yasr_get_visitor_votes ($post_id=FALSE, $create_transient=TRUE) {
|
308 |
+
|
309 |
global $wpdb;
|
310 |
|
311 |
//if values it's not passed get the post id, most of cases and default one
|
lib/yasr-functions.php
CHANGED
@@ -422,7 +422,7 @@ add_filter('the_content', 'yasr_add_schema');
|
|
422 |
|
423 |
$author = get_the_author();
|
424 |
|
425 |
-
$review_name =
|
426 |
|
427 |
$date = get_the_date('c');
|
428 |
|
@@ -541,7 +541,7 @@ add_filter('the_content', 'yasr_add_schema');
|
|
541 |
global $post;
|
542 |
|
543 |
//name
|
544 |
-
$rich_snippet["name"]= $review_name;
|
545 |
|
546 |
$rich_snippet["Review"] = array (
|
547 |
"@type" => "Review",
|
422 |
|
423 |
$author = get_the_author();
|
424 |
|
425 |
+
$review_name = the_title();
|
426 |
|
427 |
$date = get_the_date('c');
|
428 |
|
541 |
global $post;
|
542 |
|
543 |
//name
|
544 |
+
$rich_snippet["name"] = $review_name;
|
545 |
|
546 |
$rich_snippet["Review"] = array (
|
547 |
"@type" => "Review",
|
lib/yasr-settings-functions.php
CHANGED
@@ -1724,303 +1724,4 @@ function yasr_custom_admin_footer ($text) {
|
|
1724 |
}
|
1725 |
|
1726 |
|
1727 |
-
|
1728 |
-
/*************************BEGIN IMPORT FUNCTIONS*******************************/
|
1729 |
-
|
1730 |
-
/****** Check for previous GD STAR INSTALLATION *******/
|
1731 |
-
function yasr_search_gd_star_rating () {
|
1732 |
-
$gd_star_rating_found=FALSE;
|
1733 |
-
|
1734 |
-
if ( is_plugin_active( 'gd-star-rating/gd-star-rating.php' ) ) {
|
1735 |
-
$gd_star_rating_found=TRUE;
|
1736 |
-
}
|
1737 |
-
|
1738 |
-
else {
|
1739 |
-
global $wpdb;
|
1740 |
-
|
1741 |
-
$gdstar_table=$wpdb->prefix . 'gdsr_data_article';
|
1742 |
-
|
1743 |
-
if ($wpdb->get_var("SHOW TABLES LIKE '$gdstar_table'") == $gdstar_table) {
|
1744 |
-
$gd_star_rating_found=TRUE;
|
1745 |
-
}
|
1746 |
-
|
1747 |
-
else {
|
1748 |
-
__( 'No previous Gd Star Rating installation was found', 'yet-another-stars-rating' );
|
1749 |
-
}
|
1750 |
-
}
|
1751 |
-
|
1752 |
-
return $gd_star_rating_found;
|
1753 |
-
|
1754 |
-
}
|
1755 |
-
|
1756 |
-
/****** Import the following Gd Star Rating columns FROM gdsr_data_article
|
1757 |
-
post_id
|
1758 |
-
user_voters
|
1759 |
-
user_votes
|
1760 |
-
visitor_voters
|
1761 |
-
visitor_votes
|
1762 |
-
review
|
1763 |
-
******/
|
1764 |
-
|
1765 |
-
function yasr_import_gdstar_data(){
|
1766 |
-
|
1767 |
-
$gd_stars_option=get_option("gd-star-rating");
|
1768 |
-
|
1769 |
-
if ($gd_stars_option) {
|
1770 |
-
|
1771 |
-
$n_visitors_stars=$gd_stars_option['stars'];
|
1772 |
-
$n_review_stars=$gd_stars_option['review_stars'];
|
1773 |
-
}
|
1774 |
-
|
1775 |
-
else {
|
1776 |
-
|
1777 |
-
$n_visitors_stars=5;
|
1778 |
-
$n_review_stars=5;
|
1779 |
-
|
1780 |
-
}
|
1781 |
-
|
1782 |
-
global $wpdb;
|
1783 |
-
|
1784 |
-
$gdsr_data_article=$wpdb->prefix . 'gdsr_data_article';
|
1785 |
-
|
1786 |
-
$data=$wpdb->get_results(" SELECT gd.post_id, (gd.user_voters + gd.visitor_voters) AS voters,
|
1787 |
-
(gd.user_votes + gd.visitor_votes) AS sum_votes,
|
1788 |
-
gd.review,
|
1789 |
-
p.ID
|
1790 |
-
FROM $gdsr_data_article AS gd, $wpdb->posts AS p
|
1791 |
-
WHERE gd.post_id = p.id" );
|
1792 |
-
|
1793 |
-
//If in gd star rating user didn't use 5 rating system convert it
|
1794 |
-
|
1795 |
-
//Review Convertion
|
1796 |
-
if($n_review_stars != 5) {
|
1797 |
-
|
1798 |
-
foreach ($data as $data_row) {
|
1799 |
-
$data_row->review=($data_row->review/$n_review_stars)*5; //Review vote convertion
|
1800 |
-
}
|
1801 |
-
|
1802 |
-
}
|
1803 |
-
|
1804 |
-
|
1805 |
-
if ($n_visitors_stars != 5) {
|
1806 |
-
|
1807 |
-
foreach ($data as $data_row) {
|
1808 |
-
$data_row->sum_votes=($data_row->sum_votes/$n_visitors_stars)*5; //Visitor Vote conversion
|
1809 |
-
}
|
1810 |
-
|
1811 |
-
}
|
1812 |
-
|
1813 |
-
return $data;
|
1814 |
-
|
1815 |
-
}
|
1816 |
-
|
1817 |
-
|
1818 |
-
/****** Import the following GDSR columns FROM wp_gdsr_multis ******/
|
1819 |
-
function yasr_import_gdstar_multi_set(){
|
1820 |
-
global $wpdb;
|
1821 |
-
|
1822 |
-
$table_name = $wpdb->prefix . 'gdsr_multis';
|
1823 |
-
|
1824 |
-
$multi_set = $wpdb->get_results (" SELECT multi_id, name, stars, object FROM $table_name");
|
1825 |
-
|
1826 |
-
return $multi_set;
|
1827 |
-
}
|
1828 |
-
|
1829 |
-
|
1830 |
-
/****** Import the following Gd Star Rating columns:
|
1831 |
-
'id' and 'post_id': FROM gdsr_multis_data
|
1832 |
-
'user_votes' and 'item_id' FROM gdsr_multis_values
|
1833 |
-
'multi_id' from gdsr_multis_values
|
1834 |
-
|
1835 |
-
Then check if some multi set has star's number !=5 and convert every vote
|
1836 |
-
that use that set
|
1837 |
-
|
1838 |
-
Thanks to Alessandro Carlo Chirico for his helps in this query!
|
1839 |
-
******/
|
1840 |
-
function yasr_import_gdstar_multi_value(){
|
1841 |
-
global $wpdb;
|
1842 |
-
|
1843 |
-
$table_gdsr_multis_values=$wpdb->prefix . 'gdsr_multis_values';
|
1844 |
-
$table_gdsr_multis_data=$wpdb->prefix . 'gdsr_multis_data';
|
1845 |
-
$table_gdsr_multis=$wpdb->prefix . 'gdsr_multis';
|
1846 |
-
|
1847 |
-
$multi_set_data=$wpdb->get_results (" SELECT d.post_id,
|
1848 |
-
v.user_votes, v.item_id,
|
1849 |
-
m.multi_id
|
1850 |
-
FROM $table_gdsr_multis_values AS v, $table_gdsr_multis_data AS d, $wpdb->posts AS p, $table_gdsr_multis AS m
|
1851 |
-
WHERE v.id = d.id
|
1852 |
-
AND 0 <> (
|
1853 |
-
SELECT SUM( user_votes )
|
1854 |
-
FROM $table_gdsr_multis_values AS tabin
|
1855 |
-
WHERE tabin.id = v.id )
|
1856 |
-
AND p.ID = d.post_id
|
1857 |
-
AND d.multi_id = m.multi_id
|
1858 |
-
AND p.post_status = 'publish'
|
1859 |
-
AND v.source = 'rvw'
|
1860 |
-
ORDER BY d.post_id, m.multi_id, v.item_id ASC ");
|
1861 |
-
|
1862 |
-
|
1863 |
-
//Import multi set name: if a multiset use != 5 stars,
|
1864 |
-
//then i search wich vote has that set and convert
|
1865 |
-
//the vote to fit 5 stars vote
|
1866 |
-
$old_multi_set = yasr_import_gdstar_multi_set();
|
1867 |
-
|
1868 |
-
foreach ($old_multi_set AS $multi_set) { //Search wich set not use 5 stars
|
1869 |
-
if ($multi_set->stars != 5) {
|
1870 |
-
//Search in the $multi_set_data if some vote use a set with !=5 stars
|
1871 |
-
foreach ($multi_set_data as $data_row) {
|
1872 |
-
if ($data_row->multi_id == $multi_set->multi_id) {
|
1873 |
-
$data_row->user_votes=($data_row->user_votes/$multi_set->stars)*5; //Vote convertion
|
1874 |
-
}
|
1875 |
-
} //End foreach $multi_set_data
|
1876 |
-
} //End if $multi_set->stars != 5
|
1877 |
-
}
|
1878 |
-
|
1879 |
-
return ($multi_set_data);
|
1880 |
-
}
|
1881 |
-
|
1882 |
-
/****** Import gd star logs ******/
|
1883 |
-
function yasr_import_gdstar_logs() {
|
1884 |
-
|
1885 |
-
global $wpdb;
|
1886 |
-
|
1887 |
-
$table_gdsr_logs=$wpdb->prefix . 'gdsr_votes_log';
|
1888 |
-
|
1889 |
-
$gdsr_log_data = $wpdb->get_results (" SELECT id AS post_id, user_id, vote, voted AS date, ip
|
1890 |
-
FROM $table_gdsr_logs
|
1891 |
-
WHERE vote_type = 'article'
|
1892 |
-
ORDER BY date DESC ");
|
1893 |
-
|
1894 |
-
return $gdsr_log_data;
|
1895 |
-
|
1896 |
-
}
|
1897 |
-
|
1898 |
-
/****** Insert Gd Star Rating review in overall rating ******/
|
1899 |
-
function yasr_insert_gdstar_data($votes){
|
1900 |
-
global $wpdb;
|
1901 |
-
|
1902 |
-
foreach ( $votes as $column ) {
|
1903 |
-
$result=$wpdb->replace(
|
1904 |
-
YASR_VOTES_TABLE,
|
1905 |
-
array (
|
1906 |
-
'post_id' => $column->post_id,
|
1907 |
-
'overall_rating' => $column->review,
|
1908 |
-
'number_of_votes' => $column->voters,
|
1909 |
-
'sum_votes' =>$column->sum_votes
|
1910 |
-
),
|
1911 |
-
array( '%d', '%s', '%d', '%s')
|
1912 |
-
);
|
1913 |
-
}
|
1914 |
-
|
1915 |
-
if ($result) {
|
1916 |
-
return TRUE;
|
1917 |
-
};
|
1918 |
-
}
|
1919 |
-
|
1920 |
-
/****** Insert logs ******/
|
1921 |
-
function yasr_insert_gdstar_logs($logs) {
|
1922 |
-
global $wpdb;
|
1923 |
-
|
1924 |
-
foreach ($logs as $column) {
|
1925 |
-
$result = $wpdb->replace(
|
1926 |
-
YASR_LOG_TABLE,
|
1927 |
-
array(
|
1928 |
-
'post_id' => $column->post_id,
|
1929 |
-
'multi_set_id' => '-1',
|
1930 |
-
'user_id' => $column->user_id,
|
1931 |
-
'vote' => $column->vote,
|
1932 |
-
'date' => $column->date,
|
1933 |
-
'ip' => $column->ip
|
1934 |
-
),
|
1935 |
-
array( '%d', '%s', '%d', '%s', '%s', '%s' )
|
1936 |
-
);
|
1937 |
-
}
|
1938 |
-
|
1939 |
-
if ($result) {
|
1940 |
-
return TRUE;
|
1941 |
-
}
|
1942 |
-
|
1943 |
-
}
|
1944 |
-
|
1945 |
-
/****** Insert gd star rating multi set name
|
1946 |
-
|
1947 |
-
Thanks to Alessandro Carlo Chirico for his help in regex!
|
1948 |
-
******/
|
1949 |
-
function yasr_insert_gdstar_multi_set($multi_set_names) {
|
1950 |
-
|
1951 |
-
global $wpdb;
|
1952 |
-
|
1953 |
-
$i=0;
|
1954 |
-
foreach ($multi_set_names as $value) {
|
1955 |
-
|
1956 |
-
$result = $wpdb->replace(
|
1957 |
-
YASR_MULTI_SET_NAME_TABLE,
|
1958 |
-
array(
|
1959 |
-
'set_id' =>$value->multi_id,
|
1960 |
-
'set_name' =>$value->name
|
1961 |
-
),
|
1962 |
-
array ('%d', '%s')
|
1963 |
-
);
|
1964 |
-
|
1965 |
-
if ($result) {
|
1966 |
-
|
1967 |
-
if(preg_match_all('#".+?"#', $value->object, $matches)) {
|
1968 |
-
$fields = $matches[0];
|
1969 |
-
}
|
1970 |
-
|
1971 |
-
$fields = str_replace('"', '', $fields);
|
1972 |
-
|
1973 |
-
foreach ($fields as $id => $field_name) {
|
1974 |
-
$result2=$wpdb->replace(
|
1975 |
-
YASR_MULTI_SET_FIELDS_TABLE,
|
1976 |
-
array(
|
1977 |
-
'id' => $i,
|
1978 |
-
'parent_set_id' =>$value->multi_id,
|
1979 |
-
'field_name' =>$field_name,
|
1980 |
-
'field_id' =>$id
|
1981 |
-
),
|
1982 |
-
array ('%d', '%d', '%s', '%d')
|
1983 |
-
);
|
1984 |
-
$i++;
|
1985 |
-
} //End Foreach ($fields as $id => $field_name)
|
1986 |
-
|
1987 |
-
} //End if $result
|
1988 |
-
}
|
1989 |
-
|
1990 |
-
if ($result && $result2) {
|
1991 |
-
return "OK";
|
1992 |
-
}
|
1993 |
-
|
1994 |
-
}
|
1995 |
-
|
1996 |
-
/******
|
1997 |
-
Check how many stars the existing set use, than convert the vote
|
1998 |
-
into 5 stars. Last insert GD Star Rating multi values
|
1999 |
-
******/
|
2000 |
-
function yasr_insert_gdstar_multi_value($multi_datas) {
|
2001 |
-
global $wpdb;
|
2002 |
-
|
2003 |
-
$i=1;
|
2004 |
-
foreach ($multi_datas as $value) {
|
2005 |
-
$result=$wpdb->replace(
|
2006 |
-
YASR_MULTI_SET_VALUES_TABLE,
|
2007 |
-
array(
|
2008 |
-
'id' =>$i,
|
2009 |
-
'post_id' => $value->post_id,
|
2010 |
-
'votes' => $value->user_votes,
|
2011 |
-
'field_id' => $value->item_id,
|
2012 |
-
'set_type' => $value->multi_id
|
2013 |
-
),
|
2014 |
-
array('%d', '%d', '%s', '%d','%d')
|
2015 |
-
);
|
2016 |
-
$i++;
|
2017 |
-
}
|
2018 |
-
|
2019 |
-
return $result;
|
2020 |
-
}
|
2021 |
-
|
2022 |
-
|
2023 |
-
/************************************************END IMPORT FUNCTIONS****************************************************/
|
2024 |
-
|
2025 |
-
|
2026 |
?>
|
1724 |
}
|
1725 |
|
1726 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1727 |
?>
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
3 |
Tags: 5 star, admin, administrator, AJAX, five-star, javascript, jquery, post rating, posts, rate, rating, rating platform, rating system, ratings, review, reviews, rich snippets, seo, star, star rating, stars, vote, Votes, voting, voting contest, schema, serp
|
4 |
Requires at least: 4.3.0
|
5 |
Contributors: Dudo
|
6 |
-
Tested up to: 4.6
|
7 |
-
Stable tag: 1.3.
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
Yet Another Stars Rating is a simple plugin which allows you and / or your visitor to rate a post or element. Ideal for review's website
|
@@ -30,12 +30,6 @@ This may not works if you use a caching plugin.
|
|
30 |
Multisets give the opportunity to score different aspects for each review: for example, if you're reviewing a videogame, you can create the aspects "Graphics",
|
31 |
"Gameplay", "Story", etc.
|
32 |
|
33 |
-
= Importing data from gd star rating =
|
34 |
-
If you're using gd-star-rating, YASR is the plugin for you! You can import from gd-star-rating "Overall Rating", "Visitor Votes" and all the multisets with
|
35 |
-
their respective score. Once YASR is installed you just have to go to "Settings" -> "Yet Another Stars Rating: Settings" and start the import (last box at the bottom).
|
36 |
-
This operation can take some time, don't stop it! Once it's done you just need to replace the gd-star-rating's shortcode with the YASR tags.
|
37 |
-
If with gd-star-rating you're using a different number of stars from the default of 5, YASR will automatically convert all the scores in a range from 1 to 5.
|
38 |
-
(Gd Star Rating version must be 1.9.22 or lower)
|
39 |
|
40 |
= Supported Languages =
|
41 |
|
@@ -113,6 +107,9 @@ Of course not: you can easily add it on the visual editor just by clicking the "
|
|
113 |
|
114 |
The full changelog can be found in the plugin's directory. Recent entries:
|
115 |
|
|
|
|
|
|
|
116 |
= 1.3.8 =
|
117 |
* FIXED: Shortcode creatore finally works even in text mode
|
118 |
* TWEAKED: Added a link to the settings in the plugin list under the plugin name
|
3 |
Tags: 5 star, admin, administrator, AJAX, five-star, javascript, jquery, post rating, posts, rate, rating, rating platform, rating system, ratings, review, reviews, rich snippets, seo, star, star rating, stars, vote, Votes, voting, voting contest, schema, serp
|
4 |
Requires at least: 4.3.0
|
5 |
Contributors: Dudo
|
6 |
+
Tested up to: 4.6.1
|
7 |
+
Stable tag: 1.3.9
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
Yet Another Stars Rating is a simple plugin which allows you and / or your visitor to rate a post or element. Ideal for review's website
|
30 |
Multisets give the opportunity to score different aspects for each review: for example, if you're reviewing a videogame, you can create the aspects "Graphics",
|
31 |
"Gameplay", "Story", etc.
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
= Supported Languages =
|
35 |
|
107 |
|
108 |
The full changelog can be found in the plugin's directory. Recent entries:
|
109 |
|
110 |
+
= 1.3.9 =
|
111 |
+
* Dropped import support for old gd star
|
112 |
+
|
113 |
= 1.3.8 =
|
114 |
* FIXED: Shortcode creatore finally works even in text mode
|
115 |
* TWEAKED: Added a link to the settings in the plugin list under the plugin name
|
yasr-settings-page.php
CHANGED
@@ -117,75 +117,6 @@ $n_multi_set = NULL; //Evoid undefined variable when printed outside multiset ta
|
|
117 |
|
118 |
<?php
|
119 |
|
120 |
-
$gd_star_rating_found = yasr_search_gd_star_rating();
|
121 |
-
|
122 |
-
$gd_star_imported = get_option('yasr-gdstar-imported');
|
123 |
-
|
124 |
-
//If gdstar rating has been found but data haven't been imported yet
|
125 |
-
if ($gd_star_rating_found && !$gd_star_imported) {
|
126 |
-
?>
|
127 |
-
<div class="yasr-settingsdiv">
|
128 |
-
<h3><?php _e("Import Gd Star Rating", 'yet-another-stars-rating'); ?></h3>
|
129 |
-
<?php _e("I've found a previous installation of Gd Star Rating.", 'yet-another-stars-rating'); ?> <br /><?php _e("Do you want proceed to import data?", 'yet-another-stars-rating'); ?>
|
130 |
-
<br />
|
131 |
-
<button href="#" class="button-delete" id="import-gdstar"><?php _e('Yes, Begin Import', 'yet-another-stars-rating'); ?></button>
|
132 |
-
|
133 |
-
<div id="yasr-import-gdstar-div" style="display:none;">
|
134 |
-
<strong>
|
135 |
-
<?php _e("Click on Proceed to import Gd Star Rating data."); ?>
|
136 |
-
</strong>
|
137 |
-
<br />
|
138 |
-
<button href="#" class="button-primary" id="import-button"> <?php _e('Proceed', 'yet-another-stars-rating'); ?></button>
|
139 |
-
|
140 |
-
<span id="yasr-loader-importer" style="display:none;" > <img src="<?php echo YASR_IMG_DIR . "loader.gif" ?>">
|
141 |
-
</span>
|
142 |
-
<br />
|
143 |
-
|
144 |
-
<div id="result-import">
|
145 |
-
</div>
|
146 |
-
</div>
|
147 |
-
</div>
|
148 |
-
|
149 |
-
<div class="yasr-space-settings-div">
|
150 |
-
</div>
|
151 |
-
|
152 |
-
<?php
|
153 |
-
|
154 |
-
} //End If $gd_star_rating_found && !$gd_star_imported
|
155 |
-
|
156 |
-
else if ($gd_star_rating_found && $gd_star_imported==1) {
|
157 |
-
?>
|
158 |
-
|
159 |
-
<div class="yasr-settingsdiv">
|
160 |
-
<h3><?php _e("Manage GD Star Data", 'yet-another-stars-rating'); ?></h3>
|
161 |
-
<?php _e("Gd Star Rating has been already imported.", 'yet-another-stars-rating'); ?> <br />
|
162 |
-
<?php _e("If you wish you can import it again, but", 'yet-another-stars-rating'); ?><strong> <?php _e("you will lose all data you've collect since the import!", 'yet-another-stars-rating'); ?> </strong>
|
163 |
-
<br />
|
164 |
-
<button href="#" class="button-delete" id="import-gdstar"><?php _e('Ok, Import Again'); ?></button>
|
165 |
-
|
166 |
-
<div id="yasr-import-gdstar-div" style="display:none;">
|
167 |
-
<strong>
|
168 |
-
<?php _e("Click on Proceed to import again Gd Star Rating data. This may take a while!"); ?>
|
169 |
-
</strong>
|
170 |
-
<br />
|
171 |
-
<button href="#" class="button-primary" id="import-button"> <?php _e('Proceed', 'yet-another-stars-rating'); ?></button>
|
172 |
-
|
173 |
-
<span id="yasr-loader-importer" style="display:none;" > <img src="<?php echo YASR_IMG_DIR . "loader.gif" ?>">
|
174 |
-
</span>
|
175 |
-
|
176 |
-
<br />
|
177 |
-
|
178 |
-
<div id="result-import">
|
179 |
-
</div>
|
180 |
-
|
181 |
-
</div>
|
182 |
-
</div>
|
183 |
-
|
184 |
-
<div class="yasr-space-settings-div">
|
185 |
-
</div>
|
186 |
-
|
187 |
-
<?php
|
188 |
-
} //$gd_star_rating_found && $gd_star_imported==1$gd_star_rating_found = yasr_search_gd_star_rating();
|
189 |
|
190 |
} //End if tab 'general_settings'
|
191 |
|
117 |
|
118 |
<?php
|
119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
} //End if tab 'general_settings'
|
122 |
|
yet-another-stars-rating.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Yet Another Stars Rating
|
4 |
* Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
|
5 |
* Description: Yet Another Stars Rating turn your WordPress into a complete review website.
|
6 |
-
* Version: 1.3.
|
7 |
* Author: Dario Curvino
|
8 |
* Author URI: https://yetanotherstarsrating.com/
|
9 |
* Text Domain: yet-another-stars-rating
|
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
31 |
|
32 |
if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
|
33 |
|
34 |
-
define('YASR_VERSION_NUM', '1.3.
|
35 |
|
36 |
//Plugin relative path
|
37 |
define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
|
3 |
* Plugin Name: Yet Another Stars Rating
|
4 |
* Plugin URI: http://wordpress.org/plugins/yet-another-stars-rating/
|
5 |
* Description: Yet Another Stars Rating turn your WordPress into a complete review website.
|
6 |
+
* Version: 1.3.9
|
7 |
* Author: Dario Curvino
|
8 |
* Author URI: https://yetanotherstarsrating.com/
|
9 |
* Text Domain: yet-another-stars-rating
|
31 |
|
32 |
if ( ! defined( 'ABSPATH' ) ) exit('You\'re not allowed to see this page'); // Exit if accessed directly
|
33 |
|
34 |
+
define('YASR_VERSION_NUM', '1.3.9');
|
35 |
|
36 |
//Plugin relative path
|
37 |
define( "YASR_ABSOLUTE_PATH", dirname(__FILE__) );
|