Forum Replies Created

Viewing 15 replies - 16 through 30 (of 142 total)
  • Thread Starter ChrisL

    (@chrslcy)

    The original code seems to trigger on the first tmptitle post, however, if you increase the trigger value to 3, that seems to fix the issue, like this:

    function check_draft_post_title( $new_status, $old_status, $post ) {
        if ( $new_status === 'draft' && strtolower( $post->post_title ) === 'tmptitle' ) {
            $post_id = $post->ID;
    
            // Check if transient already exists
            $email_sent = get_transient( 'draft_post_email_sent_' . $post_id );
    
            if ( false === $email_sent ) {
                $args = array(
                    'post_type'   => 'post',
                    'post_status' => 'draft',
                    'post_title' => 'tmptitle',
                );
                $query = new WP_Query( $args );
    
                // Check if there are three or more draft posts with the title tmptitle
                if ( $query->found_posts >= 3 ) {
                    error_log( 'Three or more draft posts with the title "tmptitle" have been created by Postie Plugin.' );
                    $to      = get_option( 'admin_email' ); // Use admin email address
    		$subject = get_bloginfo( 'name' ) . ' - Multiple Draft tmptitle Posts Created';
    		$message = '<p>Three or more draft posts with the title "tmptitle" have been created by Postie Plugin.</p>';
    		$message .= '<p>View all posts in the admin area: ' . get_admin_url() . 'edit.php?post_type=post</p>';
    		$message .= '<p>Here are some suggested remedies: https://postieplugin.com/ufaq/my-posts-have-a-tmptitle-title-and-no-content/</p>';
                    $headers = array( 'Content-Type: text/html; charset=UTF-8' );
                    wp_mail( $to, $subject, $message, $headers );
    
                    // Set transient to prevent duplicate email
                    set_transient( 'draft_post_email_sent_' . $post_id, true, DAY_IN_SECONDS );
                }
    
                wp_reset_postdata();
            }
        }
    }
    add_action( 'transition_post_status', 'check_draft_post_title', 10, 3 );
    Thread Starter ChrisL

    (@chrslcy)

    Hi,

    I see that this problem has been mentioned several times on your pro support forum. Any plans to investigate?

    I’m getting this error when trying to add the Content Toggle block to a page:

    This block has encountered an error and cannot be previewed.

    This is the error appearing in the console:

    TypeError: Cannot read properties of undefined (reading 'length')
    at bt (react-dom.min.js?ver=18.2.0:10:47434)

    • This reply was modified 1 year, 7 months ago by ChrisL.
    Thread Starter ChrisL

    (@chrslcy)

    Thought I should add: this is the error in the console:

    Switching useSelect from mapping to mapping is not allowed

    Bump. The latest update also broke my development site. Needed to rollback to fix.

    • This reply was modified 1 year, 8 months ago by ChrisL.
    Thread Starter ChrisL

    (@chrslcy)

    Thanks for the reply. I have done exactly as stated above on an iPad running iPadOS 16.4 (beta), however, the prompt for push doesn’t appear and notifications are not received. Are you saying that the current version of the plugin should work on iOS 16.4?

    Thread Starter ChrisL

    (@chrslcy)

    Not sure how to confirm that wp-cron tasks are running other than to confirm that other plugins which rely on wp-cron are working fine.

    Thread Starter ChrisL

    (@chrslcy)

    Thanks for your prompt and thorough reply. The log and site-info file have been submitted to your contact form as requested.

    Thread Starter ChrisL

    (@chrslcy)

    If anyone has a similar problem, it turns out that I was migrating from a very old multisite with the legacy file structure. All I needed to do after using this plugin was manually migrate the media files from the old site (/wp-content/blogs.dir/{num}/, where {num} is the number of the subsite) to the new single site uploads folder.

    How to turn a reasonably useful plugin into a cynical spam address harvester. This plugin is presenting this message to users who login:

    Please confirm your email by clicking on the link we sent to {users_email_address}. This makes sure you’re not a bot.

    ..and sending the confirmation email automatically. Even to Editors. Despite the fact that the basic functionality of the plugin has nothing to do with email.

    I’m deactivating this plugin from the 46 sites I have it installed on. Until this email-confirmation request is made opt-in and ONLY shown to Administrators, I will
    not be using it again.

    Thread Starter ChrisL

    (@chrslcy)

    Any chance of an update on this? The recent update is exactly the same.

    Thanks.

    Chris

    Thread Starter ChrisL

    (@chrslcy)

    I should add that if I rollback to Version 6.2, the ‘App Subscribers’ list reappears.

    Thanks for your support in advance.

    Thread Starter ChrisL

    (@chrslcy)

    Thanks Wayne. In case anyone is looking for the same solution, I adapted your suggestion to ensure that all potential URLs which Outlook might use are captured:

    Get <a href=(?:"([^"]+)"|'([^']+)').*?>Outlook for

    Thread Starter ChrisL

    (@chrslcy)

    No worries. Would be great to see this as part of Postie’s core, but I’ve created a function that seems to do the trick for anyone in need:

    (modified from this https://stackoverflow.com/questions/55007093/remove-tags-a-to-a-specific-url-domain-php)

    add_filter('postie_post_before', 'unlink_embed_links');
    
    function unlink_embed_links($post) {
    	$post['post_content'] = remove_domain($post['post_content'], 'amazon.com', 'animoto.com', 'cloudup.com', 'crowdsignal.com', 'dailymotion.com', 'flickr.com', 'giphy.com', 'imgur.com', 'issuu.com', 'kickstarter.com', 'meetup.com', 'mixcloud.com', 'photobucket.com', 'reddit.com', 'reverbnation.com', 'scribd.com', 'slideshare.net', 'smugmug.com', 'soundcloud.com', 'speakerdeck.com', 'spotify.com', 'ted.com', 'tiktok.com', 'tumblr.com', 'twitter.com', 'videopress.com', 'vimeo.com', 'www.ads-software.com', 'wordpress.tv', 'youtube.com', 'youtu.be');
        return $post;
    }
    
    function remove_domain($str, $domainsToRemove) {
        $domainsToRemove = is_array($domainsToRemove) ? $domainsToRemove : array_slice(func_get_args(), 1);
    
        $dom = new DOMDocument;
        $dom->loadHTML("<div>{$str}</div>", LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
    
        $anchors = $dom->getElementsByTagName('a');
        // Code taken and modified from: https://php.net/manual/en/domnode.replacechild.php#50500
        $i = $anchors->length - 1;
        while ($i > -1) {
            $anchor = $anchors->item($i);
    
            foreach ($domainsToRemove as $domain) {
                if (strpos($anchor->getAttribute('href'), $domain) !== false) {
    				if (strpos($anchor->textContent, $domain) !== false) { 
    				// only do it if the link text contains the domain (otherwise it is a deliberate text link and should remain linked)
    					$new = $dom->createElement('p', htmlentities($anchor->textContent)); // wrap url in p tag
    					//$new = $dom->createTextNode($anchor->textContent); // alternatively, place url only without wrapping
    					$anchor->parentNode->replaceChild($new, $anchor);
    				}      
                }
            }
    
            $i--;
        }
    
        // Create HTML string, then remove the wrapping div.
        $html = $dom->saveHTML();
        $html = substr($html, 5, strlen($html) - (strlen('</div>') + 1) - strlen('<div>'));
    
        return $html;
    }
    ChrisL

    (@chrslcy)

    For me, this error appears to be a conflict between Simple Calendar and Official Facebook Pixel. I deactivated either plugin and the error disappeared.

Viewing 15 replies - 16 through 30 (of 142 total)