Skip to content
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

Fix guideline issues #54

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ Create a [new GitHub release](https://github.com/hypothesis/wp-hypothesis/releas

## License

[BSD](http://opensource.org/licenses/BSD-2-Clause)
[BSD-2-Clause](http://opensource.org/licenses/BSD-2-Clause)
acelaya marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions class-hypothesissettingspage.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Hypothesis;

/**
* Create settings page (see https://codex.wordpress.org/Creating_Options_Pages)
*/
Expand Down
22 changes: 16 additions & 6 deletions hypothesis.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,30 @@
* Requires PHP: 7.4
* Author: The Hypothesis Project and contributors
* Author URI: https://hypothes.is/
* License: BSD
* License: BSD-2-Clause
* License URI: https://opensource.org/licenses/BSD-2-Clause
* Text Domain: hypothesis
* Domain Path: /languages
**/

namespace Hypothesis;

use function add_action;
use function define;
use function defined;
use function get_option;
use function is_admin;
use function load_plugin_textdomain as wp_load_plugin_textdomain;
use function wp_enqueue_script;

// Exit if called directly.
defined( 'ABSPATH' ) || die( 'Cannot access pages directly.' );

// Load textdomain
function hypothesis_load_plugin_textdomain() {
load_plugin_textdomain( 'hypothesis', false, basename( __DIR__ ) . '/languages/' );
function load_plugin_textdomain() {
wp_load_plugin_textdomain( 'hypothesis', false, basename( __DIR__ ) . '/languages/' );
}
add_action( 'plugins_loaded', 'hypothesis_load_plugin_textdomain' );
add_action( 'plugins_loaded', 'Hypothesis\load_plugin_textdomain' );

define( 'HYPOTHESIS_PLUGIN_VERSION', '0.7.1' );

Expand All @@ -34,7 +44,7 @@ function hypothesis_load_plugin_textdomain() {
/**
* Add Hypothesis based on conditions set in the plugin settings.
*/
add_action( 'wp', 'add_hypothesis' );
add_action( 'wp', 'Hypothesis\add_scripts' );

/**
* Wrapper for the primary Hypothesis wp_enqueue call.
Expand All @@ -46,7 +56,7 @@ function enqueue_hypothesis() {
/**
* Add Hypothesis script(s) to front end.
*/
function add_hypothesis() {
function add_scripts() {
$options = get_option( 'wp_hypothesis_options' );
$posttypes = HypothesisSettingsPage::get_posttypes();

Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: hypothesis, annotation, comments
Requires at least: 6.2
Tested up to: 6.4.2
Stable tag: 0.7.1
License: BSD
License: BSD-2-Clause
License URI: http://opensource.org/licenses/BSD-2-Clause

An open platform for the collaborative evaluation of knowledge.
Expand All @@ -13,6 +13,13 @@ An open platform for the collaborative evaluation of knowledge.

Hypothesis is a web annotation tool that allows users to provide commentary, references, and insight on top of news, blogs, scientific articles, books, terms of service, ballot initiatives, legislation and regulations, software code and more. You can find out more at [http://hypothes.is/](http://hypothes.is/)

This plugin will allow you to automatically embed Hypothesis in your site.

Without this plugin, you would have to follow [these steps](https://web.hypothes.is/help/embedding-hypothesis-in-websites-and-platforms/), but with this plugin you only need to check some checkboxes, and you will be good to go.

* [Terms of Service](https://web.hypothes.is/terms-of-service/)
* [Privacy Policy](https://web.hypothes.is/privacy/)

== Installation ==

1. Upload `hypothesis.php` to the `/wp-content/plugins/` directory
Expand Down