• Hi,

    I discovered that the dump produced by the plugin contained errors, making it impossible to import into the database. In my case, these errors relate to WPML.

    Here the result of a dump made by phpMyAdmin :

    INSERT INTOwpp2015_icl_translations(translation_id,element_type,element_id,trid,language_code,source_language_code`) VALUES
    (1505, ‘post_gravity_form’, NULL, 731, ‘de’, ‘fr’),
    (1506, ‘post_gravity_form’, NULL, 732, ‘de’, ‘fr’),
    (1507, ‘post_gravity_form’, NULL, 733, ‘de’, ‘fr’),
    (1508, ‘post_gravity_form’, NULL, 734, ‘de’, ‘fr’),…`

    And here the result of a dump made by Ithemes Security :

    INSERT INTOwpp2015_icl_translations` VALUES(“1505″,”post_gravity_form”,””,”731″,”de”,”fr”);
    INSERT INTO wpp2015_icl_translations VALUES(“1506″,”post_gravity_form”,””,”732″,”de”,”fr”);
    INSERT INTO wpp2015_icl_translations VALUES(“1507″,”post_gravity_form”,””,”733″,”de”,”fr”);
    INSERT INTO wpp2015_icl_translations VALUES(“1508″,”post_gravity_form”,””,”734″,”de”,”fr”);`

    We lost values “null” and the import can not be done in phpMyAdmin because there are constraints unique keys in the table definition.

    https://wordpress.org/plugins/better-wp-security/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter xavier nuel

    (@xavier-nuel)

    A little up for this topic.

    Thread Starter xavier nuel

    (@xavier-nuel)

    Hi,

    I finaly found a solution for this problem by myself :

    Modify file \plugins\better-wp-security\modules\free\backup\class-itsec-backup.php at line 142 :

    for ($j = 0; $j < $num_fields; $j ++) {
     if (is_null($row[$j])) {
      $return .= 'NULL';
     } else {
      $row[$j] = addslashes($row[$j]);
      $row[$j] = preg_replace('#' . PHP_EOL . '#', "\n", $row[$j]);
      if (isset($row[$j])) {
       $return .= '"' . $row[$j] . '"';
      } else {
       $return .= '""';
      }
     }
    
     if ($j < ( $num_fields - 1 )) {
      $return .= ',';
     }
    }

    I hope it can help to fix the bug in futur release of your excelent plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Database backup : dump unusable in phpmyadmin’ is closed to new replies.