• Resolved fepixie

    (@fepixie)


    Dates are not showing on any of the donations in Admin – either on the donations list or on the donations details page

    We are in NZDT

    How to fix please?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author WPCharitable

    (@wpcharitable)

    Hello @fepixie,

    Can you provide screenshots of some part of the donation list/details pages (try not to show any personal information)? Also can you share what general settings in Charitable you are using, along with information provided by the WordPress tools (the Site Health Site Info – you can click a button that copies information into the clipboard which can paste in here).

    Also any background information and context is appreciated – when did this problem start (at the very start of you installing the plugin or some point after that, when was it working last, etc.).

    Finally if you can share a URL to your site that might also help our team. Thanks!

    Thread Starter fepixie

    (@fepixie)

    site URL = https://www.stheliers.org.nz

    not sure when the problem started – i am a dev contractor not the day to day operator – it was showing an update error in the plugin earlier so i downloaded the latest and updated it (0.5 to 0.8) – but that didnt seem to fix the problem

    images…

    WP Version6.1.1
    Plugin Version 1.7.0.8
    Timezone+12:00
    PHP version7.4.28

    cheers

    Plugin Author WPCharitable

    (@wpcharitable)

    @fepixie thanks for sharing. that is odd, and don’t recall seeing this issue before. I’ll share this with the team but meantime can you turn on WP_DEBUG and WP_DEBUG_LOG and then access these pages again to see if anything is generated in the debug.log file that might be of use? This might also include making a test donation since it’s possible whatever it causing this might be happening on upon donation creation.

    And also, is this happening to all donations even to those from the very beginning, when it would be assumed this issue wasn’t happening? Thanks.

    Thread Starter fepixie

    (@fepixie)

    Hi

    None of the donations are showing a date – what DB table are they in and i’ll look in there for you to see if its a recording or display issue?

    I have turned on debug in the config – but no file has been generated when i reloaded the admin pages or the donation form live page

    Thread Starter fepixie

    (@fepixie)

    on the wp dash page – it is showing 14 (of 30 total listed) donations as being ‘this year’ – so that must be finding a date from somewhere?

    Plugin Author WPCharitable

    (@wpcharitable)

    @fepixie

    Donations for Charitable are custom post types stored in the wp_posts table (post_type=”donation”) and should have dates in the format as any WordPress post (example: “2022-10-10 23:18:27”). You can check this to confirm the records in the database haven’t been altered, although it’s unlikely unless a third party plugin or source has done that.

    Speaking of third parties, if the data looks ok you might want to do a standard troubleshooting technique of making sure that the theme or a third party plugin isn’t part of the issue. If you can switch to a default WordPress theme and deactivate all non-Charitable plugins (preferably just have Charitable core plugin activated as well) to see if this changes anything that would help troubleshoot. This also removes the possibly of custom snippets in the theme or plugin from the equation. After this also checking the debug.log file as well.

    After theme and plugins are deactivated you might want to do a sample test donation to see if the issue still exists just with core Charitable active.

    Charitable should always be showing a particular date like “January 30, 2022” and not “this year”. So that is odd. Our team will try to look into this further and see if there’s any way you can add code or log something to be able to determine why this is happening. Thanks.

    Thread Starter fepixie

    (@fepixie)

    Hi

    checked and yes we have post dates in the DB – like (date & gmt fields)
    2023-02-15 14:24:03 2023-02-15 02:24:03

    theme is Neve – fully updated with no code hacks

    Right now the site owner is in a national disaster area (NZ floods) and as it is a local neighborhood support group i don’t want to take anything down and startle them – perhaps we can try this in a week or 2 if needed

    Code snippets plugin is installed but there are no active snippets

    the debug.log file still has not been generated

    the summary on the wp dash is where it says ‘this year’ – so this part is finding dates

    plugins list

    CharitableVersion 1.7.0.8 by Charitable Donations & Fundraising Team | Auto-updates enabledCode SnippetsVersion 3.2.2 by Code Snippets Pro | Auto-updates enabledFont AwesomeVersion 4.3.2 by Font Awesome | Auto-updates enabledMC4WP: Mailchimp for WordPressVersion 4.9.1 by ibericode | Auto-updates enabledPods – Custom Content Types and FieldsVersion 2.9.11.1 by Pods Framework Team | Auto-updates enabledSmushVersion 3.12.4 by WPMU DEV | Auto-updates enabledTablePressVersion 2.0.4 by Tobias B?thge | Auto-updates enabledTemplates Patterns CollectionVersion 1.1.34 by ThemeIsle | Auto-updates enabledWordfence SecurityVersion 7.9.0 by Wordfence | Auto-updates enabledWP Dashboard NotesVersion 1.0.10 by Jeroen Sormani | Auto-updates enabledWPForms LiteVersion 1.7.9.1 by WPForms (Latest version: 1.8.0.1) | Auto-updates enabledYoast SEOVersion 20.1 by Team Yoast | Auto-updates enabled

    thanks

    Plugin Author WPCharitable

    (@wpcharitable)

    @fepixie thanks for the information and sharing the screenshot. Sharing that also confirms the issue is happening anywhere Charitable attempts to display a date. Since it should look more like this:

    I can understand not disturbing the site, and at least the dates are being recorded. If you can find a few minutes (after a backup if that reassures you) please try the theme/plugin test I mentioned to rule that out.

    It’s odd that nothing has been written yet to debug.log in the wp-content – perhaps add:

    error_log( "test" );

    to the functions.php to confirm it is writing to the log.

    Once you confirmed the log is writing, our team suggest first to find the get_date() function in /charitable/includes/abstracts/abstract-class-charitable-abstract-donation.php. It’s a simple function that returns a formatted date of a donation. Replace the function with this one, which adds information to add to the error log:

    public function get_date( $format = '' ) {
    
    error_log('get_date');
    
    error_log( print_r( $format, true ) );
    
    if ( empty( $format ) ) {
    
    error_log('get_date_format_from_option');
    
    $format = get_option( 'date_format' );
    
    error_log( print_r( $format, true ) );
    
    }
    
    error_log( print_r( $this->donation_data, true ) );
    
    error_log( print_r( $this->donation_data->post_date, true ) );
    
    return date_i18n( $format, strtotime( $this->donation_data->post_date ) );
    
    }

    Any time a date is needed from Charitable it should go through this function, so the error log should populate fairly quickly and hopefully lead to some further insights.

    Thread Starter fepixie

    (@fepixie)

    debug result (edited name for privacy) theres a bunch of these….

    
    [16-Feb-2023 22:00:13 UTC] 2022-09-18 01:23:07
    [16-Feb-2023 22:00:13 UTC] get_date
    [16-Feb-2023 22:00:13 UTC] 
    [16-Feb-2023 22:00:13 UTC] get_date_format_from_option
    [16-Feb-2023 22:00:13 UTC] 
    [16-Feb-2023 22:00:13 UTC] WP_Post Object
    (
        [ID] => 1093
        [post_author] => 0
        [post_date] => 2022-09-01 15:25:48
        [post_date_gmt] => 2022-09-01 03:25:48
        [post_content] => 
        [post_title] => xxx – Memberships
        [post_excerpt] => 
        [post_status] => charitable-pending
        [comment_status] => closed
        [ping_status] => closed
        [post_password] => 
        [post_name] => xxx-memberships-2
        [to_ping] => 
        [pinged] => 
        [post_modified] => 2022-09-01 15:25:48
        [post_modified_gmt] => 2022-09-01 03:25:48
        [post_content_filtered] => 
        [post_parent] => 0
        [guid] => https://www.stheliers.org.nz/?post_type=donation&p=1093
        [menu_order] => 0
        [post_type] => donation
        [post_mime_type] => 
        [comment_count] => 0
        [filter] => raw
    )
    
    [16-Feb-2023 22:00:13 UTC] 2022-09-01 15:25:48
    Plugin Author WPCharitable

    (@wpcharitable)

    @fepixie thanks for this.

    According to the log, nothing is being returned after get_date_format_from_option and this line of code it should be returning a value in your database WordPress options table:

    $format = get_option( 'date_format' );

    Can you check in the wp_options table if the row date_form exists? For a typical WordPress install (at least in the US/English) the follow row exists:

    option_name = date_format
    option_value = F j,Y
    autoload = yes

    If you got to WordPress->general settings that is where one normally changes this value. Normally a pre-selected value is there based on the database value.

    Thread Starter fepixie

    (@fepixie)

    yay – we fixed it – here’s what the problem was…

    format set to custom with no entry – changed formats to the next one up and it goes ??

    perhaps you need to add a catch for that in your next update? ??

    $format = get_option( 'date_format' );
    if ($format=='') { $format = 'Y-m-d'; }

    should fix it ??

    now – another question – what i was originally asked to do (before i found broken bits) is to hook the donations from one campaign to mailchimp – is there a hook i can use with a snippet to do that?

    thanks ??

    Plugin Author WPCharitable

    (@wpcharitable)

    @fepixie In terms of integrating with MailChimp, that’s a more complicated issue to address. That’s why we have a dedicated addon that addresses this but there is nothing currently we could recommend that would work with the free version of Charitable.

    But it’s awesome we found the solution! glad we could resolve the issue and i’ll pass that suggestion to our developers (honestly this is a first but doesn’t hurt).

    Thanks!

    Thread Starter fepixie

    (@fepixie)

    ok – thanks – i’ll ask them if they’d like to go on a paid plan

    cheers

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Dates not showing on donations’ is closed to new replies.