Skip to content

Commit

Permalink
Merge pull request #40 from iamsayan/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
iamsayan authored Jan 5, 2023
2 parents 8da45b1 + 6ac60d2 commit 38c3b0d
Show file tree
Hide file tree
Showing 28 changed files with 389 additions and 294 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.8.5
Release Date: January 5, 2023

* Fixed: PHP Error if the the global post object is undefined.
* Fixed: WooCommerce product modified date updated even if the option is disabled.
* Fixed: Update Locked posts was showing all posts in post list page.
* Fixed: Lock Modified Date option was not working properly.
* Fixed: Bulk Editing was not working.
* Tweak: Allow Toogle Disable Update Option for all post types and posts with future date.
* Imporved: Optimize codebase.
* Tested with WordPress v6.1.

## 1.8.4
Release Date: July 29, 2022

* Added: User Column Sorting.
* Fixed: Quick Edit HTML issue.
* Fixed: Default Post Type ordering was not working.
* Fixed: JS issue if Syntax Highlighting is disabled from User Profile.
* Fixed: PHP Warning: Undefined property.

## 1.8.3
Release Date: May 30, 2022

* Fixed: Bulk Editing is not working.
* Fixed: Dashbaord Widget Posts List Order was wrong on some cases.

## 1.8.2
Release Date: May 24, 2022

* Fixed: Block Editor JS Errors on some cases.
* Fixed: Dashboard Widget showing wrong timestamp.
* Fixed: Widget Editor is not loading some cases if this plugin is active.
* Fixed: Block Rendering issue if custom colors are specified in theme.json.
* Added: Nonce checking on Dashbaord Widget.

## 1.8.1
Release Date: May 22, 2022

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PostModifiedField = () => {
{ postMeta?._lmt_disableupdate == 'yes' ? (
<>
<span>{ __( 'Last Modified', 'wp-last-modified-info' ) }</span>
<b>{ dateI18n( dateTimeFormat, currentModified ) }</b>
<b>{ dateI18n( dateTimeFormat, editedModified ) }</b>
</>
) : (
<>
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin.min.css

Large diffs are not rendered by default.

36 changes: 27 additions & 9 deletions assets/css/admin.sass
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
z-index: 99
top: 32px

@media screen and (max-width: 782px)
text-align: center

h2
font-size: 20px
display: inline-block
Expand All @@ -19,6 +22,9 @@
letter-spacing: -.02rem
text-transform: uppercase

@media screen and (max-width: 782px)
display: block

.title-count
top: -2px
font-size: 11px
Expand Down Expand Up @@ -92,11 +98,14 @@
margin-left: 0.4rem

.wplmi-form-control
&:not(.selectize-control):not(.selectize-dropdown):not(.wplmi-editor)
&:not(.wplmi-editor)
width: 40%
padding: 6px 12px !important
border-color: #ccc

@media screen and (max-width: 782px)
width: 95% !important

&:focus, &:hover
border-color: #ccc !important

Expand Down Expand Up @@ -173,6 +182,9 @@ h1.title .title-count
top: 15px
// padding-right: 20px
@media screen and (max-width: 1300px)
display: none

> *
vertical-align: middle
margin-left: 10px
Expand Down Expand Up @@ -245,9 +257,15 @@ input, select
th
width: 25%

td:not(.social-td)
@media screen and (max-width: 782px)
width: 90%

td
width: 75%

@media screen and (max-width: 782px)
display: table-cell

tbody tr
padding: 5px 0
border-top: 1px solid #dadfe4
Expand Down Expand Up @@ -332,20 +350,20 @@ hr

.wplmi-wrap
margin-top: 25px
max-width: 1200px

#poststuff
padding-top: 0

div[class*="notice"]:not(.notice-alt)
//border-radius: 6px
width: 996px
padding-right: 12px !important
// div[class*="notice"]:not(.notice-alt)
// //border-radius: 6px
// width: 996px
// padding-right: 12px !important
&:not(.fs-notice-body):not(.components-notice__content)
margin-bottom: 25px
// &:not(.fs-notice-body):not(.components-notice__content)
// margin-bottom: 25px
#wplmi-settings-form, .metabox-holder
width: 1024px
max-width: 100%

.wplmi-metabox-holder
Expand Down
19 changes: 11 additions & 8 deletions assets/js/edit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
( function( $ ) {

'use strict';

// Copy of the WP inline edit post function.
let $wp_inline_edit = inlineEditPost.edit;

Expand Down Expand Up @@ -55,9 +56,9 @@
}*/

$( '#wplmi-change-modified', $edit_row ).val( 'yes' );
$( '#wplmi-disable-hidden', $edit_row ).val( 'no' );
$( '#wplmi_disable', $edit_row ).prop( 'checked', false );
});
// $( '#wplmi-disable-hidden', $edit_row ).val( 'no' );
// $( '#wplmi_disable', $edit_row ).prop( 'checked', false );
} );

