• Hi

    I have Jetpack installed and I am just trying to use the publicize option but it doesn’t seem to work (e.g nothing is sent out to LinkedIn, Google=, FB, Twitter etc) IF I am not logged in.

    When I have a browser window open and I am logged in I can run a manual feed import that loads articles from feeds and posts them to my site. I also get the publicize action working with posts to LinkedIn, FB etc.

    However how do I know JUST from looking at an edited page that Publicize has run or worked?

    When viewing articles in edit mode that HAVE been publicized there are no ticks in the disabled (in the generated HTML source all checkboxes have disabled=”disabled” for each social media sites I have linked in) so that is no good.

    Also there is no custom field or Post Meta that would indicate the Publicize action had fired (and worked or not which would be nice) – and even nicer if it showed WHY it had errored e.g a log window/file listing events like
    -[date stamp] – Post Published
    -[date stamp] – Post Publicized to Twitter account X
    -[date stamp] – Post Not Publicized to LinkedIN account X due to a failed OAuth connection
    -[date stamp] – Post Not Publicized to Facebook account X due to an HTTP connection timeout

    This would be very handy!

    For some reason whether articles are OR not publicized the social media tick boxes are ALWAYS disabled – never with ticks in.

    I can manually run a feed import, get my articles posted and publicizied but when a CRON job runs an import of articles and I am not manually logged in somewhere, it just doesn’t send anything out even though the post is published.

    Is there some sort of OnPublicize action that I could use to generate a custom post META value/custom field to tell me the publicize action had run (successful or not)?

    This would be very handy for some of my own plugins which rely on delayed saves as I could use the action / hook to fire some of my own code and display a cutom field that showed whether publicize had run or not.

    Also as you are using remote API calls to run most of your plugins code how can I debug it to see what is going wrong?

    E.G when the CRON job runs and the posts are published but not publicized I want to see what failed. At the moment it is looking like it needs somone to be logged in as admin for it work at all.

    Thanks

    Rob

    https://wordpress.org/plugins/jetpack/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    it doesn’t seem to work (e.g nothing is sent out to LinkedIn, Google=, FB, Twitter etc) IF I am not logged in.

    Being logged in or out doesn’t really matter here. You can trigger Publicize even when posting from a third-party app, like one of the Mobile apps.

    However, in your case, if you’re importing posts with a third-party tool the WP_IMPORTING constant is most likely set during the import, and Publicize won’t be triggered when that constant is set. This allows us to not trigger Publicize multiple times when you import posts with one of the importers.

    there is no custom field or Post Meta that would indicate the Publicize action had fired (and worked or not which would be nice) – and even nicer if it showed WHY it had errored e.g a log window/file listing events like
    -[date stamp] – Post Published
    -[date stamp] – Post Publicized to Twitter account X
    -[date stamp] – Post Not Publicized to LinkedIN account X due to a failed OAuth connection
    -[date stamp] – Post Not Publicized to Facebook account X due to an HTTP connection timeout

    While it’s not as detailed as that, we do actually save post meta for each post, to let you know if a post was pushed to a specific Social Network, or not. These custom fields all start with the same prefix: _wpas_.

    You can take a look at how we do this here:
    https://github.com/Automattic/jetpack/tree/3.5.3/modules/publicize

    For some reason whether articles are OR not publicized the social media tick boxes are ALWAYS disabled – never with ticks in.

    The checkboxes are disabled because you can’t use them again. Publicize can only be triggered once, when the post is published.

    Also as you are using remote API calls to run most of your plugins code how can I debug it to see what is going wrong?

    You can’t really debug things since the posts are all pushed via our own app (that’s the main idea behind Publicize!), but we can help you by debugging for you. 🙂

    Thread Starter strictly-software

    (@strictly-software)

    Hi

    The first part you got the wrong way round, when I am logged in and import a feed (batch of articles), the Publicize action DOES work, with FB,G+,TW all going out.

    It is when I am not logged in and the feed is imported that the publicize actions don’t seem to work.

    Therefore it seems like being logged in as admin in an open browser window is somehow affecting it?

    Also re the tick boxes, surely even if disabled, when editing a post that has had successful Publicize actions to the various listed Social Media outlets WORK, then they should be ticked, even if I cannot edit them?

    This would show the user that the Publicize actions to those sites had worked without the need for custom fields etc.

    Also re the _wpas_ custom fields.

    If I am displaying Custom Fields on my edit page then surely if Publicize HAD worked these should be showing up along with my other custom fields? At the moment whether it works or not I don’t see any custom fields named _wpas_ on the page.

    Thanks for your help

    Rob

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    when I am logged in and import a feed (batch of articles), the Publicize action DOES work, with FB,G+,TW all going out.

    It is when I am not logged in and the feed is imported that the publicize actions don’t seem to work.

    Could you let me know the name of the plugin you use to run this import, so I can run some tests on my end and see if I can understand what’s going on?

    when editing a post that has had successful Publicize actions to the various listed Social Media outlets WORK, then they should be ticked, even if I cannot edit them?

    This would show the user that the Publicize actions to those sites had worked without the need for custom fields etc.

    That’s a good idea. I’ll forward your suggestion to our team in charge of Publicize, we’ll see if we can add that to a future Jetpack update!

    At the moment whether it works or not I don’t see any custom fields named _wpas_ on the page.

    Custom fields starting with an underscore won’t appear in the post editor. You’ll need to check your database to see them.

    Thread Starter strictly-software

    (@strictly-software)

    Hi okay I’ll check the DB, why don’t they show custom fields with an underscore OR why don’t you rename them to NOT have an underscore so that users could see the values on the page – checkboxes being ticked would be better of course. But it depends what other data you store e.g failures or errors – that would be great to see on the page.

    The plugin I use to import feeds is WP-O-Matic that uses SimplePie to load in feeds. However I have customized it a bit to make it add in custom categories depending on the content of the article but the core of the plugin should be the same as the original or the one being used at the moment.

    Thanks

    Rob

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    why don’t they show custom fields with an underscore OR why don’t you rename them to NOT have an underscore so that users could see the values on the page

    That’s a core WordPress feature, as explained here:
    https://codex.wordpress.org/Function_Reference/add_post_meta#Hidden_Custom_Fields

    Hidden custom fields are currently the preferred way to store plugin custom fields that have their own UI.

    The plugin I use to import feeds is WP-O-Matic that uses SimplePie to load in feeds.

    I just gave it a try, added a test feed as a new campaign, and fetched that feed. It fetched the 10 latest posts from the feed, and all 10 entries were pushed to Facebook and Twitter via Publicize. It seems to be working properly on my end.

    Would you mind sending me a copy of your edited version of the plugin, so I can test things again?

    Thanks!

    Thread Starter strictly-software

    (@strictly-software)

    Hi

    The problem is that I have customised it a lot so that it’s now proprietary code.

    What I can say is that it is the same code as WP-O-Matic, e.g it uses SimplePie to fetch feeds but then it also does the following
    -checks the feed type as if it’s a small piece of text it might use your wp_remote_get function to get the URL, extract the body of the article with regular expressions, then analyse the content to see if it’s relevant (e.g with a list of keywords), and also runs it through a function that assigns categories to it depending on whether it has certain words in the article. It then saves the article with this insert post function.

    function insertPost($title, $content, $timestamp = null, $category = null, $status = 'draft', $authorid = null, $allowpings = true, $comment_status = 'open', $meta = array())
      {
        $date = ($timestamp) ? gmdate('Y-m-d H:i:s', $timestamp + (get_option('gmt_offset') * 3600)) : null;
        $postid = wp_insert_post(array(
        	'post_title' 	            => $title,
      		'post_content'  	        => $content,
      		'post_content_filtered'  	=> $content,
      		'post_category'           => $category,
      		'post_status' 	          => $status,
      		'post_author'             => $authorid,
      		'post_date'               => $date,
      		'comment_status'          => $comment_status,
      		'ping_status'             => $allowpings
        ));
    
    		foreach($meta as $key => $value)
    			$this->insertPostMeta($postid, $key, $value);			
    
    		return $postid;
      }

    Therefore I think it might be something to do with the length of time all this takes?

    I also have my own Strictly AutoTags / StrictlyTweetBot plugins which
    a) analyse the content for relevant post tags, adding new ones or existing ones.
    b) then if TweetBot is installed (which it is), it waits for my finished_tagging hook before running and Tweeting out the posts.

    What seems to happen when Jetpack / Publicize is enabled is this
    -A plugin called Postie that takes emails and converts them to posts never works and the posts always stay as drafts.
    -I will get posts added but not published
    -I will have some of my Strictly AutoTags plugin SEO work done on the content (deeplinking/bolding etc) – will be done BUT no tags will be added which means…
    -Strictly TweetBot never runs as the finished_tagging never fires.

    Why I have no idea all I can say is what happens when I turn the plugin on and off.

    I can run the plugin to import feeds manually logged in as admin and it will work fine e.g, posts with tags, tweets and all the publicize posts.

    However a CRON job running the same WP-O-Matic feed import will cause, posts, not published OR no tags, and no tweets.

    At the moment I am having to manually turn it on and off before and after my email import runs in the morning and then manually run the feed import to ensure publicize pushes out to LinkedIn/Tumblr etc.

    I also have to constantly check for posts with no tags from CRON initiated jobs.

    I am just wondering if it is do with the sequential processing of the steps OR the priority flag not working e.g maybe I need to set it really high in JetPack (Can I do this) OR it is do with an Admin logged in cookie which means when I run the job manually it works, automatically it doesn’t.

    Is there any hook that can be added or event/action that I could manually fire from my OTHER plugins to fire Publicize rather than letting it run automatically as this would allow me to tag, tweet then FIRE your code?

    Thanks for your help

    Rob

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    What seems to happen when Jetpack / Publicize is enabled is this
    -A plugin called Postie that takes emails and converts them to posts never works and the posts always stay as drafts.
    -I will get posts added but not published
    -I will have some of my Strictly AutoTags plugin SEO work done on the content (deeplinking/bolding etc) – will be done BUT no tags will be added which means…
    -Strictly TweetBot never runs as the finished_tagging never fires.

    It would be nice if you could deactivate each plugin, one at a time, until you figure out exactly which one (Postie, Strictly AutoTags, or StrictlyTweetBot) conflicts with Jetpack. We could then keep debugging to find out more.

    Is there any hook that can be added or event/action that I could manually fire from my OTHER plugins to fire Publicize rather than letting it run automatically as this would allow me to tag, tweet then FIRE your code?

    I’m afraid not. Publicize is fired when the post status changes to publish, so you’d have to have your plugins fire right before that, maybe?

    Thread Starter strictly-software

    (@strictly-software)

    Hi

    The problem is that the tagging plugin fires on_save (publish/draft) which is why I have to add a hook finished_tagging as if a post is published I then, take it out the DB, analyse it for tags, save the tags and re-save (with SQL) the article before setting finished_tagging which the TweetBOT listens for and then runs.

    I am guessing as you run on publish there are no tags at that point but why it stops everything else running I don’t know.

    Problem with turning one off is the three are linked

    email => Posite parses and puts it on the system => (with Publicize nothing goes from draft to publish)
    normal feed import (admin) => publish is fired, strictly autotags runs & re-saves the post, sets the finished_tagging hook => strictlyTweetBot runs and Tweets.

    I think although I wish I had all the Jetpack code to debug, it’s to do with the timings of the actions/events firing.

    Thanks

    Rob

    Thread Starter strictly-software

    (@strictly-software)

    Oh and something else, whenever I try and authorise the plugin to connect to a WP.com account it always fails, going to my Cloudflare account as an error – then on “retry for a live version” it works but it does it 100% of the time.

    Don’t know if connections are an issue but it does seem to only work when I am logged in as admin with a manual feed push.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    The problem is that the tagging plugin fires on_save (publish/draft) which is why I have to add a hook finished_tagging as if a post is published I then, take it out the DB, analyse it for tags, save the tags and re-save (with SQL) the article before setting finished_tagging which the TweetBOT listens for and then runs.

    As long as both Publicize and your tagging plugin fire at the same time, you’ll have the problem I’m afraid.
    How about trying to save your tags before publication, maybe only when saving as draft? That’s not ideal, but could be a good work-around.

    whenever I try and authorise the plugin to connect to a WP.com account it always fails, going to my Cloudflare account as an error

    I’d suggest playing with your CloudFlare security settings until you get this sorted out.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Why do I need to be logged in?’ is closed to new replies.