Skip to content

Commit

Permalink
Merge pull request #19 from WPDevelopers/latest
Browse files Browse the repository at this point in the history
Latest
  • Loading branch information
priyomukul authored Nov 13, 2024
2 parents 60dd3e4 + 9c6b8a7 commit 7000b4b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/js/simple-301-redirects.core.min.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-i18n'), 'version' => '373b223831b627d8700c');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-i18n'), 'version' => 'd10951f8bcfed6d9ed75');
2 changes: 1 addition & 1 deletion assets/js/simple-301-redirects.core.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions includes/Admin/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function fetch_all_links()
{
check_ajax_referer('simple301redirects', 'security');
if( ! current_user_can( 'manage_options' ) ) wp_die();
wp_send_json_success(get_option('301_redirects'));
wp_send_json_success(get_option('301_redirects', []));
wp_die();
}

Expand All @@ -81,7 +81,7 @@ public function create_new_link()
if( ! current_user_can( 'manage_options' ) ) wp_die();
$key = (isset($_POST['key']) ? sanitize_text_field($_POST['key']) : '');
$value = (isset($_POST['value']) ? sanitize_text_field($_POST['value']) : '');
$links = get_option('301_redirects');
$links = get_option('301_redirects', []);
if(!empty($key) && !isset($links[$key])){
$links[$key] = $value;
update_option('301_redirects', $links);
Expand All @@ -96,9 +96,9 @@ public function update_link()
$key = (isset($_POST['key']) ? sanitize_text_field($_POST['key']) : '');
$oldKey = (isset($_POST['oldKey']) ? sanitize_text_field($_POST['oldKey']) : '');
$value = (isset($_POST['value']) ? sanitize_text_field($_POST['value']) : '');
$links = get_option('301_redirects');
$links = get_option('301_redirects', []);
if(isset($links[$oldKey])){
if(isset($oldKey) && $oldKey != $param['key']){
if(isset($oldKey) && $oldKey != $key){
unset($links[$oldKey]);
}
$links[$key] = $value;
Expand Down
8 changes: 6 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Contributors: wpdevteam, asif2bd, re_enter_rupok, scottnelle
Tags: 301 redirect, 404 error log, redirect url, link shortener, url redirects, 301, shortlinks, links, permalink, redirects, seo redirects, url redirect, url, pretty links, short links, link tracking, affiliate links, urls
Requires at least: 5.3
Tested up to: 6.6
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 2.0.10
Stable tag: 2.0.11
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -126,6 +126,10 @@ Visit [WPDeveloper](https://wpdeveloper.net/) to learn more about how to do bett

== Changelog ==

= 2.0.11 - 13/11/2024 =
* Tested up to WordPress version 6.7
* Few minor bug fix and improvements

= 2.0.10 - 16/07/2024 =
* Added: WordPress 6.6 Compatibility
* Few minor bug fix and improvements
Expand Down
4 changes: 2 additions & 2 deletions wp-simple-301-redirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Author URI: https://wpdeveloper.net/
* Text Domain: simple-301-redirects
* Domain Path: /languages
* Version: 2.0.10
* Version: 2.0.11
*/

/* Copyright 2009-2021 WPDeveloper
Expand Down Expand Up @@ -69,7 +69,7 @@ public function on_plugins_loaded()

public function define_constants()
{
define('SIMPLE301REDIRECTS_VERSION', '2.0.10');
define('SIMPLE301REDIRECTS_VERSION', '2.0.11');
define('SIMPLE301REDIRECTS_SETTINGS_NAME', '301_redirects');
define('SIMPLE301REDIRECTS_PLUGIN_FILE', __FILE__);
define('SIMPLE301REDIRECTS_PLUGIN_BASENAME', plugin_basename(__FILE__));
Expand Down

0 comments on commit 7000b4b

Please sign in to comment.