Acunetix WP Security - Version 3.0.6

Version Description

Download this release

Release Info

Developer WebsiteDefender
Plugin Icon wp plugin Acunetix WP Security
Version 3.0.6
Comparing to
See all releases

Code changes from version 3.0.5 to 3.0.6

Files changed (4) hide show
  1. libs/wpssUtil.php +119 -0
  2. readme.txt +8 -1
  3. securityscan.php +45 -18
  4. uninstall.php +2 -1
libs/wpssUtil.php ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * utility methods
4
+ *
5
+ * @author kos
6
+ */
7
+ class wpssUtil
8
+ {
9
+ /**
10
+ * @public
11
+ * @static
12
+ * @since v0.1
13
+ * @global WPSS_WSD_BLOG_FEED
14
+ *
15
+ * Retrieve and display a list of links for an existing RSS feed, limiting the selection to the 5 most recent items.
16
+ *
17
+ * @return void
18
+ */
19
+ public static function displayDashboardWidget()
20
+ {
21
+ //@ flag
22
+ $run = false;
23
+
24
+ //@ check cache
25
+ $optData = get_option('wsd_feed_data');
26
+ if (! empty($optData))
27
+ {
28
+ if (is_object($optData))
29
+ {
30
+
31
+ $lastUpdateTime = @$optData->expires;
32
+ // invalid cache
33
+ if (empty($lastUpdateTime)) { $run = true; }
34
+ else
35
+ {
36
+ $nextUpdateTime = $lastUpdateTime+(24*60*60);
37
+ if ($nextUpdateTime >= $lastUpdateTime)
38
+ {
39
+ $data = @$optData->data;
40
+ if (empty($data)) { $run = true; }
41
+ else {
42
+ // still a valid cache
43
+ echo $data;
44
+ return;
45
+ }
46
+ }
47
+ else { $run = true; }
48
+ }
49
+ }
50
+ else { $run = true; }
51
+ }
52
+ else { $run = true; }
53
+
54
+ if (!$run) { return; }
55
+
56
+ $rss = fetch_feed(WPSS_WSD_BLOG_FEED);
57
+
58
+ $out = '';
59
+ if (is_wp_error( $rss ) )
60
+ {
61
+ $out = '<li>'.__('An error has occurred while trying to load the rss feed!').'</li>';
62
+ echo $out;
63
+ return;
64
+ }
65
+ else
66
+ {
67
+ // Limit to 5 entries.
68
+ $maxitems = $rss->get_item_quantity(5);
69
+
70
+ // Build an array of all the items,
71
+ $rss_items = $rss->get_items(0, $maxitems);
72
+
73
+ $out .= '<ul>';
74
+ if ($maxitems == 0)
75
+ {
76
+ $out.= '<li>'.__('There are no entries for this rss feed!').'</li>';
77
+ }
78
+ else
79
+ {
80
+ foreach ( $rss_items as $item ) :
81
+ $url = esc_url($item->get_permalink());
82
+ $out.= '<li>';
83
+ $out.= '<h4><a href="'.$url.'" target="_blank" title="Posted on '.$item->get_date('F j, Y | g:i a').'">';
84
+ $out.= esc_html( $item->get_title() );
85
+ $out.= '</a></h4>';
86
+ $out.= '<p>';
87
+ $d = $item->get_description();
88
+ $p = substr($d, 0, 115).' <a href="'.$url.'" target="_blank" title="Read all article">[...]</a>';
89
+ $out.= $p;
90
+ $out.= '</p>';
91
+ $out.= '</li>';
92
+ endforeach;
93
+ }
94
+ $out.= '</ul>';
95
+ }
96
+
97
+ // Update cache
98
+ $obj = new stdClass();
99
+ $obj->expires = time();
100
+ $obj->data = $out;
101
+ update_option('wsd_feed_data', $obj);
102
+
103
+ echo $out;
104
+ }
105
+
106
+ /**
107
+ * @public
108
+ * @static
109
+ * @since v0.1
110
+ *
111
+ * Add the rss widget to dashboard
112
+ *
113
+ * @return void
114
+ */
115
+ public static function addDashboardWidget()
116
+ {
117
+ wp_add_dashboard_widget('acx_plugin_dashboard_widget', __('WebsiteDefender news and updates'), 'wpssUtil::displayDashboardWidget');
118
+ }
119
+ }
readme.txt CHANGED
@@ -1,4 +1,4 @@
1
- === Plugin Name ===
2
  Contributors: WebsiteDefender
3
  Author: WebsiteDefender
4
  Tags: security, securityscan, chmod, permissions, admin, administration, authentication, database, dashboard, post, notification, password, plugin, posts, wsd, websitedefender,
@@ -41,6 +41,13 @@ For more information on the WP Security Scan and other WordPress security news,
41
 
42
  == Changelog ==
43
 
 
 
 
 
 
 
 
44
  = v3.0.5 (07/20/2011) =
