Changeset 3315519
- Timestamp:
- 06/21/2025 12:03:37 AM (7 months ago)
- Location:
- prime-mover/trunk
- Files:
-
- 13 edited
-
PrimeMoverFactory.php (modified) (1 diff)
-
changelog.txt (modified) (1 diff)
-
classes/PrimeMoverSystemFunctions.php (modified) (5 diffs)
-
classes/PrimeMoverUsers.php (modified) (3 diffs)
-
engines/prime-mover-panel/advance/PrimeMoverTroubleshooting.php (modified) (3 diffs)
-
engines/prime-mover-panel/prime-mover-panel.php (modified) (1 diff)
-
engines/prime-mover-panel/vendor/composer/installed.php (modified) (2 diffs)
-
global/PrimeMoverGlobalConstants.php (modified) (2 diffs)
-
global/PrimeMoverGlobalFunctions.php (modified) (1 diff)
-
prime-mover.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
utilities/PrimeMoverSearchReplaceUtilities.php (modified) (1 diff)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
prime-mover/trunk/PrimeMoverFactory.php
r3301867 r3315519 319 319 $this->removePrimeMoverDirectoriesOnUninstall(); 320 320 $this->removePrimeMoverOptionsInDb(); 321 $this->removePrimeMoverCrons(); 322 } 323 324 /** 325 * Remove Prime Mover cron hooks on uninstall 326 */ 327 private function removePrimeMoverCrons() 328 { 329 if (!function_exists('getPrimeMoverCronHooks')) { 330 return; 331 } 332 333 $prime_mover_crons = getPrimeMoverCronHooks(); 334 if (!is_array($prime_mover_crons)) { 335 return; 336 } 337 338 foreach ($prime_mover_crons as $cron_hook) { 339 if ($cron_hook && is_string($cron_hook)) { 340 wp_unschedule_hook($cron_hook); 341 } 342 } 321 343 } 322 344 -
prime-mover/trunk/changelog.txt
r3301867 r3315519 2 2 3 3 **This is a list detailing changes for all Prime Mover releases.** 4 5 = 2.0.4 = 6 7 * Fixed: Data was missing on import due to a large extended insert in the database restore. 8 * Updated Freemius SDK to the latest version. 4 9 5 10 = 2.0.3 = -
prime-mover/trunk/classes/PrimeMoverSystemFunctions.php
r3301867 r3315519 1195 1195 */ 1196 1196 if ((isset($diff['users'])) && (! empty($diff['users']))) { 1197 $admin_text = esc_html__('administrator', 'prime-mover'); 1198 $platform_text = esc_html__('WordPress', 'prime-mover'); 1199 $tutorial_link = PRIME_MOVER_RESETDB_TUTORIAL; 1200 if (is_multisite()) { 1201 $admin_text = esc_html__('super administrator', 'prime-mover'); 1202 $platform_text = esc_html__('WordPress multisite', 'prime-mover'); 1203 $tutorial_link = PRIME_MOVER_RESETDB_MULTISITE_TUTORIAL; 1204 } 1205 1197 1206 $blank_site = true; 1198 1207 if (isset($diff['users']['blank_site'])) { … … 1216 1225 $msg .= esc_html__('For best restoration results, the following is recommended:', 'prime-mover'); 1217 1226 $msg .= '<ol>'; 1218 $msg .= '<li>' . sprintf(esc_html__('Start with a %s', 'prime-mover'), '<a class="prime-mover-external-link" target="_blank" href="' . PRIME_MOVER_RESETDB_TUTORIAL . '">' . esc_html__('fresh WordPress install', 'prime-mover') . '</a>.') . '</li>';1227 $msg .= '<li>' . sprintf(esc_html__('Start with a %s', 'prime-mover'), '<a class="prime-mover-external-link" target="_blank" href="' . $tutorial_link . '">' . sprintf(esc_html__('fresh %s install', 'prime-mover'), $platform_text) . '</a>.') . '</li>'; 1219 1228 1220 1229 $recommended_email = ''; … … 1224 1233 1225 1234 if ($recommended_email) { 1226 $msg .= '<li>' . sprintf(esc_html__('Set %s as its administrator.', 'prime-mover'), '<strong>' . $recommended_email . '</strong>') . '</li>';1235 $msg .= '<li>' . sprintf(esc_html__('Set %s as its %s.', 'prime-mover'), '<strong>' . $recommended_email . '</strong>', $admin_text) . '</li>'; 1227 1236 } else { 1228 1237 $msg .= '<li>' . sprintf(esc_html__('Use a %s email, and do not use %s to avoid user restoration conflicts', 'prime-mover'), '<em>' . … … 1231 1240 1232 1241 $msg .= '</ol>'; 1233 $msg .= sprintf(esc_html__('To do this, you must cancel this import by clicking the "%s" button and re-install WordPress in a fresh state. Please %s about this feature.', 'prime-mover'),1242 $msg .= sprintf(esc_html__('To do this, you must cancel this import by clicking the "%s" button and re-install %s in a fresh state. Please %s about this feature.', 'prime-mover'), 1234 1243 '<strong>' . esc_html__('No', 'prime-mover') . '</strong>', 1244 $platform_text, 1235 1245 '<a class="prime-mover-external-link" target="_blank" href="' . CODEXONICS_USER_DIFF_FAQ . '">' . esc_html__('read the FAQ', 'prime-mover') . '</a>'); 1236 1246 $msg .= PHP_EOL; … … 4759 4769 4760 4770 /** 4771 * Replace is_multisite returns TRUE if multisite. 4772 * This function returns TRUE if multisite AND MAIN SITE IS fresh (entire network also) 4773 * @param number $blog_id 4774 * @return boolean 4775 */ 4776 public function isFreshMultisiteMainSite($blog_id = 0) 4777 { 4778 if (!$blog_id) { 4779 return false; 4780 } 4781 4782 if (!is_multisite()) { 4783 return false; 4784 } 4785 4786 $admins = get_super_admins(); 4787 if (!is_array($admins)) { 4788 return false; 4789 } 4790 4791 $count_admins = count($admins); 4792 $count_admins = (int)$count_admins; 4793 if ($count_admins > 1) { 4794 return false; 4795 } 4796 4797 $count_users = get_user_count(); 4798 $count_users = (int)$count_users; 4799 if ($count_users > 1) { 4800 return false; 4801 } 4802 4803 $large_network = wp_is_large_network(); 4804 if ($large_network) { 4805 return false; 4806 } 4807 4808 $count_blogs = get_blog_count(); 4809 $count_blogs = (int)$count_blogs; 4810 if ($count_blogs > 1) { 4811 return false; 4812 } 4813 4814 if (!$this->isMultisiteMainSite($blog_id)) { 4815 return false; 4816 } 4817 4818 return true; 4819 } 4820 4821 /** 4761 4822 * Clean Tables to export 4762 4823 * @param number $blogid_to_export -
prime-mover/trunk/classes/PrimeMoverUsers.php
r3217325 r3315519 134 134 add_filter('prime_mover_process_userid_adjustment_db', [$this, 'dBCustomerUserIdsHelper'], 10, 13); 135 135 136 add_filter('prime_mover_filter_config_after_diff_check', [ $this, 'handleUserDifferences'], 99, 1);136 add_filter('prime_mover_filter_config_after_diff_check', [ $this, 'handleUserDifferences'], 99, 2); 137 137 } 138 138 … … 140 140 * Handle user differences 141 141 * @param array $import_data 142 * @return array 143 */ 144 public function handleUserDifferences(array $import_data) 145 { 146 $bailout = apply_filters('prime_mover_maybe_bailout_user_diff_check', false, $import_data); 142 * @param number $blog_id 143 * @return array 144 */ 145 public function handleUserDifferences(array $import_data = [], $blog_id = 0) 146 { 147 $bailout = apply_filters('prime_mover_maybe_bailout_user_diff_check', false, $import_data, $blog_id); 147 148 if ($bailout) { 148 149 return $import_data; … … 154 155 155 156 $do_user_diff_check = !wp_is_large_user_count(); 156 if (!$do_user_diff_check || is_multisite()) { 157 if (!$do_user_diff_check) { 158 return $import_data; 159 } 160 161 if (is_multisite() && false === $this->getSystemFunctions()->isFreshMultisiteMainSite($blog_id)) { 157 162 return $import_data; 158 163 } -
prime-mover/trunk/engines/prime-mover-panel/advance/PrimeMoverTroubleshooting.php
r3217325 r3315519 178 178 add_action('wp_ajax_prime_mover_clear_locked_settings', [$this,'clearLockedSettings']); 179 179 180 add_filter('prime_mover_maybe_bailout_user_diff_check', [$this, 'maybeBailOutUserSiteDiff'], 10, 1);180 add_filter('prime_mover_maybe_bailout_user_diff_check', [$this, 'maybeBailOutUserSiteDiff'], 10, 3); 181 181 } 182 182 … … 184 184 * Maybe bail out user site diff 185 185 * @param boolean $bailout 186 * @param array $ret 187 * @param number $blog_id 186 188 * @return string|boolean 187 189 */ 188 public function maybeBailOutUserSiteDiff($bailout = false )190 public function maybeBailOutUserSiteDiff($bailout = false, $ret = [], $blog_id = 0) 189 191 { 190 192 $setting = $this->getPrimeMoverSettings()->getSetting(self::DISABLE_USER_DIFF_CHECK); 191 if (!$setting || is_multisite()) { 193 if (!$setting) { 194 return $bailout; 195 } 196 197 if (is_multisite() && false === $this->getPrimeMover()->getSystemFunctions()->isFreshMultisiteMainSite($blog_id)) { 192 198 return $bailout; 193 199 } … … 740 746 public function renderDisableUserDiffMarkup() 741 747 { 748 $blog_id = 0; 742 749 if (is_multisite()) { 750 $blog_id = get_current_blog_id(); 751 } 752 753 if ($blog_id && false === $this->getPrimeMover()->getSystemFunctions()->isFreshMultisiteMainSite($blog_id)) { 743 754 return; 744 755 } -
prime-mover/trunk/engines/prime-mover-panel/prime-mover-panel.php
r3301867 r3315519 43 43 } 44 44 define( 'PRIME_MOVER_PANEL_PLUGINPATH', plugin_dir_path( __FILE__ ) ); 45 define( 'PRIME_MOVER_PANEL_VERSION', '2.0. 6' );45 define( 'PRIME_MOVER_PANEL_VERSION', '2.0.7' ); 46 46 define( 'PRIME_MOVER_PANEL_MAINPLUGIN_FILE', __FILE__ ); 47 47 define( 'PRIME_MOVER_PANEL_PLUGINBASENAME', plugin_basename( PRIME_MOVER_PANEL_MAINPLUGIN_FILE ) ); -
prime-mover/trunk/engines/prime-mover-panel/vendor/composer/installed.php
r3301867 r3315519 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 50872445a354c9a4f93d35b245b7a9b4db40a151',6 'reference' => '44126d4736eeaf70024cc5acab43fdfe647dd0df', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 50872445a354c9a4f93d35b245b7a9b4db40a151',16 'reference' => '44126d4736eeaf70024cc5acab43fdfe647dd0df', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../', -
prime-mover/trunk/global/PrimeMoverGlobalConstants.php
r3301867 r3315519 9 9 } 10 10 11 define('PRIME_MOVER_VERSION', '2.0. 6');11 define('PRIME_MOVER_VERSION', '2.0.7'); 12 12 define('PRIME_MOVER_PLUGIN_CODENAME', 'Prime Mover'); 13 13 define('PRIME_MOVER_PRO_PLUGIN_CODENAME', 'Prime Mover PRO'); … … 224 224 } 225 225 226 if (!defined('PRIME_MOVER_RESETDB_MULTISITE_TUTORIAL')) { 227 define('PRIME_MOVER_RESETDB_MULTISITE_TUTORIAL', 'https://codexonics.com/prime_mover/prime-mover/how-to-create-a-fresh-wordpress-multisite-install-with-a-specific-network-administrator-email/'); 228 } 229 226 230 if (!defined('PRIME_MOVER_FIX_MU_SCRIPT_TUTORIAL')) { 227 231 define('PRIME_MOVER_FIX_MU_SCRIPT_TUTORIAL', 'https://codexonics.com/prime_mover/prime-mover/troubleshooting-unable-to-activate-prime-mover-in-restricted-mu-plugins-directory/'); -
prime-mover/trunk/global/PrimeMoverGlobalFunctions.php
r3301867 r3315519 615 615 616 616 } 617 if ( !function_exists( 'str_starts_with' ) ) { 618 function str_starts_with( $haystack, $needle ) { 619 if ( '' === $needle ) { 620 return true; 621 } 622 return 0 === strpos( $haystack, $needle ); 623 } 624 625 } 626 if ( !function_exists( 'getPrimeMoverCronHooks' ) ) { 627 function getPrimeMoverCronHooks() { 628 $prime_mover_crons = []; 629 if ( !function_exists( '_get_cron_array' ) ) { 630 return $prime_mover_crons; 631 } 632 $cron = _get_cron_array(); 633 if ( !is_array( $cron ) ) { 634 return $prime_mover_crons; 635 } 636 $cron_values = array_values( $cron ); 637 foreach ( $cron_values as $v ) { 638 if ( !is_array( $v ) ) { 639 continue; 640 } 641 $cron_hooks = array_keys( $v ); 642 foreach ( $cron_hooks as $hook ) { 643 if ( $hook && is_string( $hook ) && str_starts_with( $hook, 'primeMover' ) ) { 644 $prime_mover_crons[] = $hook; 645 } 646 } 647 } 648 return $prime_mover_crons; 649 } 650 651 } 617 652 if ( !function_exists( 'primeMoverRestoreAdminCaps' ) ) { 618 653 function primeMoverRestoreAdminCaps() { -
prime-mover/trunk/prime-mover.php
r3301867 r3315519 5 5 Plugin URI: https://codexonics.com/ 6 6 Description: The simplest all-around WordPress migration tool/backup plugin. These support multisite backup/migration or clone WP site/multisite subsite. 7 Version: 2.0. 67 Version: 2.0.7 8 8 Author: Codexonics 9 9 Author URI: https://codexonics.com/ -
prime-mover/trunk/readme.txt
r3301867 r3315519 6 6 Tested up to: 6.8 7 7 Requires PHP: 5.6 8 Stable tag: 2.0. 68 Stable tag: 2.0.7 9 9 License: GPLv3 or later 10 10 License URI: https://codexonics.com … … 105 105 == Changelog == 106 106 107 = 2.0.7 = 108 109 * Fixed: Malformed domain name due to edge case double search replace. 110 * Feature: Added user difference check when migrating site to multisite main site. 111 * Fixed: Removed cron jobs when the plugin is uninstalled. 112 107 113 = 2.0.6 = 108 114 … … 125 131 * Usability: Added tutorial to download packages in different ways. 126 132 127 = 2.0.4 =128 129 * Fixed: Data was missing on import due to a large extended insert in the database restore.130 * Updated Freemius SDK to the latest version.131 132 133 See the previous changelogs in changelog.txt. -
prime-mover/trunk/utilities/PrimeMoverSearchReplaceUtilities.php
r3263153 r3315519 325 325 add_filter('prime_mover_filter_final_replaceables', [$this, 'maybeUnsetWpRoot'], 25000, 4); 326 326 add_filter('prime_mover_filter_final_replaceables', [$this, 'maybeAdjustEdgeRelativeCustomContentUploads'], 30000, 4); 327 add_filter('prime_mover_filter_final_replaceables', [$this, 'maybeUnsetGenericAltDomain'], 35000, 4); 328 } 329 330 /** 331 * Maybe unset generic alt domain 332 * @param array $replaceables 333 * @param array $ret 334 * @param boolean $retries 335 * @param number $blogid_to_import 336 */ 337 public function maybeUnsetGenericAltDomain($replaceables = [], $ret = [], $retries = false, $blogid_to_import = 0) 338 { 339 if (!$this->getSystemAuthorization()->isUserAuthorized() || !is_array($replaceables)) { 340 return $replaceables; 341 } 342 343 if (!is_multisite()) { 344 return $replaceables; 345 } 346 347 if (!isset($replaceables['generic_alt_domain_scheme'])) { 348 return $replaceables; 349 } 350 351 $generic_domain_scheme_replace = ''; 352 $generic_alt_domain_scheme_replace = ''; 353 354 if (isset($replaceables['generic_domain_scheme']['replace'])) { 355 $generic_domain_scheme_replace = $replaceables['generic_domain_scheme']['replace']; 356 } 357 358 if (isset($replaceables['generic_alt_domain_scheme']['replace'])) { 359 $generic_alt_domain_scheme_replace = $replaceables['generic_alt_domain_scheme']['replace']; 360 } 361 362 if (!$generic_domain_scheme_replace || !$generic_alt_domain_scheme_replace) { 363 return $replaceables; 364 } 365 366 if ($generic_domain_scheme_replace !== $generic_alt_domain_scheme_replace) { 367 return $replaceables; 368 } 369 370 $search = ''; 371 $replace = ''; 372 $subject = ''; 373 374 if (isset($replaceables['generic_alt_domain_scheme']['search'])) { 375 $search = $replaceables['generic_alt_domain_scheme']['search']; 376 } 377 378 if (isset($replaceables['generic_alt_domain_scheme']['replace'])) { 379 $replace = $replaceables['generic_alt_domain_scheme']['replace']; 380 } 381 382 if (isset($replaceables['generic_domain_scheme']['replace'])) { 383 $subject = $replaceables['generic_domain_scheme']['replace']; 384 } 385 386 if (!$search || !$replace || !$subject) { 387 return $replaceables; 388 } 389 390 if (!is_string($search) || !is_string($replace) || !is_string($subject)) { 391 return $replaceables; 392 } 393 394 $search = trim($search); 395 $replace = trim($replace); 396 $subject = trim($subject); 397 398 $result = str_replace($search, $replace, $subject); 399 $problem = false; 400 if ($result !== $subject && $result !== $replace) { 401 $problem = true; 402 } 403 404 if (!$problem) { 405 return $replaceables; 406 } 407 408 if (isset($replaceables['generic_alt_domain_scheme'])) { 409 unset($replaceables['generic_alt_domain_scheme']); 410 } 411 412 if (isset($replaceables['generic_alt_domain_scheme_slashedvar'])) { 413 unset($replaceables['generic_alt_domain_scheme_slashedvar']); 414 } 415 416 return $replaceables;; 327 417 } 328 418 -
prime-mover/trunk/vendor/composer/installed.php
r3301867 r3315519 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' 50872445a354c9a4f93d35b245b7a9b4db40a151',6 'reference' => '44126d4736eeaf70024cc5acab43fdfe647dd0df', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' 50872445a354c9a4f93d35b245b7a9b4db40a151',16 'reference' => '44126d4736eeaf70024cc5acab43fdfe647dd0df', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.