Skip to content

Commit

Permalink
AIOSEO
Browse files Browse the repository at this point in the history
  • Loading branch information
gpaul988 committed Apr 25, 2023
1 parent e9e3c46 commit cf57d3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions app/Common/Admin/Notices/DeprecatedWordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DeprecatedWordPress {
* @since 4.1.2
*/
public function __construct() {
add_action( 'wp_ajax_aioseo-dismiss-deprecated-wordpress-notice', [ $this, 'dismissNotice' ] );
add_action ( 'wp_ajax_aioseo-dismiss-deprecated-wordpress-notice', [ $this, 'dismissNotice' ] );
}

/**
Expand All @@ -31,13 +31,13 @@ public function __construct() {
public function maybeShowNotice() {
global $wp_version;

$dismissed = get_option( '_aioseo_deprecated_wordpress_dismissed', true );
$dismissed = get_option ( '_aioseo_deprecated_wordpress_dismissed', true );
if ( '1' === $dismissed ) {
return;
}

// Only show to users that interact with our pluign.
if ( ! current_user_can( 'publish_posts' ) ) {
if ( ! current_user_can ( 'publish_posts' ) ) {
return;
}

Expand All @@ -49,7 +49,7 @@ public function maybeShowNotice() {
$this->showNotice();

// Print the script to the footer.
add_action( 'admin_footer', [ $this, 'printScript' ] );
add_action ( 'admin_footer', [ $this, 'printScript' ] );
}

/**
Expand Down Expand Up @@ -119,7 +119,7 @@ public function showNotice() {
*/
public function printScript() {
// Create a nonce.
$nonce = wp_create_nonce( 'aioseo-dismiss-deprecated-wordpress' );
$nonce = wp_create_nonce ( 'aioseo-dismiss-deprecated-wordpress' );
?>
<script>
window.addEventListener('load', function () {
Expand All @@ -135,7 +135,7 @@ public function printScript() {
postData += '&action=aioseo-dismiss-deprecated-wordpress-notice'
postData += '&nonce=<?php echo esc_html( $nonce ); ?>'

httpRequest.open('POST', '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>')
httpRequest.open('POST', '<?php echo esc_url ( admin_url ( 'admin-ajax.php' ) ); ?>')
httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
httpRequest.send(postData)
})
Expand All @@ -157,10 +157,10 @@ public function dismissNotice() {
return;
}

check_ajax_referer( 'aioseo-dismiss-deprecated-wordpress', 'nonce' );
check_ajax_referer ( 'aioseo-dismiss-deprecated-wordpress', 'nonce' );

update_option( '_aioseo_deprecated_wordpress_dismissed', true );
update_option ( '_aioseo_deprecated_wordpress_dismissed', true );

return wp_send_json_success();
return wp_send_json_success ();
}
}
4 changes: 2 additions & 2 deletions app/Common/Admin/Notices/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public function showNotice() {
?>
<div class="notice notice-info aioseo-migration">
<p><strong><?php echo esc_html( $string1 ); ?></strong></p>
<p><?php echo esc_html( $string2 ); ?></p>
<p><?php echo esc_html( $string3 ); ?></p>
<p><?php echo esc_html($string2); ?></p>
<p><?php echo esc_html($string3); ?></p>
</div>
<style>
</style>
Expand Down

0 comments on commit cf57d3c

Please sign in to comment.