--- a/wp-last-modified-info/assets/block-editor/build/index.asset.php
+++ b/wp-last-modified-info/assets/block-editor/build/index.asset.php
@@ -1 +1 @@
-<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => 'a609d5b3313b3514bdb4');
+<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-components', 'wp-core-data', 'wp-data', 'wp-date', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '70ef8105af626bf57549');
--- a/wp-last-modified-info/inc/Core/Backend/AdminColumn.php
+++ b/wp-last-modified-info/inc/Core/Backend/AdminColumn.php
@@ -66,7 +66,7 @@
return;
}
- $disabled = $this->get_meta( $post->ID, '_lmt_disableupdate' ) ?: 'no';
+ $disabled = $this->get_meta( $post->ID, '_lmt_disableupdate' ) ?? 'no';
$modified = $this->format_modified_date( $post );
$html = $modified;
@@ -85,10 +85,10 @@
}
$hidden = [
- 'date-format' => date( 'M d, Y H:i:s', strtotime( $post->post_modified ) ),
+ 'date-format' => date( 'M d, Y H:i:s', strtotime( $post->post_modified ) ),
'post-modified' => $post->post_modified,
- 'disabled' => $disabled,
- 'post-type' => $post->post_type,
+ 'disabled' => $disabled,
+ 'post-type' => $post->post_type,
];
foreach ( $hidden as $key => $value ) {
--- a/wp-last-modified-info/inc/Core/Backend/EditScreen.php
+++ b/wp-last-modified-info/inc/Core/Backend/EditScreen.php
@@ -255,16 +255,16 @@
if ( $post_ids ) { // only proceed if we have posts to bulk-edit
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
- $mm = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_month'] ?? '' ) ), 1, 12, 1 ); // month 1-12
+ $mm = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_month'] ?? '' ) ), 1, 12, 1 ); // month 1-12
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
- $jj = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_day'] ?? '' ) ), 1, 31, 1 ); // day 1-31
+ $jj = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_day'] ?? '' ) ), 1, 31, 1 ); // day 1-31
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
- $aa = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_year'] ?? '' ) ), 0, 9999, 1970 ); // year 0-9999
+ $aa = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_year'] ?? '' ) ), 0, 9999, 1970 ); // year 0-9999
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
- $hh = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_hour'] ?? '' ) ), 0, 23, 12 ); // hour 0-23
+ $hh = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_hour'] ?? '' ) ), 0, 23, 12 ); // hour 0-23
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
- $mn = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_minute'] ?? '' ) ), 0, 59, 0 ); // minute 0-59
- $ss = '00'; // seconds hard-coded for bulk
+ $mn = $this->clamp( sanitize_text_field( wp_unslash( $_POST['modified_minute'] ?? '' ) ), 0, 59, 0 ); // minute 0-59
+ $ss = '00'; // seconds hard-coded for bulk
$newdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $aa, $mm, $jj, $hh, $mn, $ss ); // build MySQL datetime
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated
@@ -276,16 +276,24 @@
$update_status = 'none' !== $disable; // disable selector != “No Change”
foreach ( $post_ids as $post_id ) {
+ // Skip drafts & scheduled posts
if ( in_array( get_post_status( $post_id ), [ 'auto-draft', 'future' ], true ) ) {
- continue; // skip drafts & scheduled posts
+ continue;
}
- if ( $update_date ) { // save new modified datetime
+ // Skip posts the user can't edit
+ if ( ! current_user_can( 'edit_post', $post_id ) ) {
+ continue;
+ }
+
+ // Update modified datetime
+ if ( $update_date ) {
$this->update_meta( $post_id, '_wplmi_last_modified', $newdate );
$this->update_meta( $post_id, 'wplmi_bulk_update_datetime', $newdate ); // flag for update_data()
}
- if ( $update_status ) { // save lock/unlock preference
+ // Update lock/unlock preference
+ if ( $update_status ) {
$this->update_meta( $post_id, '_lmt_disableupdate', $disable );
}
}
--- a/wp-last-modified-info/inc/Core/Backend/MetaBox.php
+++ b/wp-last-modified-info/inc/Core/Backend/MetaBox.php
@@ -116,7 +116,7 @@
}
// Sanitize & save.
- $hide = isset( $_POST['wplmi_disable_auto_insert'] ) ? 'yes' : 'no';
+ $hide = isset( $_POST['wplmi_disable_auto_insert'] ) ? 'yes' : 'no'; // PHPCS:ignore WordPress.Security.NonceVerification.Missing
$this->update_meta( $post_id, '_lmt_disable', $hide );
}
--- a/wp-last-modified-info/inc/Core/Backend/MiscActions.php
+++ b/wp-last-modified-info/inc/Core/Backend/MiscActions.php
@@ -99,7 +99,7 @@
'shop_order_placehold',
'shop_order',
'shop_order_refund',
- 'shop_subscription'
+ 'shop_subscription',
], $post_id, $post );
// check if post type is supported
--- a/wp-last-modified-info/inc/Core/Backend/PluginsData.php
+++ b/wp-last-modified-info/inc/Core/Backend/PluginsData.php
@@ -133,13 +133,13 @@
];
$map = [
- 'version' => 'version',
- 'requires' => 'requires',
- 'tested' => 'tested',
- 'last_updated' => 'last_updated',
- 'rating' => 'rating',
- 'num_ratings' => 'num_ratings',
- 'active_installs'=> 'active_installs',
+ 'version' => 'version',
+ 'requires' => 'requires',
+ 'tested' => 'tested',
+ 'last_updated' => 'last_updated',
+ 'rating' => 'rating',
+ 'num_ratings' => 'num_ratings',
+ 'active_installs' => 'active_installs',
];
foreach ( $map as $key => $prop ) {
--- a/wp-last-modified-info/inc/Core/Backend/PostStatusFilters.php
+++ b/wp-last-modified-info/inc/Core/Backend/PostStatusFilters.php
@@ -71,11 +71,11 @@
// Fast count query: only IDs, no post objects.
$locked_ids = get_posts( [
- 'post_type' => $typenow,
- 'post_status' => [ 'publish', 'draft', 'private' ],
- 'fields' => 'ids',
- 'posts_per_page' => -1,
- 'meta_query' => [
+ 'post_type' => $typenow,
+ 'post_status' => [ 'publish', 'draft', 'private' ],
+ 'fields' => 'ids',
+ 'posts_per_page' => -1,
+ 'meta_query' => [
[
'key' => '_lmt_disableupdate',
'value' => 'yes',
--- a/wp-last-modified-info/inc/Core/Frontend/PostView.php
+++ b/wp-last-modified-info/inc/Core/Frontend/PostView.php
@@ -198,7 +198,7 @@
$format = $this->do_filter( 'post_datetime_format', $this->get_data( 'lmt_date_time_format', get_option( 'date_format' ) ), $post_id );
$date = $this->get_modified_date( $format, $post_id );
} else {
- $date = human_time_diff( $modified, current_time( 'U' ) ) . ' ' . __( 'ago' );
+ $date = human_time_diff( $modified, current_time( 'U' ) ) . ' ' . __( 'ago', 'wp-last-modified-info' );
}
return $this->do_filter( 'post_formatted_date', $date, $post_id );
@@ -263,7 +263,11 @@
$html = str_replace( [ "r", "n" ], '', $html );
$allowed = wp_kses_allowed_html( 'post' );
- $allowed['time'] = [ 'class' => true, 'itemprop' => true, 'datetime' => true ];
+ $allowed['time'] = [
+ 'class' => true,
+ 'itemprop' => true,
+ 'datetime' => true,
+ ];
return wp_kses( $html, $allowed );
}
--- a/wp-last-modified-info/inc/Core/Notification.php
+++ b/wp-last-modified-info/inc/Core/Notification.php
@@ -90,7 +90,7 @@
$diff[] = $this->diff_line( __( 'Excerpt', 'wp-last-modified-info' ), $post_before->post_excerpt, $post_after->post_excerpt );
}
- if ( $post_before->post_author != $post_after->post_author ) {
+ if ( (int) $post_before->post_author !== (int) $post_after->post_author ) {
$diff[] = $this->diff_line( __( 'Author', 'wp-last-modified-info' ), $this->author_name( $post_before->post_author ), $this->author_name( $post_after->post_author ) );
}
@@ -137,17 +137,17 @@
/**
* Helper to produce a single diff line.
*
- * @param string $label
- * @param string $old
- * @param string $new
+ * @param string $label Label for the diff line.
+ * @param string $old_item Old value.
+ * @param string $new_item New value.
* @return string
*/
- private function diff_line( $label, $old, $new ) {
+ private function diff_line( $label, $old_item, $new_item ) {
return sprintf(
'<strong>%1$s:</strong><br>%2$s<br>%3$s',
esc_html( $label ),
- esc_html( __( 'Old:', 'wp-last-modified-info' ) ) . ' ' . esc_html( $old ),
- esc_html( __( 'New:', 'wp-last-modified-info' ) ) . ' ' . esc_html( $new )
+ esc_html( __( 'Old:', 'wp-last-modified-info' ) ) . ' ' . esc_html( $old_item ),
+ esc_html( __( 'New:', 'wp-last-modified-info' ) ) . ' ' . esc_html( $new_item )
);
}
@@ -158,7 +158,7 @@
* @return string
*/
private function author_name( $user_id ) {
- return get_the_author_meta( 'display_name', $user_id ) ?: __( 'Unknown', 'wp-last-modified-info' );
+ return get_the_author_meta( 'display_name', $user_id ) ?? __( 'Unknown', 'wp-last-modified-info' );
}
/**
@@ -188,10 +188,10 @@
'%author_name%' => $this->author_name( $post->post_author ),
'%modified_author_name%' => $this->author_name( $this->get_meta( $post_id, '_edit_last' ) ),
'%post_title%' => $post->post_title,
- '%post_type%' => get_post_type( $post_id ),
- '%current_time%' => date_i18n( $this->do_filter( 'notification_datetime_format', 'j F, Y @ g:i a', $post_id ), current_time( 'timestamp', 0 ) ),
- '%site_name%' => wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
- '%site_url%' => esc_url( home_url() ),
+ '%post_type%' => get_post_type( $post_id ),
+ '%current_time%' => date_i18n( $this->do_filter( 'notification_datetime_format', 'j F, Y @ g:i a', $post_id ), current_time( 'timestamp', 0 ) ),
+ '%site_name%' => wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
+ '%site_url%' => esc_url( home_url() ),
];
if ( 'body' === $type ) {
--- a/wp-last-modified-info/vendor/composer/installed.php
+++ b/wp-last-modified-info/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'iamsayan/wp-last-modified-info',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '98b5e6d3b28cbda42c07bc23cd9417b2a7d4b2e2',
+ 'reference' => '8e3f901b83ad739eb19a6dac4158148bfbbffd49',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -22,7 +22,7 @@
'iamsayan/wp-last-modified-info' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
- 'reference' => '98b5e6d3b28cbda42c07bc23cd9417b2a7d4b2e2',
+ 'reference' => '8e3f901b83ad739eb19a6dac4158148bfbbffd49',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
--- a/wp-last-modified-info/wp-last-modified-info.php
+++ b/wp-last-modified-info/wp-last-modified-info.php
@@ -3,7 +3,7 @@
* Plugin Name: WP Last Modified Info
* Plugin URI: https://wordpress.org/plugins/wp-last-modified-info/
* Description: Ultimate Last Modified Plugin for WordPress with Gutenberg Block Integration. It is possible to use shortcodes to display last modified info anywhere on a WordPress site running 4.7 and beyond.
- * Version: 1.9.5
+ * Version: 1.9.6
* Author: Sayan Datta
* Author URI: https://www.sayandatta.co.in
* License: GPLv3
@@ -46,7 +46,7 @@
*
* @var string
*/
- public $version = '1.9.5';
+ public $version = '1.9.6';
/**
* Minimum version of WordPress required to run WPLMI.