Plugin Directory

Changeset 2496004


Ignore:
Timestamp:
03/15/2021 02:08:52 PM (5 years ago)
Author:
avisverifies
Message:

Version 2.3.7 / 15/03/2021 - Performance optimisation on install

Location:
netreviews/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • netreviews/trunk/changelog.txt

    r2394291 r2496004  
    1 Version 2.3.6 / 06/10/2020
     1Version 2.3.7 / 15/03/2021
     2- Performance optimisation on install
     3
     4Version 2.3.6 / 06/10/2020
    25- Fix number of stars displayed with badge 2
    36- Adapt product name and url to WPML lang when exporting CSV orders
  • netreviews/trunk/functions.php

    r2394291 r2496004  
    55function ntav_update_version_plugin()
    66{
    7     ntav_updateValue('MODVERSION', '2.3.6');
     7    ntav_updateValue('MODVERSION', '2.3.7');
    88}
    99
     
    1111    Fonction qui installe les tables du plugin et flag toutes les commandes à 1
    1212 */
     13
     14
    1315function ntav_install_db_av()
    1416{
     17    global $wpdb;
     18    $time = time();
     19    $table = $wpdb->prefix . 'postmeta';
    1520
    1621    ntav_create_table_conf();
    1722    ntav_create_table_ave();
    1823    ntav_create_table_rev();
    19     $time = time();
    20 
     24
     25    //if old data exists in postmeta, initialize the datas
     26    $wpdb->query("DELETE FROM $table where meta_key = 'av_flag' or meta_key = 'av_horodate'");
     27
     28
     29    $value_av_flag = '';
     30    $value_av_horodate = '';
    2131    if (($list_orders_id = ntav_get_orders()) != NULL) {
    22         foreach ($list_orders_id as $id) {
    23             update_post_meta($id, 'av_flag', '1');
    24             update_post_meta($id, 'av_horodate', $time);
    25         }
    26     }
     32        foreach ($list_orders_id as $key => $id) {
     33            $data_link = ($key != (count($list_orders_id)-1)) ? "," : ";";
     34            $value_av_flag .= "(".$id.",'av_flag','1'),";
     35            $value_av_horodate .= "(".$id.",'av_horodate',$time)" . $data_link;
     36        }
     37    }
     38   
     39    $wpdb->query("INSERT INTO $table (post_id,meta_key,meta_value) VALUE " . $value_av_flag . $value_av_horodate);
    2740}
    2841
     
    179192    if (($results = $wpdb->get_results("SELECT ID FROM " . $table_prefix . "posts "
    180193            . "WHERE post_type = 'shop_order'")) != NULL) {
     194        // var_dump($results);
    181195        foreach ($results as $result) {
    182196            $list_ids[$i] = $result->ID;
  • netreviews/trunk/netreviews.php

    r2394291 r2496004  
    99 * Description: We provide you with a solution that enables you to collect customer reviews about your website and products which will show on your
    1010 * website and on a attestation which will increase the credibility of published reviews.
    11  * Version: 2.3.6
     11 * Version: 2.3.7
    1212 * Author: NetReviews SAS <contact@avis-verifies.com>
    1313 * Author URI: www.avis-verifies.com
Note: See TracChangeset for help on using the changeset viewer.