45
  * Bugfix: Updated the links to websitedefender.com
46
 
1
+ === WP Security Scan ===
2
  Contributors: WebsiteDefender
3
  Author: WebsiteDefender
4
  Tags: security, securityscan, chmod, permissions, admin, administration, authentication, database, dashboard, post, notification, password, plugin, posts, wsd, websitedefender,
41
 
42
  == Changelog ==
43
 
44
+ = v3.0.6 =
45
+ * Feature: The WebsiteDefender RSS widget added to the admin dashboard
46
+ * Update: The plug-in has been made compatible with Secure WP and WebsiteDefender WordPress Security
47
+ * Update: The plug-in can be safe used in a Multi User WP environment
48
+ * Bugfix: Fixed the bug related to the database ALTER rights retrieval
49
+ * BugFix: Fixed the version information script
50
+
51
  = v3.0.5 (07/20/2011) =
52
  * Bugfix: Updated the links to websitedefender.com
53
 
securityscan.php CHANGED
@@ -5,10 +5,16 @@ Plugin URI: http://www.websitedefender.com/news/free-wordpress-security-scan-plu
5
 
6
  Description: Perform security scan of WordPress installation.
7
  Author: WebsiteDefender
8
- Version: 3.0.5
9
  Author URI: http://www.websitedefender.com/
10
  */
11
 
 
 
 
 
 
 
12
  /*
13
  Copyright (C) 2008-2010 Acunetix / http://www.websitedefender.com/
14
  (info AT websitedefender DOT com)
@@ -39,20 +45,18 @@ if ( ! defined('WP_PLUGIN_URL')) {
39
  if ( ! defined('WP_PLUGIN_DIR')) {
40
  define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
41
  }
42
-
43
- //main files
44
- //## $rev #1 07/17/2011 {c}$
 
45
  if(!function_exists('json_encode') || !class_exists('Services_JSON')) {
46
- require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/json.php");
47
  }
48
-
49
  require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/functions.php");
50
 
51
- //## $rev #1 07/17/2011 {c}$
52
  if (!defined('WSD_RECAPTCHA_API_SERVER')) {
53
- require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/recaptchalib.php");
54
  }
55
-
56
  require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/wsd.php");
57
 
58
  //menus
@@ -67,6 +71,8 @@ require_once(WP_PLUGIN_DIR . "/wp-security-scan/inc/admin/templates/footer.php")
67
 
68
  //## this is the container for header scripts
69
  add_action('admin_head', 'mrt_hd');
 
 
70
 
71
  //before sending headers
72
  add_action("init",'mrt_wpdberrors',1);
@@ -82,6 +88,21 @@ add_action("init", 'mrt_remove_wp_version',1); //comment out this line to make
82
  //before rendering each admin init
83
  add_action('admin_init','mrt_wpss_admin_init');
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
 
86
  function mrt_wpss_admin_init(){
87
  wp_enqueue_style('wsd_style', WP_PLUGIN_URL . '/wp-security-scan/css/wsd.css');
@@ -92,10 +113,10 @@ function add_men_pg() {
92
  if (function_exists('add_menu_page'))
93
  {
94
  add_menu_page('Security', 'Security', 'edit_pages', __FILE__, 'mrt_opt_mng_pg', WP_PLUGIN_URL.'/wp-security-scan/images/wsd-logo-small.png');
95
- add_submenu_page(__FILE__, 'Scanner', 'Scanner', 'edit_pages', 'scanner', 'mrt_sub0');
96
- add_submenu_page(__FILE__, 'Password Tool', 'Password Tool', 'edit_pages', 'passwordtool', 'mrt_sub1');
97
- add_submenu_page(__FILE__, 'Database', 'Database', 'edit_pages', 'database', 'mrt_sub3');
98
- add_submenu_page(__FILE__, 'Support', 'Support', 'edit_pages', 'support', 'mrt_sub2');
99
  }
100
  }
101
 
@@ -199,14 +220,20 @@ function wpss_mrt_meta_box2()
199
  </ul>
200
  <?php
201
  }
202
-
 
 
 
 
 
 
 
 
 
 
203
  function mrt_hd()
204
  {
205
  ?>
206
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL;?>/wp-security-scan/js/json.js"></script>
207
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL;?>/wp-security-scan/js/md5.js"></script>
208
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL;?>/wp-security-scan/js/scripts.js"></script>
209
- <script type="text/javascript" src="<?php echo WP_PLUGIN_URL;?>/wp-security-scan/js/wsd.js"></script>
210
  <script type="text/javascript">
211
  var wordpress_site_name = "<?php echo htmlentities(get_bloginfo('siteurl'));?>"
212
  </script>
5
 
6
  Description: Perform security scan of WordPress installation.
7
  Author: WebsiteDefender
8
+ Version: 3.0.6
9
  Author URI: http://www.websitedefender.com/
10
  */
11
 
