Version Description
Released 2016-05-30
- Enhancement: filters for logs.
- Enhancement: can now change the email address for automatic updates.
- Enhancement: warnings now show up in the Advanced tab if automatic updates are disabled by something other than this plugin.
Download this release
Release Info
| Developer | ronalfy |
| Plugin | |
| Version | 6.1.0 |
| Comparing to | |
| See all releases | |
Code changes from version 6.0.5 to 6.1.0
- css/style.css +30 -16
- includes/MPSUM_Admin_Advanced.php +12 -0
- includes/MPSUM_Admin_Core.php +61 -1
- includes/MPSUM_Disable_Updates.php +30 -0
- includes/MPSUM_Logs_List_Table.php +152 -2
- main.php +1 -1
- readme.txt +13 -3
css/style.css
CHANGED
|
@@ -53,7 +53,7 @@
|
|
| 53 |
max-width: 0;
|
| 54 |
opacity: 0;
|
| 55 |
}
|
| 56 |
-
.dashboard-item-choice
|
| 57 |
display: block;
|
| 58 |
position: relative;
|
| 59 |
text-indent: -5000px;
|
|
@@ -63,7 +63,7 @@
|
|
| 63 |
float: right;
|
| 64 |
}
|
| 65 |
.dashboard-item-choice .mpsum-spinner {
|
| 66 |
-
|
| 67 |
}
|
| 68 |
|
| 69 |
.dashboard-item-choice input + label:before {
|
|
@@ -205,9 +205,9 @@
|
|
| 205 |
padding-bottom:20px;
|
| 206 |
}
|
| 207 |
.dashboard-item-wrapper p {
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
}
|
| 212 |
/*
|
| 213 |
.dashboard-main-wrapper:nth-child( odd ) {
|
|
@@ -271,35 +271,49 @@ label{
|
|
| 271 |
background-position: 0 -24px;
|
| 272 |
}
|
| 273 |
.button.delete {
|
| 274 |
-
|
| 275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 276 |
}
|
| 277 |
|
| 278 |
@media only screen and (max-width:1200px) {
|
| 279 |
#dashboard-main-outputs {
|
| 280 |
-
|
| 281 |
}
|
| 282 |
}
|
| 283 |
@media only screen and (max-width:1000px) {
|
| 284 |
#dashboard-main-outputs .dashboard-main-wrapper {
|
| 285 |
-
|
| 286 |
-
|
| 287 |
|
| 288 |
}
|
| 289 |
.dashboard-item-wrapper {
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
}
|
| 294 |
}
|
| 295 |
@media only screen and (max-width:782px) {
|
| 296 |
#dashboard-main-outputs .dashboard-main-wrapper {
|
| 297 |
-
|
| 298 |
}
|
| 299 |
#dashboard-main-outputs {
|
| 300 |
-
|
| 301 |
}
|
| 302 |
#dashboard-main-outputs input[type=radio]:checked:before {
|
| 303 |
-
|
| 304 |
}
|
| 305 |
}
|
| 53 |
max-width: 0;
|
| 54 |
opacity: 0;
|
| 55 |
}
|
| 56 |
+
.dashboard-item-choice input + label {
|
| 57 |
display: block;
|
| 58 |
position: relative;
|
| 59 |
text-indent: -5000px;
|
| 63 |
float: right;
|
| 64 |
}
|
| 65 |
.dashboard-item-choice .mpsum-spinner {
|
| 66 |
+
float: right;
|
| 67 |
}
|
| 68 |
|
| 69 |
.dashboard-item-choice input + label:before {
|
| 205 |
padding-bottom:20px;
|
| 206 |
}
|
| 207 |
.dashboard-item-wrapper p {
|
| 208 |
+
padding: 15px;
|
| 209 |
+
padding-bottom: 0;
|
| 210 |
+
margin-bottom: 0;
|
| 211 |
}
|
| 212 |
/*
|
| 213 |
.dashboard-main-wrapper:nth-child( odd ) {
|
| 271 |
background-position: 0 -24px;
|
| 272 |
}
|
| 273 |
.button.delete {
|
| 274 |
+
background-color: #e14d43;
|
| 275 |
+
color: #FFF;
|
| 276 |
+
}
|
| 277 |
+
.mpsum-error {
|
| 278 |
+
background: #fff;
|
| 279 |
+
border-left: 4px solid #dc3232;
|
| 280 |
+
-webkit-box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
| 281 |
+
box-shadow: 0 1px 1px 0 rgba( 0, 0, 0, 0.1 );
|
| 282 |
+
margin: 5px 15px 2px;
|
| 283 |
+
padding: 1px 12px;
|
| 284 |
+
margin: 5px 0 15px;
|
| 285 |
+
color: #ff0000;
|
| 286 |
+
}
|
| 287 |
+
.mpsum_error p {
|
| 288 |
+
margin: 0.5em 0;
|
| 289 |
+
padding: 2px;
|
| 290 |
}
|
| 291 |
|
| 292 |
@media only screen and (max-width:1200px) {
|
| 293 |
#dashboard-main-outputs {
|
| 294 |
+
width:100%;
|
| 295 |
}
|
| 296 |
}
|
| 297 |
@media only screen and (max-width:1000px) {
|
| 298 |
#dashboard-main-outputs .dashboard-main-wrapper {
|
| 299 |
+
width: 48.5%;
|
| 300 |
+
padding:0;
|
| 301 |
|
| 302 |
}
|
| 303 |
.dashboard-item-wrapper {
|
| 304 |
+
min-height: auto;
|
| 305 |
+
max-height: 700px;
|
| 306 |
+
overflow: auto;
|
| 307 |
}
|
| 308 |
}
|
| 309 |
@media only screen and (max-width:782px) {
|
| 310 |
#dashboard-main-outputs .dashboard-main-wrapper {
|
| 311 |
+
width: 98.5%;
|
| 312 |
}
|
| 313 |
#dashboard-main-outputs {
|
| 314 |
+
margin-top: 20px;
|
| 315 |
}
|
| 316 |
#dashboard-main-outputs input[type=radio]:checked:before {
|
| 317 |
+
margin:0 !important;
|
| 318 |
}
|
| 319 |
}
|
includes/MPSUM_Admin_Advanced.php
CHANGED
|
@@ -238,6 +238,18 @@ class MPSUM_Admin_Advanced {
|
|
| 238 |
</form>
|
| 239 |
<form action="<?php echo esc_url( add_query_arg( array() ) ); ?>" method="post">
|
| 240 |
<h3><?php esc_html_e( 'Force Automatic Updates', 'stops-core-theme-and-plugin-updates' ); ?></h3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
<p><?php esc_html_e( 'This will attempt to force automatic updates. This is useful for debugging.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
| 242 |
<input type="hidden" name="action" value='mpsum_force_updates' />
|
| 243 |
<?php
|
| 238 |
</form>
|
| 239 |
<form action="<?php echo esc_url( add_query_arg( array() ) ); ?>" method="post">
|
| 240 |
<h3><?php esc_html_e( 'Force Automatic Updates', 'stops-core-theme-and-plugin-updates' ); ?></h3>
|
| 241 |
+
<?php
|
| 242 |
+
if ( defined( 'AUTOMATIC_UPDATER_DISABLED' ) && true == AUTOMATIC_UPDATER_DISABLED ) {
|
| 243 |
+
?>
|
| 244 |
+
<div class="mpsum-error"><p><strong><?php esc_html_e( 'Automatic updates are disabled. Please check your wp-config.php file for AUTOMATIC_UPDATER_DISABLED and remove the line.' ); ?> </strong></p></div>
|
| 245 |
+
<?php
|
| 246 |
+
}
|
| 247 |
+
if ( defined( 'WP_AUTO_UPDATE_CORE' ) && false == WP_AUTO_UPDATE_CORE ) {
|
| 248 |
+
?>
|
| 249 |
+
<div class="mpsum-error"><p><strong><?php esc_html_e( 'Automatic updates for Core are disabled. Please check your wp-config.php file for WP_AUTO_UPDATE_CORE and remove the line.' ); ?> </strong></p></div>
|
| 250 |
+
<?php
|
| 251 |
+
}
|
| 252 |
+
?>
|
| 253 |
<p><?php esc_html_e( 'This will attempt to force automatic updates. This is useful for debugging.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
| 254 |
<input type="hidden" name="action" value='mpsum_force_updates' />
|
| 255 |
<?php
|
includes/MPSUM_Admin_Core.php
CHANGED
|
@@ -82,6 +82,7 @@ class MPSUM_Admin_Core {
|
|
| 82 |
'notification_core_update_emails_themes' => 'on',
|
| 83 |
'notification_core_update_emails_translations' => 'on',
|
| 84 |
'logs' => 'off',
|
|
|
|
| 85 |
) );
|
| 86 |
}
|
| 87 |
|
|
@@ -107,17 +108,46 @@ class MPSUM_Admin_Core {
|
|
| 107 |
$query_args = array();
|
| 108 |
$query_args[ 'updated' ] = "1";
|
| 109 |
$query_args[ 'tab' ] = 'main';
|
|
|
|
|
|
|
| 110 |
|
| 111 |
//Save options
|
| 112 |
$options = $_POST[ 'options' ];
|
| 113 |
if ( isset( $_POST[ 'reset' ] ) ) {
|
| 114 |
$options = self::get_defaults();
|
| 115 |
}
|
|
|
|
| 116 |
$options_to_save = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
foreach( $options as $key => $value ) {
|
|
|
|
|
|
|
| 118 |
$option_value = sanitize_text_field( $value );
|
| 119 |
$options_to_save[ sanitize_key( $key ) ] = $option_value;
|
| 120 |
}
|
|
|
|
|
|
|
| 121 |
MPSUM_Updates_Manager::update_options( $options_to_save, 'core' );
|
| 122 |
|
| 123 |
//Redirect back to settings screen
|
|
@@ -144,7 +174,12 @@ class MPSUM_Admin_Core {
|
|
| 144 |
?>
|
| 145 |
<br />
|
| 146 |
<div class="updated"><p><strong><?php echo esc_html( $message ); ?></strong></p></div>
|
| 147 |
-
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
}
|
| 149 |
|
| 150 |
?>
|
|
@@ -265,6 +300,31 @@ class MPSUM_Admin_Core {
|
|
| 265 |
<p class="description"><?php esc_html_e( 'Disable e-mails that are sent when your site has been upgraded automatically. These will not be functional until WordPress 4.5.', 'stops-core-theme-and-plugin-updates' ); ?></p>*/ ?>
|
| 266 |
</td>
|
| 267 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 268 |
</table>
|
| 269 |
<h3><?php esc_html_e( 'Miscellaneous', 'stops-core-theme-and-plugin-updates' ); ?></h3>
|
| 270 |
<table class="form-table">
|
| 82 |
'notification_core_update_emails_themes' => 'on',
|
| 83 |
'notification_core_update_emails_translations' => 'on',
|
| 84 |
'logs' => 'off',
|
| 85 |
+
'email_addresses' => array(),
|
| 86 |
) );
|
| 87 |
}
|
| 88 |
|
| 108 |
$query_args = array();
|
| 109 |
$query_args[ 'updated' ] = "1";
|
| 110 |
$query_args[ 'tab' ] = 'main';
|
| 111 |
+
|
| 112 |
+
|
| 113 |
|
| 114 |
//Save options
|
| 115 |
$options = $_POST[ 'options' ];
|
| 116 |
if ( isset( $_POST[ 'reset' ] ) ) {
|
| 117 |
$options = self::get_defaults();
|
| 118 |
}
|
| 119 |
+
|
| 120 |
$options_to_save = array();
|
| 121 |
+
|
| 122 |
+
//Check for valid e-mail address
|
| 123 |
+
if ( isset( $options[ 'email_addresses' ] ) ) {
|
| 124 |
+
$email_addresses = explode( ',', $options[ 'email_addresses' ] );
|
| 125 |
+
$email_addresses_to_save = array();
|
| 126 |
+
if ( count( $email_addresses ) > 0 ) {
|
| 127 |
+
foreach( $email_addresses as $email ) {
|
| 128 |
+
if ( ! is_email( $email ) && ! empty( $email ) ) {
|
| 129 |
+
$email_addresses_to_save = array();
|
| 130 |
+
$query_args[ 'bad_email' ] = 1;
|
| 131 |
+
break;
|
| 132 |
+
} else {
|
| 133 |
+
if ( ! empty( $email ) ) {
|
| 134 |
+
$email_addresses_to_save[] = $email;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
}
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
$options_to_save[ 'email_addresses' ] = $email_addresses_to_save;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
foreach( $options as $key => $value ) {
|
| 144 |
+
if ( 'email_addresses' == $key ) continue;
|
| 145 |
+
|
| 146 |
$option_value = sanitize_text_field( $value );
|
| 147 |
$options_to_save[ sanitize_key( $key ) ] = $option_value;
|
| 148 |
}
|
| 149 |
+
//die( '<pre>' . print_r( $options_to_save, true ) );
|
| 150 |
+
|
| 151 |
MPSUM_Updates_Manager::update_options( $options_to_save, 'core' );
|
| 152 |
|
| 153 |
//Redirect back to settings screen
|
| 174 |
?>
|
| 175 |
<br />
|
| 176 |
<div class="updated"><p><strong><?php echo esc_html( $message ); ?></strong></p></div>
|
| 177 |
+
<?php
|
| 178 |
+
if ( isset( $_GET[ 'bad_email' ] ) ) {
|
| 179 |
+
?>
|
| 180 |
+
<div class="error"><p><strong><?php echo esc_html__( 'The email address is not valid', 'stops-core-theme-and-plugin-updates' ); ?></strong></p></div>
|
| 181 |
+
<?php
|
| 182 |
+
}
|
| 183 |
}
|
| 184 |
|
| 185 |
?>
|
| 300 |
<p class="description"><?php esc_html_e( 'Disable e-mails that are sent when your site has been upgraded automatically. These will not be functional until WordPress 4.5.', 'stops-core-theme-and-plugin-updates' ); ?></p>*/ ?>
|
| 301 |
</td>
|
| 302 |
</tr>
|
| 303 |
+
<tr>
|
| 304 |
+
<th scope="row"><?php esc_html_e( 'Notification E-mail', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
| 305 |
+
<td>
|
| 306 |
+
<?php
|
| 307 |
+
$email_addresses = array();
|
| 308 |
+
if ( isset( $options[ 'email_addresses' ] ) && is_array( $options[ 'email_addresses' ] ) ) {
|
| 309 |
+
foreach( $options[ 'email_addresses' ] as $email ) {
|
| 310 |
+
if ( ! is_email( $email ) ) {
|
| 311 |
+
$email_addresses = array();
|
| 312 |
+
break;
|
| 313 |
+
} else {
|
| 314 |
+
$email_addresses[] = $email;
|
| 315 |
+
}
|
| 316 |
+
}
|
| 317 |
+
if ( ! empty( $email_addresses ) ) {
|
| 318 |
+
$email_addresses = implode( ',', $options[ 'email_addresses' ] );
|
| 319 |
+
} else {
|
| 320 |
+
$email_addresses = '';
|
| 321 |
+
}
|
| 322 |
+
}
|
| 323 |
+
?>
|
| 324 |
+
<input type="text" name="options[email_addresses]" value="<?php echo esc_attr( $email_addresses ); ?>" style="width: 50%" /><br />
|
| 325 |
+
<em><?php echo esc_html_e( 'Emails can be comma separated', 'stops-core-theme-and-plugin-updates' ); ?></em>
|
| 326 |
+
</td>
|
| 327 |
+
</tr>
|
| 328 |
</table>
|
| 329 |
<h3><?php esc_html_e( 'Miscellaneous', 'stops-core-theme-and-plugin-updates' ); ?></h3>
|
| 330 |
<table class="form-table">
|
includes/MPSUM_Disable_Updates.php
CHANGED
|
@@ -156,6 +156,9 @@ class MPSUM_Disable_Updates {
|
|
| 156 |
}
|
| 157 |
}
|
| 158 |
|
|
|
|
|
|
|
|
|
|
| 159 |
|
| 160 |
//Prevent updates on themes/plugins
|
| 161 |
add_filter( 'site_transient_update_plugins', array( $this, 'disable_plugin_notifications' ), 50 );
|
|
@@ -164,6 +167,33 @@ class MPSUM_Disable_Updates {
|
|
| 164 |
|
| 165 |
} //end constructor
|
| 166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
/**
|
| 168 |
* Maybe disable updates.
|
| 169 |
*
|
| 156 |
}
|
| 157 |
}
|
| 158 |
|
| 159 |
+
//Automatic Updates E-mail Address
|
| 160 |
+
add_filter( 'auto_core_update_email', array( $this, 'maybe_change_automatic_update_email' ), 50 );
|
| 161 |
+
|
| 162 |
|
| 163 |
//Prevent updates on themes/plugins
|
| 164 |
add_filter( 'site_transient_update_plugins', array( $this, 'disable_plugin_notifications' ), 50 );
|
| 167 |
|
| 168 |
} //end constructor
|
| 169 |
|
| 170 |
+
/**
|
| 171 |
+
* Maybe change automatic update email
|
| 172 |
+
*
|
| 173 |
+
* @since 6.1.0
|
| 174 |
+
* @access public
|
| 175 |
+
* @see __construct
|
| 176 |
+
*
|
| 177 |
+
* @param array $email array
|
| 178 |
+
*
|
| 179 |
+
* @return array email array
|
| 180 |
+
*
|
| 181 |
+
*/
|
| 182 |
+
public function maybe_change_automatic_update_email( $email ) {
|
| 183 |
+
$core_options = MPSUM_Updates_Manager::get_options( 'core' );
|
| 184 |
+
$email_addresses = isset( $core_options[ 'email_addresses' ] ) ? $core_options[ 'email_addresses' ] : array();
|
| 185 |
+
$email_addresses_to_override = array();
|
| 186 |
+
foreach( $email_addresses as $emails ) {
|
| 187 |
+
if ( is_email( $emails ) ) {
|
| 188 |
+
$email_addresses_to_override[] = $emails;
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
if ( ! empty( $email_addresses_to_override ) ) {
|
| 192 |
+
$email[ 'to' ] = $email_addresses_to_override;
|
| 193 |
+
}
|
| 194 |
+
return $email;
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
/**
|
| 198 |
* Maybe disable updates.
|
| 199 |
*
|
includes/MPSUM_Logs_List_Table.php
CHANGED
|
@@ -8,6 +8,8 @@
|
|
| 8 |
* @access private
|
| 9 |
*/
|
| 10 |
class MPSUM_Logs_List_Table extends MPSUM_List_Table {
|
|
|
|
|
|
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Constructor.
|
|
@@ -23,12 +25,13 @@ class MPSUM_Logs_List_Table extends MPSUM_List_Table {
|
|
| 23 |
* @param array $args An associative array of arguments.
|
| 24 |
*/
|
| 25 |
public function __construct( $args = array() ) {
|
| 26 |
-
global $post_type_object, $wpdb;
|
| 27 |
|
| 28 |
parent::__construct( array(
|
| 29 |
'singular'=> 'log',
|
| 30 |
'plural' => 'logs',
|
| 31 |
) );
|
|
|
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
public function prepare_items() {
|
|
@@ -44,7 +47,34 @@ class MPSUM_Logs_List_Table extends MPSUM_List_Table {
|
|
| 44 |
} else {
|
| 45 |
$offset = ( $paged -1 ) * $per_page;
|
| 46 |
}
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
$this->items = $wpdb->get_results( $query );
|
| 50 |
|
|
@@ -60,6 +90,126 @@ class MPSUM_Logs_List_Table extends MPSUM_List_Table {
|
|
| 60 |
'per_page' => $per_page
|
| 61 |
) );
|
| 62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
/**
|
| 65 |
*
|
| 8 |
* @access private
|
| 9 |
*/
|
| 10 |
class MPSUM_Logs_List_Table extends MPSUM_List_Table {
|
| 11 |
+
|
| 12 |
+
private $url = '';
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Constructor.
|
| 25 |
* @param array $args An associative array of arguments.
|
| 26 |
*/
|
| 27 |
public function __construct( $args = array() ) {
|
|
|
|
| 28 |
|
| 29 |
parent::__construct( array(
|
| 30 |
'singular'=> 'log',
|
| 31 |
'plural' => 'logs',
|
| 32 |
) );
|
| 33 |
+
|
| 34 |
+
$this->url = add_query_arg( array( 'tab' => 'logs' ), MPSUM_Admin::get_url() );
|
| 35 |
}
|
| 36 |
|
| 37 |
public function prepare_items() {
|
| 47 |
} else {
|
| 48 |
$offset = ( $paged -1 ) * $per_page;
|
| 49 |
}
|
| 50 |
+
|
| 51 |
+
$month = isset( $_GET[ 'm' ] ) ? absint( $_GET[ 'm' ] ) : 0;
|
| 52 |
+
|
| 53 |
+
$where = '';
|
| 54 |
+
if ( isset( $_GET[ 'm' ] ) && strlen( $_GET[ 'm' ] ) > 4 ) {
|
| 55 |
+
$where .= " AND YEAR($tablename.date)=" . substr($month, 0, 4);
|
| 56 |
+
if ( strlen( $month ) > 5 ) {
|
| 57 |
+
$where .= " AND MONTH($tablename.date)=" . substr( $month, 4, 2 );
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
if ( isset( $_GET[ 'status' ] ) && 'all' !== $_GET[ 'status' ] ) {
|
| 61 |
+
$where .= $wpdb->prepare( " and $tablename.status = %d ", absint( $_GET[ 'status' ] ) );
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
if ( isset( $_GET[ 'action' ] ) && 'all' !== $_GET[ 'action' ] ) {
|
| 65 |
+
$where .= $wpdb->prepare( " and $tablename.action = %s ", sanitize_text_field( $_GET[ 'action' ] ) );
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
if ( isset( $_GET[ 'type' ] ) && 'all' !== $_GET[ 'type' ] ) {
|
| 69 |
+
$where .= $wpdb->prepare( " and $tablename.type = %s ", sanitize_text_field( $_GET[ 'type' ] ) );
|
| 70 |
+
}
|
| 71 |
+
|
| 72 |
+
$select = "select * from $tablename WHERE 1=1";
|
| 73 |
+
$orderby = " order by log_id DESC";
|
| 74 |
+
$limit = " limit %d,%d";
|
| 75 |
+
$query = $select . $where . $orderby . $limit;
|
| 76 |
+
|
| 77 |
+
$query = $wpdb->prepare( $query, $offset, $per_page );
|
| 78 |
|
| 79 |
$this->items = $wpdb->get_results( $query );
|
| 80 |
|
| 90 |
'per_page' => $per_page
|
| 91 |
) );
|
| 92 |
}
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* Display a monthly dropdown for filtering items
|
| 96 |
+
*
|
| 97 |
+
* @since 6.0.0
|
| 98 |
+
* @access protected
|
| 99 |
+
*
|
| 100 |
+
* @global wpdb $wpdb
|
| 101 |
+
*
|
| 102 |
+
* @param string $post_type
|
| 103 |
+
*/
|
| 104 |
+
protected function months_dropdown( $post_type ) {
|
| 105 |
+
global $wpdb, $wp_locale;
|
| 106 |
+
$tablename = $wpdb->base_prefix . 'eum_logs';
|
| 107 |
+
$query = "SELECT DISTINCT YEAR( date ) AS year, MONTH( date ) AS month FROM $tablename ORDER BY date DESC";
|
| 108 |
+
|
| 109 |
+
$months = $wpdb->get_results( $query );
|
| 110 |
+
|
| 111 |
+
$month_count = count( $months );
|
| 112 |
+
if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
|
| 113 |
+
return;
|
| 114 |
+
|
| 115 |
+
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
|
| 116 |
+
?>
|
| 117 |
+
<label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
| 118 |
+
<select name="m" id="filter-by-date">
|
| 119 |
+
<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 120 |
+
<?php
|
| 121 |
+
foreach ( $months as $arc_row ) {
|
| 122 |
+
if ( 0 == $arc_row->year )
|
| 123 |
+
continue;
|
| 124 |
+
|
| 125 |
+
$month = zeroise( $arc_row->month, 2 );
|
| 126 |
+
$year = $arc_row->year;
|
| 127 |
+
|
| 128 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
| 129 |
+
selected( $m, $year . $month, false ),
|
| 130 |
+
esc_attr( $arc_row->year . $month ),
|
| 131 |
+
/* translators: 1: month name, 2: 4-digit year */
|
| 132 |
+
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
|
| 133 |
+
);
|
| 134 |
+
}
|
| 135 |
+
?>
|
| 136 |
+
</select>
|
| 137 |
+
<?php
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
private function type_dropdown() {
|
| 141 |
+
$type = isset( $_GET['type'] ) ? sanitize_text_field( $_GET['type'] ) : 'all';
|
| 142 |
+
?>
|
| 143 |
+
<label for="filter-by-type" class="screen-reader-text"><?php _e( 'Filter by Upgrade Type', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
| 144 |
+
<select name="type" id="filter-by-type">
|
| 145 |
+
<option<?php selected( $type, 'all' ); ?> value="all"><?php echo _x( 'All Types', 'Upgrade types: translation, core, plugin, theme', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 146 |
+
<option<?php selected( $type, 'core' ); ?> value="core"><?php echo _x( 'Core', 'Show WordPress core updates', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 147 |
+
<option<?php selected( $type, 'plugin' ); ?> value="plugin"><?php echo _x( 'Plugins', 'Show WordPress Plugin updates', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 148 |
+
<option<?php selected( $type, 'theme' ); ?> value="theme"><?php echo _x( 'Themes', 'Show WordPress Theme updates', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 149 |
+
<option<?php selected( $type, 'translation' ); ?> value="translation"><?php echo _x( 'Translations', 'Show WordPress translation updates', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 150 |
+
</select>
|
| 151 |
+
<?php
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
private function status_dropdown() {
|
| 155 |
+
$status = isset( $_GET['status'] ) ? sanitize_text_field( $_GET['status'] ) : 'all';
|
| 156 |
+
?>
|
| 157 |
+
<label for="filter-by-success" class="screen-reader-text"><?php _e( 'Filter by Status', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
| 158 |
+
<select name="status" id="filter-by-success">
|
| 159 |
+
<option<?php selected( $status, 'all' ); ?> value="all"><?php _e( 'All Statuses', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 160 |
+
<option<?php selected( $status, 1 ); ?> value="1"><?php echo _x( 'Success', 'Show status updates that are successful', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 161 |
+
<option<?php selected( $status, 0 ); ?> value="0"><?php echo _x( 'Failures', 'Show status updates that are not successful', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 162 |
+
</select>
|
| 163 |
+
<?php
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
private function action_dropdown() {
|
| 167 |
+
$action = isset( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : 'all';
|
| 168 |
+
?>
|
| 169 |
+
<label for="filter-by-action" class="screen-reader-text"><?php _e( 'Filter by Action', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
| 170 |
+
<select name="action" id="filter-by-action">
|
| 171 |
+
<option<?php selected( $action, 'all' ); ?> value="all"><?php _e( 'All Actions', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 172 |
+
<option<?php selected( $action, 'automatic' ); ?> value="automatic"><?php echo _x( 'Automatic Updates', 'Show log items that are automatic updates only', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 173 |
+
<option<?php selected( $action, 'manual' ); ?> value="manual"><?php echo _x( 'Manual Updates', 'Show log items that are manual updates only', 'stops-core-theme-and-plugin-updates' ); ?></option>
|
| 174 |
+
</select>
|
| 175 |
+
<?php
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* @global int $cat
|
| 180 |
+
* @param string $which
|
| 181 |
+
*/
|
| 182 |
+
protected function extra_tablenav( $which ) {
|
| 183 |
+
global $cat;
|
| 184 |
+
?>
|
| 185 |
+
<form id="logs-filter" action="<?php echo esc_url( $this->url ); ?>" method="GET">
|
| 186 |
+
<input type="hidden" name="page" value="mpsum-update-options" />
|
| 187 |
+
<input type="hidden" name="tab" value="logs" />
|
| 188 |
+
<div class="alignleft">
|
| 189 |
+
<?php
|
| 190 |
+
if ( 'top' === $which && !is_singular() ) {
|
| 191 |
+
|
| 192 |
+
$this->months_dropdown( $this->screen->post_type );
|
| 193 |
+
$this->status_dropdown();
|
| 194 |
+
$this->action_dropdown();
|
| 195 |
+
$this->type_dropdown();
|
| 196 |
+
|
| 197 |
+
submit_button( __( 'Filter', 'stops-core-theme-and-plugin-updates' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
|
| 198 |
+
}
|
| 199 |
+
?>
|
| 200 |
+
</div>
|
| 201 |
+
</form><!-- #logs-filter -->
|
| 202 |
+
<?php
|
| 203 |
+
/**
|
| 204 |
+
* Fires immediately following the closing "actions" div in the tablenav for the posts
|
| 205 |
+
* list table.
|
| 206 |
+
*
|
| 207 |
+
* @since 4.4.0
|
| 208 |
+
*
|
| 209 |
+
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
|
| 210 |
+
*/
|
| 211 |
+
do_action( 'manage_posts_extra_tablenav', $which );
|
| 212 |
+
}
|
| 213 |
|
| 214 |
/**
|
| 215 |
*
|
main.php
CHANGED
|
@@ -4,7 +4,7 @@ Plugin Name: Easy Updates Manager
|
|
| 4 |
Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
| 5 |
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
|
| 6 |
Author: Easy Updates Manager Team
|
| 7 |
-
Version: 6.0
|
| 8 |
Requires at least: 4.4
|
| 9 |
Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
| 10 |
Contributors: kidsguide, ronalfy
|
| 4 |
Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
| 5 |
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
|
| 6 |
Author: Easy Updates Manager Team
|
| 7 |
+
Version: 6.1.0
|
| 8 |
Requires at least: 4.4
|
| 9 |
Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
| 10 |
Contributors: kidsguide, ronalfy
|
readme.txt
CHANGED
|
@@ -3,7 +3,7 @@ Contributors: kidsguide, ronalfy, roary86, bigwing
|
|
| 3 |
Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates, multisite, logs
|
| 4 |
Requires at least: 4.4
|
| 5 |
Tested up to: 4.5
|
| 6 |
-
Stable tag: 6.0
|
| 7 |
License: GPLv2 or later
|
| 8 |
Donate link: https://mediaron.com/contribute/
|
| 9 |
|
|
@@ -86,7 +86,7 @@ Unfortunately, we do not support older versions of WordPress or the non-current
|
|
| 86 |
|
| 87 |
= How do I change the WordPress update notification e-mail? =
|
| 88 |
|
| 89 |
-
|
| 90 |
|
| 91 |
= Automatic Updates =
|
| 92 |
|
|
@@ -103,10 +103,17 @@ For additional information and FAQs for Easy Updates Manager check out our <a hr
|
|
| 103 |
|
| 104 |
== Changelog ==
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
= 6.0.5 =
|
| 107 |
Released 2016-05-20
|
| 108 |
|
| 109 |
-
* Added new filter: `mpsum_default_options` to set defaults programmatically
|
| 110 |
* Bug fix: CSS styles for dashboard were applied to the list views.
|
| 111 |
|
| 112 |
= 6.0.3 =
|
|
@@ -209,6 +216,9 @@ In version 5.0.0 we completely re-wrote the plugin to offer a faster and more se
|
|
| 209 |
|
| 210 |
== Upgrade Notice ==
|
| 211 |
|
|
|
|
|
|
|
|
|
|
| 212 |
= 6.0.5 =
|
| 213 |
New filter mpsum_default_options. Style fixes for list views.
|
| 214 |
|
| 3 |
Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates, multisite, logs
|
| 4 |
Requires at least: 4.4
|
| 5 |
Tested up to: 4.5
|
| 6 |
+
Stable tag: 6.1.0
|
| 7 |
License: GPLv2 or later
|
| 8 |
Donate link: https://mediaron.com/contribute/
|
| 9 |
|
| 86 |
|
| 87 |
= How do I change the WordPress update notification e-mail? =
|
| 88 |
|
| 89 |
+
Go to the General tab in our settings. You can enter a single email address, or multiple if you comma separate them.
|
| 90 |
|
| 91 |
= Automatic Updates =
|
| 92 |
|
| 103 |
|
| 104 |
== Changelog ==
|
| 105 |
|
| 106 |
+
= 6.1.0 =
|
| 107 |
+
Released 2016-05-30
|
| 108 |
+
|
| 109 |
+
* Enhancement: filters for logs.
|
| 110 |
+
* Enhancement: can now change the email address for automatic updates.
|
| 111 |
+
* Enhancement: warnings now show up in the Advanced tab if automatic updates are disabled by something other than this plugin.
|
| 112 |
+
|
| 113 |
= 6.0.5 =
|
| 114 |
Released 2016-05-20
|
| 115 |
|
| 116 |
+
* Added new filter: `mpsum_default_options` to set defaults programmatically.
|
| 117 |
* Bug fix: CSS styles for dashboard were applied to the list views.
|
| 118 |
|
| 119 |
= 6.0.3 =
|
| 216 |
|
| 217 |
== Upgrade Notice ==
|
| 218 |
|
| 219 |
+
= 6.1.0 =
|
| 220 |
+
Filters for logs. Can now change email address for automatic updates.
|
| 221 |
+
|
| 222 |
= 6.0.5 =
|
| 223 |
New filter mpsum_default_options. Style fixes for list views.
|
| 224 |
|
