Project

General

Profile

Documentation #3240

Scribd shortcode

Added by Sarah Morgano about 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
WordPress Plugins
Target version:
Due date:
% Done:

0%


Description

The upgrade to WP 3.9 broke the Simple iPaper plugin. Kimon suggested Scribd Doc Embedder as an alternative plugin. I can create a separate ticket for that request if you think it's a good idea. We currently have Slideshare, Apture, and Google Docs as other plugin options to embed docs.


Related issues

Has duplicate CUNY Academic Commons - Bug #3259: scribd embed not workingDuplicate2014-06-09

History

#1 Updated by Matt Gold about 8 years ago

  • Status changed from New to Assigned
  • Assignee set to Boone Gorges

#2 Updated by Boone Gorges about 8 years ago

  • Assignee changed from Boone Gorges to scott voth
  • Target version changed from 1.6.5 to Not tracked

It appears to me that the breaking is not a result of WP 3.9, but of the fact that Scribd has changed or discontinued its embedding API.

Very few sites are actually using the plugin. I've found those that are, and whittled down a list of the posts where the shortcodes are in use:

http://majoringinmeta.commons.gc.cuny.edu/
http://core2.commons.gc.cuny.edu/?page_id=3
http://nottrivial.commons.gc.cuny.edu/?p=83
http://nottrivial.commons.gc.cuny.edu/?p=130
http://teachwithpurposebronxcc.commons.gc.cuny.edu/
http://sandboxdescott.commons.gc.cuny.edu/
http://podcasting.commons.gc.cuny.edu/
http://podcasting.commons.gc.cuny.edu/
http://qcgslis.commons.gc.cuny.edu/?p=715
http://jitp.commons.gc.cuny.edu/?p=2205
http://ilac.commons.gc.cuny.edu/?page_id=135
http://jitpstaging.commons.gc.cuny.edu/?p=2205
http://testmedia.commons.gc.cuny.edu/?page_id=178
http://chasefrobinson.commons.gc.cuny.edu/?page_id=37
http://activistwomen.commons.gc.cuny.edu/?p=258

In each case, you'll be able to find the place in the page where it should appear by viewing source, and then searching for something that looks like this:

<script type="text/javascript">
iPaper_embed('90142342', 'key-2j1w1j6aw6nc5t1ms2zb', '1333', '1000');
</script>

A number of the sites listed above are defunct or mere sandboxes. So I think it's probably within reason to do the following:
1. Identify a viable alternative to Simple iPaper
2. Identify the pages from those listed above that are legit
3. Contact the authors of those pages and either tell them how to migrate to the new embedder, or just do it on their behalf

