Forum Replies Created

Viewing 15 replies - 1 through 15 (of 41 total)
  • Plugin Author rbaer

    (@rbaer)

    Your database has the same fields as mine. Newer versions of a post are handled as a new post, but the post_type is revision and the post_parent is set to the id of the original post.
    For example:

    ID | post_parent | post_type
    1 | 0 | post
    2 | 1 | revision
    3 | 1 | revision

    If you want to see the history of a post in the database, you can use a command like this (in phpMyAdmin or a similar tool, replace <Post_ID> with the ID of your post):

    SELECT * FROM wp_posts WHERE ID = <Post_ID> OR post_parent = <Post_ID> ORDER BY wp_posts.ID ASC 

    Can you change the code of my Plugin to get some more information? You can do this on the WordPress administration in the menu ‘Plugin’->’Plugin File Editor’. There select the Plugin ‘List Last Changes’ and then the file list-last-changes.php. Please replace the function get_last_editor($post), starting on line 128, with the following code:

    	static function get_last_editor($post) {
    $post_id_to_check = <post-id with error>;
    $last_editor_id = get_post_meta( $post->ID, '_edit_last', true );
    if($post->ID == $post_id_to_check) { print("<pre>last_editor_id = "); print_r($last_editor_id); print("</pre>"); }
    if ( $last_editor_id ) {
    $last_user = get_userdata( $last_editor_id );
    if($post->ID == $post_id_to_check) { print("<pre>last_user = "); print_r($last_user); print("</pre>"); }

    if($post->ID == $post_id_to_check && $last_user) { print("<pre>last_user-&gt;display_name = "); print_r($last_user->display_name); print("</pre>"); }

    return apply_filters( 'the_modified_author', $last_user ? $last_user->display_name : '' );
    }

    return '';
    }

    Please replace <post-id with error> with an id of a post that causes troubles. When you then open a page with the plugin included it should post some messages on the screen. Please send these to my email-Adress [email protected] . Of course you can (and should) remove/replace sensitive information like the hashed password of the user.

    To restore the normal behaviour here is the original code:

    	static function get_last_editor($post) {
    $last_editor_id = get_post_meta( $post->ID, '_edit_last', true );

    if ( $last_editor_id ) {
    $last_user = get_userdata( $last_editor_id );

    return apply_filters( 'the_modified_author', $last_user ? $last_user->display_name : '' );
    }

    return '';
    }

    Thanks for your Help!

    Plugin Author rbaer

    (@rbaer)

    I’m not able to reproduce the problem on my testing system. Can you help me with some more information?

    Are all edited pages/posts from the same author working and all non-working from other autors (and all edited pages of these autors are not working)? If yes, do you see differences between the working and non-working autors (especially in the display name)?

    Plugin Author rbaer

    (@rbaer)

    I will have a look if I can reproduce your problem.

    Maybe you can give me some more informations:
    – do you see any relevant difference between the working and the non-working posts?
    – are the shown changes on pages or on posts?
    – have you tried to disable all other plugins? does the problem still occure with only the List Last Changes plugin?

    Thanks for your feedback!

    Thread Starter rbaer

    (@rbaer)

    ???

    Thread Starter rbaer

    (@rbaer)

    Hi @vaakash

    Here are the changes I made in the form of patches:

    Index: includes/utilities.php
    ===================================================================
    --- includes/utilities.php (revision 3106204)
    +++ includes/utilities.php (working copy)
    @@ -23,7 +23,7 @@

    global $post;

    - preg_match_all( '~<img.*?src=["\']+(.*?)["\']+~', $content, $image_urls );
    + preg_match_all( '~<img.*?src=["\']+(.*?)["\']+~', $content ?? '', $image_urls );

    if( empty( $image_urls[1] ) && has_post_thumbnail( $post->ID ) ) {
    $content = '<p>' . get_the_post_thumbnail( $post->ID ) . '</p>' . $content;
    @@ -85,7 +85,7 @@
    );

    foreach( $attributes as $attribute => $regex ){
    - preg_match( $regex, $content, $urls );
    + preg_match( $regex, $content ?? '', $urls );

    if( empty( $urls ) ){
    continue;
    Index: includes/feed.php
    ===================================================================
    --- includes/feed.php (revision 3078518)
    +++ includes/feed.php (working copy)
    @@ -92,7 +92,7 @@
    if( is_wp_error( $feed ) ){
    $feed_title = __( 'Error' );
    }else{
    - $feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] : strip_tags( $feed->get_title() );
    + $feed_title = ( isset( $tab_titles[$i] ) && !empty( $tab_titles[$i] ) ) ? $tab_titles[$i] : strip_tags( $feed->get_title() ?? '' );
    }

    $feeds[ $feed_url ] = array(
    @@ -163,7 +163,7 @@
    $link = strip_tags($link);

    // Title
    - $title = strip_tags( $item->get_title() );
    + $title = strip_tags( $item->get_title() ?? '' );
    $title_full = $title;

    if ( empty( $title ) ){
    @@ -187,7 +187,7 @@

    // Date
    $date = '';
    - $date_full = strip_tags( $item->get_date() );
    + $date_full = strip_tags( $item->get_date() ?? '' );

    if( strtolower( $date_format ) == 'relative' ){
    $item_date = $item->get_date( 'U' );
    @@ -228,7 +228,7 @@
    // Description
    $desc = '';
    if( $show_desc ){
    - $desc_content = ( $desc_type == 'summary' ) ? $item->get_description() : $item->get_content();
    + $desc_content = ( $desc_type == 'summary' ) ? ( $item->get_description() ?? '') : ( $item->get_content() ?? '' );
    if( $rich_desc ){
    $desc = wp_kses_post( strip_tags( $desc_content, '<p><a><img><em><strong><font><strike><s><u><b><i><br>' ) );
    }else{

    The changes are to avoid working on non-strings (invalid values).

    Greetings
    Roland

    Plugin Author rbaer

    (@rbaer)

    The Version 1.1.0 has now the support for the field {editor} in the template string.

    Hope this solves your needs!

    Plugin Author rbaer

    (@rbaer)

    Thanks for the idea!

    I can’t say if it is possible but I noted your suggestion. It will be tracked on the github repository of List Last Changes: https://github.com/rolandbaer/list-last-changes/issues/29

    Plugin Author rbaer

    (@rbaer)

    @walrusguy:
    Have you tried one of the updates (Versions 1.0.3 to 1.0.5 should solve the problem)? Just keep your currently working version as a backup and restore it when the problem still isn’t solved (as you did last time, but should not be needed this time).

    Plugin Author rbaer

    (@rbaer)

    @rwitkamp
    I think I found the problem. A fixed version (1.0.5) is available. Could you give it a try?

    Plugin Author rbaer

    (@rbaer)

    Thanks for the update. This information helps me; I haven’t tested this feature with that many pages to ignore.

    Plugin Author rbaer

    (@rbaer)

    @rwitkamp:
    Can you give me some more information? Which version of List Last Changes causes this problem (are you on the latest version 1.0.3)? Have you updated only WordPress to 6.4.1 or have you also updated List Last Changes? Did you update WordPress from 6.4.0 to 6.4.1 of were you running an older version of WordPress before the update? Are some of the excluded pages (with the custon field) still excluded (recently changed, so that it would appear in the list but excluded as expected) or could it be that all excluded pages are ignored but just older than the not excluded ones?

    I know that are a lot of questions. Hope they were at least asked understandable. I’ve tested the Plugin with 6.4.0 but not yet with 6.4.1. With 6.4.0 I didn’t saw problems with the exclude mechanism in my tests.

    Plugin Author rbaer

    (@rbaer)

    Thanks for your feedback and your patience!

    Plugin Author rbaer

    (@rbaer)

    Thanks for the information. I’ve made a new release 1.0.3 in which I left out all the refactorings (mostly type information) that were also included in 1.0.2

    Could you give it a try?

    Plugin Author rbaer

    (@rbaer)

    Updated to 1.0.3: includes now only the changes to read the exluded pages, but not the refactorings (especially type information) that seemed to cause some troubles.

    @serpher :
    I’m still interested in your PHP version to understand better what caused the error.

    @egingell :
    Thanks for the suggestion, but after the trouble the refactorings cause I’m now more on the defensive side with changes ??

    Plugin Author rbaer

    (@rbaer)

    Thanks for your message. From the error message I assume that adding the type information breaks the usage of the plugin.

    Can you tell me which version of PHP your website is running on?

Viewing 15 replies - 1 through 15 (of 41 total)