Skip to content

Commit

Permalink
Fixed issue with tables not updating during plugin update
Browse files Browse the repository at this point in the history
  • Loading branch information
riklewis committed Apr 6, 2020
1 parent dfa4b35 commit 8f9cae5
Show file tree
Hide file tree
Showing 20 changed files with 1,058 additions and 4 deletions.
951 changes: 951 additions & 0 deletions svn/tags/1.5/better-detection.php

Large diffs are not rendered by default.

Binary file added svn/tags/1.5/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/icon-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/icon-white-36x36.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-bg_glass_55_fbf9ee_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-bg_glass_65_ffffff_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-bg_glass_75_dadada_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-bg_glass_75_e6e6e6_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-bg_glass_95_fef1ec_1x400.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-icons_222222_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-icons_454545_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added svn/tags/1.5/images/ui-icons_888888_256x240.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions svn/tags/1.5/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
# Silence is golden.
16 changes: 16 additions & 0 deletions svn/tags/1.5/jquery-ui-tabs.min.css

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions svn/tags/1.5/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
jQuery(function() {
//initialise tab widget
jQuery("#better-detection-tabs").tabs({
activate: function(event,ui) {
var inp = jQuery("[name='_wp_http_referer']");
var val = inp.val().split("#")[0];
inp.val(val+"#"+ui.newPanel.attr("id"));
}
});

//update error count
function better_detection_error_count() {
var trs = Math.max(0,jQuery("#better-detection-tabs-errors").find("tr").length-2);
jQuery("#better-detection-error-count").html(" ("+trs+")");
}
better_detection_error_count();

//handle button clicks
jQuery("#better-detection-tabs").on("click","input",function(e) {
var data = {'action':'better_detection','mode':'unknown','key':ajax_object.key};
var inp = jQuery(this);
if(inp.hasClass("action-fixed")) {
data.mode = "fixed";
data.id = inp.attr("id").replace("action-fix-","");
}
if(inp.hasClass("action-ignore")) {
data.mode = "ignore";
data.id = inp.attr("id").replace("action-ign-","");
}
if(inp.hasClass("action-test")) {
data.val = inp.siblings("input").val();
if(data.val) {
data.mode = "test";
data.id = inp.attr("id").replace("action-tst-","");
}
}
if(data.mode!=="unknown") {
inp.after("<img src='"+ajax_object.gif+"' class='better-detection-spinner'>").hide().siblings("input[type=button]").hide();
jQuery.post(ajax_object.url, data, function(response) {
if(response==="Success") {
inp.closest("tr").fadeOut("slow",function() { //remove row
jQuery(this).remove();
var trs = jQuery("#better-detection-tabs-errors").find("tr");
if(trs.length===2) {
jQuery("#better-detection-tabs-errors").html("<p>No new errors have been detected - yay!</p>"); //if only header/footer left then show message
}
better_detection_error_count();
});
}
else {
inp.siblings("img").remove(); //remove working image
inp.siblings("input").addBack().show(); //restore buttons
}
});
}
});
});
15 changes: 15 additions & 0 deletions svn/tags/1.5/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
=== Better Detection ===
Contributors: bettersecurity, riklewis
Tags: better, better, security, detection, content, scanner
Requires at least: 3.5
Tested up to: 5.4
Stable tag: trunk
Requires PHP: 5.6
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Improve the security of your website by detecting unexpected changes to content

== Description ==

This plugin will create and store hashes of content (eg. posts, pages, etc.) and monitor these moving forwards in order to detect when changes occur. When changes are made outside of the normal working process, such as a direct database update, this will then be detected as the hash will get out of sync with the content.
Binary file added svn/tags/1.5/working.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 16 additions & 3 deletions svn/trunk/better-detection.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
--------------------------- Installation ---------------------------
*/

define('BETTER_DETECTION_VERSION','1.4');
define('BETTER_DETECTION_VERSION','1.5');

function better_detection_activation() {
global $wpdb;
Expand Down Expand Up @@ -86,6 +86,19 @@ function better_detection_database($table, $sql) {
return false;
}

/*
------------------------------ Update -------------------------------
*/

function better_detection_loaded() {
$dat_ver = get_option('better_detection_version') * 1;
$cur_ver = BETTER_DETECTION_VERSION * 1;
if($cur_ver > $dat_ver) {
better_detection_activation(); //run activation code if updated to new version
}
}
add_action('plugins_loaded', 'better_detection_loaded');

/*
-------------------------- Uninstallation ---------------------------
*/
Expand Down Expand Up @@ -920,12 +933,12 @@ function better_detection_links($links) {
}

//show Pro link
function better_detection_meta($links, $file) {
/*function better_detection_meta($links, $file) {
if($file===plugin_basename(__FILE__)) {
$links[] = '<a href="plugin-install.php?tab=plugin-information&plugin=better-security-pro&TB_iframe=true&width=600&height=550"><em><strong>' . __('Check out Better Security Pro', 'better-detect-text') . '</strong></em></a>';
}
return $links;
}
}*/

//add actions
if(is_admin()) {
Expand Down
2 changes: 1 addition & 1 deletion svn/trunk/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: bettersecurity, riklewis
Tags: better, better, security, detection, content, scanner
Requires at least: 3.5
Tested up to: 5.3
Tested up to: 5.4
Stable tag: trunk
Requires PHP: 5.6
License: GPLv3
Expand Down

0 comments on commit 8f9cae5

Please sign in to comment.