ideag / content-cards Goto Github PK
View Code? Open in Web Editor NEWA WordPress plugin to display links as "cards" based on OpenGraph information
Home Page: https://wordpress.org/plugins/content-cards
A WordPress plugin to display links as "cards" based on OpenGraph information
Home Page: https://wordpress.org/plugins/content-cards
I can imagine some sites don't want to cache OG images locally so being able to toggle it would be nice
ideag/content-cards
<title>
and <meta>
if OG data not foundreadme.txt
postmeta
, update via WP_Cron
Feel free to add more suggestions or discuss the existing ones.
Hello! I was wondering if it's possible to categorize a content card by tags so a user could pull up all cards under whatever category tag they may be interested in?
Thank you!
Damon K.
Right now we're using esc_url() for some variables in the template functions, I propose instead that we create dedicated functions that are escaped properly ahead of time:
the_cc_url();
the_cc_title();
the_cc_description();
the_cc_site_name();
the_cc_domain(); //New suggestion! Example: domain.com, like Facebook does it
These would also need to have versions starting with get_
as well.
It would imho simplify templating quite a bit.
I tried this across some themes and some of them have very large columns, which means the content gets stretched to 1000px or more.
If we have an option for the max width of the content card and then center it, we would be able to let the user decide.
TinyMCE button that prints a shortcode to to embed an url
Button - done
To Do: localize dialog strings
Great work on the plugin! There is one thing that bothers me a bit though. I've recently installed the AMP plugin and since the AMP standard features a very limited subset of HTML/CSS, cards look suboptimal on my AMP pages.
With AMP-restrictions turned on
I am raising this issue, looking for an advice, and potentially hoping to help you guys solve this issue. I think that eventually, card layout should simply fall back to a Blockquote style, similar to how Embedly cards get displayed, when JavaScript gets turned off
There seems to be some encoding issues if the cached filename contains special characters, try embedding this link:
http://www.aftonbladet.se/nyheter/article21396018.ab
The result in a 404 image:
http://site.dev/wp-content/uploads/2015/09/BEDR%C3%84GERI.jpg
However, the og:image is correctly placed:
http://gfx.aftonbladet-cdn.se/image/21396163/300/imageColumn/ffa13d83b9807/BEDR%C3%84GERI.JPG
A proposal from #18
If the site does not have OG, maybe we should fall back to use the <title> tag and the name="description"> tag for description text if it exists? Would make this work fairly ok on most sites even if they don't implement OG.
Like others, I cannot switch off caching (which takes up a lot of space and might also create legal problems).
https://wordpress.org/support/topic/caching-function-php-ignored/
Reference:
https://wordpress.org/support/topic/content-card-not-displaying-correct-image-on-own-site?replies=1
Example:
...
<meta property="og:image" content="http://margeburkell.com/wp-content/uploads/2015/09/How-to-Get-Started-on-Low-Carb-Checklist.jpg" />
<meta property="og:image" content="http://margeburkell.com/wp-content/uploads/2015/09/90_Days_cropped.png" />
<meta property="og:image" content="http://margeburkell.com/wp-content/uploads/2015/09/2012-to-2014-valentine-party-300x300.jpg" />
<meta property="og:image" content="http://margeburkell.com/wp-content/uploads/2015/08/Marge-Burkell-Trimmed.png" />
...
Allow PHP in templates, making them more in WordPress style and flexible.
Instead of file_get_contents()
, use includes and output buffering.
Instead of %%title%%
use <?php the_og_value('title'); ?>
to insert OpenGraph data.
Saw some site with huge OG descriptions.
Would be great if we could have something like:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed enim augue, ullamcorper sed ornare vitae, porta vitae odio. Quisque porttitor ut ipsum id ornare. Praesent urna ipsum... (250 more words)
The setting could be controllable through the options page?
Coming from feedback on Facebook, WP.org, etc. Will be split to separate issues when/if we decide to pursue them.
Before this moves much forward, I'd like to rename the repo to ideag/content-cards
to mirror the name on the WP.org repo.
I have successfully added content cared from many different sources to my site http://www.galiadigital.co.uk. However, the last couple of LinkedIn posts I have tried to add have simply displayed as a link with the text as just http://www.linkedin.com and the link itself going to the correct URL. Old cards are not affected.
I have tried making a new card with an older URL from May and the card works. Anything prior works. Anything from July onwards does not, which makes me think this is LinkedIn change.
https://wordpress.org/support/topic/new-linkedin-urls-not-displaying-as-content-cards/
After updating to 0.9.1 and trying to add a content card, it went into an infinite loop and started downloading images infinitely. It created 1000 images before I managed to manually stop the web server.
Aside from that, these images were not properly hidden from the media library.
I suggest retracting the 0.9.1 upgrade for now. @ideag
Hi,
first of all, thank you for your plugin :)
I'm trying to use it on my personal blog but seems it doesn't work for any HTTPS urls.
HTTP version of the same URL is ok. No errors on error log.
I use PHP 7 over nginx with PHP-fpm.
Any idea about the problem?
We're going to be rolling this out on a WP network where thousands of content cards will be inserted, processing all of them every day would take a really long time. So I suggest we set a max number of links to be checked every time the cron job runs, something like 30 (can be user configurable).
A "Weekly" schedule would also be nice.
Finally, if the OG is working fine, but on the next check-up, the site is down, we still keep the old data, right @ideag ?
As description.
It is way, way past time to release a new version. There are a couple of bugs that need to be fixed and some feature requests to be considered. I'll use this ticket to keep track of all the things that need to be done for the next release.
A default list of popular sites not currently having native oEmbed support in WP.
A list anyone can contribute to.
URL http://shaminnong.blog.sohu.com/309687253.html
Problem Broken encoding in title field. (Probably description too if there was one.)
As per:
https://wordpress.org/support/topic/content-cards-in-sidebar-widgets?replies=1#post-7614559
Shouldn't be too hard, just a standard width with a text input that runs the CC shortcode callback.
So, the skins are now PHP-enabled. You can use get_cc_data($key)
and the_cc_data($key)
to get OpenGraph data and the_cc_target()
to insert target="_blank"
if it was turned on via settings / shortcode arguments.
Also, the skins are now autodetected via a header in the CSS file (not unlike plugins/themes in WordPress). The only required and used value at the moment is Skin Name
.
v1.0.0
Future releases
Hi,
obviously your plugin can't handle german sites with umlaute in the headlines. It stopps to read the headlines exactly at the umlaut.
That should be easy to fix, shouldn't it?
THANK YOU!
Better OpenGraph data storage.
To Do:
postmeta
WP_Cron
postmeta
fields if link gets removed from postIdeas:
Optional expiration time for the opengraph oembeds and refresh them in the background. (Maybe possible to piggyback on core WP functions.) via @khromov
save the og data as a custom field into postmeta. That way it minimizes delays due to link rot and page load times waiting for embeds. via @lincourtl
Right now cached images show up in the media library after the CC plugin has been disabled / uninstalled.
I think we should delete the images even on deactivation of the plugin, since the user expectation is not to have a "dirty" media library if they deactivate this plugin.
@ideag Thoughts?
Right now, the light theme loading gif is always used. We need to make a separate dark gif that matches the dark color schemes, add in the proper filters etc.
Add an uninstall hook to cleanup postmeta
if plugin is deleted.
Wow, this plugin has come so far in so short a time! Thanks for all your work on Content Cards. I can't believe nobody hasn't done this before now.
Just a note that it seems the new WordPress site images are being shown at too large a size next to content_cards_site_name.
You can see an example here: http://leolincourt.com/cc-card-demo/
The regular news sites, and the one WP site which isn't using the new site images, display at icon size. Meanwhile the two WP sites using the new site images are being displayed too large.
<div class="content_cards_site_name">
<img scale="0" src="//subpanda.com/wp-content/uploads/2015/03/62881.png.jpg" alt="Subsequent Panda Creation" class="content_cards_favicon">
Subsequent Panda Creation
</div>
Hi all,
What if the parser already being used could populate a wp_post and its metadata? The way it would work would be the same as now: a button in tinymce where user can put an url. But after url is passed, the content, description and metadata could be populated with the data grabbed. So we would not have a simple card, but a full post.
If no favicon metatag is detected, try domain.com/favicon.ico
. If file exists, use that.
Update readme.txt
:
assets
From AWP post:
Looks great guys, just put it to the test. One little request would be to limit the image size pulled from the OpenGraph data (or perhaps even give a choice). I just did a test and the site I pulled in had a HUGE image set as OpenGraph.
We really have to introduce some consistency here. Maybe even return to the idea of caching images in the Media Library.
Sometimes the text in the default skin goes outside the Content Card box on the frontend on Twenty Fifteen.
I used the following shortcodes with Content Cards. The first one embeds with no problem but the second is invalid. Can you decipher the reason why one would work but not the other? It's an https website: https//:ncmountains.net
[contentcards url="http://www.edinarealty.com/marc-cutter-realtor/homes-for-sale/707-River-Street-Taylors-Falls-MN-55084-154138266"]
[contentcards url="http://www.navicamls.net/displays/?n=253&i=1765214&k=2yff"]
Thx!
To reproduce:
Embed the following URL via shortcode:
http://www.dramaten.se/Repertoar/Beckomberga/
Result: The image is broken and links to:
/Global/Repertoar/Beckomberga/BOB_lans_P_940X608b.jpg
Here is that meta property:
<meta property="og:image" content="/Global/Repertoar/Beckomberga/BOB_lans_P_940X608b.jpg" />
If we find a non-absolute path, we need to prepend the domain to it.
Skin detection system, similar to Themes (based on a comment block in stylesheet)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.