hypothesis / wp-hypothesis Goto Github PK
View Code? Open in Web Editor NEWHypothesis WordPress plugin
Home Page: https://wordpress.org/plugins/hypothesis/
License: Other
Hypothesis WordPress plugin
Home Page: https://wordpress.org/plugins/hypothesis/
License: Other
Introducing a static analysis tool would allow to have a layer similar to TypeScript's type checking.
PHPStan is a good option, but we would need to make sure it does not detect WordPress core functions as undefined.
The list of post types which users can enable Hypothesis on is limited to Posts and Pages, with a not-well-documented "hypothesis_supported_posttypes" hook which can be used to override this. This means that custom post types added using tools such as Custom Post Types UI will not appear automatically.
It looks to me like it should be possible for the plugin to enumerate all registered post types automatically using get_post_types.
The page is displaying old ore no logos at all. See https://wordpress.org/plugins/hypothesis
We should update this to use up-to-date branding.
Same goes for the generic WordPress account we created: https://profiles.wordpress.org/hypodev/
Use https://github.com/10up/action-wordpress-plugin-deploy to automate the publishing of the plugin.
Hi plugin owners--
I've been working with some local users who are very excited about adding Hypothesis to their WordPress sites (and to their Pressbooks books) and have activated the plugin and begun using it. There are, however, a few commonly requested features for the plugin, and I was wondering if you'd be open to a pull request incorporating them into the existing core plugin. I've started making a very experimental "Hypothesis Modifications" plugin to do two of them here: https://github.com/SteelWagstaff/hypo-mods.
Placeholder for now - but I've gotten a number of tickets in support asking us if the plugin is defunct because it hasn't been updated in >3yrs. Common "wisdom" in the WP community is to only install plugins with recent updates. We might consider a somewhat frequent update schedule going forward.
appears in sidebar and streams annotations like a twitter feed--could be from WP install itself (URL, w/in a URL), a user, groups, tag, etc.
First, thanks for developing this plugin!
Second, Hypothesis would like to continue work on this project, and use your existing foundation as a base. For us to do that well, I wanted to ask if you could do two things:
You're also welcome to sign our Contributors License Agreement, but I'm not sure that's necessary in this case.
Thanks, @timmmmyboy!
Also, @dwhly says "hi" ๐
Dear all,
Thank you very much for your work on this excellent plugin!
I want to use hypothesis to allow users on a Wordpress blog to add extra information to a text.
It would be great if I as the blog owner could receive a notification if someone has added a note or annotation highlight.
Is this technically possible?
Thankfully,
Robert
Love your work!
I would like to use this plugin on a WP page with a longer text to add my own annotations to the text and let some others help out with the annotations, without letting the whole world add to it.
I guess this is not perfectly within your scope, but I don't know of any other tool that would work better for this. All I need is for you to add an option to let me choose either:
Would this be possible?
Thank you!
This plugin is currently using composer only to install development dependencies, which should present no problem.
If at some point we want to install production dependencies and ship them with the plugin, we'll have to explore some tool like https://github.com/humbug/php-scoper, to avoid collisions with other dependencies from other plugins.
Composer is the de-facto official package manager for PHP.
On top of allowing the installation of production and development dependencies, it also provides autoloading capabilities for all the symbols in those packages.
Autoloading is a mechanism that other programming languages resolve differently. In PHP, you have to explicitly require the file containing a class in order to be able to use that class somewhere else.
// src/Hypothesis/MyClass.php
class MyClass
{
// ...
}
---
// src/Hypothesis/OtherClass.php
use MyClass; // This is similar to Java imports, but does not bring the other class into this file's scope
class OtherClass
{
public function foo()
{
// This will throw unless we do `require __DIR__ . '/MyClass.php';` somewhere before this line
new MyClass();
}
}
Since this can become cumbersome as a codebase grows, as you need both the use
statement and also the explicit require
of the file, PHP provides a function that gets automatically invoked when an unknown class is used, to give you a last opportunity to require it before failing.
Composer builds some utilities on top of that, which allow package maintainers to provide some config that will make class files to be properly autoloaded, without forcing applications to know the dependency's file structure.
It also lets applications themselves to take advantage of this mechanism.
With this explained, there's one problem if you try to make use of this in a WordPress plugin. This is that the autoloading triggers only if the symbol/class does not exist in memory, but if some other plugin has already required the same class but from a different version of the plugin, your plugin will end-up using that same version and potentially fail if there are incompatibilities.
That's where PHP-Scoper might make sense, as it allows to "rename" the classes for all the dependencies you ship, ensuring there won't be name collisions if other plugins, or WordPress itself, are also using composer to install the same dependency.
This problem does not usually occur when an app is fully managed with composer, as you end up with a flat dependency tree, but WordPress and its plugin system predates composer.
Where could I translate all the strings of the plugin to spanish? Not only the ones of the adjustments area.
Thanks
following @JakeHartnell great update that allows you do add hypothes.is to specific pages in a WP instance, i think it would be great to allow them to choose how h appears as well:
sidebar default open/closed
highlights default visible/in-
this task comes out of Zendesk metrics for Jan 2018, where these two topics generated the most user requests
Relates to hypothesis/product-backlog#1527
This is the reason the plugin was closed, and the steps to follow to bring it back:
The email associated with the plugins owner's user account bounced. As such, all plugins associated with the account were closed, because we do require your email to be functional.
- Make sure the email on the user account is valid
- If the email is a group mail or mailing list, make sure it can receive email from external domains or non-members (Google changed their defaults in 2019 due to GDPR laws)
- If the email forwards, check all addresses to make sure they're valid and do not forward bounces
- If the ownership of the plugin is in doubt, let us know what accounts are supposed to have access and be the official owners so we can transfer them appropriately
- You must update the plugin readme to confirm it is compatible with the current release of WordPress. This is to ensure people can actually find your plugin.
- Perform a full security and guideline check of your own work. Look for sanitization, remote loading of content, and any other minor bug.
- Update all the code and upload it to SVN.
- Reply to this email that you are ready for a review
Add some integration/unit tests that allow further changes to the plugin with a lower risk to break something.
https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/
The PDF feature works by prepending https://via.hypothes.is to links in posts that point into the media upload folder, by default wp-content/uploads. But if your WP system refers to a different place, you're out of luck. So, the path to that folder should be a setting.
This plugin currently has just one class, which is manually required for convenience.
However, if we want to split it into multiple classes, using composer autoloading capabilities would be useful.
There's one consideration though. If this plugin also starts using more dependencies, then we have to resolve #60 before.
When WordPress is configured to host its Media Library in a different environment than the local file system (eg, AWS S3), this plugin doesn't launch the Hypothesis client with PDFs stored in such a
"foreign" Media Library using via.hypothes.is. This may have to do with cross-domain issues.
To recreate:
Relaying a report from our support email address:
After I updated the Hypothes.is plugin on my Wordpress website to the version mentioned above, it was not accessible anymore. I had to delete the plugin folder via my FTP access; that restored service immediately. The error message I found in my server logs was:
mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '[' in /var/www/vhosts/wordpress.karstens.eu/httpdocs/wp-content/plugins/hypothesis/hypothesis.php on line 409
I'm not sure, but I'd guess this is a result of 1f8a0c6, which replaced array()
with []
in a number of places.
It appears that this short syntax for arrays was only introduced in PHP 5.4: https://secure.php.net/manual/en/language.types.array.php#syntax
We should either revert that part of the change, or clearly document that we only support PHP>=5.4.
Do you think you might have time to look at this, @greatislander?
For optional PDF + annotation viewing:
http://github.com/hypothesis/pdf.js-hypothes.is/
Prettier has an official plugin to format PHP code which might be a good option: https://github.com/prettier/plugin-php
It has some considerations:
As discussed in #40, publishing this in the standard composer registry (AKA packagist.org) would allow people to install it as a regular dependency with composer.
It needs to have "type": "wordpress-plugin"
, and I would suggest we rename it to hypothesis/hypothesis-wp-plugin
, or something in those lines.
We are looking into adding functionality that would hide the hypothes.is functionality from people who didn't have accounts on the wordpress site.
Our use case is for people who are reading/accessing material on the site as part of a learning community/class. They would all have accounts on the WP site.
For this use case, we would want to hide the Hypothesis tab from people who did not have accounts, and show it to everyone else.
This functionality could be toggled on the Pressbooks Textbooks admin screen.
We'll gladly write the code for this, but before we dug in we wanted to check that this functionality makes sense/aligns with what you would want to support down the road.
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.