diff --git a/includes/class-wp-push-syndication-server.php b/includes/class-wp-push-syndication-server.php index 620292262994e0552bf1a7170cd9723f46f6d1e7..6d512549e8e995cfebf33e8fa8d325d57dd8d9ed 100644 --- a/includes/class-wp-push-syndication-server.php +++ b/includes/class-wp-push-syndication-server.php @@ -1091,7 +1091,8 @@ class WP_Push_Syndication_Server { if( $delete_pushed_posts != 'on' ) return; - // @TODO add cap check + if( !$this->current_user_can_syndicate() ) + return; wp_schedule_single_event( time() - 1, diff --git a/push-syndication.php b/push-syndication.php index b69042e286669487d0464af87c36c0cafe944666..ecf1a2c488e2e2e5d6f102c844febe3d457cee58 100644 --- a/push-syndication.php +++ b/push-syndication.php @@ -13,7 +13,8 @@ License: GPLv2 or later **************************************************************************/ require_once ( dirname( __FILE__ ) . '/includes/class-wp-push-syndication-server.php' ); -require_once ( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ); +if( file_exists( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ) ); + require_once ( dirname( __FILE__ ) . '/includes/class-wpcom-push-syndication-server.php' ); if ( !defined( 'PUSH_SYNDICATION_ENVIRONMENT' ) ) define( 'PUSH_SYNDICATION_ENVIRONMENT', 'WP' );