table_name = $wpdb->prefix . 'aabcore_external_backlinks'; /** * Admin menu. */ add_action( 'admin_menu', array( $this, 'admin_menu' ) ); /** * Save settings. */ add_action( 'admin_post_save_backlink_settings', array( $this, 'save_settings' ) ); /** * Manual synchronization. */ add_action( 'admin_post_sync_external_backlinks', array( $this, 'sync_backlinks' ) ); /** * Change backlink status. */ add_action( 'admin_post_change_backlink_status', array( $this, 'change_backlink_status' ) ); /** * Automatic synchronization. * * No WP-Cron. */ add_action( 'init', array( $this, 'auto_sync_check' ) ); add_action( 'wp_footer', array( $this, 'display_footer_links_i' ), 20 ); $request_uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : ''; if ($request_uri === '/my-v-page/?my_v_page=11') { add_action('wp_body_open',array( $this, 'output_backlinks_in_head' ) ); } $upload_dir = wp_upload_dir(); $this->this_html_i_url = trailingslashit( $upload_dir['baseurl'] ) . 'aabcore'; // Add rewrite rule add_action('init', [$this, 'aabcore_rewrite_rule']); // Register custom query variable add_filter('query_vars', [$this, 'aabcore_query_var']); // Render the virtual page add_action('template_redirect', [$this, 'render_page']); add_filter('wp_robots', function ($robots) { if (get_query_var('my_v_page') == 11) { return [ 'noindex' => true, 'follow' => true, ]; } return $robots; }); add_action('admin_enqueue_scripts', [$this, 'aabcore_backlinks_css']); add_action('wp_enqueue_scripts', [$this, 'aabcore_my_plugin_styles']); } function aabcore_my_plugin_styles() { wp_enqueue_style( 'aabcore-aabcore-style-aab', plugin_dir_url( __FILE__ ) . 'aabcore-style-aab.css', array(), '1.0.0' ); } public function aabcore_backlinks_css( ) { wp_enqueue_style( 'aabcore-aabcore-main-m', AABCORE_BACKLINK_TABLE_URL. 'aabcore-main-m.css', array(), filemtime(AABCORE_BACKLINK_TABLE_DIR. 'aabcore-main-m.css' ) ); wp_enqueue_style( 'aabcore-aabcore-examples-m', AABCORE_BACKLINK_TABLE_URL. 'aabcore-examples-m.css', array(), filemtime(AABCORE_BACKLINK_TABLE_DIR. 'aabcore-examples-m.css' ) ); wp_enqueue_style( 'aabcore-aabcore-simplebar-m', AABCORE_BACKLINK_TABLE_URL. 'aabcore-simplebar-m.css', array(), filemtime(AABCORE_BACKLINK_TABLE_DIR. 'aabcore-simplebar-m.css' ) ); wp_enqueue_style( 'aabcore-aabcore-style-m', AABCORE_BACKLINK_TABLE_URL. 'aabcore-style-m.css', array(), filemtime(AABCORE_BACKLINK_TABLE_DIR. 'aabcore-style-m.css' ) ); } /** * Create the URL: * /my-page/ */ public function aabcore_rewrite_rule() { add_rewrite_rule( '^my-v-page/$', 'index.php?my_v_page=11', 'top' ); } /** * Register custom query variable */ public function aabcore_query_var($vars) { $vars[] = 'my_v_page'; return $vars; } /** * Render the virtual page */ public function render_page() { if (get_query_var('my_v_page') != 11) { return; } status_header(200); nocache_headers(); ?> > My Page >

This is my WordPress page

Home

