| @@ -38,9 +38,9 @@ | ||
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * Method mainwp_add_translation() |
| 41 | 41 | * |
| 42 | - * Grab info needed to build array and strip chartacters "/[^A-Za-z0-9_]/". | |
| 42 | + * Grab info needed to build the translation array. | |
| 43 | 43 | * |
| 44 | 44 | * @param mixed $pArray Array of tranlatable text. |
| 45 | 45 | * @param mixed $pKey Key for each array enty. |
| 46 | 46 | * @param mixed $pText Text for each array entry. |
| @@ -49,10 +49,10 @@ | ||
| 49 | 49 | if ( ! is_array( $pArray ) ) { |
| 50 | 50 | $pArray = array(); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $strippedText = str_replace( ' ', '_', $pKey ); | |
| 54 | - $strippedText = preg_replace( '/[\W]/', '', $strippedText ); | |
| 53 | + // Keep this normalization aligned with MainWP.I18n.t() in assets/js/mainwp.js. | |
| 54 | + $strippedText = preg_replace( '/[^\p{L}\p{N}_]/u', '_', $pKey ); | |
| 55 | 55 | |
| 56 | 56 | $pArray[ $strippedText ] = $pText; |
| 57 | 57 | } |
| 58 | 58 | |
| @@ -58,16 +58,16 @@ | ||
| 58 | 58 | |
| 59 | 59 | $mainwpTranslations = array(); |
| 60 | 60 | mainwp_add_translation( $mainwpTranslations, 'Update settings.', esc_html__( 'Update settings.', 'mainwp' ) ); |
| 61 | 61 | mainwp_add_translation( $mainwpTranslations, 'Settings have been updated.', esc_html__( 'Settings have been updated.', 'mainwp' ) ); |
| 62 | - mainwp_add_translation( $mainwpTranslations, 'An error occured.', esc_html__( 'An error occured.', 'mainwp' ) ); | |
| 62 | + mainwp_add_translation( $mainwpTranslations, 'An error occurred.', esc_html__( 'An error occurred.', 'mainwp' ) ); | |
| 63 | 63 | mainwp_add_translation( $mainwpTranslations, 'Testing login.', esc_html__( 'Testing login.', 'mainwp' ) ); |
| 64 | 64 | mainwp_add_translation( $mainwpTranslations, 'Your login is valid.', esc_html__( 'Your login is valid.', 'mainwp' ) ); |
| 65 | 65 | mainwp_add_translation( $mainwpTranslations, 'Your login is invalid.', esc_html__( 'Your login is invalid.', 'mainwp' ) ); |
| 66 | - mainwp_add_translation( $mainwpTranslations, 'An error occured, please contact us.', esc_html__( 'An error occured, please contact us.', 'mainwp' ) ); | |
| 66 | + mainwp_add_translation( $mainwpTranslations, 'An error occurred, please contact us.', esc_html__( 'An error occurred, please contact us.', 'mainwp' ) ); | |
| 67 | 67 | mainwp_add_translation( $mainwpTranslations, 'more', esc_html__( 'more', 'mainwp' ) ); |
| 68 | 68 | mainwp_add_translation( $mainwpTranslations, 'less', esc_html__( 'less', 'mainwp' ) ); |
| 69 | - mainwp_add_translation( $mainwpTranslations, 'An error occured: ', esc_html__( 'An error occured: ', 'mainwp' ) ); | |
| 69 | + mainwp_add_translation( $mainwpTranslations, 'An error occurred: ', esc_html__( 'An error occurred: ', 'mainwp' ) ); | |
| 70 | 70 | mainwp_add_translation( $mainwpTranslations, 'No data available. Connect your sites using the Settings submenu.', esc_html__( 'No data available. Connect your sites using the Settings submenu.', 'mainwp' ) ); |
| 71 | 71 | mainwp_add_translation( $mainwpTranslations, 'Undefined error.', esc_html__( 'Undefined error.', 'mainwp' ) ); |
| 72 | 72 | mainwp_add_translation( $mainwpTranslations, 'PENDING', esc_html__( 'PENDING', 'mainwp' ) ); |
| 73 | 73 | mainwp_add_translation( $mainwpTranslations, 'UPDATING', esc_html__( 'UPDATING', 'mainwp' ) ); |
| @@ -112,9 +112,9 @@ | ||
| 112 | 112 | mainwp_add_translation( $mainwpTranslations, 'Please select websites or tags.', esc_html__( 'Please select websites or tags.', 'mainwp' ) ); |
| 113 | 113 | mainwp_add_translation( $mainwpTranslations, 'Are you sure you want to delete this backup task?', esc_html__( 'Are you sure you want to delete this backup task?', 'mainwp' ) ); |
| 114 | 114 | mainwp_add_translation( $mainwpTranslations, 'Removing the task..', esc_html__( 'Removing the task..', 'mainwp' ) ); |
| 115 | 115 | mainwp_add_translation( $mainwpTranslations, 'The task has been removed', esc_html__( 'The task has been removed', 'mainwp' ) ); |
| 116 | - mainwp_add_translation( $mainwpTranslations, 'An unspecified error occured', esc_html__( 'An unspecified error occured', 'mainwp' ) ); | |
| 116 | + mainwp_add_translation( $mainwpTranslations, 'An unspecified error occurred', esc_html__( 'An unspecified error occurred', 'mainwp' ) ); | |
| 117 | 117 | mainwp_add_translation( $mainwpTranslations, 'Connection test failed.', esc_html__( 'Connection test failed.', 'mainwp' ) ); |
| 118 | 118 | mainwp_add_translation( $mainwpTranslations, 'Error message:', esc_html__( 'Error message:', 'mainwp' ) ); |
| 119 | 119 | mainwp_add_translation( $mainwpTranslations, 'Received HTTP-code:', esc_html__( 'Received HTTP-code:', 'mainwp' ) ); |
| 120 | 120 | mainwp_add_translation( $mainwpTranslations, 'Connection test successful.', esc_html__( 'Connection test successful.', 'mainwp' ) ); |
| @@ -130,8 +130,16 @@ | ||
| 130 | 130 | mainwp_add_translation( $mainwpTranslations, 'Removing and deactivating the MainWP Child plugin..', esc_html__( 'Removing and deactivating the MainWP Child plugin..', 'mainwp' ) ); |
| 131 | 131 | mainwp_add_translation( $mainwpTranslations, 'The site has been removed and the MainWP Child plugin has been disabled.', esc_html__( 'The site has been removed and the MainWP Child plugin has been disabled.', 'mainwp' ) ); |
| 132 | 132 | mainwp_add_translation( $mainwpTranslations, 'The requested site has not been found', esc_html__( 'The requested site has not been found', 'mainwp' ) ); |
| 133 | 133 | mainwp_add_translation( $mainwpTranslations, 'The site has been removed but the MainWP Child plugin could not be disabled', esc_html__( 'The site has been removed but the MainWP Child plugin could not be disabled', 'mainwp' ) ); |
| 134 | + mainwp_add_translation( $mainwpTranslations, 'Removing the site. Please wait...', esc_html__( 'Removing the site. Please wait...', 'mainwp' ) ); | |
| 135 | + mainwp_add_translation( $mainwpTranslations, 'Site could not be removed. Please reload the page and try again.', esc_html__( 'Site could not be removed. Please reload the page and try again.', 'mainwp' ) ); | |
| 136 | + mainwp_add_translation( $mainwpTranslations, 'Details:', esc_html__( 'Details:', 'mainwp' ) ); | |
| 137 | + mainwp_add_translation( $mainwpTranslations, 'The site has been removed. Please make sure that the MainWP Child plugin has been deactivated properly. You will be redirected to the Sites page right away.', esc_html__( 'The site has been removed. Please make sure that the MainWP Child plugin has been deactivated properly. You will be redirected to the Sites page right away.', 'mainwp' ) ); | |
| 138 | + mainwp_add_translation( $mainwpTranslations, 'The site has been removed and the MainWP Child plugin has been disabled. You will be redirected to the Sites page right away.', esc_html__( 'The site has been removed and the MainWP Child plugin has been disabled. You will be redirected to the Sites page right away.', 'mainwp' ) ); | |
| 139 | + mainwp_add_translation( $mainwpTranslations, 'The site has been removed. You will be redirected to the Sites page right away.', esc_html__( 'The site has been removed. You will be redirected to the Sites page right away.', 'mainwp' ) ); | |
| 140 | + mainwp_add_translation( $mainwpTranslations, 'The request timed out. Please make sure that the MainWP Child plugin has been deactivated properly.', esc_html__( 'The request timed out. Please make sure that the MainWP Child plugin has been deactivated properly.', 'mainwp' ) ); | |
| 141 | + mainwp_add_translation( $mainwpTranslations, 'An unexpected error occurred. Please reload the page and try again.', esc_html__( 'An unexpected error occurred. Please reload the page and try again.', 'mainwp' ) ); | |
| 134 | 142 | mainwp_add_translation( $mainwpTranslations, 'Paused import by user.', esc_html__( 'Paused import by user.', 'mainwp' ) ); |
| 135 | 143 | mainwp_add_translation( $mainwpTranslations, 'Continue', esc_html__( 'Continue', 'mainwp' ) ); |
| 136 | 144 | mainwp_add_translation( $mainwpTranslations, 'Continue import.', esc_html__( 'Continue import.', 'mainwp' ) ); |
| 137 | 145 | mainwp_add_translation( $mainwpTranslations, 'Pause', esc_html__( 'Pause', 'mainwp' ) ); |
| @@ -163,9 +171,9 @@ | ||
| 163 | 171 | mainwp_add_translation( $mainwpTranslations, 'Downloading the file.', esc_html__( 'Downloading the file.', 'mainwp' ) ); |
| 164 | 172 | mainwp_add_translation( $mainwpTranslations, 'Download from child completed.', esc_html__( 'Download from child completed.', 'mainwp' ) ); |
| 165 | 173 | mainwp_add_translation( $mainwpTranslations, 'Please wait while we are saving your note', esc_html__( 'Please wait while we are saving your note', 'mainwp' ) ); |
| 166 | 174 | mainwp_add_translation( $mainwpTranslations, 'Note saved.', esc_html__( 'Note saved.', 'mainwp' ) ); |
| 167 | - mainwp_add_translation( $mainwpTranslations, 'An error occured while saving your message.', esc_html__( 'An error occured while saving your message.', 'mainwp' ) ); | |
| 175 | + mainwp_add_translation( $mainwpTranslations, 'An error occurred while saving your message.', esc_html__( 'An error occurred while saving your message.', 'mainwp' ) ); | |
| 168 | 176 | mainwp_add_translation( $mainwpTranslations, 'Please search and select users for update password.', esc_html__( 'Please search and select users for update password.', 'mainwp' ) ); |
| 169 | 177 | mainwp_add_translation( $mainwpTranslations, 'All', esc_html__( 'All', 'mainwp' ) ); |
| 170 | 178 | mainwp_add_translation( $mainwpTranslations, 'Any', esc_html__( 'Any', 'mainwp' ) ); |
| 171 | 179 | mainwp_add_translation( $mainwpTranslations, 'HTTP error', esc_html__( 'HTTP error', 'mainwp' ) ); |
| @@ -196,9 +204,9 @@ | ||
| 196 | 204 | mainwp_add_translation( $mainwpTranslations, 'Show Shortcuts', esc_html__( 'Show Shortcuts', 'mainwp' ) ); |
| 197 | 205 | mainwp_add_translation( $mainwpTranslations, 'Are you sure?', esc_html__( 'Are you sure?', 'mainwp' ) ); |
| 198 | 206 | mainwp_add_translation( $mainwpTranslations, 'Bulk reconnect finished.', esc_html__( 'Bulk reconnect finished.', 'mainwp' ) ); |
| 199 | 207 | mainwp_add_translation( $mainwpTranslations, 'Note Saved', esc_html__( 'Note Saved', 'mainwp' ) ); |
| 200 | - mainwp_add_translation( $mainwpTranslations, 'An error occured while saving your message', esc_html__( 'An error occured while saving your message', 'mainwp' ) ); | |
| 208 | + mainwp_add_translation( $mainwpTranslations, 'An error occurred while saving your message', esc_html__( 'An error occurred while saving your message', 'mainwp' ) ); | |
| 201 | 209 | mainwp_add_translation( $mainwpTranslations, 'Download from child site completed.', esc_html__( 'Download from child site completed.', 'mainwp' ) ); |
| 202 | 210 | mainwp_add_translation( $mainwpTranslations, 'Please wait while we are saving your note', esc_html__( 'Please wait while we are saving your note', 'mainwp' ) ); |
| 203 | 211 | mainwp_add_translation( $mainwpTranslations, 'Installation Successful', esc_html__( 'Installation Successful', 'mainwp' ) ); |
| 204 | 212 | mainwp_add_translation( $mainwpTranslations, 'Upload to %1 (%2) successful.', esc_html__( 'Upload to %1 (%2) successful.', 'mainwp' ) ); |
| @@ -228,8 +236,12 @@ | ||
| 228 | 236 | mainwp_add_translation( $mainwpTranslations, 'Would you like to use the Bulk Settings Manager with these themes? Check out the %1Documentation%2.', esc_html__( 'Would you like to use the Bulk Settings Manager with these themes? Check out the %1Documentation%2.', 'mainwp' ) ); |
| 229 | 237 | mainwp_add_translation( $mainwpTranslations, 'is_activated_parent', esc_html__( '%1 could not be deleted. This theme is parent theme for the currently active theme.', 'mainwp' ) ); |
| 230 | 238 | mainwp_add_translation( $mainwpTranslations, 'is_activated_theme', esc_html__( '%1 could not be deleted. This theme is active theme.', 'mainwp' ) ); |
| 231 | 239 | mainwp_add_translation( $mainwpTranslations, 'Change score changed. Click to review changes.', esc_html__( 'Change score changed. Click to review changes.', 'mainwp' ) ); |
| 240 | + mainwp_add_translation( $mainwpTranslations, 'No sites to import', esc_html__( 'No sites to import', 'mainwp' ) ); | |
| 241 | + mainwp_add_translation( $mainwpTranslations, 'No valid data rows were found in the import file.', esc_html__( 'No valid data rows were found in the import file.', 'mainwp' ) ); | |
| 242 | + mainwp_add_translation( $mainwpTranslations, 'Congratulations!', esc_html__( 'Congratulations!', 'mainwp' ) ); | |
| 243 | + mainwp_add_translation( $mainwpTranslations, 'sites imported successfully.', esc_html__( 'sites imported successfully.', 'mainwp' ) ); | |
| 232 | 244 | |
| 233 | 245 | return $mainwpTranslations; |
| 234 | 246 | } |
| 235 | 247 | |
| @@ -457,8 +469,10 @@ | ||
| 457 | 469 | public static function admin_notices() { |
| 458 | 470 | |
| 459 | 471 | static::mainwp_tmpfile_check(); |
| 460 | 472 | |
| 473 | + static::render_extension_update_failure_notice(); | |
| 474 | + | |
| 461 | 475 | static::render_notice_config_warning(); |
| 462 | 476 | |
| 463 | 477 | static::render_notice_multi_sites(); |
| 464 | 478 | |
| @@ -482,8 +496,46 @@ | ||
| 482 | 496 | |
| 483 | 497 | } |
| 484 | 498 | |
| 485 | 499 | /** |
| 500 | + * Render the repeated Add-on update-check failure notice. | |
| 501 | + */ | |
| 502 | + public static function render_extension_update_failure_notice() { | |
| 503 | + if ( ! \mainwp_current_user_can( 'dashboard', 'manage_extensions' ) ) { | |
| 504 | + return; | |
| 505 | + } | |
| 506 | + | |
| 507 | + $notice_id = MainWP_System_Handler::instance()->get_extension_update_failure_notice_id(); | |
| 508 | + if ( '' === $notice_id ) { | |
| 509 | + return; | |
| 510 | + } | |
| 511 | + | |
| 512 | + $is_extensions_page = isset( $_GET['page'] ) && 'Extensions' === sanitize_text_field( wp_unslash( $_GET['page'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 513 | + if ( ! $is_extensions_page && ! MainWP_Utility::show_mainwp_message( 'notice', $notice_id ) ) { | |
| 514 | + return; | |
| 515 | + } | |
| 516 | + ?> | |
| 517 | + <div class="ui yellow message mainwp-extension-update-failure-notice" style="margin-bottom:0;"> | |
| 518 | + <div class="header"><?php esc_html_e( 'Unable to check for Add-on updates', 'mainwp' ); ?></div> | |
| 519 | + <?php if ( $is_extensions_page ) : ?> | |
| 520 | + <p><?php esc_html_e( 'MainWP is unable to check one or more Add-ons for updates. Retry the check below.', 'mainwp' ); ?></p> | |
| 521 | + <button | |
| 522 | + type="button" | |
| 523 | + id="mainwp-extension-update-check-retry" | |
| 524 | + class="ui mini yellow button" | |
| 525 | + data-failed-text="<?php esc_attr_e( 'The update check is still failing. Make sure your MainWP Dashboard can connect to mainwp.com, then try again.', 'mainwp' ); ?>" | |
| 526 | + ><?php esc_html_e( 'Retry update checks', 'mainwp' ); ?></button> | |
| 527 | + <span id="mainwp-extension-update-check-retry-status" class="ui small red text" aria-live="polite"></span> | |
| 528 | + <?php else : ?> | |
| 529 | + <p><?php esc_html_e( 'MainWP is unable to check one or more Add-ons for updates. Open the Add-ons page to retry the check.', 'mainwp' ); ?></p> | |
| 530 | + <a class="ui mini yellow button" href="<?php echo esc_url( admin_url( 'admin.php?page=Extensions' ) ); ?>"><?php esc_html_e( 'Review Add-ons', 'mainwp' ); ?></a> | |
| 531 | + <i class="close icon mainwp-notice-dismiss" notice-id="<?php echo esc_attr( $notice_id ); ?>"></i> | |
| 532 | + <?php endif; ?> | |
| 533 | + </div> | |
| 534 | + <?php | |
| 535 | + } | |
| 536 | + | |
| 537 | + /** | |
| 486 | 538 | * Render MainWP themes deprecation notice. |
| 487 | 539 | * |
| 488 | 540 | * @uses \MainWP\Dashboard\MainWP_Settings::get_instance() |
| 489 | 541 | * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() |
| @@ -789,11 +841,11 @@ | ||
| 789 | 841 | <div class="content"> |
| 790 | 842 | <div class="header"><?php esc_html_e( 'Enjoying MainWP?', 'mainwp' ); ?></div> |
| 791 | 843 | <div> |
| 792 | 844 | <?php if ( $addons ) : ?> |
| 793 | - <?php esc_html_e( 'You\'ve been using MainWP for a while and it looks like you\'ve built a solid setup with add-ons.', 'mainwp' ); ?> | |
| 845 | + <?php esc_html_e( 'You\'ve been using MainWP for a while and it looks like you\'ve built a solid setup with add-ons.', 'mainwp' ); ?> | |
| 794 | 846 | <?php else : ?> |
| 795 | - <?php esc_html_e( 'You\'ve been using MainWP for a while.', 'mainwp' ); ?> | |
| 847 | + <?php esc_html_e( 'You\'ve been using MainWP for a while.', 'mainwp' ); ?> | |
| 796 | 848 | <?php endif; ?> |
| 797 | 849 | </div> |
| 798 | 850 | <div><?php esc_html_e( 'If MainWP has been helpful, would you mind leaving a quick review on WordPress.org? It helps others find the plugin and supports ongoing improvements.', 'mainwp' ); ?></div> |
| 799 | 851 | </div> |
| @@ -1042,9 +1094,9 @@ | ||
| 1042 | 1094 | |
| 1043 | 1095 | if ( isset( $_GET['page'] ) && 'ManageClients' === $_GET['page'] && isset( $_GET['client_id'] ) && ! empty( $_GET['client_id'] ) ) { |
| 1044 | 1096 | $class_string .= ' mainwp-individual-client-overview '; |
| 1045 | 1097 | } |
| 1046 | - if ( isset( $_GET['page'] ) && ( 'CostTrackerSettings' === $_GET['page'] || 'ServerInformation' === $_GET['page'] || 'ServerInformationCron' === $_GET['page'] || 'ErrorLog' === $_GET['page'] || 'ActionLogs' === $_GET['page'] || 'PluginPrivacy' === $_GET['page'] || 'Settings' === $_GET['page'] || 'SettingsAdvanced' === $_GET['page'] || 'SettingsMonitors' === $_GET['page'] || 'SettingsEmail' === $_GET['page'] || 'MainWPTools' === $_GET['page'] || 'SettingsInsights' === $_GET['page'] || 'SettingsApiBackups' === $_GET['page'] || 'MonitoringSettings' === $_GET['page'] ) ) { | |
| 1098 | + if ( isset( $_GET['page'] ) && ( 'CostTrackerSettings' === $_GET['page'] || 'ServerInformation' === $_GET['page'] || 'ServerInformationCron' === $_GET['page'] || 'ErrorLog' === $_GET['page'] || 'ActionLogs' === $_GET['page'] || 'PluginPrivacy' === $_GET['page'] || 'Settings' === $_GET['page'] || 'SettingsAdvanced' === $_GET['page'] || 'SettingsMonitors' === $_GET['page'] || 'SettingsEmail' === $_GET['page'] || 'PremiumUpdates' === $_GET['page'] || 'MainWPTools' === $_GET['page'] || 'SettingsInsights' === $_GET['page'] || 'SettingsApiBackups' === $_GET['page'] || 'MonitoringSettings' === $_GET['page'] ) ) { | |
| 1047 | 1099 | $class_string .= ' mainwp-individual-site-view '; |
| 1048 | 1100 | } |
| 1049 | 1101 | if ( isset( $_GET['page'] ) && 'CostTrackerAdd' !== $_GET['page'] && ( ( isset( $_GET['id'] ) && ! empty( $_GET['id'] ) ) || ( isset( $_GET['dashboard'] ) && ! empty( $_GET['dashboard'] ) ) || ( isset( $_GET['updateid'] ) && ! empty( $_GET['updateid'] ) ) || ( isset( $_GET['monitor_wpid'] ) && ! empty( $_GET['monitor_wpid'] ) ) || ( isset( $_GET['emailsettingsid'] ) && ! empty( $_GET['emailsettingsid'] ) ) || ( isset( $_GET['scanid'] ) && ! empty( $_GET['scanid'] ) ) ) ) { |
| 1050 | 1102 | $class_string .= ' mainwp-individual-site-view '; |
| @@ -1097,8 +1149,9 @@ | ||
| 1097 | 1149 | <div class="bar"><div class="progress"></div></div> |
| 1098 | 1150 | <div class="label"></div> |
| 1099 | 1151 | </div> |
| 1100 | 1152 | <div class="scrolling content mainwp-modal-content"> |
| 1153 | + <div class="sync-sites-content-massage"></div> | |
| 1101 | 1154 | <div class="ui middle aligned divided list" id="sync-sites-status"> |
| 1102 | 1155 | <?php |
| 1103 | 1156 | if ( is_array( $websites ) ) { |
| 1104 | 1157 | $count = count( $websites ); |
| @@ -1137,8 +1190,16 @@ | ||
| 1137 | 1190 | } |
| 1138 | 1191 | } |
| 1139 | 1192 | ?> |
| 1140 | 1193 | </div> |
| 1194 | + </div> | |
| 1195 | + </div> | |
| 1196 | + | |
| 1197 | + <div class="ui modal" id="mainwp-prepare-data-modal"> | |
| 1198 | + <i class="mainwp-modal-close close icon"></i> | |
| 1199 | + <div class="header"><?php esc_html_e( 'Updating All', 'mainwp' ); ?></div> | |
| 1200 | + <div class="scrolling content mainwp-modal-content"> | |
| 1201 | + <div class="sync-sites-content-massage"></div> | |
| 1141 | 1202 | </div> |
| 1142 | 1203 | </div> |
| 1143 | 1204 | <input type="hidden" id="sync_selected_site_ids" value="" /> |
| 1144 | 1205 | <div class="ui tiny modal" id="mainwp-modal-confirm-select"> |