• Resolved syedir

    (@syedir)


    One of my client’s website had an issue where they cannot update the posts. I was assigned the task to debug and fix the issue. What I found out was that FeedBurner.php was causing the fatal error if $fb_urls are present or null.

    here is the error

    PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /home/somewebsite/public_html/wp-content/plugins/a2-w3-total-cache/extensions/FeedBurner.php:28
    Stack trace:
    #0 /home/somewebsite/public_html/wp-includes/class-wp-hook.php(294): W3_FeedBurner->flush_feedburner(3952)
    #1 /home/somewebsite/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(true, Array)
    #2 /home/somewebsite/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #3 /home/somewebsite/public_html/wp-includes/post.php(5047): do_action('publish_post', 3952, Object(WP_Post))
    #4 /home/somewebsite/public_html/wp-includes/post.php(4284): wp_transition_post_status('publish', 'publish', Object(WP_Post))
    #5 /home/somewebsite/public_html/wp-includes/post.php(4486): wp_insert_post(Array, false, true)
    #6 /home/somewebsite/public_html/wp-admin/includes/post.php(419): wp_update_post(Array)
    #7 /home/somewebsite/public_html/wp-admin/post.php(227): edit_post()

    Here is the code before editing:

    if ($fb_urls) 
                $fb_urls = explode("\n", $fb_urls);
    $fb_urls[] = home_url();
                foreach($fb_urls as $url) {
                    wp_remote_get('https://feedburner.google.com/fb/a/pingSubmit?bloglink=' . urlencode($url));
            }

    Here is what I did to fix it

    function flush_feedburner($post_id) {
            if (!w3_is_flushable_post($post_id, 'pgcache', $this->_config)) {
                return;
            }
            $fb_urls = w3tc_get_extension_config('feedburner','urls');
            
            if ($fb_urls) {
                $fb_urls = explode("\n", $fb_urls);
                $fb_urls[] = home_url();
                foreach($fb_urls as $url) {
                    wp_remote_get('https://feedburner.google.com/fb/a/pingSubmit?bloglink=' . urlencode($url));
                }
            }
        }

    Please update the feedburner.php file so that after any future update the issue should not occur again

Viewing 1 replies (of 1 total)
  • Plugin Author A2 Hosting

    (@a2hosting)

    While this is not functionality supported by A2 Optimized, the latest version of the plugin effectively resolves this issue by removing the requirement of using W3TC.

    Alternately, you can upgrade to the mainline version of W3TC where this issue should be fixed as well. Be sure to disable the caching functionality of A2 Optimized as A2 Optimized does not support configuring newer versions of W3TC.

Viewing 1 replies (of 1 total)
  • The topic ‘Feedburner issue’ is closed to new replies.