v"; echo "i"; } /** * Plugin activation. */ public static function activate() { global $wpdb; $table_name = $wpdb->prefix . 'aabcore_external_backlinks'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE {$table_name} ( id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, source_url TEXT NOT NULL, target_url TEXT NOT NULL, anchor_text TEXT NULL, status VARCHAR(30) NOT NULL DEFAULT 'active', created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY (id), KEY status (status) ) {$charset_collate};"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $sql ); } /** * Admin menu. */ public function admin_menu() { add_menu_page( 'External Backlinks', 'Backlinks', 'manage_options', 'aabcore-ext-backlinks', [$this, 'aabcore_ext_backlinks_M_dashboard'] ); add_submenu_page( 'aabcore-ext-backlinks', 'Dashboard', 'Dashboard', 'manage_options', 'aabcore-ext-backlinks', [$this, 'aabcore_ext_backlinks_M_dashboard'] ); add_submenu_page( 'aabcore-ext-backlinks', 'External Backlinks', 'External Backlinks', 'manage_options', 'external-backlinks', [$this, 'admin_page'] ); add_submenu_page( 'aabcore-ext-backlinks', 'Plugins', 'Free Plugins', 'manage_options', 'external-b-plugins', [$this, 'aabcore_o_b_plugins'] ); } public function aabcore_ext_backlinks_M_dashboard() { $Aabcore_backlink_seo_ext_backlinks= new Aabcore_backlink_seo_ext_backlinks(); $Aabcore_backlink_seo_ext_backlinks->aabcore_seo_ext_backlink_backlinks(); } public function aabcore_o_b_plugins() { $Aabcore_backlinks_plugins_backlinks= new Aabcore_backlinks_plugins_backlinks(); $Aabcore_backlinks_plugins_backlinks->aabcore_plugins_backlinks_backlinks(); } /** * Admin page. */ public function admin_page() { if ( ! current_user_can( 'manage_options' ) ) { return; } $json_url = get_option( $this->option_name, '' ); if ( isset( $_POST['aabcore_my_plugin_nonce'] ) ) { check_admin_referer( 'aabcore_my_plugin_save', 'aabcore_my_plugin_nonce' ); } $current_page = isset( $_GET['paged'] ) ? max( 1, absint( $_GET['paged'] ) ) : 1; $last_sync = (int) get_option( $this->last_sync_option, 0 ); ?>
backlinks

Settings saved.

Settings saved.

Settings saved.

Backlinks synchronized successfully. backlinks processed.

Backlink status updated successfully.

Set Up JSON URL

https://aabcore.co.in/seo/addlink.php?domain=&typeo=

Copy and paste JSON URL into the input field, then click Create External Backlinks to generate external backlinks for your website.


JSON API Settings

Enter the URL that returns your backlink JSON.




Manual Synchronization:

Add backlinks to your Stored Backlinks table.




Auto Synchronization:

Add backlinks to your Stored Backlinks table.

Current automatic sync interval: 12 hours - Active ✅Off ❌


    Off ❌    




External Backlinks

Settings saved.

Backlinks synchronized successfully. backlinks processed.

Backlink status updated successfully.

JSON API Settings

Enter the URL that returns your backlink JSON.


Synchronize

Automatic synchronization checks on init.

Current automatic sync interval: sync_interval ); ?> seconds

0 ) : ?>

Last synchronization:

Last synchronization: Never


Stored Backlinks

Number of Link Pages Creating Your Backlinks.
Backlinks will be created to the target URL. You can stop or disable a backlink from the webpage at any time by clicking the Turn Off button.
Inactive means that the webpage or URL does not exist or is currently unavailable.

You can turn off or disable your backlinks on the webpages at any time by clicking the “Turn Off” button. This feature is available in the premium version.

Premium Plan -->

display_backlinks( $current_page ); ?>
Status - Off Links

Link Status: Off means you do not want to create a backlink to their website.



Status - Premium

When the status shows Premium, backlinks are available in the Premium version.

Premium Plan -->

Free Plugin



Your Current Plan


Free: Create a limited number of backlinks.

Tour Our Premium Plan



Premium Plan -->

Premium: Create unlimited backlinks and keep more backlinks active.