12
+ /*
13
+ * $rev #1 07/17/2011 {c}
14
+ * $rev #2 07/26,27/2011 {c}
15
+ * $rev #3 08/05/2011 {c}
16
+ * $rev #4 08/26/2011 {c}
17
+ */
18
  /*
19
  Copyright (C) 2008-2010 Acunetix / http://www.websitedefender.com/
20
  (info AT websitedefender DOT com)
45
  if ( ! defined('WP_PLUGIN_DIR')) {
46
  define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
47
  }
48
+
49
+
50
+
51
+ //## $rev #1, #2, #3 {c}$
52
  if(!function_exists('json_encode') || !class_exists('Services_JSON')) {
53
+ @require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/json.php");
54
  }
 
55
  require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/functions.php");
56
 
 
57
  if (!defined('WSD_RECAPTCHA_API_SERVER')) {
58
+ @require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/recaptchalib.php");
59
  }
 
60
  require_once(WP_PLUGIN_DIR . "/wp-security-scan/libs/wsd.php");
61
 
62
  //menus
71
 
72
  //## this is the container for header scripts
73
  add_action('admin_head', 'mrt_hd');
74
+ // # $rev #2 {c}
75
+ add_action('admin_init', 'wps_admin_init_load_resources');
76
 
77
  //before sending headers
78
  add_action("init",'mrt_wpdberrors',1);
88
  //before rendering each admin init
89
  add_action('admin_init','mrt_wpss_admin_init');
90
 
91
+ // Check to see whether or not we should display the dashboard widget
92
+ //@ $rev4
93
+ $plugin1 = 'websitedefender-wordpress-security';
94
+ $plugin2 = 'secure-wordpress';
95
+ if (! in_array($plugin1.'/'.$plugin1.'.php', apply_filters('active_plugins', get_option('active_plugins')))
96
+ || ! in_array($plugin2.'/'.$plugin2.'.php', apply_filters('active_plugins', get_option('active_plugins'))))
97
+ {
98
+ define('WPSS_WSD_BLOG_FEED', 'http://www.websitedefender.com/feed/');
99
+ @require_once('libs/wpssUtil.php');
100
+ //@@ Hook into the 'wp_dashboard_setup' action to create the dashboard widget
101
+ add_action('wp_dashboard_setup', "wpssUtil::addDashboardWidget");
102
+ }
103
+ unset($plugin1,$plugin2);
104
+
105
+ //@===
106
 
107
  function mrt_wpss_admin_init(){
108
  wp_enqueue_style('wsd_style', WP_PLUGIN_URL . '/wp-security-scan/css/wsd.css');
113
  if (function_exists('add_menu_page'))
114
  {
115
  add_menu_page('Security', 'Security', 'edit_pages', __FILE__, 'mrt_opt_mng_pg', WP_PLUGIN_URL.'/wp-security-scan/images/wsd-logo-small.png');
116
+ add_submenu_page(__FILE__, 'Scanner', 'Scanner', 'edit_pages', 'scanner', 'mrt_sub0');
117
+ add_submenu_page(__FILE__, 'Password Tool', 'Password Tool', 'edit_pages', 'passwordtool', 'mrt_sub1');
118
+ add_submenu_page(__FILE__, 'Database', 'Database', 'edit_pages', 'database', 'mrt_sub3');
119
+ add_submenu_page(__FILE__, 'Support', 'Support', 'edit_pages', 'support', 'mrt_sub2');
120
  }
121
  }
122
 
220
  </ul>
221
  <?php
222
  }
223
+
224
+
225
+ // $rev #2: only load if they're not already.
226
+ function wps_admin_init_load_resources()
227
+ {
228
+ wp_enqueue_script('acx-json', WP_PLUGIN_URL.'/wp-security-scan/js/json.js');
229
+ wp_enqueue_script('acx-md5', WP_PLUGIN_URL.'/wp-security-scan/js/md5.js');
230
+ wp_enqueue_script('wsd-scripts', WP_PLUGIN_URL.'/wp-security-scan/js/scripts.js');
231
+ wp_enqueue_script('wsd-wsd', WP_PLUGIN_URL.'/wp-security-scan/js/wsd.js');
232
+ }
233
+
234
  function mrt_hd()
235
  {
236
  ?>
 
 
 
 
237
  <script type="text/javascript">
238
  var wordpress_site_name = "<?php echo htmlentities(get_bloginfo('siteurl'));?>"
239
  </script>
uninstall.php CHANGED
@@ -5,4 +5,5 @@
5
  delete_option('WSD-COOKIE');
6
  delete_option('WSD-TOKEN');
7
  delete_option('WSD-TARGETID');
8
- delete_option('WSD-USER');
 
5
  delete_option('WSD-COOKIE');
6
  delete_option('WSD-TOKEN');
7
  delete_option('WSD-TARGETID');
8
+ delete_option('WSD-USER');
9
+ delete_option('wsd_feed_data');