Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanDS committed Aug 12, 2019
2 parents a57ab7a + caf4500 commit 182bd1e
Show file tree
Hide file tree
Showing 124 changed files with 3,364 additions and 1,047 deletions.
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ pages. This is particularly useful for finding out whether newer posts on a part
been made, as long as the author of the newer post remembered to link back to the older one. This
feature acts like a bit like a "related posts" list on other websites.

### Mathematical markup support
ALP adds a TeX block to the Gutenberg editor in WordPress 5.0, allowing users to create equations.
The equation is rendered within the editor so the user can check their markup, and the markup can be
edited later alongside the rest of the post.

### Unread flags
ALP tracks whether logged-in users have read new posts. When a new post is made, everyone except
the post's author sees the new post as unread, designated in the *Labbook* theme using a closed
Expand All @@ -56,6 +51,12 @@ also click a link in the top bar to view a list of all unread posts.
When a post undergoes significant edits, a post is again marked as unread to all users except the
author.

### Inventory system
ALP adds an inventory system to allow you to create pages for inventory items. These pages can be
used as a central place to store e.g. manuals, schematics, images, etc., and the system lets your
users tag posts with inventory items which then provides links to these pages under the
corresponding posts.

### Advanced search
When used with the *Labbook* theme, ALP adds advanced search capabilities allowing users to
search by categories, tags, coauthors, dates, and keywords. Users can also disallow posts made by
Expand All @@ -74,9 +75,18 @@ searches.
Note: images are still accessible when the direct link is known - this is a shortcoming in WordPress
itself. This can in most cases be mitigated with appropriate HTTP server configuration.

### Mathematical markup support
ALP adds a TeX block to the Gutenberg editor in WordPress 5.0, allowing users to create equations.
The equation is rendered within the editor so the user can check their markup, and the markup can be
edited later alongside the rest of the post.

### Term management
ALP adds the ability to merge tags and categories in bulk.

### Post changes
ALP prevents posts being published with the "Uncategorized" category if the author has specified
another category. In such cases, the "Uncategorized" category is silently removed.

### Page changes
ALP modifies pages to work more like wiki pages. When using the *Labbook* theme, authors and dates
are removed from the title area, a breadcrumb trail is shown back to the home page, and there is
Expand Down Expand Up @@ -157,11 +167,10 @@ outdated browsers, and this project is not concerned about losing sales from use
## Design principles
- **Clean code**: there's an awful lot of terribly written code in the WordPress ecosystem. This
plugin attempts to conform to coding standards, and to interfere minimally with the default
WordPress behaviour where possible. For some of the more major features, like coauthors,
some quiet major modifications are required to core behaviour, which means that ALP may not be
compatible with certain other plugins.
- **Modular**: most/all features can be enabled or disabled, and work independently from each
other.
WordPress behaviour where possible.
- **Modular**: most features can be enabled or disabled via the settings page, and work
independently from each other. The plugin can also be used without the corresponding theme,
though this hides a lot of the useful parts of the plugin from users.

## Future development plans
The basic behaviour of ALP is already in place, but the plan is to keep adding useful features
Expand Down
31 changes: 29 additions & 2 deletions ssl-alp/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: logbook, coauthor, revisions, references, latex, tex, mathematics, wiki
Requires at least: 5.1.0
Tested up to: 5.2.0
Requires PHP: 7.0.0
Stable tag: 0.15.2
Stable tag: 0.16.0
License: GNU General Public License v3 or later
License URI: LICENCE

