| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Search & Replace |
| 5 |
* |
| 6 |
* Search & Replace Everything - Quick and Easy Way to Find and Replace Text, Links |
| 7 |
* |
| 8 |
* @link https://wordpress.org/plugins/update-urls |
| 9 |
* @author KaizenCoders <hello@kaizencoders.com> |
| 10 |
* @license GPL-2.0+ |
| 11 |
* @package UpdateURLS |
| 12 |
* @copyright 2020 - 2025 KaizenCoders |
| 13 |
* |
| 14 |
* @wordpress-plugin |
| 15 |
* |
| 16 |
* Plugin Name: Update URLS |
| 17 |
* Plugin URI: https://kaizencoders.com/update-urls |
| 18 |
* Description: Search & Replace Everything - Quick and Easy Way to Find and Replace Text, Links |
| 19 |
* Version: 1.4.6 |
| 20 |
* Requires PHP: 5.6 |
| 21 |
* Tested up to: 7.0 |
| 22 |
* Author: KaizenCoders |
| 23 |
* Author URI: https://kaizencoders.com |
| 24 |
* Text Domain: update-urls |
| 25 |
* License: GPL-3.0+ |
| 26 |
* License URI: http://www.gnu.org/licenses |
| 27 |
* Domain Path: /languages |
| 28 |
* |
| 29 |
* @fs_premium_only /pro/ |
| 30 |
* @fs_ignore /vendor/, /lite/dist/styles/app.css, /lite/scripts/app.js |
| 31 |
* |
| 32 |
*/ |
| 33 |
|
| 34 |
// If this file is called directly, abort. |
| 35 |
if ( ! defined( 'ABSPATH' ) ) { |
| 36 |
die; |
| 37 |
} |
| 38 |
|
| 39 |
if ( ! defined( 'KC_UU_PLUGIN_VERSION' ) ) { |
| 40 |
define( 'KC_UU_PLUGIN_VERSION', '1.4.6' ); |
| 41 |
} |
| 42 |
|
| 43 |
if ( function_exists( 'kc_uu_fs' ) ) { |
| 44 |
kc_uu_fs()->set_basename( true, __FILE__ ); |
| 45 |
} else { |
| 46 |
// Create a helper function for easy SDK access. |
| 47 |
function kc_uu_fs() { |
| 48 |
global $kc_uu_fs; |
| 49 |
|
| 50 |
if ( ! isset( $kc_uu_fs ) ) { |
| 51 |
|
| 52 |
require_once dirname( __FILE__ ) . '/libs/fs/start.php'; |
| 53 |
|
| 54 |
$kc_uu_fs = fs_dynamic_init( [ |
| 55 |
'id' => '13148', |
| 56 |
'slug' => 'update-urls', |
| 57 |
'type' => 'plugin', |
| 58 |
'public_key' => 'pk_e7f60f62fb5346a24d64aeb9eea5e', |
| 59 |
'is_premium' => false, |
| 60 |
'has_premium_version' => true, |
| 61 |
'has_addons' => false, |
| 62 |
'has_paid_plans' => true, |
| 63 |
'menu' => [ |
| 64 |
'slug' => 'update-urls', |
| 65 |
'first-path' => 'admin.php?page=update-urls', |
| 66 |
'parent' => [ |
| 67 |
'slug' => 'update-urls', |
| 68 |
], |
| 69 |
'account' => true, |
| 70 |
'contact' => true, |
| 71 |
'support' => true, |
| 72 |
'affiliation' => false, |
| 73 |
], |
| 74 |
] ); |
| 75 |
} |
| 76 |
|
| 77 |
return $kc_uu_fs; |
| 78 |
} |
| 79 |
|
| 80 |
kc_uu_fs(); |
| 81 |
|
| 82 |
do_action( 'kc_uu_fs_loaded' ); |
| 83 |
|
| 84 |
if ( ! function_exists( 'kc_uu_fail_php_version_notice' ) ) { |
| 85 |
|
| 86 |
/** |
| 87 |
* Update URLS admin notice for minimum PHP version. |
| 88 |
* |
| 89 |
* Warning when the site doesn't have the minimum required PHP version. |
| 90 |
* |
| 91 |
* @return void |
| 92 |
* @since 1.0.0 |
| 93 |
* |
| 94 |
*/ |
| 95 |
function kc_uu_fail_php_version_notice() { |
| 96 |
/* translators: %s: PHP version */ |
| 97 |
$message = sprintf( esc_html__( 'Update URLS requires PHP version %s+, plugin is currently NOT RUNNING.', |
| 98 |
'update-urls' ), '5.6' ); |
| 99 |
$html_message = sprintf( '<div class="error">%s</div>', wpautop( $message ) ); |
| 100 |
echo wp_kses_post( $html_message ); |
| 101 |
} |
| 102 |
} |
| 103 |
|
| 104 |
if ( ! version_compare( PHP_VERSION, '5.6', '>=' ) ) { |
| 105 |
|
| 106 |
add_action( 'admin_notices', 'kc_uu_fail_php_version_notice' ); |
| 107 |
|
| 108 |
return; |
| 109 |
} |
| 110 |
|
| 111 |
if ( file_exists( dirname( __FILE__ ) . '/vendor/autoload.php' ) ) { |
| 112 |
require_once dirname( __FILE__ ) . '/vendor/autoload.php'; |
| 113 |
} |
| 114 |
|
| 115 |
require_once dirname( __FILE__ ) . '/libs/action-scheduler/action-scheduler.php'; |
| 116 |
|
| 117 |
if ( ! defined( 'KC_UU_PLUGIN_DIR' ) ) { |
| 118 |
/* @const KC_UU_PLUGIN_DIR */ |
| 119 |
define( 'KC_UU_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 120 |
} |
| 121 |
|
| 122 |
if ( ! defined( 'KC_UU_PLUGIN_BASE_NAME' ) ) { |
| 123 |
define( 'KC_UU_PLUGIN_BASE_NAME', plugin_basename( __FILE__ ) ); |
| 124 |
} |
| 125 |
|
| 126 |
if ( ! defined( 'KC_UU_PLUGIN_FILE' ) ) { |
| 127 |
define( 'KC_UU_PLUGIN_FILE', __FILE__ ); |
| 128 |
} |
| 129 |
|
| 130 |
if ( ! defined( 'KC_UU_PLUGIN_URL' ) ) { |
| 131 |
define( 'KC_UU_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 132 |
} |
| 133 |
|
| 134 |
if ( ! defined( 'KC_UU_PLUGIN_ASSETS_DIR_URL' ) ) { |
| 135 |
define( 'KC_UU_PLUGIN_ASSETS_DIR_URL', KC_UU_PLUGIN_URL . 'lite/dist/assets' ); |
| 136 |
} |
| 137 |
|
| 138 |
if ( ! defined( 'KC_UU_PRO_DIR' ) ) { |
| 139 |
define( 'KC_UU_PRO_DIR', KC_UU_PLUGIN_DIR . 'pro/' ); |
| 140 |
} |
| 141 |
|
| 142 |
/** |
| 143 |
* The code that runs during plugin activation. |
| 144 |
* This action is documented in lib/Activator.php |
| 145 |
*/ |
| 146 |
\register_activation_hook( __FILE__, '\KaizenCoders\UpdateURLS\Activator::activate' ); |
| 147 |
|
| 148 |
/** |
| 149 |
* The code that runs during plugin deactivation. |
| 150 |
* This action is documented in lib/Deactivator.php |
| 151 |
*/ |
| 152 |
\register_deactivation_hook( __FILE__, '\KaizenCoders\UpdateURLS\Deactivator::deactivate' ); |
| 153 |
|
| 154 |
|
| 155 |
if ( ! function_exists( 'UU' ) ) { |
| 156 |
/** |
| 157 |
* |
| 158 |
* @since 1.0.0 |
| 159 |
*/ |
| 160 |
function UU() { |
| 161 |
return \KaizenCoders\UpdateURLS\Plugin::instance(); |
| 162 |
} |
| 163 |
} |
| 164 |
|
| 165 |
UU()->run(); |
| 166 |
} |