From 12332c65b6b5538cd649fac053bbc05615be080f Mon Sep 17 00:00:00 2001 From: Lemuel Smyth <36257395+lemsmyth@users.noreply.github.com> Date: Thu, 24 Feb 2022 08:40:23 -0600 Subject: [PATCH 1/3] Encode urls (#75) * encode/escape properly save canonical as post meta --- templates/channels-page.php | 8 ++++---- templates/meta-box.php | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/templates/channels-page.php b/templates/channels-page.php index 1bdf11c..edcad7b 100644 --- a/templates/channels-page.php +++ b/templates/channels-page.php @@ -19,13 +19,13 @@ if ( current_user_can( 'manage_options' ) ) {

admin->available_channels_callback(); ?> items[0]->amount; ?> - name, 'lbrypress' ); ?> - + name, 'lbrypress' ); ?> + diff --git a/templates/meta-box.php b/templates/meta-box.php index e577956..f3f2362 100644 --- a/templates/meta-box.php +++ b/templates/meta-box.php @@ -32,7 +32,12 @@ if ( ( $lbry_published == true ) && ( ( $lbry_claim_id ) ) && ( ! ( $lbry_publis update_post_meta( $post_id, '_lbry_post_pub_license', $license ); } $lbry_canonical_url = get_post_meta( $post_id, '_lbry_canonical_url', true ); -$lbry_url = ( ($lbry_canonical_url) ? $lbry_canonical_url : 'lbry://' . $lbry_published_channel . '#' . $lbry_claim_id ); +if ( ! $lbry_canonical_url ) { + $result = LBRY()->daemon->claim_search( $lbry_claim_id ); + $lbry_canonical_url = $result->items[0]->canonical_url; + update_post_meta( $post_id, '_lbry_canonical_url', $lbry_canonical_url ); +} +$lbry_url = $lbry_canonical_url; $cur_channel = ( get_post_meta( $post_id, LBRY_POST_PUB_CHANNEL, true ) ? get_post_meta( $post_id, LBRY_POST_PUB_CHANNEL, true ) : get_post_meta( $post_id, '_lbry_channel', true ) ); $default_channel = get_option( LBRY_SETTINGS )['default_lbry_channel']; $chan_open_url = ( 'open.lbry.com/'. $lbry_published_channel .'#' . $lbry_channel_claim_id . ''); @@ -63,13 +68,13 @@ $chan_open_url = ( 'open.lbry.com/'. $lbry_published_channel .'#' . $lbry_channe ); printf( '
' . __( 'Supports:', 'lbrypress' ) . ' - ' . esc_html__( '%1$s', 'lbrypress' ) . '' . __( 'Add', 'lbrypress' ) . '
', + ' . esc_html__( '%1$s', 'lbrypress' ) . '' . __( 'Add', 'lbrypress' ) . '', $support_amount, - $lbry_claim_id, - urlencode($lbry_url), - $lbry_published_channel, - $support_amount, - $init_bid + urlencode( $lbry_claim_id ), + urlencode( esc_url( $lbry_url ) ), + urlencode( $lbry_published_channel ), + urlencode( $support_amount ), + urlencode( $init_bid ) ); printf( '
' . __( 'LBRY channel published to:', 'lbrypress' ) . '
@@ -129,4 +134,4 @@ $chan_open_url = ( 'open.lbry.com/'. $lbry_published_channel .'#' . $lbry_channe LBRY_POST_PUB_LICENSE, $options ); - } \ No newline at end of file + } From d34e24143204ff614000c9018d43a828297a90b4 Mon Sep 17 00:00:00 2001 From: Lemuel Smyth <36257395+lemsmyth@users.noreply.github.com> Date: Fri, 25 Feb 2022 12:44:23 -0600 Subject: [PATCH 2/3] Meta box non compat blockeditor (#76) WP block editor not working with plugin --- README.md | 1 + classes/LBRY_Network.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0bec85..ce15b2c 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ First, install the LBRYPress plugin on WordPress. 1) Download the [zip file for this repository](https://github.com/lbryio/lbrypress/archive/master.zip). 1) In WordPress, upload and install the plugin zip file from the WordPress admin dashboard. After activating, errors will show until the next steps are completed. +1) LBRYPress is not currently working correctly with the WordPress block editor, try either [Classic Editor](https://wordpress.org/plugins/classic-editor/) or [Disable Gutenberg](https://wordpress.org/plugins/disable-gutenberg/) plugins to use the classic WP Editor screen. LBRYPress may work in the future with Gutenberg block editor. ## Downloading and installing LBRY This will step you through downloading the LBRY SDK, installing it, and running as a system service. diff --git a/classes/LBRY_Network.php b/classes/LBRY_Network.php index 816e9a0..0895465 100644 --- a/classes/LBRY_Network.php +++ b/classes/LBRY_Network.php @@ -56,7 +56,10 @@ class LBRY_Network array($this, 'meta_box_html'), // Callback function 'post', // Screen Options (or post type) 'side', // Context - 'high' // Priority + 'high', // Priority + array( + '__block_editor_compatible_meta_box' => false, + ) ); } From 510d6426ee7c48c391e5f3e60175201d29acd6a1 Mon Sep 17 00:00:00 2001 From: Lemuel Smyth <36257395+lemsmyth@users.noreply.github.com> Date: Fri, 25 Feb 2022 13:04:21 -0600 Subject: [PATCH 3/3] Remove links (#77) remove links to external plugins on README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce15b2c..8f43b54 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ First, install the LBRYPress plugin on WordPress. 1) Download the [zip file for this repository](https://github.com/lbryio/lbrypress/archive/master.zip). 1) In WordPress, upload and install the plugin zip file from the WordPress admin dashboard. After activating, errors will show until the next steps are completed. -1) LBRYPress is not currently working correctly with the WordPress block editor, try either [Classic Editor](https://wordpress.org/plugins/classic-editor/) or [Disable Gutenberg](https://wordpress.org/plugins/disable-gutenberg/) plugins to use the classic WP Editor screen. LBRYPress may work in the future with Gutenberg block editor. +1) LBRYPress is not currently working correctly with the WordPress block editor, try a plugin that reactivates the classic WP Editor screen. LBRYPress may work in the future with Gutenberg block editor. ## Downloading and installing LBRY This will step you through downloading the LBRY SDK, installing it, and running as a system service.