Expand All @@ -15,7 +15,7 @@ more.
== Description ==
Please also visit [our website](https://alp.attackllama.com/)!

Academic Labbook Plugin (ALP) provides a lightweight but powerful set of tools
Academic Labbook Plugin (ALP) provides a powerful set of tools
on top of core WordPress to allow researchers to write about their work,
leveraging the powerful WordPress platform. With ALP, you can benefit from
WordPress's post compositition, tagging and categorisation, media management and
Expand Down Expand Up @@ -46,6 +46,12 @@ account in order to access the content. Combined with WordPress's disable login
setting, and perhaps an LDAP authentication plugin, access can be tightly
controlled.

An "Inventory" system is added which lets your users create pages for lab
equipment such as electronics. These pages can be used in whatever way you wish,
such as to store manuals, images, guides and background information. Posts can
also be tagged with inventory, and links to the corresponding inventory pages
are shown under the post.

ALP provides a tool to convert user roles from the blog-centric WordPress
defaults to one more suitable for an academic group. The primary role becomes
"Researcher" instead of "Editor", allowing users with this role to create, edit
Expand Down Expand Up @@ -73,6 +79,27 @@ on the ALP website.

== Changelog ==

= 0.16.0 =
- Renamed taxonomy term names. This is a BREAKING change and requires some
custom queries to be run to update old terms. See the GitHub release notes
for details.
- Added inventory system.
- Changed post revisions widget to show only posts with line changes.
- Changed post revision widget to use transients instead of cache; default
update time set to 5 minutes.
- Added check to remove "Uncategorised" category from posts with at least one
other category.
- Added check to avoid referenced posts which cannot be read by user from
showing in the cross-references list.
- Simplified permission checks when editing custom taxonomy terms.
- Updated KaTeX to 0.10.2.
- Fixed bug with coauthors not being assigned to posts on sites with existing
posts.
- Fixed bug with unread posts list pagination.
- Added tool to detect pretty permalink status.
- Expanded admin documentation.
- Numerous minor bug fixes.

= 0.15.2 =
- Fixed bug with media type definitions where trailing spaces caused types not
to be saved.
Expand Down
11 changes: 8 additions & 3 deletions ssl-alp/alp.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Academic Labbook
* Plugin URI: https://alp.attackllama.com/
* Description: Turn WordPress into a collaborative academic labbook.
* Version: 0.15.2
* Version: 0.16.0
* Author: Sean Leavey
* Author URI: https://attackllama.com/
* License: GPL3
Expand All @@ -21,7 +21,7 @@
* Current plugin version.
*/

define( 'SSL_ALP_VERSION', '0.15.2' );
define( 'SSL_ALP_VERSION', '0.16.0' );

/**
* Plugin name
Expand All @@ -48,6 +48,7 @@
define( 'SSL_ALP_SITE_TOOLS_MENU_SLUG', 'ssl-alp-admin-tools' );
define( 'SSL_ALP_POST_REVISIONS_MENU_SLUG', 'ssl-alp-admin-post-revisions' );
define( 'SSL_ALP_PAGE_REVISIONS_MENU_SLUG', 'ssl-alp-admin-page-revisions' );
define( 'SSL_ALP_INVENTORY_REVISIONS_MENU_SLUG', 'ssl-alp-admin-inventory-revisions' );
define( 'SSL_ALP_APPLICATIONS_MENU_SLUG', 'ssl-alp-admin-applications' );

/**
Expand All @@ -60,7 +61,11 @@
* Default settings
*/

define( 'SSL_ALP_KATEX_VERSION', '0.10.1' );
// KaTeX version.
define( 'SSL_ALP_KATEX_VERSION', '0.10.2' );

// Recent revisions widget cache timeout.
define( 'SSL_ALP_RECENT_REVISIONS_CACHE_TIMEOUT', 5 * 60 );

/**
* Code to run on plugin activation and deactivation.
Expand Down
1 change: 1 addition & 0 deletions ssl-alp/includes/class-ssl-alp-activator.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private static function add_options() {
add_option( 'ssl_alp_require_login', true );
add_option( 'ssl_alp_enable_applications', false );
add_option( 'ssl_alp_disallow_public_advanced_search', true );
add_option( 'ssl_alp_enable_inventory', true );
add_option( 'ssl_alp_allow_multiple_authors', true );
add_option( 'ssl_alp_disable_post_trackbacks', true );
add_option( 'ssl_alp_enable_crossreferences', true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function prepare_items() {
$orderby = ( isset( $_GET['orderby'] ) ) ? wp_unslash( $_GET['orderby'] ) : 'last_used';
$order = ( isset( $_GET['order'] ) ) ? wp_unslash( $_GET['order'] ) : 'desc';

if ( array_key_exists( $orderby, $this->get_sortable_columns() )) {
if ( array_key_exists( $orderby, $this->get_sortable_columns() ) ) {
// Sort columns.
$this->items = wp_list_sort( $this->items, $orderby, $order );
}
Expand Down Expand Up @@ -88,11 +88,11 @@ public function prepare_items() {
}

public function column_cb( $item ) {
return sprintf(
return sprintf(
'<input type="checkbox" name="ssl_alp_applications[]" value="%s" />',
$item['slug']
);
}
);
}

public function column_password( $item ) {
// Break password into chunks.
Expand Down Expand Up @@ -155,7 +155,7 @@ protected function handle_row_actions( $application, $column_name, $primary ) {
}

$actions = array(
'revoke' => $ssl_alp->auth->get_revoke_url( $application )
'revoke' => $ssl_alp->auth->get_revoke_url( $application ),
);

return $this->row_actions( $actions );
Expand Down
16 changes: 11 additions & 5 deletions ssl-alp/includes/class-ssl-alp-authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ public function output_admin_applications_page() {

// Create array with unique slugs as keys.
foreach ( $this->get_user_applications() as $application ) {
$slug = $this->generate_application_slug( $application );
$application['slug'] = $slug;
$slug = $this->generate_application_slug( $application );
$application['slug'] = $slug;
$applications[ $slug ] = $application;
}

Expand Down Expand Up @@ -268,7 +268,7 @@ public function print_admin_notices() {
}

switch ( $_GET['message'] ) {
case 'ssl_alp_add_success':
case 'ssl_alp_add_success':
echo '<div class="notice notice-success is-dismissible">';
echo '<p>' . esc_html__( 'Application added.', 'ssl-alp' ) . '</p>';
echo '</div>';
Expand Down Expand Up @@ -308,7 +308,13 @@ public function get_revoke_url( $application ) {
return sprintf(
'<a href="%1$s" class="ssl-alp-application-revoke" aria-label="$2$s">%3$s</a>',
wp_nonce_url( "admin-post.php?&amp;action=ssl-alp-revoke-application&amp;ssl_alp_applications[]={$application['slug']}", 'ssl-alp-manage-applications', 'ssl_alp_manage_applications_nonce' ),
esc_attr( sprintf( __( 'Revoke &#8220;%s&#8221;', 'ssl-alp' ), $application['name'] ) ),
esc_attr(
sprintf(
/* translators: application name to revoke */
__( 'Revoke &#8220;%s&#8221;', 'ssl-alp' ),
$application['name']
)
),
esc_html__( 'Revoke', 'ssl-alp' )
);
}
Expand Down Expand Up @@ -551,7 +557,7 @@ public function authenticate_application( $input_user, $username, $password ) {
}

private function authenticate_application_password( $username, $password ) {
$user = get_user_by( 'login', $username );
$user = get_user_by( 'login', $username );

if ( ! $user ) {
return false;
Expand Down
Loading

0 comments on commit 182bd1e

Please sign in to comment.