$( '#wplmi_disable', $edit_row ).on( 'change', function() {
if ( $( this ).is( ':checked' ) ) {
Expand Down Expand Up @@ -90,10 +91,10 @@

// get the selected post ids that are being edited
let $post_ids = new Array();
$bulk_row.find( '#bulk-titles' ).children().each( function() {
$post_ids.push( $( this ).attr( 'id' ).replace( /^(ttle)/i, '' ) );
$bulk_row.find( '#bulk-titles' ).find( '.ntdelbutton' ).each( function() {
$post_ids.push( $( this ).attr( 'id' ).replace( '_', '' ) );
} );

// get the custom fields
let $modified_month = $bulk_row.find( 'select[name="mmm"]' ).val();
let $modified_day = $bulk_row.find( 'input[name="jjm"]' ).val();
Expand All @@ -115,7 +116,9 @@
};

$.post( wplmi_edit_L10n.ajaxurl, wplmiBulkData, function( response ) {
$( 'body' ).find( '#bulk_edit' ).trigger( 'click' );
setInterval( function() {
$( 'body' ).find( '#bulk_edit' ).trigger( 'click' );
}, 1000 );
} );
} );

Expand Down
2 changes: 1 addition & 1 deletion assets/js/edit.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 6 additions & 19 deletions assets/js/post.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(function($) {
( function( $ ) {
'use strict';

let $tsmdiv = $('#timestampmodifieddiv');

Expand Down Expand Up @@ -28,16 +29,7 @@
});

$tsmdiv.find( '.save-timestamp' ).click( function( e ) {
if ( $( '#wplmi_disable' ).is( ':checked' ) ) {
$( '#mmm' ).val( $('#hidden_mmm').val() );
$( '#jjm' ).val( $('#hidden_jjm').val() );
$( '#aam' ).val( $('#hidden_aam').val() );
$( '#hhm' ).val( $('#hidden_hhm').val() );
$( '#mnm' ).val( $('#hidden_mnm').val() );
} else {
$( '#wplmi-change-modified' ).val( 'yes' );
}

$( '#wplmi-change-modified' ).val( 'yes' );
if ( updateTextModified() ) {
$tsmdiv.slideUp( 'fast' );
$tsmdiv.siblings( 'a.edit-timestampmodified' ).show().focus();
Expand All @@ -56,7 +48,7 @@

$( '#publishing-action .spinner' ).removeClass( 'is-active' );
}
});
} );

var updateTextModified = function() {
if ( ! $tsmdiv.length ) {
Expand Down Expand Up @@ -107,11 +99,6 @@
if ( ! $(this).is( ':checked' ) ) {
$( '#wplmi-disable-hidden' ).val( 'no' );
}
}).change();

$( '.time-modified' ).change( function() {
$( '#wplmi-disable-hidden' ).val( 'no' );
$( '#wplmi_disable' ).prop( 'checked', false );
});
} ).change();

})( jQuery );
} )( jQuery );
2 changes: 1 addition & 1 deletion assets/js/post.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 13 additions & 23 deletions inc/Base/PluginTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use Wplmi\Helpers\Ajax;
use Wplmi\Helpers\Hooker;
use Wplmi\Helpers\SettingsData;
use Wplmi\Helpers\HelperFunctions;

defined( 'ABSPATH' ) || exit;

Expand All @@ -21,7 +21,7 @@
*/
class PluginTools
{
use Ajax, Hooker, SettingsData;
use Ajax, Hooker, HelperFunctions;

/**
* Register functions.
Expand Down Expand Up @@ -113,17 +113,17 @@ public function set_meta() {
// security check
$this->verify_nonce();

if ( ! isset( $_REQUEST['action_type'] ) ) {
if ( ! isset( $_POST['action_type'] ) ) {
$this->error();
}

$action = sanitize_text_field( $_REQUEST['action_type'] );
$action = sanitize_text_field( wp_unslash( $_POST['action_type'] ) );
$value = ( $action == 'check' ) ? 'yes' : 'no';

$args = [
'numberposts' => -1,
'post_type' => $this->get_data( 'lmt_custom_post_types_list', [ 'post' ] ),
'post_status' => [ 'publish', 'draft', 'pending' ],
'post_type' => array_keys( $this->get_post_types() ),
'post_status' => [ 'publish', 'draft', 'pending', 'future' ],
'fields' => 'ids',
];

Expand Down Expand Up @@ -184,28 +184,18 @@ public function remove_settings() {
// security check
$this->verify_nonce();

// Remove options
delete_option( 'lmt_plugin_global_settings' );
delete_option( 'wplmi_site_global_update_info' );
delete_option( 'lmt_dashboard_widget_options' );
delete_option( 'wplmi_plugin_api_data' );

$args = [
'numberposts' => -1,
'post_type' => 'any',
'post_status' => 'any',
'fields' => 'ids',
];

$posts = get_posts( $args );
if ( ! empty( $posts ) ) {
foreach ( $posts as $post_id ) {
$this->delete_meta( $post_id, '_lmt_disable' );
$this->delete_meta( $post_id, '_lmt_disableupdate' );
$this->delete_meta( $post_id, '_wplmi_last_modified' );
$this->delete_meta( $post_id, 'wp_last_modified_info' );
$this->delete_meta( $post_id, 'wplmi_shortcode' );
}
}
// Remove post metas
delete_post_meta_by_key( '_lmt_disable' );
delete_post_meta_by_key( '_lmt_disableupdate' );
delete_post_meta_by_key( '_wplmi_last_modified' );
delete_post_meta_by_key( 'wp_last_modified_info' );
delete_post_meta_by_key( 'wplmi_shortcode' );

$this->success( [
'reload' => true,
Expand Down
8 changes: 8 additions & 0 deletions inc/Core/AdminBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public function register() {
public function admin_bar( $wp_admin_bar ) {
global $post;

if ( ! $post instanceof \WP_Post ) {
return;
}

if ( ! $this->is_enabled( 'enable_on_admin_bar_cb' ) ) {
return;
}
Expand Down Expand Up @@ -91,6 +95,10 @@ private function title() {
*/
private function revision() {
global $post;

if ( ! $post instanceof \WP_Post ) {
return;
}

// If user can't edit post, then don't show
if ( ! current_user_can( 'edit_post', $post->ID ) ) {
Expand Down
Loading

0 comments on commit 38c3b0d

Please sign in to comment.