-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OwnYourGram posts not pulling in photos #51
Comments
I don't think this is a theme problem, because there is no functionality to filter the post output and there were no changes since the last version. was there an update of one of the other plugins you use? do you use micropub and ownyourgram? |
I do use micropub and ownyougram. Though the micropub plugin update came out a month ago and I haven't had any issues. Wondering if some code I'd added was blown away. I'll start digging there though. |
I am not aware of any change that might cause this issue. Can you check if the html is in the DB? SemPress might only be filtering the output and have no impact of saving new data. So if it is correctly saved to the db, it might be a theme issue, if not, there might be another plugin. |
I rolled back to version 1.4 of SemPress and posted a photo to Instagram, PESO'd to my blog with OwnYourGram and it is now working as before. Even posting the same code block and pulling the image in
I didn't change any other plugins. I'm really not sure what is wrong. |
Can you check if it might be the same problem as #52 ? |
@davidmead, Not directly related, but in lieu of OwnYourGram, which is very solid, you might also want to take a look at https://github.com/jtsternberg/DsgnWrks-Instagram-Importer which is a WordPress specific Instagram importer. Because it was built specifically for WordPress it's got a lot of additional pre-built functionality that allows you to set Post Format, Post Kind (if you're using Post Kinds plugin), handle hashtags, Import your entire Instagram history (not just from when you started using OYG), set the photo as Featured (or not), categories and tags, and a bunch of other subtle bells and whistles that are WordPress specific and not well supported by OYG. Otherwise, it works much like OYG does on the back end and includes all of the meta-data including GPS coordinates and location data if you choose to include it in your post. |
OK @pfefferle. I updated every plugin and theme so everything is up-to-date. Just posted to Instagam, went into OwnYourGram and clicked post there so I didn't have to wait, and what I have in the db is as follows... ID = No image in the HTML. Above that is ID = Last Instagram image, before all the updates, was ID = post_content = Really in the blind here. |
Thanks for the recommendation @chrisaldrich. At this point I'm feeling like throwing the towel in on syndication as a whole :-( |
I am very sorry, never thought that I changes something that fundamental. I will have a look at ownyourgram to hopefully find the problem! |
OK, I can reproduce the problem! that is really strange! 'will have a look what exactly happens here, later today. |
sorry for the trouble, all! i suspect it's this: https://github.com/snarfed/wordpress-micropub/blob/4eb0e217685a653957eb4d9604bd848f25ec41f5/micropub.php#L516-L524 micropub generates and injects HTML into post content for things like replies, reposts, likes, rsvps, events, and photos. it doesn't do that if post kinds is installed or the current theme support mf2, though, since it expects them to do it. i think we've settled on a standard way across plugins to store structured mf2 in wordpress - post metadata with what do we want to render in this case, it sounds like sempress doesn't render photos, but micropub thinks it does, at write time, which is why micropub notices that post content is empty when there's no caption and renders the photos as a fallback. |
oh ok... that's it! |
@snarfed you are right, SemPress does not render images, but it says that it supports |
@snarfed I think we should add another theme support key. supporting what do you think about: |
i like it! especially if the values are the exact i wonder if post kinds could even do something similar, to be explicit about which mf2 properties it can and can't render. @dshanske? is the some shared way that both plugins and themes can declare their support for individual things like this? |
cool! yes, if they exactly match the for plugins we could add a filter like: function custom_plugin_disable_microbub_rendering( $for ) {
$for[] = 'mf2_photo';
return $for;
}
apply_filters( 'microbub_disable_rendering', 'custom_plugin_disable_microbub_rendering' ); |
@davidmead long story short: we have to change something in the micropub plugin and everything should work as expected again. |
hmm. if sempress and post kinds both support rendering some property, how do they decide which one actually should? other WordPress plugins must have had this problem before with common functionality. do you know what they do? filters with priorities? something else? |
hmm... that is another good question... |
theme should always be first, so the plugin could also check the theme support... but what if two plugins can render the same property.... |
another problem: micropub renders at write time, into post_content, but sempress and post kinds (i think) render to HTML at page load time. so, when a post is created, if post kinds doesn't support a property but micropub does, micropub will generate HTML for it into post_content. if post kinds (or sempress) later adds support for that property, it will show up on the page twice, since it's already in post_content. thoughts? i suspect this means micropub should stop generating its own HTML into post_content. :/ sorry for the brain dump. feel free to grab me on IRC instead if you want! |
This has been a problem that Core has discussed also in their new content block explorations, and in the Post Formats UI that was explored in (I think) 3.6. How do you generate dynamically and support statically? https://make.wordpress.org/core/2017/01/17/editor-technical-overview/ This is where WordPress seems to be going with that idea. It seems like if this work comes into core, we might be able to enhance it to address the issues in the long term. With Post Kinds, the advantage of storing and generating is that the rendering can change and improve over time. I intend to add more support for rendering properties. In the the last few versions, Post Kinds actually supports the theme taking over rendering. The microformats2 support suggests the theme supports it...which would reflect the structure of the theme itself. I wonder if there is a way to combine the Micropub generation with Post Kinds to form something different? I have no problem if we separate the rendering from the UI. |
@snarfed @pfefferle Thanks for digging into this. I always seem to be the one "breaking" #indieweb stuff on Wordpress ;-) Look forward to updating the plugins/themes soon. |
@davidmead if you need a quick fix, just remove this line https://github.com/pfefferle/SemPress/blob/master/sempress/functions.php#L102 |
@dshanske et al:
sure! to start, i should change micropub's rendering code from injecting into then, we need a way for themes and plugins to cooperatively determine who renders which mf2 property. here's a straw man proposal: themes and plugins hook into function my_plugin_mf2_renderer( $renderer ) {
return $renderer ?: 'my_plugin';
}
add_filter( 'mf2_pronoun_renderer', my_plugin_mf2_renderer, 2, 1 );
add_filter( 'mf2_photo_renderer', my_plugin_mf2_renderer, 99, 1 ); when a theme/plugin is ready to render an mf2 property, it first calls the filter. if it gets its name, it renders the property. otherwise, another theme/plugin has higher priority for this mf2 property, so the current plugin skips rendering it. if ( apply_filters( 'mf2_pronoun_renderer', NULL ) == 'my_plugin' ) ) {
echo( implode( '/', $mf2_pronouns ) );
} it's similar to |
You can actually do a more dynamic filter using apply_filters( "mf2_{$type}_renderer",$type... There is also the option of registering the configuration to a global variable, which is how post types and other objects are done. |
Would this be a possible extension of wordpress-uf2? Turning it into a mf2 rendering library that can be installed standalone or incorporated into other plugins? |
@snarfed There is one other alternative. Post Kinds uses a template system where a template piece is used for the specific post type presentation. It can be overridden in the theme. Wonder if that is worth expanding adoption on. |
I think I would start with:
what do you think? |
I like the idea of a generic filter system that can be used by various plugins/themes, btw. |
Post Kinds is three pieces. A taxonomy to classify the post types for archives and such. A post UI enhancement that adds fields and will parse URLs for link preview data. A mf2 renderer that adds mf2 properties to content which is themeable. That is why I am saying that I am willing to spin the rendering stuff out of Post Kinds, merge it with the rendering part from Micropub so that we aren't having two things do the same function. Then Post Kinds becomes the UI enhancements. Not sure what you think re the Taxonomy. |
thanks for the feedback, guys! @pfefferle, i think i mostly understand. i'll put together a PR for micropub and cc you on it. feel free to do the same for sempress! no hurry. @dshanske maybe! i'd like to avoid scope creep here though. regardless of where any functionality lives, we'll always have cases where more than one plugin/theme can render a given mf2 property, |
I will be happy to implement the proposed filters in Post Kinds for the time being as well. Suggest the variable version I suggested though |
I will close this, as it is not a SemPress problem... |
Since updating my syndicated posts from Instagram, via OwnYourGram, are not including the photo when being being created.
What I'm getting is the WP post being created with all the content pulled across, but, the image is in the media library and the normal code isn't being generated to show it.
Post with the old version of SemPress...
Post with the new SemPress
As you can see the
<div>
and[gallery]
aren't being created.Any ideas?
The text was updated successfully, but these errors were encountered: