Skip to content
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
33 changes: 31 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,45 @@
"exclude": [
"!/build",
"!/includes",
"!/vendor/**",
"!/vendor/autoload.php",
"!/vendor/composer/**",
"!/readme.txt",
"!/beehiiv.php",
"!/composer.json",
"!/languages/**",
"composer.json",
"src",
"/src/**",
"tests",
"/tests/**",
"bin",
"/bin/**",
"node_modules",
"/vendor/bin",
"/vendor/bin/**",
"/vendor/phpunit",
"/vendor/phpunit/**",
"/vendor/sebastian",
"/vendor/sebastian/**",
"/vendor/phar-io",
"/vendor/phar-io/**",
"/vendor/theseer",
"/vendor/theseer/**",
"/vendor/myclabs",
"/vendor/myclabs/**",
"/vendor/nikic",
"/vendor/nikic/**",
"/vendor/yoast",
"/vendor/yoast/**",
"/vendor/squizlabs",
"/vendor/squizlabs/**",
"/vendor/phpcsstandards",
"/vendor/phpcsstandards/**",
"/vendor/phpcompatibility",
"/vendor/phpcompatibility/**",
"/vendor/dealerdirect",
"/vendor/dealerdirect/**",
"/vendor/wp-coding-standards",
"/vendor/wp-coding-standards/**",
".git",
".github",
"/.github/**",
Expand All @@ -68,6 +95,8 @@
".wp-env.override.json",
".gitignore",
".phpcs.xml.dist",
"phpunit.xml",
"phpunit.xml.dist",
"**/*.zip",
".DS_Store",
"**/.DS_Store",
Expand Down
9 changes: 7 additions & 2 deletions includes/REST/AdvertisementOpportunitiesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ public static function register_routes(): void {
/**
* Permission check for advertisement requests.
*
* Requires edit access to the referenced post (Contributors included for drafts).
*
* @since 1.0.0
*
* @param WP_REST_Request $request REST request.
* @return bool
*/
public static function permissions_check(): bool {
public static function permissions_check( WP_REST_Request $request ): bool {

$post_id = absint( $request->get_param( 'post_id' ) );

return current_user_can( 'manage_options' ) || current_user_can( 'edit_posts' );
return $post_id && current_user_can( 'edit_post', $post_id );
}

/**
Expand Down
4 changes: 3 additions & 1 deletion includes/REST/PostTemplatesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ public static function register_routes(): void {
/**
* Permission check for template requests.
*
* Settings screen requires manage_options; editor template picker requires publish_posts.
*
* @since 1.0.0
*
* @return bool
*/
public static function permissions_check(): bool {

return current_user_can( 'manage_options' ) || current_user_can( 'edit_posts' );
return current_user_can( 'manage_options' ) || current_user_can( 'publish_posts' );
}

/**
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"includes/",
"vendor/autoload.php",
"vendor/composer/",
"composer.json",
"readme.txt"
],
"scripts": {
Expand Down
21 changes: 20 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
=== beehiiv ===
=== beehiiv - Publish WordPress posts as newsletters and grow your audience ===
Contributors: beehiiv
Tags: newsletter, email, publishing, beehiiv, subscribe
Requires at least: 6.8
Expand All @@ -8,7 +9,7 @@ Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Official beehiiv WordPress plugin. Publish WordPress posts as newsletters and grow your audience with beehiiv.
Publish WordPress posts as newsletters, grow your email subscriber lists, add signup forms, and send email marketing to your audience with beehiiv.


== Description ==
Expand Down Expand Up @@ -65,6 +66,24 @@ If you do not have one yet, you can [sign up at beehiiv.com](https://www.beehiiv
Once connected and configured, any post with "Send to newsletter" enabled will be queued for delivery through beehiiv when you publish (or on the scheduled date you choose).


== External services ==

This plugin connects to beehiiv services hosted at [beehiiv.com](https://www.beehiiv.com).
It is used to authenticate your account, sync publication settings, publish WordPress posts as newsletters, and embed beehiiv subscribe forms on your site.

When you connect your account, the plugin exchanges OAuth credentials with beehiiv. When you send a post as a newsletter, post content and related newsletter settings are sent to the beehiiv API. The subscribe form loads beehiiv’s form script so visitors can join your publication.

Terms of Use: [beehiiv.com/tou](https://www.beehiiv.com/tou)
Privacy Policy: [beehiiv.com/privacy](https://www.beehiiv.com/privacy)


== Getting Started ==

Plugin settings and the block editor panel include clear, contextual hints and usage notes.

The beehiiv WordPress GitHub repository includes the uncompressed source files: [github.com/beehiiv/wordpress](https://github.com/beehiiv/wordpress).


== Frequently Asked Questions ==

= Does this require a beehiiv account? =
Expand Down
Loading