A2 Optimized WP - Version 2.1.2

Version Description

= 2.0.10.9 = Important security update. Please upgrade immediately.

= 2.0 = New GPL plugin, now updates are through the wordpress.org repository

Download this release

Release Info

Developer a2hosting
Plugin Icon 128x128 A2 Optimized WP
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

A2_Optimized_OptionsManager.php CHANGED
@@ -434,7 +434,6 @@ class A2_Optimized_OptionsManager {
434
  copy( A2OPT_DIR . '/object-cache.php', WP_CONTENT_DIR . '/object-cache.php' );
435
 
436
  $this->write_wp_config();
437
-
438
  update_option('a2_object_cache_enabled', 1);
439
  }
440
 
@@ -2495,9 +2494,23 @@ HTML;
2495
  $lockdown = $this->get_lockdown();
2496
  $nomods = $this->get_nomods();
2497
  $obj_server = $this->get_memcached_server();
 
 
 
 
 
 
 
2498
 
2499
  touch(ABSPATH . 'wp-config.php');
2500
- copy(ABSPATH . 'wp-config.php', ABSPATH . 'wp-config.bak-a2.php');
 
 
 
 
 
 
 
2501
 
2502
  $a2_config = <<<PHP
2503
 
@@ -2543,6 +2556,13 @@ PHP;
2543
  $fh = fopen(ABSPATH . 'wp-config.php', 'w+');
2544
  fwrite($fh, $wpconfig);
2545
  fclose($fh);
 
 
 
 
 
 
 
2546
  }
2547
 
2548
  /**
434
  copy( A2OPT_DIR . '/object-cache.php', WP_CONTENT_DIR . '/object-cache.php' );
435
 
436
  $this->write_wp_config();
 
437
  update_option('a2_object_cache_enabled', 1);
438
  }
439
 
2494
  $lockdown = $this->get_lockdown();
2495
  $nomods = $this->get_nomods();
2496
  $obj_server = $this->get_memcached_server();
2497
+ $backup_filename = 'wp-config.bak-a2.php';
2498
+ $error_message = '<div class="notice notice-error"><p>Unable to write to ' . ABSPATH . 'wp-config.php. Please check file permissions.</p><p><a href="' . admin_url('admin.php?page=A2_Optimized_Plugin_admin') . '">Back to A2 Optimized</a></p></div>';
2499
+
2500
+ if (!file_exists(ABSPATH . 'wp-config.php')) {
2501
+ echo $error_message;
2502
+ exit;
2503
+ }
2504
 
2505
  touch(ABSPATH . 'wp-config.php');
2506
+ copy(ABSPATH . 'wp-config.php', ABSPATH . $backup_filename);
2507
+
2508
+ $config_hash = sha1(file_get_contents(ABSPATH . 'wp-config.php'));
2509
+ $backup_config_hash = sha1(file_get_contents(ABSPATH . $backup_filename));
2510
+ if ($config_hash != $backup_config_hash || filesize(ABSPATH . $backup_filename) == 0) {
2511
+ echo $error_message;
2512
+ exit;
2513
+ }
2514
 
2515
  $a2_config = <<<PHP
2516
 
2556
  $fh = fopen(ABSPATH . 'wp-config.php', 'w+');
2557
  fwrite($fh, $wpconfig);
2558
  fclose($fh);
2559
+
2560
+ $updated_config_hash = sha1(file_get_contents(ABSPATH . 'wp-config.php'));
2561
+ if ($updated_config_hash != sha1($wpconfig) || filesize(ABSPATH . 'wp-config.php') == 0) {
2562
+ copy(ABSPATH . $backup_filename, ABSPATH . 'wp-config.php');
2563
+ echo $error_message;
2564
+ exit;
2565
+ }
2566
  }
2567
 
2568
  /**
a2-optimized.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: A2 Optimized WP
4
  Plugin URI: https://wordpress.org/plugins/a2-optimized/
5
- Version: 2.1.1
6
  Author: A2 Hosting
7
  Author URI: https://www.a2hosting.com/
8
  Description: A2 Optimized - WordPress Optimization Plugin
2
  /*
3
  Plugin Name: A2 Optimized WP
4
  Plugin URI: https://wordpress.org/plugins/a2-optimized/
5
+ Version: 2.1.2
6
  Author: A2 Hosting
7
  Author URI: https://www.a2hosting.com/
8
  Description: A2 Optimized - WordPress Optimization Plugin
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: A2BCool, a2hosting, dmatteson, sputala
3
  Tags: Speed, Optimize, Secure, Fast, W3 Total Cache, W3TC, Hosting
4
  Requires at least: 5.1
5
  Tested up to: 5.7.1
6
- Stable tag: 2.1.1
7
  Requires PHP: 5.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
3
  Tags: Speed, Optimize, Secure, Fast, W3 Total Cache, W3TC, Hosting
4
  Requires at least: 5.1
5
  Tested up to: 5.7.1
6
+ Stable tag: 2.1.2
7
  Requires PHP: 5.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html