Forum Replies Created

Viewing 15 replies - 1 through 15 (of 265 total)
  • Thread Starter jjbte

    (@jjbte)

    Thanks so much for your helpful response, @threadi! I signed up for the WP Trac mailing list.

    Thread Starter jjbte

    (@jjbte)

    Hi @amieiro. Thank you for your reply and suggestion. This seems like it has to be a bug in WP 5.8. I am hoping I won’t have to install a plugin to fix it. I do like the idea of using blocks in widgets, so I hope I won’t have to give up a new feature because of a bug that should be fixable.

    I do like that the plugin you suggested is built by WordPress folks and they have promised to maintain it through next year.

    Thanks again, and you have a nice day too! 🙂

    Thread Starter jjbte

    (@jjbte)

    Welp, I guess I’m going to have to just live with it, as much as it pains me to do so.

    I tried defining a constant right after the email is sent successfully. Then I added a check for whether that constant is defined along with the $wpdb->insert check. No success.

    I also tried turning on debug mode, but all I got in my debug log were the duplicate DB entry messages.

    I tried adding debug_print_backtrace() at various points in the contact_form_email() function. I did the same for the plugin on the site (running WP 4.8) that is working as expected/intended. I compared the output from the two. The 4.8 site shows the contact_form_email() function completing the step for sending the email. It only goes to the step for a repeat submission if I refresh the page and say Yes to resubmitting the form data.

    The test site (running WP 5.4) shows no evidence of the send email step at all. It goes straight to the repeat submission step. So it gives me no information as to whether the contact_form_email() function is bring run twice or, if so, why.

    Other than these two differences, the two sites appear to be running the same steps, functions, hooks, etc. in the process of submitting the contact form.

    Thank you again fro all your help, @bcworkz. I really appreciate all the trouble you’ve gone to in order to help me with this problem. 🙂

    Thread Starter jjbte

    (@jjbte)

    Thank you, @bcworkz, for another informative reply. I’ll look into the constant method when I have a chance. I found this post from someone having an issue with multiple shortcode invocations and a constant was suggested in that case also.

    I already changed the “repeat submission” message on the other site where this is happening so it’s not obvious to the user that anything is wrong. I’m currently working on a test site, so I haven’t changed the message yet. On the first site, I thought the theme I was using might be the cause; it was a theme I’d never used before. But now this test site is having the same issue with a different theme.

    I understand the shortcode could be causing the send email function to be getting called more than once, but why is it not happening in the older versions of WP? Has there been a major change in shortcode behavior between WP 4.8 and now? I guess I’ll have to do some file comparisons and study the WP changelogs to see if I can find any clues.

    Thanks again for your help.

    Thread Starter jjbte

    (@jjbte)

    Hi @bcworkz,

    Thank you so much for your detailed, helpful reply!

    The contact_form_email() function is called once from the shortcode function. I don’t have any action hooks in the plugin other than those for loading language and style files.

    I built this plugin several years ago and based it on this SitePoint tutorial.

    It runs as expected on a site running WP 4.8 on a host server running PHP 7.1.33. It does this double submission thing on two sites running WP 5.1 or 5.4 on a host server running PHP 7.3.16. All sites use many of the same plugins, but a different theme is used on each site.

    Upon submission, the contact_form_process() function checks for the unique stamp, honeypot fill-in, and nonce verification. If no issues, all inputs are sanitized and validated as appropriate. If all is well, the contact_form_email() function runs.

    The only other thing I can think of is something connected to ob_start() and ob_get_clean() as I admittedly don’t have an in-depth understanding of exactly what those functions do.

    Thread Starter jjbte

    (@jjbte)

    Hi @jojota,

    The czr_fn_render_template() function needs to be run within the while ($wp_query->have_posts()) loop.

    if ($wp_query->have_posts()) {
      while ($wp_query->have_posts()) {
        $wp_query->the_post();
        czr_fn_render_template(
          'modules/grid/grid_wrapper',
          array(
            'model_id'    => 'post_list_grid',
            'model_args'  => array(
              'grid_columns'    => 2,
              'image_centering' => 'js-centering',
              'show_thumb'      => 1
            )
          )
        );
      }
      wp_reset_postdata();
    }
    Thread Starter jjbte

    (@jjbte)

    Thanks, @supernovia. I will post the issue if I have time.

    There is no way to mark files as safe. My fix was to copy the .htaccess code generated by the filters in question, modify the code to eliminate references to the ~ character, and copy the modified code into the Custom .htaccess Rules section provided by the WP Security plugin. I then disabled the actual filters to leave just my modified code in the .htaccess file.

    The procedure is discussed in the WP Security forum here: https://wordpress.org/support/topic/character-string-filters-break-jetpack-slideshow/#post-11836522.

    Thread Starter jjbte

    (@jjbte)

    Thanks. I always forget about the custom option for some reason. So temporarily enable the filters and find their sections in the .htaccess file, remove all references to the ~ character, copy the result to the Custom area, then disable the filters.

    I reported this issue via the Jetpack forum. I’m hoping they’ll address it so this won’t even be a worry.

    Thread Starter jjbte

    (@jjbte)

    Hi @emranemranx. Thank you for your reply. I am customizing the theme. I have a child theme in which I have created a custom template for my custom post type (online_exhibit). In that custom template, beneath the content, I have placed the code above. It works except for the issue I mentioned where a new grid is created for each child post. The desired result is for all child posts to appear within a single grid.

    My code is very similar to the code used in the source theme’s template templates/parts/loop.php:

    while ( have_posts() ) {
      the_post();
      czr_fn_render_template(
        $loop_item['loop_item_tmpl'],//<= is a relative path
        $loop_item['loop_item_model']
      );
    
    }

    In my case, $loop_item[‘loop_item_tmpl’] = modules/grid/grid_wrapper.

    I also used the WordPress WP_Query examples for assistance in writing my code.

    Thread Starter jjbte

    (@jjbte)

    Thank you for this information, @talldanwp. I was thinking some of the core blocks might be good to look at since they render nicely in the block editor without being editable. I was having trouble making sense of the associated files, though. I will take a closer look at the example you linked to and see if I can figure it out.

    Thanks again! 🙂

    Thread Starter jjbte

    (@jjbte)

    Finally had a chance to test this and it does work. Thanks!

    Thread Starter jjbte

    (@jjbte)

    Thanks for replying and looking into this issue. 🙂

    You’re welcome. Glad I could help!

    Do you mean viewing the site statistics reports? If so, that can actually be controlled through Jetpack itself. Go to Jetpack > Settings > Traffic and you should see the Site stats menu at the top. Under Allow stats reports to be viewed by, slide the Author switch to on.

    Thread Starter jjbte

    (@jjbte)

    Thanks so much for your reply and consideration! 🙂

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