Skip to content

Commit

Permalink
removed legacy notice #969
Browse files Browse the repository at this point in the history
  • Loading branch information
selul committed Jul 10, 2024
1 parent c0caf6f commit 53c0174
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 73 deletions.
73 changes: 2 additions & 71 deletions includes/admin/class-rop-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,8 @@ public function check_cron_status() {
* @access public
*/
public function rop_wp_cron_notice() {

//TODO - we need to rework this as the constant is not saying that cron is not working only that the default scheduling is, the user can still use server cron instead.
return;
if ( ! defined( 'DISABLE_WP_CRON' ) ) {
return;
}
Expand Down Expand Up @@ -1646,77 +1647,7 @@ public function rop_is_edit_post_screen() {

}

/**
* Hide and remove remote cron feature.
*
* This feature will be discontinued.
*
* @since 9.0.4
* @access public
*/
public function rop_remove_remote_cron_notice() {

$installed_at_version = get_option( 'rop_first_install_version' );

if ( empty( $installed_at_version ) ) {
return false;
}

if ( version_compare( $installed_at_version, '9.0.3', '>' ) ) {
return;
}

$user_id = get_current_user_id();

if ( get_user_meta( $user_id, 'rop-remove-remote-cron-notice-dismissed' ) ) {
return;
}

$using_remote_cron = (bool) get_option( 'rop_use_remote_cron' );

if ( $using_remote_cron ) {
delete_option( 'rop_use_remote_cron' );
}

$dismiss_link = add_query_arg(
array(
'rop-remove-remote-cron-notice-dismissed' => '1',
)
);

$rop = __( 'Revive Social: ', 'tweet-old-post' );
$admin_url = admin_url( 'admin.php?page=TweetOldPost' );
$notice_text = sprintf( __( 'We\'ve removed the Remote Cron service feature of Revive Social. If you used this option in the past, then please %1$shead to the Revive Social dashboard%2$s to start sharing using the default WordPress cron. If post sharing is not working for you, then please see %3$shere for solutions.%2$s', 'tweet-old-post' ), "<a href='$admin_url'>", '</a>', "<a href='https://docs.revive.social/article/686-fix-revive-old-post-not-posting' target='blank'>" );

$message = <<<HTML
<p style="font-size: 14px">
<b>$rop</b> $notice_text
<a style='float: right;' href='$dismiss_link'>Dismiss</a>
</p>
HTML;

?>

<div class="notice notice-error">
<?php echo $message; ?>
</div>
<?php

}

/**
* Dismiss Remote cron removal notice.
*
* @since 9.0.5
* @access public
*/
public function rop_dismiss_remove_remote_cron() {
$user_id = get_current_user_id();
if ( isset( $_GET['rop-remove-remote-cron-notice-dismissed'] ) ) {
add_user_meta( $user_id, 'rop-remove-remote-cron-notice-dismissed', 'true', true );
}

}

/**
* Check the post sharing limit before sharing the post.
Expand Down
2 changes: 0 additions & 2 deletions includes/class-rop.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,6 @@ private function define_admin_hooks() {
$this->loader->add_action( 'admin_notices', $plugin_admin, 'rop_cron_event_status_notice' );
$this->loader->add_action( 'admin_notices', $plugin_admin_notices, 'rop_revive_network_nag_delayed' );

$this->loader->add_action( 'admin_notices', $plugin_admin, 'rop_remove_remote_cron_notice' );
$this->loader->add_action( 'admin_init', $plugin_admin, 'rop_dismiss_remove_remote_cron' );

$this->loader->add_action( 'admin_init', $plugin_admin, 'rop_dismiss_linkedin_api_v2_notice' );
$this->loader->add_action( 'admin_notices', $plugin_admin, 'rop_linkedin_api_v2_notice' );
Expand Down

0 comments on commit 53c0174

Please sign in to comment.