If there are no objections, Scott, I'd like you to do steps 1 and 2 here, and then report back. Then we can talk about whether it's feasible/wise to just make the necessary change for the users (for anything less than 10, I'd say yes)

#3 Updated by Matt Gold about 8 years ago

No objections -- sounds good to me. Thanks for looking into this, Boone.

#4 Updated by Boone Gorges about 8 years ago

Marked #3259 as a duplicate. There, Ben Miller suggests Jetpack as an alternative. It's great that this works for Ben, but I'd like to avoid suggesting Jetpack as the alternative for everyone, because Jetpack requires an onerous connection to wordpress.com.

#5 Updated by scott voth about 8 years ago

I'd be happy to search for another plugin for embedded docs - but I remembered that I helped Cynthia Tobar with embedding a ScribD doc - and I took a look and it is still working. So I was trying to remember what I did. I think the trick is to not use the iPaper plugin, but to use ScribD's WP shortcodes, as described here: http://en.support.wordpress.com/scribd/

Let me test this a little more - but if it works, maybe we should let people know of a easy solution - bypassing the Simple iPaper plugin.

#6 Updated by scott voth about 8 years ago

OK - it is not so straightforward to use the ScribD shortcodes (and ScribD's WP suppport isn't all that clear either). But it does work. We probably need a post to show how. You need to activate the JetPack plugin and connect to WordPress.com, etc. to get hooked up - otherwise, the shortcodes won't work.

#7 Updated by Boone Gorges about 8 years ago

Thanks, Scott. I find it very disappointing that users would need to activate the intrusive and bloated Jetpack plugin just to get this simple embed. Have you had a quick look to make sure that there aren't other plugins available that allow for Scribd embedding? If not, maybe I'll tear it out of Jetpack so it's available as a standalone.

#8 Updated by scott voth about 8 years ago

Hi Boone - there is the plugin called "Scribd Doc Embedder" (http://wordpress.org/plugins/scribd-doc-embedder/) which I tested and which works, but I hesitated to recommend it since it looks like it is brand new, it has no rating stars, and few (645) downloads.

There is another plugin called "Google Docs Embedder" (unfortunate name - it has nothing to do with Google Docs), that has a good track record and high ranking. But it doesn't work with Scribd (scribd's url for pdfs don't end with ".pdf"). But I wonder if people are just using Scribd because iPaper needed an storage host. It seems Google Docs Embedder might eliminate this need. Looks like you can simply upload a pdf and then just embed its url very simply.

Sorry not such good options.

#9 Updated by Boone Gorges about 8 years ago

  • Assignee changed from scott voth to Daniel Jones
  • Target version changed from Not tracked to 1.7

Scott, many thanks for doing this research.

Dan, I'm going to reassign this to you. I've taken a brief look at the way that http://wordpress.org/plugins/scribd-doc-embedder/ implements the shortcodes. I think this is a fine approach, but the way it's done here is a bit sloppy and insecure. In particular, all of the values that are passed from the shortcode into the JS that's printed on the page need to be run through esc_js() http://codex.wordpress.org/Function_Reference/esc_js

For this small amount of functionality, I'd also prefer not to put it into a separate plugin that has to be activated on blogs. Let's tear it out of the plugin that Scott found, and put it into our generic shortcode file: wp-content/mu-plugins/assets/shortcodes.php

Thanks!

#10 Updated by Daniel Jones about 8 years ago

Okay I added the shortcodes where you suggested - you can see the changes at https://github.com/cuny-academic-commons/cac/commit/1b20fd9bf29443cf352f282db1af62376b879e5c

There were two issues that I could identify: one was that the "allow_share" parameter didn't seem to be working. It wouldn't let me hide the share button. I don't know how big of a deal that is but thought it'd be good for y'all to know.

The second is that the plugin comes with some code for adding a button to the tinymce editor for the shortcode. Do we want to add that in as well, or just leave the shortcodes?

The last thing is that I had to make a little change to the HTML that the shortcodes output so that it wouldn't conflict when a user tried to both embed a pre-uploaded Scribd document and create a document from a publicly accessible URL on the same page. I hope that's alright. I ran the attributes coming into the javascript through esc_js.

#11 Updated by Boone Gorges almost 8 years ago

Looking good, Dan!

There were two issues that I could identify: one was that the "allow_share" parameter didn't seem to be working. It wouldn't let me hide the share button. I don't know how big of a deal that is but thought it'd be good for y'all to know.

Don't worry about this. If anyone asks, we can look into it more.

The second is that the plugin comes with some code for adding a button to the tinymce editor for the shortcode. Do we want to add that in as well, or just leave the shortcodes?

Let's forget about the editor button for the time being. The shortcode is going to be active on all sites, but it seems intrusive to me to introduce a Scribd button on all editors.

The last thing is that I had to make a little change to the HTML that the shortcodes output so that it wouldn't conflict when a user tried to both embed a pre-uploaded Scribd document and create a document from a publicly accessible URL on the same page. I hope that's alright. I ran the attributes coming into the javascript through esc_js.

Perfect. This all looks great.

Scott - I've added you as a watcher here, so that you can add this stuff to your list of items to document for 1.7. Here's the inline documentation for the new shortcodes:

 * Scribd embed - Scribd document shortcode
+ * Allows you to embed a document that has been uploaded to Scribd.
+ * The Scribd document can be public or private.
+ * Requires both the document ID and the document key:
+ * [scribd-doc doc="DOCID" key="KEY"]
+ * You can get the document ID by viewing the document and looking in the URL
+ * You can get the document key by going to the document and clicking embed/share and then embed. Copy and paste the embed code (not the link) and look for "&access-key=key-" and copy the string of characters after that
+ *
+ * Scribd URL - Scribd URL shortcode
+ * Allows you to create a Scribd Reader from a publicly accessible URL.
+ * Naturally requires that the document type be supported by Scribd.
+ * Requires both the document URL and your Scribd Publisher API key:
+ * [scribd-url url="FULL-URL" pubid="YOUR-SCRIBD-PUBLISHER-ID"]

This is active on cdev, so you should be able to test it there as needed. Thanks!

#12 Updated by Boone Gorges almost 8 years ago

  • Tracker changed from Bug to Documentation
  • Subject changed from Simple iPaper Plugin to Scribd shortcode
  • Assignee changed from Daniel Jones to scott voth

Reassigning to Scott as a documentation task.

#13 Updated by scott voth almost 8 years ago

Hi Boone and Dan -
Very nice solution! I was able to test on cdev and everything is working great. I have create a page with some documentation for the shortcode here: http://codex.commons.gc.cuny.edu/embedding-scribd-content/
So I am assuming this is just one item that we will feature when 1.7 is released - or will we make it available sooner?

#14 Updated by Boone Gorges almost 8 years ago

  • Status changed from Assigned to Resolved

Excellent, glad it works! And thanks for the codex page. This'll be part of the 1.7 release.

Also available in: Atom PDF