Changeset 2069172
- Timestamp:
- 04/16/2019 08:00:42 AM (7 years ago)
- Location:
- netreviews/trunk
- Files:
-
- 17 edited
-
changelog.txt (modified) (1 diff)
-
functions.php (modified) (3 diffs)
-
i18n/languages/av-de_DE.mo (modified) (previous)
-
i18n/languages/av-de_DE.po (modified) (1 diff)
-
i18n/languages/av-es_ES.mo (modified) (previous)
-
i18n/languages/av-es_ES.po (modified) (1 diff)
-
i18n/languages/av-fr_FR.mo (modified) (previous)
-
i18n/languages/av-fr_FR.po (modified) (1 diff)
-
i18n/languages/av-it_IT.mo (modified) (previous)
-
i18n/languages/av-it_IT.po (modified) (1 diff)
-
i18n/languages/av-pt_PT.mo (modified) (previous)
-
i18n/languages/av-pt_PT.po (modified) (1 diff)
-
includes/av_backoffice.php (modified) (7 diffs)
-
includes/av_product_tab.php (modified) (4 diffs)
-
includes/css/av_backoffice.css (modified) (1 diff)
-
netreviews.php (modified) (11 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
netreviews/trunk/changelog.txt
r2057037 r2069172 1 Version: 2.0.0 / 15/04/2019 2 - Fix Back-office and template 3 - Additional Rich Snippets code (Review) 4 - Bug Correction in Back-office 5 6 1 7 Version: 1.9.5 / 18/03/2019 2 8 - Back-office user and translations fix -
netreviews/trunk/functions.php
r2057037 r2069172 5 5 function ntav_update_version_plugin() 6 6 { 7 ntav_updateValue('MODVERSION', ' 1.9.5');7 ntav_updateValue('MODVERSION', '2.0.0'); 8 8 } 9 9 … … 698 698 `name` varchar(25) NOT NULL, 699 699 `value` text NOT NULL, 700 `lang_code` varchar( 100),700 `lang_code` varchar(25), 701 701 PRIMARY KEY (`id`) 702 702 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25"); … … 1092 1092 return $listImgBo; 1093 1093 } 1094 1095 1096 /** 1097 * We retrieve the info for the "Review" Property (Rich Snippets) 1098 * @return array (Reviews) 1099 */ 1100 function ntav_getReviewsRS($idproduct){ 1101 global $wpdb; 1102 $WpmlEnable = ntav_getWpmlEnable(); 1103 if($WpmlEnable == 'yes'){ 1104 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 1105 } else {$my_current_lang='';} 1106 1107 $query = $wpdb->get_results("SELECT customer_name,DATE_FORMAT(FROM_UNIXTIME(horodate), '%d-%m-%Y') as Newhorodate,review,rate FROM " . $wpdb->prefix . "netreviews_products_reviews WHERE ref_product = $idproduct and lang = '$my_current_lang' ORDER BY horodate DESC LIMIT 0,5"); 1108 return $query; 1109 } -
netreviews/trunk/i18n/languages/av-de_DE.po
r2051358 r2069172 404 404 msgid "Are you using WPML plugin?" 405 405 msgstr "Nutzen Sie das WPML Plugin aus?" 406 407 msgid "Please, insert your secret key and website id, corresponding to the backoffice of each shop language." 408 msgstr "Bitte überprüfen Sie Ihren Kundenbereich in der Sprache, die Sie konfigurieren möchten, um Ihre Anmeldedaten anzuzeigen." -
netreviews/trunk/i18n/languages/av-es_ES.po
r2051358 r2069172 409 409 msgid "Are you using WPML plugin?" 410 410 msgstr "¿Utiliza el plugin WPML?" 411 412 msgid "Please, insert your secret key and website id, corresponding to the backoffice of each shop language." 413 msgstr "Por favor, inserte la clave secreta y el idwebsite correspondiente al back-office de cada lengua" -
netreviews/trunk/i18n/languages/av-fr_FR.po
r2051358 r2069172 422 422 msgid "Are you using WPML plugin?" 423 423 msgstr "Est-ce que vous utilisez le plugin WPML?" 424 425 msgid "Please, insert your secret key and website id, corresponding to the backoffice of each shop language." 426 msgstr "S'il vous plait, inserer le idwebsite et secretkey de la plataforme Avis Verifies que vous voulez configurer" -
netreviews/trunk/i18n/languages/av-it_IT.po
r2057037 r2069172 409 409 msgid "Are you using WPML plugin?" 410 410 msgstr "Usi un plugin WPML?" 411 412 msgid "Please, insert your secret key and website id, corresponding to the backoffice of each shop language." 413 msgstr "Per favore, inserisci chiave segreta ed id website corrispondenti al backoffice della lingua di ciascun shop." -
netreviews/trunk/i18n/languages/av-pt_PT.po
r2051358 r2069172 439 439 msgid "Are you using WPML plugin?" 440 440 msgstr "Você está usando o plugin WPML?" 441 442 msgid "Please, insert your secret key and website id, corresponding to the backoffice of each shop language." 443 msgstr "Por favor verifique no seu espaço cliente a língua que deseja utilizar para o seu acesso." -
netreviews/trunk/includes/av_backoffice.php
r2057037 r2069172 7 7 require_once(ABSPATH . 'wp-admin/admin.php'); 8 8 require_once(ABSPATH . 'wp-admin/admin-header.php'); 9 10 ntav_columns_if_not_exists(); 11 9 12 global $wc_product_attributes; 10 13 $av_link = wp_upload_dir(); … … 83 86 <?php 84 87 $WPML_config = ''; 88 $s_keyArray = array(); 89 $id_webArray = array(); 85 90 86 91 if(is_plugin_active('wpml-string-translation/plugin.php') && is_plugin_active('wpml-translation-management/plugin.php')){ … … 172 177 if($wpmlActive == 'yes'){ 173 178 174 $s_keyArray = array(); 175 $id_webArray = array(); 179 180 176 181 foreach ($WPML_config as $key => $value) { 177 182 … … 325 330 326 331 <?php if(!empty($WPML_config)){ echo '<label class="WPMLConfig">'; _e('Are you using WPML plugin?','av'); echo '</label>'; ?> 332 327 333 <div class="items form-group"> 334 328 335 329 336 <input id="yesWPML" type="radio" name="WPML" value="yes" <?php if($wpmlActive !=NULL && $wpmlActive=='yes'): echo 'checked' ; endif; ?> onclick="displayWPML()" /><?php _e('Yes', 'av'); ?> … … 332 339 </div> 333 340 <?php } ?> 341 334 342 <?php if(!empty($WPML_config)) :?> 343 344 <u><p class="paragraphsecretkeyWpml"><?php _e('Please, insert your secret key and website id, corresponding to the backoffice of each shop language.', 'av'); ?></p></u> 345 346 335 347 <?php foreach ($WPML_config as $key => $value) { ?> 336 <?php $lang = explode(".", $value);?> 348 349 <?php $lang = explode(".", $value); ?> 337 350 <div class="elem divsecretkeyWPML" style="display: none;"> 338 <p class="paragraphsecretkey"><?php _e('Please check your customer area on ', 'av'); 339 echo " <b>"; 340 _e('verified-reviews.co.uk', 'av'); 341 echo "</b> "; 342 _e(' to see your login data.', 'av'); ?></p> 343 351 344 352 <div class="form-group"> 345 353 <label for="s_key"><b><?php _e('Secret Key : ', 'av'); ?></b></label><input … … 677 685 } 678 686 elementWithoutWPML.style.display="none"; 687 document.getElementsByClassName('paragraphsecretkeyWpml')[0].style.display = "block"; 679 688 } 680 689 … … 689 698 } 690 699 wpmlConfigButton.style.display = "block"; 700 document.getElementsByClassName('paragraphsecretkeyWpml')[0].style.display = "none"; 691 701 } 692 702 } -
netreviews/trunk/includes/av_product_tab.php
r2051358 r2069172 6 6 if($WpmlEnable == 'yes'){ 7 7 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 8 } 9 else{ 10 $my_current_lang =''; 8 11 } 9 12 // On calcule l'url à utiliser pour la fonctionnalité Avis Utile (API) … … 35 38 $getNote = round(ntav_get_netreviews_average($id_product, $my_current_lang), 1); 36 39 $countByRate = ntav_get_netreviews_countByRate($id_product,$my_current_lang); 37 38 40 39 41 … … 119 121 <input type="hidden" id="av_id_product" value="<?php echo $id_product ?>"/> 120 122 <input type="hidden" id="avisVarifiesAjaxUrl" value="<?php echo $avisAjaxUrl ?>"/> 121 <input type="hidden" id="wpml_Lang" value = "<?php echo $my_current_lang?>" >123 <input type="hidden" id="wpml_Lang" value = "<?php echo $my_current_lang?>"/> 122 124 123 125 … … 264 266 </script> 265 267 266 </div> <!-- end netreviews tab --> 267 268 268 </div> 269 </div> <!-- end netreviews tab --> 269 270 270 271 <!-- NETREVIEWS - END --> -
netreviews/trunk/includes/css/av_backoffice.css
r2051358 r2069172 540 540 } 541 541 542 .panelaccordionconfig .paragraphsecretkeyWpml { 543 font-size: 17px; 544 } 545 542 546 .panelaccordionconfig .infos { 543 547 margin-left: 1%; -
netreviews/trunk/netreviews.php
r2057037 r2069172 1 1 <?php 2 2 3 3 4 /** … … 8 9 * Description: We provide you with a solution that enables you to collect customer reviews about your website and products which will show on your 9 10 * website and on a attestation which will increase the credibility of published reviews. 10 * Version: 1.9.511 * Version: 2.0.0 11 12 * Author: NetReviews SAS <contact@avis-verifies.com> 12 13 * Author URI: www.avis-verifies.com … … 411 412 function ntav_netreviews_loop_rating() 412 413 { 413 414 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 414 415 415 global $product; 416 $WpmlEnable = ntav_getWpmlEnable(); 417 416 418 // Si on recupere le produit et que le module est actif 417 419 if (isset($product) && ntav_getConfig('IS_ACTIVE','non') == 1) { 420 421 $id_product = $product->get_id(); 422 if($WpmlEnable == 'yes'){ 423 global $sitepress; 424 $id_product = icl_object_id( get_the_id(), 'post', true, $sitepress->get_default_language() ); //Will display the ID of the original post for WPML plugin 425 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 426 } 427 else{ 428 $my_current_lang = ''; 429 } 430 418 431 // recuperation de la moyenne d'avis 419 $average = ntav_get_netreviews_average($ product->get_id(),$my_current_lang);432 $average = ntav_get_netreviews_average($id_product,$my_current_lang); 420 433 $stars = ntav_addStars($average); 421 434 … … 439 452 add_action('netreviews_product_rating', 'ntav_netreviews_product_rating'); 440 453 add_action('woocommerce_single_product_summary', 'ntav_netreviews_product_rating', 31); 454 455 $WpmlEnable = ntav_getWpmlEnable(); 456 457 if($WpmlEnable == 'yes'){ 441 458 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 459 }else{$my_current_lang = '';} 442 460 443 461 // fonction affichant les étoiles dans la description rapide et rajoute des rich snippet produit si c'est configure (activation rich snippet et microdata selectionne) 444 462 function ntav_netreviews_product_rating() 445 463 { 464 446 465 global $product; 447 466 global $sitepress; 448 467 449 468 $WpmlEnable = ntav_getWpmlEnable(); 469 470 471 if (isset($product) && ntav_getConfig('IS_ACTIVE','non') == 1) { 450 472 451 473 $id_product = $product->get_id(); … … 454 476 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 455 477 } 456 457 458 459 if (isset($product) && ntav_getConfig('IS_ACTIVE','non') == 1) { 460 $count = ntav_get_netreviews_count($id_product,$my_current_lang); 461 $average = ntav_get_netreviews_average($id_product,$my_current_lang); 478 else{$my_current_lang='';} 479 480 $id = get_permalink($product->get_id()); 481 $count = ntav_get_netreviews_count($id_product, $my_current_lang); 482 $average = ntav_get_netreviews_average($id_product, $my_current_lang); 462 483 $stars = ntav_addStars($average); 463 484 $reviews = ntav_getReviewsRS($id_product); 464 485 if (!empty($average)) { 465 486 … … 482 503 $html .= ' <meta itemprop="bestRating" content="5"/>'; 483 504 $html .= '</span>'; 505 foreach ($reviews as $value) { 506 $html .= '<div itemprop="review" itemscope itemtype="http://schema.org/Review">'; 507 $html .= '<span itemprop="author" content="'. urldecode($value->customer_name).'"></span>'; 508 $html .= '<meta itemprop="datePublished" content="'. $value->Newhorodate .'"> </meta>'; 509 $html .= ' <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">'; 510 $html .= '<meta itemprop="worstRating" content = "1">'; 511 $html .= '<meta itemprop="ratingValue" content ="'.$value->rate.'"></meta>'; 512 $html .= '<meta itemprop="bestRating" content = "5">'; 513 $html .= ' </div>'; 514 $html .= '<meta itemprop="description" content= "'.urldecode($value->review).'"> </meta>'; 515 $html .= '</div>'; 516 } 484 517 $html .= '<div class="netreviewsclear"></div>'; 485 518 $html .= '</div>'; … … 514 547 function ntav_netreviews_jsonld_product($product = null) 515 548 { 516 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 549 global $sitepress; 550 551 $WpmlEnable = ntav_getWpmlEnable(); 552 553 517 554 518 555 if (!is_object($product)) { … … 520 557 } 521 558 if (!empty($product) && (is_object($product))) { 522 $id = get_permalink($product->get_id()); 523 $count = ntav_get_netreviews_count($product->get_id(),$my_current_lang); 524 $average = ntav_get_netreviews_average($product->get_id(),$my_current_lang); 559 560 $id_product = $product->get_id(); 561 if($WpmlEnable == 'yes'){ 562 $id_product = icl_object_id( get_the_id(), 'post', true, $sitepress->get_default_language() ); //Will display the ID of the original post for WPML plugin 563 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 564 }else {$my_current_lang = '';} 565 $id = get_permalink($id_product); 566 $count = ntav_get_netreviews_count($id_product,$my_current_lang); 567 $average = ntav_get_netreviews_average($id_product, $my_current_lang); 568 $reviews = ntav_getReviewsRS($id_product); 569 570 $i=0; 525 571 $markup = ''; 526 572 if ($count > 0 && $average > 0) { … … 535 581 $markup .= '"ratingCount":"' . $count . '",'; 536 582 $markup .= '"reviewCount":"' . $count . '"'; 537 $markup .= '}'; 583 $markup .= '},'; 584 $markup .= '"review":['; 585 586 foreach ($reviews as $value) { 587 $markup .= '{'; 588 $markup .= '"@type":"Review",'; 589 $markup .= '"author":"'. urldecode($value->customer_name) .'",'; 590 $markup .= '"datePublished":"'. $value->Newhorodate .'",'; 591 $markup .= '"description":"'. urldecode($value->review) .'",'; 592 $markup .= '"reviewRating":'; 593 $markup .= '{'; 594 $markup .= '"@type":"Rating",'; 595 $markup .= '"bestRating": "5",'; 596 $markup .= '"ratingValue":"' . $value->rate . '",'; 597 $markup .= '"worstRating": "1"'; 598 $markup .= '}'; 599 $i++; 600 if($i != count($reviews)){ 601 $markup .= '},'; 602 } 603 else{ 604 $markup .= '}'; 605 } 606 } 607 $markup .=']'; 538 608 $markup .= '}'; 539 609 $markup .= '</script>'; 540 610 } 611 612 541 613 echo $markup; 542 614 } … … 593 665 { 594 666 global $wpdb; 595 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 596 667 $WpmlEnable = ntav_getWpmlEnable(); 668 if($WpmlEnable == 'yes'){ 669 $my_current_lang = apply_filters( 'wpml_current_language', NULL ); 670 }else{$my_current_lang = '';} 671 597 672 if (ntav_getConfig('SCRIPTFLOAT_ALLOWED',$my_current_lang) == 'yes') { 598 673 $widget = ntav_get_widget_floating(); … … 689 764 } 690 765 766 // Ajouter lang_code sur Table config (WPML) 767 $result4 = $wpdb->get_results("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = '" . $wpdb->dbname . "' AND TABLE_NAME = '" . $wpdb->prefix . "netreviews_configuration' AND COLUMN_NAME = 'lang_code'"); 768 if(empty($result4)){ 769 $wpdb->query("ALTER TABLE " . $wpdb->prefix . "netreviews_configuration ADD (`lang_code` varchar(25));"); 770 } 771 691 772 } 692 773 -
netreviews/trunk/readme.txt
r2057037 r2069172 57 57 58 58 == Changelog == 59 60 Version: 2.0.0 / 15/04/2019 61 - Fix Back-office and template 62 - Additional Rich Snippets code (Review) 63 - Bug Correction in Back-office 64 59 65 60 66 Version: 1.9.5 / 18/03/2019
Note: See TracChangeset
for help on using the changeset viewer.