-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made changes per WordPress Plugin reviewer's guidelines. Plugin now a…
…pproved and moved to version 1.0.
- Loading branch information
1 parent
4629bfe
commit a318bc8
Showing
9 changed files
with
474 additions
and
421 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
<?php | ||
if (!defined('ABSPATH')) exit; // Exit if accessed directly | ||
|
||
// Function to create the admin page | ||
function wpbm_bookmarklet_page() { | ||
$plugin_url = plugins_url('', __FILE__); | ||
$site_url = site_url(); | ||
function bmwpskywolf_bookmarklet_page() { | ||
$plugin_url = esc_url_raw(plugins_url('', __FILE__)); | ||
$site_url = esc_url(home_url()); | ||
|
||
$description = isset($_GET['content']) ? wp_kses_post(sanitize_text_field($_GET['content'])) : ''; | ||
|
||
$og_image = ''; | ||
if (isset($_GET['wpbm_og_image'])) { | ||
$og_image = esc_url(sanitize_url($_GET['wpbm_og_image'])); | ||
} | ||
|
||
$bookmarklet_code = " | ||
javascript:(function(){var t=encodeURIComponent(document.title),d=document.querySelector('meta[name=\"description\"]'),u=encodeURIComponent(window.location.href),i=document.querySelector('meta[property=\"og:image\"]');d=d?encodeURIComponent(d.content):'No description available';i=i?encodeURIComponent(i.content):'No image available';var r=\"$site_url/wp-admin/post-new.php?post_type=post\";r+=\"&title=\"+t+\"&content=\"+d+\"&wpbm_url=\"+u+\"&wpbm_og_image=\"+i;window.location.href=r;})(); | ||
"; | ||
$bookmarklet_code = "javascript:(function(){var t=encodeURIComponent(document.title),d=document.querySelector('meta[name=\"description\"]'),u=encodeURIComponent(window.location.href),i=document.querySelector('meta[property=\"og:image\"]');d=d?encodeURIComponent(d.getAttribute('content')):'No description available';i=i?encodeURIComponent(i.getAttribute('content')):'No image available';var r='" . esc_url($site_url) . "/wp-admin/post-new.php?post_type=post'+'&title='+t+'&content='+d+'&wpbm_url='+u+'&wpbm_og_image='+i;window.location.href=r;})();"; | ||
|
||
?> | ||
<div class="wrap"> | ||
<h1><?php echo esc_html__('Bookmarklet', 'wpbm'); ?></h1> | ||
<p><?php echo esc_html__('Copy the code below and paste it as a new browser bookmark\'s URL.', 'wpbm'); ?></p> | ||
<textarea rows="5" cols="50" id="bookmarklet-code"><?php echo esc_textarea($bookmarklet_code); ?></textarea> | ||
<h1><?php echo esc_html__('Bookmarklet', 'bmwpskywolf'); ?></h1> | ||
<p><?php echo esc_html__('Copy the code below and paste it as a new browser bookmark\'s URL.', 'bmwpskywolf'); ?></p> | ||
<textarea rows="5" cols="50" id="bookmarklet-code"><?php echo esc_textarea($bookmarklet_code); ?></textarea> | ||
</div> | ||
<?php | ||
} | ||
|
||
// Add the admin menu page | ||
function wpbm_add_admin_menu() { | ||
add_management_page('Bookmarklet', 'Bookmarklet', 'manage_options', 'wpbm-bookmarklet', 'wpbm_bookmarklet_page'); | ||
// Add the admin menu page within tools | ||
function bmwpskywolf_add_admin_menu() { | ||
add_management_page('Bookmarklet', 'Bookmarklet', 'manage_options', 'wpbm-bookmarklet', 'bmwpskywolf_bookmarklet_page'); | ||
} | ||
add_action('admin_menu', 'wpbm_add_admin_menu'); | ||
add_action('admin_menu', 'bmwpskywolf_add_admin_menu'); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
=== bookmark wp === | ||
Contributors: wilcosky | ||
Tags: bookmark, bookmarklet | ||
Requires at least: 6.0 | ||
Tested up to: 6.4.2 | ||
Stable tag: 1.0 | ||
Requires PHP: 7 | ||
License: GPLv2 or later | ||
License URI: http://www.gnu.org/licenses/gpl-2.0.html | ||
|
||
Bookmark/share webpages by clicking a special bookmark in your browser called a bookmarklet. It's like the old "Press This." But, it's minimal, and it works with the new editor. If you know, you know. Go to the Installation tab to learn how to set it up. Contribute at: | ||
https://github.com/zerosonesfun/wp-bookmark | ||
|
||
|
||
== Installation == | ||
|
||
1. Within the admin dashboard go to Plugins --> Add New | ||
2. Search for "wp bookmark" | ||
3. Choose activate, and then install | ||
4. Go to Tools, then Bookmarklet, and copy the code | ||
5. Paste the code into the URL field of a new browser bookmark that you create | ||
6. On any webpage click on the new bookmark you made | ||
|
||
Alternative install method: From the Add Plugins page choose Upload Plugin and upload this plugin's zip file. | ||
|
||
== Frequently Asked Questions == | ||
|
||
= Are there any FAQs? = | ||
No. This is the initial release. | ||
|
||
== Changelog == | ||
|
||
= 1.0 = | ||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
<?php | ||
/* | ||
Plugin Name: WP Bookmark | ||
Description: A bookmarking plugin for WordPress. | ||
Version: 0.1 | ||
Plugin Name: bookmark wp | ||
Description: A bookmarking/reposting plugin for WordPress similar to the old Press This feature. | ||
Version: 1.0 | ||
Author: Billy Wilcosky | ||
Author URI: https://wilcosky.com | ||
Author URI: https://wilcosky.com/skywolf | ||
License: GPL-2.0+ | ||
*/ | ||
|
||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | ||
// Include necessary files | ||
include(plugin_dir_path(__FILE__) . 'includes/wpbm-admin-page.php'); | ||
include(plugin_dir_path(__FILE__) . 'includes/wpbm-post.php'); | ||
include(plugin_dir_path(__FILE__) . 'includes/wpbm-handle-bookmarklet.php'); | ||
include(plugin_dir_path(__FILE__) . 'includes/wpbm-post.php'); |