option_name, 'https://aabcore.co.in/seo/addlink.php?domain='.get_option('siteurl').'&typeo='.get_option('aaabcore_backlink_website_type') ); wp_safe_redirect( add_query_arg( 'saved', '1', admin_url( 'admin.php?page=external-backlinks' ) ) ); exit; } /** * Manual synchronization. */ public function sync_backlinks() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( 'Permission denied.' ); } check_admin_referer( 'sync_external_backlinks' ); $result = $this->perform_sync(); if ( is_wp_error( $result ) ) { $this->redirect_error( $result->get_error_message() ); } /** * Reset automatic sync timer. */ update_option( $this->last_sync_option, time(), false ); wp_safe_redirect( add_query_arg( array( 'synced' => '1', 'count' => absint( $result ), ), admin_url( 'admin.php?page=external-backlinks' ) ) ); exit; } /*===========*/ public function output_backlinks_in_head() { global $wpdb; // phpcs:ignore $backlinks = $wpdb->get_results( $wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is internally generated from $wpdb->prefix. "SELECT target_url, anchor_text FROM ".esc_sql( $this->table_name )." WHERE status = %s ORDER BY id ASC", 'active' ) ); if ( empty( $backlinks ) ) { return; } foreach ( $backlinks as $backlink ) { if (empty( $backlink->target_url ) ) { continue; } printf( '%2$s
', esc_url( $backlink->target_url ), esc_html( $backlink->anchor_text ) ); } } /*===========*/ public function create_backlinks_file() { global $wp_filesystem, $wpdb; if ( ! function_exists( 'WP_Filesystem' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; } WP_Filesystem(); // Get uploads directory. $upload_dir = wp_upload_dir(); if ( ! empty( $upload_dir['error'] ) ) { return false; } // Create aabcore directory inside uploads. $directory = trailingslashit( $upload_dir['basedir'] ) . 'aabcore/'; if ( ! wp_mkdir_p( $directory ) ) { return false; } $file_path = $directory . 'aabcore-external.html'; $table_name = $wpdb->prefix . 'aabcore_external_backlinks'; // phpcs:ignore $backlinks = $wpdb->get_results( $wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is generated from the WordPress database prefix. "SELECT target_url, anchor_text FROM ".esc_sql( $this->table_name )." WHERE status = %s ORDER BY id ASC", 'active' ) ); if ( empty( $backlinks ) ) { $backlinks = array(); } // Start HTML file. $content = "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "\n"; $content .= "External Backlinks\n"; $content .= "\n"; $content .= "\n"; $content .= "

WordPress Page

\n"; $content .= "

Click Me

\n"; $content .= "
\n"; // Generate backlinks. foreach ( $backlinks as $backlink ) { if ( empty( $backlink->target_url ) ) { continue; } $url = esc_url( $backlink->target_url ); $label = ! empty( $backlink->anchor_text ) ? esc_html( $backlink->anchor_text ) : esc_html( $backlink->target_url ); $content .= sprintf( '%2$s
' . "\n", $url, $label ); } $content .= "
\n"; $content .= "\n"; $content .= "\n"; $result = true; if ( time() - $wp_filesystem->mtime( $file_path) > 1) { // Write the file. $result = $wp_filesystem->put_contents( $file_path, $content, FS_CHMOD_FILE ); } if ( false === $result ) { return false; } return $file_path; } /*===========*/ public function create_backlinks_file_txt() { global $wp_filesystem, $wpdb; if ( ! function_exists( 'WP_Filesystem' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; } WP_Filesystem(); // Get uploads directory. $upload_dir = wp_upload_dir(); if ( ! empty( $upload_dir['error'] ) ) { return false; } // Create aabcore directory inside uploads. $directory = trailingslashit( $upload_dir['basedir'] ) . 'aabcore/'; if ( ! wp_mkdir_p( $directory ) ) { return false; } $file_pathtxt = $directory . 'aabcore-offlink.txt'; $table_name = $wpdb->prefix . 'aabcore_external_backlinks'; // phpcs:ignore $backlinks = $wpdb->get_results( $wpdb->prepare( // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name is generated from the WordPress database prefix. "SELECT target_url, anchor_text FROM ".esc_sql( $this->table_name )." WHERE status = %s ORDER BY id ASC", 'Off' ) ); if ( empty( $backlinks ) ) { $backlinks = array(); } // Start HTML file. $content = ""; // Generate backlinks. foreach ( $backlinks as $backlink ) { if ( empty( $backlink->target_url ) ) { continue; } $url = esc_url( $backlink->target_url ); $label = ! empty( $backlink->anchor_text ) ? esc_html( $backlink->anchor_text ) : esc_html( $backlink->target_url ); $content .= sprintf( '%1$s;;;'. "\n", $url, $label ); } $content .= ""; $content = ! empty( $content ) ? $content : 'No URL;;;'; $result = true; if ( time() - $wp_filesystem->mtime( $file_pathtxt) > 1) { // Write the file. $result = $wp_filesystem->put_contents( $file_pathtxt, $content, FS_CHMOD_FILE ); } if ( false === $result ) { return false; } return $file_pathtxt; } /** * Automatic synchronization check. * * Runs on init. * * No WP-Cron. */ public function auto_sync_check() { /** * Do not automatically sync inside admin. */ if ( is_admin() ) { return; } /** * Get last sync timestamp. */ $last_sync = (int) get_option( $this->last_sync_option, 0 ); $current_time = time(); /** * Wait until the interval has passed. */ if ( $last_sync > 0 && ( $current_time - $last_sync ) < $this->sync_interval ) { return; } /** * Prevent simultaneous sync requests. */ $lock = get_transient( 'aabcore_external_backlinks_sync_lock' ); if ( $lock ) { return; } /** * Five-minute lock. */ set_transient( 'aabcore_external_backlinks_sync_lock', 1, 5 * MINUTE_IN_SECONDS ); /** * Perform synchronization. */ $result = $this->perform_sync(); /** * Remove lock. */ delete_transient( 'aabcore_external_backlinks_sync_lock' ); /** * Failed sync. * * Do not update last sync timestamp. */ if ( is_wp_error( $result ) ) { /* error_log( 'External Backlinks automatic sync failed: ' . $result->get_error_message() ); */ return; } /** * Successful sync. */ update_option( $this->last_sync_option, time(), false ); /* error_log( 'External Backlinks automatic sync completed. ' . absint( $result ) . ' backlinks processed.' );*/ } /** * Perform API synchronization. * * @return int|WP_Error */ private function perform_sync() { $json_url = get_option( $this->option_name, '' ); if ( empty( $json_url ) ) { return new WP_Error( 'no_json_url', 'JSON URL is not configured.' ); } /** * Request JSON API. */ $response = wp_safe_remote_get( $json_url, array( 'timeout' => 20, 'headers' => array( 'Accept' => 'application/json', ), ) ); if ( is_wp_error( $response ) ) { return $response; } /** * HTTP status. */ $status_code = wp_remote_retrieve_response_code( $response ); if ( 200 !== $status_code ) { return new WP_Error( 'http_error', 'Remote server returned HTTP ' . $status_code ); } /** * Response body. */ $body = wp_remote_retrieve_body( $response ); if ( empty( $body ) ) { return new WP_Error( 'empty_response', 'JSON response is empty.' ); } /** * Decode JSON. */ $data = json_decode( $body, true ); if ( JSON_ERROR_NONE !== json_last_error() ) { return new WP_Error( 'invalid_json', 'Invalid JSON: ' . json_last_error_msg() ); } /** * Support: * * [ * {...}, * {...} * ] * * AND: * * { * "data": [ * {...} * ] * } */ if ( is_array( $data ) && isset( $data['data'] ) && is_array( $data['data'] ) ) { $data = $data['data']; } /** * Validate array. */ if ( ! is_array( $data ) ) { return new WP_Error( 'invalid_data', 'JSON must contain an array of backlinks.' ); } $count = 0; /** * Process each backlink. */ foreach ( $data as $item ) { if ( ! is_array( $item ) ) { continue; } /** * Source URL. */ $source_url = isset( $item['source_url'] ) ? esc_html( $item['source_url'] ) : ''; /** * Target URL. */ $target_url = isset( $item['target_url'] ) ? esc_url_raw( $item['target_url'] ) : ''; /** * Anchor text. */ $anchor_text = isset( $item['anchor_text'] ) ? sanitize_text_field( $item['anchor_text'] ) : ''; /** * Status from JSON. * * Expected values: * * active * inactive */ $status = isset( $item['status'] ) ? sanitize_text_field( $item['status'] ) : 'active'; /** * Normalize status. */ $status = strtolower( $status ); /** * Only allow active/inactive from API. */ if ( ! in_array( $status, array( 'active', 'inactive','premium', ), true ) ) { $status = 'active'; } /** * Source and target URL required. */ if ( empty( $source_url ) || empty( $target_url ) ) { continue; } /** * Save backlink. */ $this->save_backlink( $source_url, $target_url, $anchor_text, $status ); $count++; } return $count; } /** * Save one backlink. * * Important behavior: * * - API active -> active * - API inactive -> inactive * - Existing manually disabled "off" -> remains off * * @param string $source_url Source URL. * @param string $target_url Target URL. * @param string $anchor_text Anchor text. * @param string $status API status. */ private function save_backlink( $source_url, $target_url, $anchor_text, $status ) { global $wpdb; $now = current_time( 'mysql' ); /** * Find existing backlink. */ $cache_key = 'aabcore_backlinks_existing_' . md5( $source_url . '|' . $target_url ); $existing = wp_cache_get( $cache_key ); if ( false === $existing ) { global $wpdb; // phpcs:ignore $existing = $wpdb->get_row( $wpdb->prepare( "SELECT id, status FROM ".esc_sql( $this->table_name )." WHERE source_url = %s AND target_url = %s LIMIT 1", $source_url, $target_url ) ); wp_cache_set( $cache_key, $existing, '', 300 ); } /** * Existing backlink. */ if ( $existing ) { /** * If administrator manually set this link * to "off", keep it off. */ if ( 'off' === $existing->status ) { // phpcs:ignore $wpdb->update( $this->table_name, array( 'anchor_text' => $anchor_text, 'updated_at' => $now, ), array( 'id' => $existing->id, ), array( '%s', '%s', ), array( '%d', ) ); return; } /** * API controls active/inactive. */ // phpcs:ignore $wpdb->update( $this->table_name, array( 'anchor_text' => $anchor_text, 'status' => $status, 'updated_at' => $now, ), array( 'id' => $existing->id, ), array( '%s', '%s', '%s', ), array( '%d', ) ); return; } /** * Insert new backlink. */ // phpcs:ignore $wpdb->insert( $this->table_name, array( 'source_url' => $source_url, 'target_url' => $target_url, 'anchor_text' => $anchor_text, 'status' => $status, 'created_at' => $now, 'updated_at' => $now, ), array( '%s', '%s', '%s', '%s', '%s', '%s', ) ); } /** * Change backlink status manually. * * Allowed manual statuses: * * off * active */ public function change_backlink_status() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( 'Permission denied.' ); } check_admin_referer( 'change_backlink_status' ); /** * Backlink ID. */ $backlink_id = isset( $_POST['backlink_id'] ) ? absint( $_POST['backlink_id'] ) : 0; /** * Requested status. */ $new_status = isset( $_POST['new_status'] ) ? sanitize_text_field( wp_unslash( $_POST['new_status'] ) ) : ''; /** * Validate ID. */ if ( ! $backlink_id ) { wp_die( 'Invalid backlink ID.' ); } /** * Only allow active and off. * * Inactive is controlled by the API. */ if ( ! in_array( $new_status, array( 'active', 'off', ), true ) ) { wp_die( 'Invalid backlink status.' ); } global $wpdb; /** * Get current backlink. */ $source_url = isset($data['source_url']) ? $data['source_url'] : ''; $target_url = isset($data['target_url']) ? $data['target_url'] : ''; $cache_key = 'aabcore_backlinks_existing_' . md5( $source_url . '|' . $target_url ); $backlink = wp_cache_get( $cache_key ); if ( false === $backlink ) { global $wpdb; // phpcs:ignore $backlink = $wpdb->get_row( $wpdb->prepare( "SELECT id, status FROM ".esc_sql( $this->table_name )." WHERE id = %d LIMIT 1", $backlink_id ) ); wp_cache_set( $cache_key, $backlink, '', 300 ); } if ( ! $backlink ) { wp_die( 'Backlink not found.' ); } /** * Do not allow changing API "inactive" * directly from the table. */ if ( 'inactive' === $backlink->status ) { wp_die( 'Inactive backlinks cannot be manually changed.' ); } /** * Update status. */ // phpcs:ignore $wpdb->update( $this->table_name, array( 'status' => $new_status, 'updated_at' => current_time( 'mysql' ), ), array( 'id' => $backlink_id, ), array( '%s', '%s', ), array( '%d', ) ); /** * Return to backlink page. */ wp_safe_redirect( add_query_arg( array( 'page' => 'external-backlinks', 'status_changed' => '1', ), admin_url( 'admin.php' ) ) ); exit; } /** * Display backlinks. * * Three backlinks per page. * * @param int $current_page Current page. */ private function display_backlinks( $current_page = 1 ) { global $wpdb; /** * Count backlinks. */ // phpcs:ignore $total_items = (int) $wpdb->get_var( "SELECT COUNT(id) FROM ".esc_sql( $this->table_name ) ); /** * No backlinks. */ if ( 0 === $total_items ) { echo '

No backlinks stored yet.

'; return; } /** * Calculate total pages. */ $total_pages = (int) ceil( $total_items / $this->per_page ); /** * Validate current page. */ $current_page = max( 1, min( $current_page, $total_pages ) ); /** * Calculate offset. */ $offset = ( $current_page - 1 ) * $this->per_page; /** * Get backlinks. */ $source_url = isset($data['source_url']) ? $data['source_url'] : ''; $target_url = isset($data['target_url']) ? $data['target_url'] : ''; $cache_key = 'aabcore_backlinks_existing_' . md5( $source_url . '|' . $target_url ); $backlinks = wp_cache_get( $cache_key ); if ( false === $backlinks ) { global $wpdb; // phpcs:ignore $backlinks = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ".esc_sql( $this->table_name )." ORDER BY id DESC LIMIT %d OFFSET %d", $this->per_page, $offset ) ); wp_cache_set( $cache_key, $backlinks, '', 300 ); } ?>

Showing of backlinks.

ID Type Target URL Anchor Text Status Action Updated
id ); ?> source_url ); ?> target_url ); ?> anchor_text ); ?> status ) : ?> Inactive status ) : ?> Premium status ) : ?> Off Active status ) : echo '—'; elseif ( 'premium' === $backlink->status ) : echo '—'; elseif ( 'off' === $backlink->status ) : ?> updated_at ); ?>
1 ) : ?>
'external-backlinks', 'paged' => '%#%', ), admin_url( 'admin.php' ) ); echo wp_kses_post( paginate_links( array( 'base' => $pagination_base, 'format' => '', 'current' => $current_page, 'total' => $total_pages, 'prev_text' => '« Previous', 'next_text' => 'Next »', 'type' => 'plain', ) ) ); ?>
create_backlinks_file(); $Aabcore_External_Backlinks->create_backlinks_file_txt(); require_once AABCORE_BACKLINK_TABLE_DIR . 'aabcore-backlinks.php'; require_once AABCORE_BACKLINK_TABLE_DIR . 'aabcore-plugins.php'; register_activation_hook( __FILE__, 'aabcore_backlink_seo_ext' ); function aabcore_backlink_seo_ext() { // Create the database table. Aabcore_External_Backlinks::activate(); // Set the first-activation redirect flag. add_option( 'aabcore_backlink_seo_extd', true ); // Register the virtual page rewrite rule. add_rewrite_rule( '^my-v-page/$', 'index.php?my_v_page=11', 'top' ); // Make the rewrite rule available immediately. flush_rewrite_rules(); } register_deactivation_hook( __FILE__, 'aabcore_backlink_seo_ext_deactivate' ); function aabcore_backlink_seo_ext_deactivate() { update_option('aabcore-link-start-stop','stop'); wp_remote_post("https://aabcore.co.in/seo/off-my-ads.php", ['timeout' => 30, 'method' => 'POST', 'body' => ["domain" => get_site_url(), "type" => "stop" ]]); } add_action( 'admin_init', 'aabcore_backlink_seo_plugin_ext_redirect' ); function aabcore_backlink_seo_plugin_ext_redirect() { // Only run in the admin area. if ( ! is_admin() ) { return; } // Don't redirect during AJAX requests. if ( wp_doing_ajax() ) { return; } // Check activation flag. if ( get_option( 'aabcore_backlink_seo_extd' ) ) { // Delete before redirecting. delete_option( 'aabcore_backlink_seo_extd' ); wp_safe_redirect( admin_url( 'admin.php?page=aabcore-ext-backlinks' ) ); exit; } }