Kevin Fodness
Forum Replies Created
-
Forum: Plugins
In reply to: [Publish To Apple News] Clean up database after plugin uninstallThe plugin intentionally doesn’t delete metadata associated with posts on uninstall for a few reasons:
1) This metadata is not easily reproducible once deleted, especially the metadata that links a WordPress post to an item in Apple News. Apple News does not maintain an association with WordPress post IDs, so it’s not possible to recreate these association if deleted.
2) On larger sites, deleting that much postmeta in bulk could easily cause timeouts.
The approach you took to delete via the DB is the correct one.
Forum: Plugins
In reply to: [Publish To Apple News] Site Error when publishingI’ll file an issue on our GitHub and take a look – thanks for the report!
I’m going to close this report here, but you can follow along at https://github.com/alleyinteractive/apple-news/issues/925
Forum: Plugins
In reply to: [Publish To Apple News] missing embedded linksIf you make it a separate textarea field, that’s probably getting saved to postmeta, which doesn’t automatically make it into the post content. Sounds like you need to use one of the filters, such as https://github.com/alleyinteractive/apple-news/wiki/Filter:-apple_news_exporter_content, to add the content from your textarea field to what the plugin is transforming.
Forum: Plugins
In reply to: [Publish To Apple News] articles not populating to iCloud News PublisherIf you are seeing the “unable to find list of sections” error, that means that the API credentials were not properly uploaded to the plugin, or your API credentials are incorrect. If your .papi file is formatted correctly, which can be verified by using the Apple News API CLI, then it should work properly when uploaded to the Apple News > Settings screen in WordPress and hitting the Save Changes button.
“Needs to be updated” occurs when there has been an update to the content of the post that hasn’t been sent to Apple. This most often occurs when the automatic updating features of the plugin aren’t turned on, and a post has been changed since the last time it was sent to Apple via the API. Merely having this status doesn’t trigger an update – that comes down to whether the auto update features are turned on, or whether you have published manually.
If you have the auto update features turned on and are still seeing this message, it could have something to do with using the Gutenberg editor with legacy metaboxes, and the fact that WordPress will actually update the post more than once (first with the information from Gutenberg, then with the metabox information). Are you noticing that updates that you are expecting to go to Apple News aren’t actually making it there? Does re-saving the post fix the issue?
Forum: Plugins
In reply to: [Publish To Apple News] Apple News was working great, then….You’ll need to download the article JSON for the article that is failing (Apple News > Articles from the WordPress sidebar, then click Download) and then chase down the specific path the errors are giving you. There is a top-level
components
key, then look at the second item within that (arrays are zero-indexed, so 1 is actually the second item), then look in the components key within that item, then the third item, then components, then the first item (components->1->components->2->components->0 in the example above). What Apple’s API is objecting to is an element that has no text, like an empty paragraph. The plugin has some defensive code in it to try to prevent empty elements from being sent to Apple, but due to the number of third party plugins and custom themes out there, it’s not possible to predict every circumstance under which a blank node would be rendered. Once you figure out what the culprit is based on what’s in the JSON, you should be able to figure out how to fix it (maybe it’s a blank paragraph in your content that you can remove, or maybe there is a custom embed or some custom code that is introducing the problem).If you are able to reproduce this issue on a fresh install of the Apple News plugin using one of the default themes that ships with WordPress and no other third party plugins installed, then please file a GitHub issue (https://github.com/alleyinteractive/apple-news/issues) and we will put a fix in the plugin itself.
Forum: Plugins
In reply to: [Publish To Apple News] Video embed does not work Apple NewsI just released version 2.3.0 of the plugin yesterday, which includes a fix for this issue that should resolve it for you. Please let me know if it does not!
Forum: Plugins
In reply to: [Publish To Apple News] Video embed does not work Apple NewsI opened a GitHub issue to track progress on this:
https://github.com/alleyinteractive/apple-news/issues/906
and I have an open pull request with the fix in it:
https://github.com/alleyinteractive/apple-news/pull/907
I’m going to close this issue in favor of tracking it on GitHub, but a new version containing the fix should be released within the next few days.
Forum: Plugins
In reply to: [Publish To Apple News] Video embed does not work Apple NewsAfter doing some additional digging, I can confirm that you found a bug. I’m working on a fix that will be released with the new version early next week.
Forum: Plugins
In reply to: [Publish To Apple News] apple_news_{$component_name}_jsonI think you are setting up the filter incorrectly, and that’s why it’s not getting called. That particular filter only accepts one parameter, but you’re indicating that it should accept two (the 10, 2 part).
Following the structure of your example, I created a sample filter that did work:
class AN_Test_Filter { public function __construct() { add_filter( 'apple_news_end_of_article_json', [ $this, 'apple_news_end_of_article_filter' ], 10, 1 ); } public function apple_news_end_of_article_filter( $json ) { return [ 'role' => 'body', 'text' => 'test end of article', ]; } } $tt1_test_filter = new AN_Test_Filter();
You could also do the same thing outside of a class context, like this:
function my_theme_filter_apple_news_end_of_article_json( $json ) { return [ 'role' => 'body', 'text' => 'test end of article', ]; } add_filter( 'apple_news_end_of_article_json', 'my_theme_filter_apple_news_end_of_article_json' );
In these examples, I’m just returning a static body for the end of article content, but you can modify the value of the $json variable and return it as well, if you want to do things like replacing placeholder values or adding a link to the web version of the article etc.
- This reply was modified 3 years, 5 months ago by Kevin Fodness. Reason: formatting
- This reply was modified 3 years, 5 months ago by Kevin Fodness. Reason: formatting, again
Forum: Plugins
In reply to: [Publish To Apple News] ERROR MessageWe wrote up detailed instructions on working with .papi files here: https://github.com/alleyinteractive/apple-news/wiki/Configuration#api-settings
Since this topic is resolved, if you continue to have difficulty, please open a new support request.
Forum: Plugins
In reply to: [Publish To Apple News] Apple News configurations wiped outWhat do you mean by “configurations wiped out?” We haven’t seen this behavior ourselves or received other reports of it. However, we did recently update the way configuration data (channel, API key and secret) are set in the plugin settings screen, which changes the visual appearance, but does not change the options that are saved to the database or wipe them out.
Forum: Plugins
In reply to: [Publish To Apple News] apple_news_{$component_name}_jsonThe end of article JSON is intended to be placed in the theme configuration. I think if the custom JSON for the end of article component is empty, the filter never fires. In the WordPress admin, you can go to Apple News > Customize JSON, then choose your theme, then select End of Article as the component, and save the JSON there.
More info: https://github.com/alleyinteractive/apple-news/wiki/Customizing-JSON#end-of-article
Forum: Plugins
In reply to: [Publish To Apple News] APO / cURL timeout errorIt’s entirely possible that the quantity of images is contributing to this problem. I would strongly recommend turning on the remote images setting (not just for this issue, but because it is the preferred way to send images to Apple) and testing.
Forum: Plugins
In reply to: [Publish To Apple News] Invalid Document: Unable to read URIThat error only occurs when Apple’s servers are unable to download the image at that URL. Do you have something on your website that is blocking requests from Apple’s servers, like an application firewall or IP address-based restrictions? Ultimately, this issue is not with the Publish to Apple News plugin, but is rather between Apple’s servers and your website, so I would advise following up with Apple’s support next to see if they can give you additional details about what failed.