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 | A2 Optimized WP |
Version | 2.1.3.4 |
Comparing to | |
See all releases |
Code changes from version 2.1.3.3 to 2.1.3.4
- A2_Optimized_OptionsManager.php +47 -31
- a2-optimized.php +1 -1
- readme.txt +1 -1
A2_Optimized_OptionsManager.php
CHANGED
@@ -798,7 +798,7 @@ class A2_Optimized_OptionsManager {
|
|
798 |
|
799 |
if (isset($_GET['a2-page'])) {
|
800 |
if (isset($_GET['step'])) {
|
801 |
-
$step = $_GET['step'];
|
802 |
} else {
|
803 |
$step = 1;
|
804 |
}
|
@@ -844,9 +844,10 @@ class A2_Optimized_OptionsManager {
|
|
844 |
);
|
845 |
if (isset($_GET['a2-option']) && in_array($_GET['a2-option'], $allowed_notices)) {
|
846 |
if ($_GET['a2-option'] == 'a2_login_bookmark') {
|
847 |
-
update_option(
|
848 |
} else {
|
849 |
-
|
|
|
850 |
}
|
851 |
}
|
852 |
$this->settings_page_html();
|
@@ -879,8 +880,6 @@ class A2_Optimized_OptionsManager {
|
|
879 |
} else {
|
880 |
$this->settings_page_html();
|
881 |
}
|
882 |
-
|
883 |
-
ini_set('error_reporting', $ini_error_reporting);
|
884 |
}
|
885 |
|
886 |
/**
|
@@ -1680,7 +1679,7 @@ HTML;
|
|
1680 |
</div>
|
1681 |
</div>
|
1682 |
<div class="tab-content">
|
1683 |
-
<?php if (isset($_REQUEST['settings-updated']) && $
|
1684 |
<div class="notice notice-success is-dismissible"><p>Settings Saved</p></div>
|
1685 |
<?php } ?>
|
1686 |
<?php if (get_option('a2_optimized_memcached_invalid')) { ?>
|
@@ -1862,8 +1861,10 @@ HTML;
|
|
1862 |
}
|
1863 |
|
1864 |
if (check_admin_referer('a2opt-cache-save', 'a2opt-cache-nonce')) {
|
1865 |
-
|
1866 |
-
|
|
|
|
|
1867 |
$this->write_wp_config();
|
1868 |
}
|
1869 |
}
|
@@ -1889,9 +1890,26 @@ HTML;
|
|
1889 |
HTML;
|
1890 |
}
|
1891 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1892 |
/**
|
1893 |
* Get the status of the plugin
|
1894 |
-
*
|
1895 |
*/
|
1896 |
public function get_plugin_status() {
|
1897 |
$thisclass = $this;
|
@@ -1904,21 +1922,22 @@ HTML;
|
|
1904 |
$url_token = false;
|
1905 |
|
1906 |
if (isset($_GET['a2_token'])) {
|
1907 |
-
$url_token = $_GET['a2_token'];
|
1908 |
}
|
1909 |
|
1910 |
if (isset($_GET['disable_optimization']) && $url_token) {
|
1911 |
$hash = '';
|
1912 |
-
|
1913 |
-
$
|
1914 |
-
|
|
|
1915 |
if ($a2_token && $a2_token == $url_token) {
|
1916 |
-
if (isset($this->optimizations[$
|
1917 |
-
$this->optimizations[$
|
1918 |
}
|
1919 |
|
1920 |
-
if (isset($this->advanced_optimizations[$
|
1921 |
-
$this->advanced_optimizations[$
|
1922 |
$hash = '#optimization-advanced-tab';
|
1923 |
}
|
1924 |
} else {
|
@@ -1935,16 +1954,17 @@ JAVASCRIPT;
|
|
1935 |
|
1936 |
if (isset($_GET['enable_optimization']) && $url_token) {
|
1937 |
$hash = '';
|
1938 |
-
|
1939 |
-
$
|
1940 |
|
|
|
1941 |
if ($a2_token && $a2_token == $url_token) {
|
1942 |
-
if (isset($this->optimizations[$
|
1943 |
-
$this->optimizations[$
|
1944 |
}
|
1945 |
|
1946 |
-
if (isset($this->advanced_optimizations[$
|
1947 |
-
$this->advanced_optimizations[$
|
1948 |
$hash = '#optimization-advanced-tab';
|
1949 |
}
|
1950 |
} else {
|
@@ -2144,8 +2164,7 @@ JAVASCRIPT;
|
|
2144 |
// skip adding "disable" link if 'remove_link' key is set and site is behind cloudflare
|
2145 |
// used for Gzip options
|
2146 |
} else {
|
2147 |
-
$a2_token =
|
2148 |
-
set_transient('a2_token-' . $item['slug'], $a2_token, 180);
|
2149 |
$links[] = array("?page=$settings_slug&disable_optimization={$item['slug']}&a2_token={$a2_token}", 'Disable', '_self');
|
2150 |
}
|
2151 |
}
|
@@ -2171,8 +2190,7 @@ JAVASCRIPT;
|
|
2171 |
$glyph = 'warning-sign';
|
2172 |
|
2173 |
if (isset($item['disable'])) {
|
2174 |
-
$a2_token =
|
2175 |
-
set_transient('a2_token-' . $item['slug'], $a2_token, 180);
|
2176 |
$links[] = array("?page=$settings_slug&disable_optimization={$item['slug']}&a2_token={$a2_token}", 'Disable', '_self');
|
2177 |
}
|
2178 |
if (isset($item['settings'])) {
|
@@ -2197,8 +2215,7 @@ JAVASCRIPT;
|
|
2197 |
if (isset($item['update'])) {
|
2198 |
$action_text = 'Update Now';
|
2199 |
}
|
2200 |
-
$a2_token =
|
2201 |
-
set_transient('a2_token-' . $item['slug'], $a2_token, 180);
|
2202 |
$links[] = array("?page=$settings_slug&enable_optimization={$item['slug']}&a2_token={$a2_token}", $action_text, '_self');
|
2203 |
}
|
2204 |
|
@@ -2213,8 +2230,7 @@ JAVASCRIPT;
|
|
2213 |
}
|
2214 |
} else {
|
2215 |
if (isset($item['enable']) && $active_class == '') {
|
2216 |
-
$a2_token =
|
2217 |
-
set_transient('a2_token-' . $item['slug'], $a2_token, 180);
|
2218 |
$links[] = array("?page=$settings_slug&enable_optimization={$item['slug']}&a2_token={$a2_token}", 'Enable', '_self');
|
2219 |
}
|
2220 |
|
798 |
|
799 |
if (isset($_GET['a2-page'])) {
|
800 |
if (isset($_GET['step'])) {
|
801 |
+
$step = sanitize_text_field($_GET['step']);
|
802 |
} else {
|
803 |
$step = 1;
|
804 |
}
|
844 |
);
|
845 |
if (isset($_GET['a2-option']) && in_array($_GET['a2-option'], $allowed_notices)) {
|
846 |
if ($_GET['a2-option'] == 'a2_login_bookmark') {
|
847 |
+
update_option('a2_login_bookmark', get_option('a2_login_page'));
|
848 |
} else {
|
849 |
+
$a2_option = sanitize_text_field($_GET['a2-option']);
|
850 |
+
update_option($a2_option, '1');
|
851 |
}
|
852 |
}
|
853 |
$this->settings_page_html();
|
880 |
} else {
|
881 |
$this->settings_page_html();
|
882 |
}
|
|
|
|
|
883 |
}
|
884 |
|
885 |
/**
|
1679 |
</div>
|
1680 |
</div>
|
1681 |
<div class="tab-content">
|
1682 |
+
<?php if (isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated'] == 'true') { ?>
|
1683 |
<div class="notice notice-success is-dismissible"><p>Settings Saved</p></div>
|
1684 |
<?php } ?>
|
1685 |
<?php if (get_option('a2_optimized_memcached_invalid')) { ?>
|
1861 |
}
|
1862 |
|
1863 |
if (check_admin_referer('a2opt-cache-save', 'a2opt-cache-nonce')) {
|
1864 |
+
$a2opt_cache = sanitize_text_field($_REQUEST['a2opt-cache']);
|
1865 |
+
$a2_memcached_server = sanitize_text_field($_REQUEST['a2_optimized_memcached_server']);
|
1866 |
+
update_option('a2opt-cache', $a2opt_cache);
|
1867 |
+
update_option('a2_optimized_memcached_server', $a2_memcached_server);
|
1868 |
$this->write_wp_config();
|
1869 |
}
|
1870 |
}
|
1890 |
HTML;
|
1891 |
}
|
1892 |
|
1893 |
+
/**
|
1894 |
+
* Get a2 token from transients
|
1895 |
+
*/
|
1896 |
+
private function get_a2_token($slug) {
|
1897 |
+
return get_transient('a2_token-' . $slug);
|
1898 |
+
}
|
1899 |
+
|
1900 |
+
/**
|
1901 |
+
* Set a2 token in transients
|
1902 |
+
*/
|
1903 |
+
private function set_a2_token($slug) {
|
1904 |
+
$wp_salt = wp_salt('nonce');
|
1905 |
+
$token = md5(time() . $wp_salt . $slug);
|
1906 |
+
set_transient('a2_token-' . $slug, $token, 180);
|
1907 |
+
|
1908 |
+
return $token;
|
1909 |
+
}
|
1910 |
+
|
1911 |
/**
|
1912 |
* Get the status of the plugin
|
|
|
1913 |
*/
|
1914 |
public function get_plugin_status() {
|
1915 |
$thisclass = $this;
|
1922 |
$url_token = false;
|
1923 |
|
1924 |
if (isset($_GET['a2_token'])) {
|
1925 |
+
$url_token = sanitize_text_field($_GET['a2_token']);
|
1926 |
}
|
1927 |
|
1928 |
if (isset($_GET['disable_optimization']) && $url_token) {
|
1929 |
$hash = '';
|
1930 |
+
|
1931 |
+
$optimization = sanitize_text_field($_GET['disable_optimization']);
|
1932 |
+
|
1933 |
+
$a2_token = $this->get_a2_token($optimization);
|
1934 |
if ($a2_token && $a2_token == $url_token) {
|
1935 |
+
if (isset($this->optimizations[$optimization])) {
|
1936 |
+
$this->optimizations[$optimization]['disable']($optimization);
|
1937 |
}
|
1938 |
|
1939 |
+
if (isset($this->advanced_optimizations[$optimization])) {
|
1940 |
+
$this->advanced_optimizations[$optimization]['disable']($optimization);
|
1941 |
$hash = '#optimization-advanced-tab';
|
1942 |
}
|
1943 |
} else {
|
1954 |
|
1955 |
if (isset($_GET['enable_optimization']) && $url_token) {
|
1956 |
$hash = '';
|
1957 |
+
|
1958 |
+
$optimization = sanitize_text_field($_GET['enable_optimization']);
|
1959 |
|
1960 |
+
$a2_token = $this->get_a2_token($optimization);
|
1961 |
if ($a2_token && $a2_token == $url_token) {
|
1962 |
+
if (isset($this->optimizations[$optimization])) {
|
1963 |
+
$this->optimizations[$optimization]['enable']($optimization);
|
1964 |
}
|
1965 |
|
1966 |
+
if (isset($this->advanced_optimizations[$optimization])) {
|
1967 |
+
$this->advanced_optimizations[$optimization]['enable']($optimization);
|
1968 |
$hash = '#optimization-advanced-tab';
|
1969 |
}
|
1970 |
} else {
|
2164 |
// skip adding "disable" link if 'remove_link' key is set and site is behind cloudflare
|
2165 |
// used for Gzip options
|
2166 |
} else {
|
2167 |
+
$a2_token = $this->set_a2_token($item['slug']);
|
|
|
2168 |
$links[] = array("?page=$settings_slug&disable_optimization={$item['slug']}&a2_token={$a2_token}", 'Disable', '_self');
|
2169 |
}
|
2170 |
}
|
2190 |
$glyph = 'warning-sign';
|
2191 |
|
2192 |
if (isset($item['disable'])) {
|
2193 |
+
$a2_token = $this->set_a2_token($item['slug']);
|
|
|
2194 |
$links[] = array("?page=$settings_slug&disable_optimization={$item['slug']}&a2_token={$a2_token}", 'Disable', '_self');
|
2195 |
}
|
2196 |
if (isset($item['settings'])) {
|
2215 |
if (isset($item['update'])) {
|
2216 |
$action_text = 'Update Now';
|
2217 |
}
|
2218 |
+
$a2_token = $this->set_a2_token($item['slug']);
|
|
|
2219 |
$links[] = array("?page=$settings_slug&enable_optimization={$item['slug']}&a2_token={$a2_token}", $action_text, '_self');
|
2220 |
}
|
2221 |
|
2230 |
}
|
2231 |
} else {
|
2232 |
if (isset($item['enable']) && $active_class == '') {
|
2233 |
+
$a2_token = $this->set_a2_token($item['slug']);
|
|
|
2234 |
$links[] = array("?page=$settings_slug&enable_optimization={$item['slug']}&a2_token={$a2_token}", 'Enable', '_self');
|
2235 |
}
|
2236 |
|
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.3.
|
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.3.4
|
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.8
|
6 |
-
Stable tag: 2.1.3.
|
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.8
|
6 |
+
Stable tag: 2.1.3.4
|
7 |
Requires PHP: 5.6
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|