| @@ -6,8 +6,13 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace MainWP\Dashboard; |
| 9 | 9 | |
| 10 | +// Exit if accessed directly. | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; | |
| 13 | +} | |
| 14 | + | |
| 10 | 15 | /** |
| 11 | 16 | * Class MainWP_System_View |
| 12 | 17 | * |
| 13 | 18 | * @package MainWP\Dashboard |
| @@ -33,9 +38,9 @@ | ||
| 33 | 38 | |
| 34 | 39 | /** |
| 35 | 40 | * Method mainwp_add_translation() |
| 36 | 41 | * |
| 37 | - * Grab info needed to build array and strip chartacters "/[^A-Za-z0-9_]/". | |
| 42 | + * Grab info needed to build the translation array. | |
| 38 | 43 | * |
| 39 | 44 | * @param mixed $pArray Array of tranlatable text. |
| 40 | 45 | * @param mixed $pKey Key for each array enty. |
| 41 | 46 | * @param mixed $pText Text for each array entry. |
| @@ -44,10 +49,10 @@ | ||
| 44 | 49 | if ( ! is_array( $pArray ) ) { |
| 45 | 50 | $pArray = array(); |
| 46 | 51 | } |
| 47 | 52 | |
| 48 | - $strippedText = str_replace( ' ', '_', $pKey ); | |
| 49 | - $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 ); | |
| 50 | 55 | |
| 51 | 56 | $pArray[ $strippedText ] = $pText; |
| 52 | 57 | } |
| 53 | 58 | |
| @@ -53,16 +58,16 @@ | ||
| 53 | 58 | |
| 54 | 59 | $mainwpTranslations = array(); |
| 55 | 60 | mainwp_add_translation( $mainwpTranslations, 'Update settings.', esc_html__( 'Update settings.', 'mainwp' ) ); |
| 56 | 61 | mainwp_add_translation( $mainwpTranslations, 'Settings have been updated.', esc_html__( 'Settings have been updated.', 'mainwp' ) ); |
| 57 | - 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' ) ); | |
| 58 | 63 | mainwp_add_translation( $mainwpTranslations, 'Testing login.', esc_html__( 'Testing login.', 'mainwp' ) ); |
| 59 | 64 | mainwp_add_translation( $mainwpTranslations, 'Your login is valid.', esc_html__( 'Your login is valid.', 'mainwp' ) ); |
| 60 | 65 | mainwp_add_translation( $mainwpTranslations, 'Your login is invalid.', esc_html__( 'Your login is invalid.', 'mainwp' ) ); |
| 61 | - 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' ) ); | |
| 62 | 67 | mainwp_add_translation( $mainwpTranslations, 'more', esc_html__( 'more', 'mainwp' ) ); |
| 63 | 68 | mainwp_add_translation( $mainwpTranslations, 'less', esc_html__( 'less', 'mainwp' ) ); |
| 64 | - 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' ) ); | |
| 65 | 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' ) ); |
| 66 | 71 | mainwp_add_translation( $mainwpTranslations, 'Undefined error.', esc_html__( 'Undefined error.', 'mainwp' ) ); |
| 67 | 72 | mainwp_add_translation( $mainwpTranslations, 'PENDING', esc_html__( 'PENDING', 'mainwp' ) ); |
| 68 | 73 | mainwp_add_translation( $mainwpTranslations, 'UPDATING', esc_html__( 'UPDATING', 'mainwp' ) ); |
| @@ -72,8 +77,9 @@ | ||
| 72 | 77 | mainwp_add_translation( $mainwpTranslations, 'SYNCING', esc_html__( 'SYNCING', 'mainwp' ) ); |
| 73 | 78 | mainwp_add_translation( $mainwpTranslations, 'DISCONNECTED', esc_html__( 'DISCONNECTED', 'mainwp' ) ); |
| 74 | 79 | mainwp_add_translation( $mainwpTranslations, 'TIMEOUT', esc_html__( 'TIMEOUT', 'mainwp' ) ); |
| 75 | 80 | mainwp_add_translation( $mainwpTranslations, 'Ignored', esc_html__( 'Ignored', 'mainwp' ) ); |
| 81 | + /* translators: %1s: Item type (e.g. plugins, themes) */ | |
| 76 | 82 | mainwp_add_translation( $mainwpTranslations, 'No ignored %1s', esc_html__( 'No ignored %1s', 'mainwp' ) ); |
| 77 | 83 | mainwp_add_translation( $mainwpTranslations, 'No ignored %1 conflicts', esc_html__( 'No ignored %1 conflicts', 'mainwp' ) ); |
| 78 | 84 | mainwp_add_translation( $mainwpTranslations, 'No ignored plugins', esc_html__( 'No ignored plugins', 'mainwp' ) ); |
| 79 | 85 | mainwp_add_translation( $mainwpTranslations, 'No ignored themes', esc_html__( 'No ignored themes', 'mainwp' ) ); |
| @@ -106,9 +112,9 @@ | ||
| 106 | 112 | mainwp_add_translation( $mainwpTranslations, 'Please select websites or tags.', esc_html__( 'Please select websites or tags.', 'mainwp' ) ); |
| 107 | 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' ) ); |
| 108 | 114 | mainwp_add_translation( $mainwpTranslations, 'Removing the task..', esc_html__( 'Removing the task..', 'mainwp' ) ); |
| 109 | 115 | mainwp_add_translation( $mainwpTranslations, 'The task has been removed', esc_html__( 'The task has been removed', 'mainwp' ) ); |
| 110 | - 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' ) ); | |
| 111 | 117 | mainwp_add_translation( $mainwpTranslations, 'Connection test failed.', esc_html__( 'Connection test failed.', 'mainwp' ) ); |
| 112 | 118 | mainwp_add_translation( $mainwpTranslations, 'Error message:', esc_html__( 'Error message:', 'mainwp' ) ); |
| 113 | 119 | mainwp_add_translation( $mainwpTranslations, 'Received HTTP-code:', esc_html__( 'Received HTTP-code:', 'mainwp' ) ); |
| 114 | 120 | mainwp_add_translation( $mainwpTranslations, 'Connection test successful.', esc_html__( 'Connection test successful.', 'mainwp' ) ); |
| @@ -124,8 +130,16 @@ | ||
| 124 | 130 | mainwp_add_translation( $mainwpTranslations, 'Removing and deactivating the MainWP Child plugin..', esc_html__( 'Removing and deactivating the MainWP Child plugin..', 'mainwp' ) ); |
| 125 | 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' ) ); |
| 126 | 132 | mainwp_add_translation( $mainwpTranslations, 'The requested site has not been found', esc_html__( 'The requested site has not been found', 'mainwp' ) ); |
| 127 | 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' ) ); | |
| 128 | 142 | mainwp_add_translation( $mainwpTranslations, 'Paused import by user.', esc_html__( 'Paused import by user.', 'mainwp' ) ); |
| 129 | 143 | mainwp_add_translation( $mainwpTranslations, 'Continue', esc_html__( 'Continue', 'mainwp' ) ); |
| 130 | 144 | mainwp_add_translation( $mainwpTranslations, 'Continue import.', esc_html__( 'Continue import.', 'mainwp' ) ); |
| 131 | 145 | mainwp_add_translation( $mainwpTranslations, 'Pause', esc_html__( 'Pause', 'mainwp' ) ); |
| @@ -157,9 +171,9 @@ | ||
| 157 | 171 | mainwp_add_translation( $mainwpTranslations, 'Downloading the file.', esc_html__( 'Downloading the file.', 'mainwp' ) ); |
| 158 | 172 | mainwp_add_translation( $mainwpTranslations, 'Download from child completed.', esc_html__( 'Download from child completed.', 'mainwp' ) ); |
| 159 | 173 | mainwp_add_translation( $mainwpTranslations, 'Please wait while we are saving your note', esc_html__( 'Please wait while we are saving your note', 'mainwp' ) ); |
| 160 | 174 | mainwp_add_translation( $mainwpTranslations, 'Note saved.', esc_html__( 'Note saved.', 'mainwp' ) ); |
| 161 | - 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' ) ); | |
| 162 | 176 | mainwp_add_translation( $mainwpTranslations, 'Please search and select users for update password.', esc_html__( 'Please search and select users for update password.', 'mainwp' ) ); |
| 163 | 177 | mainwp_add_translation( $mainwpTranslations, 'All', esc_html__( 'All', 'mainwp' ) ); |
| 164 | 178 | mainwp_add_translation( $mainwpTranslations, 'Any', esc_html__( 'Any', 'mainwp' ) ); |
| 165 | 179 | mainwp_add_translation( $mainwpTranslations, 'HTTP error', esc_html__( 'HTTP error', 'mainwp' ) ); |
| @@ -190,9 +204,9 @@ | ||
| 190 | 204 | mainwp_add_translation( $mainwpTranslations, 'Show Shortcuts', esc_html__( 'Show Shortcuts', 'mainwp' ) ); |
| 191 | 205 | mainwp_add_translation( $mainwpTranslations, 'Are you sure?', esc_html__( 'Are you sure?', 'mainwp' ) ); |
| 192 | 206 | mainwp_add_translation( $mainwpTranslations, 'Bulk reconnect finished.', esc_html__( 'Bulk reconnect finished.', 'mainwp' ) ); |
| 193 | 207 | mainwp_add_translation( $mainwpTranslations, 'Note Saved', esc_html__( 'Note Saved', 'mainwp' ) ); |
| 194 | - 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' ) ); | |
| 195 | 209 | mainwp_add_translation( $mainwpTranslations, 'Download from child site completed.', esc_html__( 'Download from child site completed.', 'mainwp' ) ); |
| 196 | 210 | mainwp_add_translation( $mainwpTranslations, 'Please wait while we are saving your note', esc_html__( 'Please wait while we are saving your note', 'mainwp' ) ); |
| 197 | 211 | mainwp_add_translation( $mainwpTranslations, 'Installation Successful', esc_html__( 'Installation Successful', 'mainwp' ) ); |
| 198 | 212 | mainwp_add_translation( $mainwpTranslations, 'Upload to %1 (%2) successful.', esc_html__( 'Upload to %1 (%2) successful.', 'mainwp' ) ); |
| @@ -204,9 +218,11 @@ | ||
| 204 | 218 | mainwp_add_translation( $mainwpTranslations, 'Updating', esc_html__( 'Updating', 'mainwp' ) ); |
| 205 | 219 | mainwp_add_translation( $mainwpTranslations, 'Please enter a valid name for your backup task', esc_html__( 'Please enter a valid name for your backup task', 'mainwp' ) ); |
| 206 | 220 | mainwp_add_translation( $mainwpTranslations, 'The backup task was added successfully', esc_html__( 'The backup task was added successfully', 'mainwp' ) ); |
| 207 | 221 | mainwp_add_translation( $mainwpTranslations, 'Bulk test connection finished', esc_html__( 'Bulk test connection finished', 'mainwp' ) ); |
| 222 | + /* translators: %1: Opening anchor tag, %2: Closing anchor tag, %3: HTTP status code number */ | |
| 208 | 223 | mainwp_add_translation( $mainwpTranslations, 'To find out more about what your HTTP status code means please %1click here%2 to locate your number (%3)', esc_html__( 'To find out more about what your HTTP status code means please %1click here%2 to locate your number (%3)', 'mainwp' ) ); |
| 224 | + /* translators: %1: Opening anchor tag, %2: Closing anchor tag */ | |
| 209 | 225 | mainwp_add_translation( $mainwpTranslations, 'Refreshing the page for Step 3 "Grab API Keys" in 5 seconds... if refresh fails please %1click here%2.', esc_html__( 'Refreshing the page for Step 3 "Grab API Keys" in 5 seconds... if refresh fails please %1click here%2.', 'mainwp' ) ); |
| 210 | 226 | mainwp_add_translation( $mainwpTranslations, 'No ignored abandoned plugins', esc_html__( 'No ignored abandoned plugins', 'mainwp' ) ); |
| 211 | 227 | mainwp_add_translation( $mainwpTranslations, 'Please upload plugins to install.', esc_html__( 'Please upload plugins to install.', 'mainwp' ) ); |
| 212 | 228 | mainwp_add_translation( $mainwpTranslations, 'Please upload themes to install.', esc_html__( 'Please upload themes to install.', 'mainwp' ) ); |
| @@ -219,8 +235,13 @@ | ||
| 219 | 235 | mainwp_add_translation( $mainwpTranslations, 'Would you like to use the Bulk Settings Manager with this theme? Check out the %1Documentation%2.', esc_html__( 'Would you like to use the Bulk Settings Manager with this theme? Check out the %1Documentation%2.', 'mainwp' ) ); |
| 220 | 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' ) ); |
| 221 | 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' ) ); |
| 222 | 238 | mainwp_add_translation( $mainwpTranslations, 'is_activated_theme', esc_html__( '%1 could not be deleted. This theme is active theme.', 'mainwp' ) ); |
| 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' ) ); | |
| 223 | 244 | |
| 224 | 245 | return $mainwpTranslations; |
| 225 | 246 | } |
| 226 | 247 | |
| @@ -258,10 +279,10 @@ | ||
| 258 | 279 | tr[data-plugin="<?php echo esc_attr( $plugin_slug ); ?>"] { |
| 259 | 280 | box-shadow: none; |
| 260 | 281 | } |
| 261 | 282 | </style> |
| 262 | - <tr class="plugin-update-tr active" slug="<?php echo esc_attr( $slug ); ?>"><td colspan="3" class="plugin-update colspanchange"><div class="update-message api-deactivate"> | |
| 263 | - <?php printf( esc_html__( 'You have a MainWP Extension that does not have an active API entered. This means you will not receive updates or support. Please visit the %1$sExtensions%2$s page and enter your API.', 'mainwp' ), '<a href="admin.php?page=Extensions">', '</a>' ); ?> | |
| 283 | + <tr class="plugin-update-tr active" slug="<?php echo esc_attr( $slug ); ?>"><td colspan="4" class="plugin-update colspanchange"><div class="update-message api-deactivate"> | |
| 284 | + <?php /* translators: 1: Opening link tag, 2: Closing link tag */ printf( esc_html__( 'You have a MainWP Extension that does not have an active API entered. This means you will not receive updates or support. Please visit the %1$sExtensions%2$s page and enter your API.', 'mainwp' ), '<a href="admin.php?page=Extensions">', '</a>' ); ?> | |
| 264 | 285 | <span class="mainwp-right"><a href="#" class="mainwp-activate-notice-dismiss" ><i class="times circle icon"></i> <?php esc_html_e( 'Dismiss', 'mainwp' ); ?></a></span> |
| 265 | 286 | </div></td></tr> |
| 266 | 287 | <?php |
| 267 | 288 | } |
| @@ -273,11 +294,11 @@ | ||
| 273 | 294 | */ |
| 274 | 295 | public static function mainwp_4_update_notice() { |
| 275 | 296 | if ( MainWP_Utility::show_mainwp_message( 'notice', 'upgrade_4' ) ) { |
| 276 | 297 | ?> |
| 277 | - <div class="ui icon message yellow" style="margin-bottom: 0; border-radius: 0;"> | |
| 298 | + <div class="ui icon message yellow"> | |
| 278 | 299 | <i class="exclamation circle icon"></i> |
| 279 | - <strong><?php echo esc_html__( 'Important Notice: ', 'mainwp' ); ?></strong> <?php printf( esc_html__( 'MainWP Version 4 is a major upgrade from MainWP Version 3. Please, read this %1$supdating FAQ%2$s.', 'mainwp' ), '<a href="https://kb.mainwp.com/docs/faq-on-upgrading-from-mainwp-version-3-to-mainwp-version-4/" target="_blank">', '</a> <i class="external alternate icon"></i>' ); // NOSONAR - noopener - open safe. ?> | |
| 300 | + <strong><?php echo esc_html__( 'Important Notice: ', 'mainwp' ); ?></strong> <?php /* translators: 1: Opening link tag, 2: Closing link tag with icon */ printf( esc_html__( 'MainWP Version 4 is a major upgrade from MainWP Version 3. Please, read this %1$supdating FAQ%2$s.', 'mainwp' ), '<a href="https://docs.mainwp.com/" target="_blank">', '</a> <i class="external alternate icon"></i>' ); // NOSONAR - noopener - open safe. ?> | |
| 280 | 301 | <i class="close icon mainwp-notice-dismiss" notice-id="upgrade_4"></i> |
| 281 | 302 | </div> |
| 282 | 303 | <?php |
| 283 | 304 | } |
| @@ -293,15 +314,15 @@ | ||
| 293 | 314 | ?> |
| 294 | 315 | <div class="ui modal" id="mainwp-v5-update-notice-modal"> |
| 295 | 316 | <i class="close icon mainwp-notice-dismiss" notice-id="upgrade_version5"></i> |
| 296 | 317 | <div class="header"> |
| 297 | - <?php echo esc_html__( 'MainWP 5.0 Update Notice', 'mainwp' ); ?> | |
| 318 | + <?php echo esc_html__( 'MainWP 5.0 Update Notice', 'mainwp' ); ?> | |
| 298 | 319 | </div> |
| 299 | 320 | <div class="content"> |
| 300 | 321 | <h3 class="ui header"> |
| 301 | 322 | <i class="sync alternate icon"></i> |
| 302 | 323 | <div class="content"> |
| 303 | - <?php echo esc_html__( 'Hard Refresh Required', 'mainwp' ); ?> | |
| 324 | + <?php echo esc_html__( 'Hard Refresh Required', 'mainwp' ); ?> | |
| 304 | 325 | |
| 305 | 326 | </div> |
| 306 | 327 | </h3> |
| 307 | 328 | <div class="ui hidden divider"></div> |
| @@ -318,9 +339,9 @@ | ||
| 318 | 339 | |
| 319 | 340 | <h3 class="ui header"> |
| 320 | 341 | <i class="linkify icon"></i> |
| 321 | 342 | <div class="content"> |
| 322 | - <?php echo esc_html__( 'Extensions License Reactivation Required', 'mainwp' ); ?> | |
| 343 | + <?php echo esc_html__( 'Extensions License Reactivation Required', 'mainwp' ); ?> | |
| 323 | 344 | |
| 324 | 345 | </div> |
| 325 | 346 | </h3> |
| 326 | 347 | <div class="ui hidden divider"></div> |
| @@ -363,9 +384,9 @@ | ||
| 363 | 384 | ?> |
| 364 | 385 | <div class="ui modal" id="mainwp-v502-update-notice-modal"> |
| 365 | 386 | <i class="close icon mainwp-notice-dismiss" notice-id="upgrade_version502"></i> |
| 366 | 387 | <div class="header"> |
| 367 | - <?php echo esc_html__( 'MainWP 5.0.2 Update Notice', 'mainwp' ); ?> | |
| 388 | + <?php echo esc_html__( 'MainWP 5.0.2 Update Notice', 'mainwp' ); ?> | |
| 368 | 389 | </div> |
| 369 | 390 | <div class="content"> |
| 370 | 391 | <div><?php echo esc_html__( 'Please perform a hard refresh of your browser to ensure optimal performance and access to all new features.', 'mainwp' ); ?></div> |
| 371 | 392 | <br/> |
| @@ -395,8 +416,29 @@ | ||
| 395 | 416 | } |
| 396 | 417 | } |
| 397 | 418 | |
| 398 | 419 | /** |
| 420 | + * MainWP Version ver 6.1 update Notice. | |
| 421 | + * | |
| 422 | + * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() | |
| 423 | + */ | |
| 424 | + public static function mainwp_ver61_update_notice() { | |
| 425 | + if ( MainWP_Utility::show_mainwp_message( 'notice', 'upgrade_version61' ) && MainWP_DB::instance()->get_websites_count() > 0 ) { | |
| 426 | + ?> | |
| 427 | + <div class="ui attention message"> | |
| 428 | + <div class="header"><?php esc_html_e( 'Important Rollback Notice', 'mainwp' ); ?></div> | |
| 429 | + <div> | |
| 430 | + <p><?php esc_html_e( 'Version 6.1 includes internal connection handling changes. If you roll back to a version earlier than 6.1, child sites may temporarily lose connection to your MainWP Dashboard.', 'mainwp' ); ?></p> | |
| 431 | + <p><?php esc_html_e( 'This can be easily resolved by reconnecting the sites. To reconnect multiple sites at once, go to the Manage Sites page and use the Reconnect bulk action.', 'mainwp' ); ?></p> | |
| 432 | + <a href="https://docs.mainwp.com/sites/management/manage-child-sites#reconnect-a-child-site" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Learn how to reconnect sites.', 'mainwp' ); ?></a> | |
| 433 | + </div> | |
| 434 | + <i class="close icon mainwp-notice-dismiss" notice-id="upgrade_version61"></i> | |
| 435 | + </div> | |
| 436 | + <?php | |
| 437 | + } | |
| 438 | + } | |
| 439 | + | |
| 440 | + /** | |
| 399 | 441 | * MainWP Version ver 5 update Notice. |
| 400 | 442 | * |
| 401 | 443 | * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() |
| 402 | 444 | */ |
| @@ -402,9 +444,9 @@ | ||
| 402 | 444 | */ |
| 403 | 445 | public static function mainwp_ver5_update_clear_cache_notice() { |
| 404 | 446 | if ( MainWP_Utility::show_mainwp_message( 'notice', 'upgrade_ver5_clear_cache' ) ) { |
| 405 | 447 | ?> |
| 406 | - <div class="ui message info" style="margin-bottom: 0; border-radius: 0;"> | |
| 448 | + <div class="ui message info"> | |
| 407 | 449 | <div><?php echo esc_html__( 'Please perform a hard refresh of your browser to ensure optimal performance and access to all new features. This step is crucial for loading the latest updates effectively.', 'mainwp' ); ?></div> |
| 408 | 450 | <div class="ui list"> |
| 409 | 451 | <div class="item"><?php echo esc_html__( 'Windows users: Press `Ctrl + F5`', 'mainwp' ); ?></div> |
| 410 | 452 | <div class="item"><?php echo esc_html__( 'Mac users: Press `Command + R`', 'mainwp' ); ?></div> |
| @@ -425,37 +467,102 @@ | ||
| 425 | 467 | * @uses \MainWP\Dashboard\MainWP_Server_Information_Handler::is_openssl_config_warning() |
| 426 | 468 | */ |
| 427 | 469 | public static function admin_notices() { |
| 428 | 470 | |
| 429 | - $current_options = get_option( 'mainwp_showhide_events_notice' ); | |
| 430 | - if ( ! is_array( $current_options ) ) { | |
| 431 | - $current_options = array(); | |
| 432 | - } | |
| 471 | + static::mainwp_tmpfile_check(); | |
| 433 | 472 | |
| 434 | - static::render_notice_version(); | |
| 473 | + static::render_extension_update_failure_notice(); | |
| 435 | 474 | |
| 436 | 475 | static::render_notice_config_warning(); |
| 437 | 476 | |
| 438 | - if ( is_multisite() && ( ! isset( $current_options['hide_multi_site_notice'] ) || empty( $current_options['hide_multi_site_notice'] ) ) ) { | |
| 439 | - static::render_notice_multi_sites(); | |
| 440 | - } | |
| 477 | + static::render_notice_multi_sites(); | |
| 441 | 478 | |
| 442 | - if ( ( ! isset( $current_options['trust_child'] ) || empty( $current_options['trust_child'] ) ) && MainWP_System::is_mainwp_pages() && ! MainWP_Plugins_Handler::check_auto_update_plugin( 'mainwp-child/mainwp-child.php' ) ) { | |
| 443 | - static::render_notice_trust_update(); | |
| 444 | - } | |
| 479 | + static::render_wp_mail_warning(); | |
| 445 | 480 | |
| 446 | - static::render_trours_notice(); | |
| 481 | + static::render_consumer_secret_migration_failed_notice(); | |
| 447 | 482 | |
| 448 | - static::check_rating_notice( $current_options ); | |
| 483 | + static::render_secure_priv_key_connection(); | |
| 449 | 484 | |
| 450 | - static::render_wp_mail_warning(); | |
| 485 | + static::render_notice_php_version8(); | |
| 451 | 486 | |
| 487 | + static::render_notice_trust_update(); | |
| 488 | + | |
| 489 | + static::render_mainwp_themes_deprecation_notice(); | |
| 490 | + | |
| 491 | + static::render_tours_notice(); | |
| 492 | + | |
| 493 | + static::check_rating_notice(); | |
| 494 | + | |
| 452 | 495 | static::render_browser_extensions_notice(); |
| 453 | 496 | |
| 454 | - static::mainwp_tmpfile_check(); | |
| 455 | 497 | } |
| 456 | 498 | |
| 457 | 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 | + /** | |
| 538 | + * Render MainWP themes deprecation notice. | |
| 539 | + * | |
| 540 | + * @uses \MainWP\Dashboard\MainWP_Settings::get_instance() | |
| 541 | + * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() | |
| 542 | + */ | |
| 543 | + public static function render_mainwp_themes_deprecation_notice() { | |
| 544 | + $selected_theme = MainWP_Settings::get_instance()->get_selected_theme(); | |
| 545 | + $legacy_themes = array( 'dark', 'wpadmin', 'minimalistic', 'classic', 'default-2024' ); | |
| 546 | + | |
| 547 | + if ( in_array( $selected_theme, $legacy_themes, true ) && MainWP_Utility::show_mainwp_message( 'notice', 'mainwp_themes_deprecation_notice' ) ) { | |
| 548 | + $message_class = 'default-2024' === $selected_theme ? 'attention' : 'yellow'; | |
| 549 | + ?> | |
| 550 | + <div class="ui <?php echo esc_attr( $message_class ); ?> message"> | |
| 551 | + <div class="header"><?php esc_html_e( 'MainWP Dashboard Theme Support Notice', 'mainwp' ); ?></div> | |
| 552 | + <div> | |
| 553 | + <?php | |
| 554 | + /* translators: 1: Opening anchor tag, 2: Closing anchor tag */ | |
| 555 | + printf( esc_html__( 'You\'re currently using a legacy or custom MainWP theme. With MainWP v6, only Light and Dark themes are actively maintained. Your current theme will keep working for now, but it may not receive updates and could have visual issues in future releases. Switch anytime in %1$sMainWP → Tools%2$s.', 'mainwp' ), '<a href="' . esc_url( admin_url( 'admin.php?page=MainWPTools' ) ) . '">', '</a>' ); | |
| 556 | + ?> | |
| 557 | + </div> | |
| 558 | + <i class="close icon mainwp-notice-dismiss" notice-id="mainwp_themes_deprecation_notice"></i> | |
| 559 | + </div> | |
| 560 | + <?php | |
| 561 | + } | |
| 562 | + } | |
| 563 | + | |
| 564 | + /** | |
| 458 | 565 | * Method mainwp_tmpfile_check() |
| 459 | 566 | * |
| 460 | 567 | * Checks if the `tmpfile()` PHP function is disabled. |
| 461 | 568 | */ |
| @@ -462,24 +569,31 @@ | ||
| 462 | 569 | public static function mainwp_tmpfile_check() { |
| 463 | 570 | if ( MainWP_Demo_Handle::is_instawp_site() ) { |
| 464 | 571 | return; |
| 465 | 572 | } |
| 466 | - $disabled_functions = ini_get( 'disable_functions' ); | |
| 467 | - if ( '' !== $disabled_functions ) { | |
| 468 | - $disabled_functions_array = explode( ',', $disabled_functions ); | |
| 469 | - if ( in_array( 'tmpfile', $disabled_functions_array ) && MainWP_Utility::show_mainwp_message( 'notice', 'tmpfile_notice' ) ) { | |
| 470 | - ?> | |
| 471 | - <div class="ui red message" style="margin-bottom: 0; border-radius: 0;"> | |
| 472 | - <i class="close icon mainwp-notice-dismiss" notice-id="tmpfile_notice"></i> | |
| 473 | - <div><?php esc_html_e( 'tmpfile() function is currently disabled on your server.', 'mainwp' ); ?></div> | |
| 474 | - <div><?php esc_html_e( 'This function is essential for creating temporary files, and its unavailability may affect certain functionalities of your MainWP Dashboard.', 'mainwp' ); ?></div> | |
| 475 | - <div><?php esc_html_e( 'If you are unsure how to enable it, please contact your host support and have them do it for you.', 'mainwp' ); ?></div> | |
| 476 | - </div> | |
| 477 | - <?php | |
| 478 | - } | |
| 573 | + if ( ! static::is_tmpfile_enable() && MainWP_Utility::show_mainwp_message( 'notice', 'tmpfile_notice' ) ) { | |
| 574 | + ?> | |
| 575 | + <div class="ui red message"> | |
| 576 | + <div class="header"><?php esc_html_e( 'Server configuration required (tmpfile disabled)', 'mainwp' ); ?></div> | |
| 577 | + <div><?php esc_html_e( 'Your server has tmpfile() disabled. MainWP uses temporary files for some background tasks, so parts of the Dashboard may not work correctly until this is enabled. Please ask your host to enable tmpfile() (PHP function).', 'mainwp' ); ?></div> | |
| 578 | + <i class="close icon mainwp-notice-dismiss" notice-id="tmpfile_notice"></i> | |
| 579 | + </div> | |
| 580 | + <?php | |
| 479 | 581 | } |
| 480 | 582 | } |
| 481 | 583 | |
| 584 | + /** | |
| 585 | + * Method is_tmpfile_enable() | |
| 586 | + * | |
| 587 | + * Checks if the `tmpfile()` PHP function is enable. | |
| 588 | + */ | |
| 589 | + public static function is_tmpfile_enable() { | |
| 590 | + if ( ! function_exists( '\tmpfile' ) ) { | |
| 591 | + return false; | |
| 592 | + } | |
| 593 | + $disabled_functions = ini_get( 'disable_functions' ); | |
| 594 | + return '' !== $disabled_functions && false !== stripos( $disabled_functions, 'tmpfile' ) ? false : true; | |
| 595 | + } | |
| 482 | 596 | |
| 483 | 597 | /** |
| 484 | 598 | * Renders Browsers extensions notice. |
| 485 | 599 | * |
| @@ -485,19 +599,17 @@ | ||
| 485 | 599 | * |
| 486 | 600 | * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() |
| 487 | 601 | */ |
| 488 | 602 | public static function render_browser_extensions_notice() { |
| 489 | - $is_demo = MainWP_Demo_Handle::is_demo_mode(); | |
| 490 | - if ( MainWP_DB::instance()->get_websites_count() > 4 && ! $is_demo && MainWP_Utility::show_mainwp_message( 'notice', 'mainwp_browser_extensions_notice' ) ) { | |
| 603 | + if ( MainWP_DB::instance()->get_websites_count() > 4 && MainWP_Utility::show_mainwp_message( 'notice', 'mainwp_browser_extensions_notice' ) ) { | |
| 491 | 604 | ?> |
| 492 | - <div class="ui info message" style="margin-bottom: 0; border-radius: 0;"> | |
| 493 | - <h3><?php esc_html_e( 'Track Updates and Non-MainWP Changes from Your Browser!', 'mainwp' ); ?></h3> | |
| 605 | + <div class="ui info message"> | |
| 606 | + <div class="header"><?php esc_html_e( 'Track Updates and Non-MainWP Changes from Your Browser!', 'mainwp' ); ?></div> | |
| 494 | 607 | <div><?php esc_html_e( 'The MainWP Browser Extension helps you easily track available updates across all your connected Child Sites, including changes to your plugins and themes status made outside your MainWP Dashboard.', 'mainwp' ); ?></div> |
| 495 | 608 | <div><?php esc_html_e( 'The extension quickly connects to your MainWP Dashboard via MainWP REST API, eliminating the need to log in to your MainWP Dashboard repeatedly to check available updates and non-MainWP changes.', 'mainwp' ); ?></div> |
| 496 | 609 | <br/> |
| 497 | 610 | <div> |
| 498 | 611 | <a href="https://chrome.google.com/webstore/detail/mainwp-browser-extension/kjlehednpnfgplekjminjpocdechbnge" target="_blank" class="ui green tiny button"><i class="chrome icon"></i> <?php echo esc_html__( 'Get Chrome Extension', 'mainwp' ); ?></a> |
| 499 | - <a href="https://addons.mozilla.org/en-US/firefox/addon/mainwp-browser-extension/" target="_blank" class="ui green tiny button"><i class="firefox icon"></i> <?php echo esc_html__( 'Get Firefox Extension', 'mainwp' ); ?></a> | |
| 500 | 612 | <a href="https://mainwp.com/mainwp-browser-extension/" target="_blank" class="ui tiny button"><?php echo esc_html__( 'Read More', 'mainwp' ); // NOSONAR - noopener - open safe. ?></a> |
| 501 | 613 | </div> |
| 502 | 614 | <i class="close icon mainwp-notice-dismiss" notice-id="mainwp_browser_extensions_notice"></i> |
| 503 | 615 | </div> |
| @@ -505,8 +617,48 @@ | ||
| 505 | 617 | } |
| 506 | 618 | } |
| 507 | 619 | |
| 508 | 620 | /** |
| 621 | + * Renders Browsers extensions notice. | |
| 622 | + * | |
| 623 | + * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() | |
| 624 | + */ | |
| 625 | + public static function render_secure_priv_key_connection() { | |
| 626 | + if ( MainWP_DB::instance()->get_websites_count() > 0 && ! static::check_keys_encrypted() && MainWP_Utility::show_mainwp_message( 'notice', 'mainwp_secure_priv_key_notice' ) ) { | |
| 627 | + ?> | |
| 628 | + <div class="ui attention message"> | |
| 629 | + <div class="header"><?php esc_html_e( 'New Security Feature: OpenSSL Key Encryption', 'mainwp' ); ?></div> | |
| 630 | + <div><?php esc_html_e( 'To enhance security, we\'ve added a feature to encrypt your private keys stored in the database. This provides an extra layer of protection in the unlikely event your database is compromised.', 'mainwp' ); ?> <a href="https://docs.mainwp.com/sites/management/mainwp-dashboard-settings#force-new-openssl-keys" target="_blank"><?php esc_html_e( 'Learn more here.', 'mainwp' ); ?></a></div> | |
| 631 | + <p><button class="ui green mini button" id="increase-connection-security-btn"><?php echo esc_html__( 'Encrypt Keys Now', 'mainwp' ); ?></button></p> | |
| 632 | + <i class="close icon mainwp-notice-dismiss" notice-id="mainwp_secure_priv_key_notice"></i> | |
| 633 | + </div> | |
| 634 | + <?php | |
| 635 | + } | |
| 636 | + } | |
| 637 | + | |
| 638 | + /** | |
| 639 | + * Method check_keys_encrypted(). | |
| 640 | + * | |
| 641 | + * @return bool Keys encrypted or not. | |
| 642 | + */ | |
| 643 | + public static function check_keys_encrypted() { | |
| 644 | + if ( get_option( 'mainwp_keys_is_encrypted' ) ) { | |
| 645 | + return true; | |
| 646 | + } | |
| 647 | + $websites = MainWP_DB::instance()->query( MainWP_DB::instance()->get_sql_websites_for_current_user( false, null, 'wp.url', false, false, null, true ) ); | |
| 648 | + while ( $websites && ( $website = MainWP_DB::fetch_object( $websites ) ) ) { | |
| 649 | + // try to decrypt priv key. | |
| 650 | + $de_privkey = MainWP_Encrypt_Data_Lib::instance()->decrypt_privkey( base64_decode( $website->privkey ), $website->id ); // phpcs:ignore -- NOSONAR - base64_encode trust. | |
| 651 | + if ( ! empty( $de_privkey ) ) { | |
| 652 | + update_option( 'mainwp_keys_is_encrypted', 1 ); | |
| 653 | + return true; | |
| 654 | + } | |
| 655 | + } | |
| 656 | + return false; | |
| 657 | + } | |
| 658 | + | |
| 659 | + | |
| 660 | + /** | |
| 509 | 661 | * Renders wp_mail warning. |
| 510 | 662 | */ |
| 511 | 663 | public static function render_wp_mail_warning() { |
| 512 | 664 | $mail_failed = get_option( 'mainwp_notice_wp_mail_failed' ); |
| @@ -511,10 +663,11 @@ | ||
| 511 | 663 | public static function render_wp_mail_warning() { |
| 512 | 664 | $mail_failed = get_option( 'mainwp_notice_wp_mail_failed' ); |
| 513 | 665 | if ( 'yes' === $mail_failed ) { |
| 514 | 666 | ?> |
| 515 | - <div class="ui yellow message" style="margin-bottom: 0; border-radius: 0;"> | |
| 516 | - <?php echo esc_html__( 'wp_mail() error detected! It is more than likely that your MainWP Dashboard will fail to send any email. Please check for possible plugin conflicts with your Dashboard or contact your host support to determine why the wp_mail() function fails.', 'mainwp' ); ?> | |
| 667 | + <div class="ui yellow message"> | |
| 668 | + <div class="header"><?php esc_html_e( 'Email sending failed (wp_mail)', 'mainwp' ); ?></div> | |
| 669 | + <div><?php esc_html_e( 'Your Dashboard failed to send email using wp_mail(). This may affect alerts, reports, and notifications. Common causes include SMTP/server configuration or a plugin conflict. Check your email setup or contact your host for help.', 'mainwp' ); ?></div> | |
| 517 | 670 | <i class="close icon mainwp-notice-dismiss" notice-id="mail_failed"></i> |
| 518 | 671 | </div> |
| 519 | 672 | <?php |
| 520 | 673 | } |
| @@ -520,44 +673,76 @@ | ||
| 520 | 673 | } |
| 521 | 674 | } |
| 522 | 675 | |
| 523 | 676 | /** |
| 524 | - * Renders PHP Version Notice. | |
| 677 | + * Renders a notice when the consumer_secret schema migration did not complete. | |
| 525 | 678 | * |
| 679 | + * The migration in MainWP_Install::update_optimize_indexes_55() widens | |
| 680 | + * wp_mainwp_api_keys.consumer_secret to varchar(255) so that hashed | |
| 681 | + * secrets fit. If the ALTER TABLE silently fails on the host, modern | |
| 682 | + * bcrypt hashes get truncated and authentication breaks for any newly | |
| 683 | + * created API key. The flag option is set when the post-migration | |
| 684 | + * SHOW COLUMNS check finds the column still narrower than expected. | |
| 685 | + */ | |
| 686 | + public static function render_consumer_secret_migration_failed_notice() { | |
| 687 | + $failed_at = get_option( 'mainwp_notice_consumer_secret_migration_failed' ); | |
| 688 | + if ( empty( $failed_at ) ) { | |
| 689 | + return; | |
| 690 | + } | |
| 691 | + ?> | |
| 692 | + <div class="ui red message"> | |
| 693 | + <div class="header"><?php esc_html_e( 'REST API keys table upgrade did not complete', 'mainwp' ); ?></div> | |
| 694 | + <div> | |
| 695 | + <?php esc_html_e( 'A database upgrade for the REST API keys table did not complete on this site. New API keys created on this version may not authenticate correctly until the upgrade runs successfully. Existing API keys are unaffected. Please contact MainWP support so we can help diagnose the underlying database error.', 'mainwp' ); ?> | |
| 696 | + </div> | |
| 697 | + </div> | |
| 698 | + <?php | |
| 699 | + } | |
| 700 | + | |
| 701 | + /** | |
| 702 | + * Renders PHP 8.0 Version Notice. | |
| 703 | + * | |
| 526 | 704 | * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() |
| 527 | 705 | */ |
| 528 | - public static function render_notice_version() { | |
| 706 | + public static function render_notice_php_version8() { | |
| 529 | 707 | $phpver = phpversion(); |
| 530 | - if ( version_compare( $phpver, '7.0', '<' ) && MainWP_Utility::show_mainwp_message( 'notice', 'phpver_5_5' ) ) { | |
| 531 | - ?> | |
| 532 | - <div class="ui icon yellow message" style="margin-bottom: 0; border-radius: 0;"> | |
| 533 | - <i class="exclamation circle icon"></i> | |
| 534 | - <?php printf( esc_html__( 'Your server is currently running PHP version %1$s. In the next few months your MainWP Dashboard will require PHP 7.4 as a minimum. Please upgrade your server to at least 7.4 but we recommend PHP 8 or newer. You can find a template email to send your host %2$shere%3$s.', 'mainwp' ), esc_html( $phpver ), '<a href="https://wordpress.org/about/requirements/" target="_blank">', '</a>' ); ?> | |
| 535 | - <i class="close icon mainwp-notice-dismiss" notice-id="phpver_5_5"></i> | |
| 536 | - </div> | |
| 537 | - <?php | |
| 708 | + if ( version_compare( $phpver, '8.0', '<' ) ) { | |
| 709 | + $last_hidden = (int) get_user_option( 'lasttime_hidden_phpver_8_0' ); | |
| 710 | + if ( time() > $last_hidden + 30 * DAY_IN_SECONDS || MainWP_Utility::show_mainwp_message( 'notice', 'phpver_8_0' ) ) { | |
| 711 | + ?> | |
| 712 | + <div class="ui attention message"> | |
| 713 | + <div class="header"><?php esc_html_e( 'Upcoming PHP requirement (Dashboard)', 'mainwp' ); ?></div> | |
| 714 | + <?php esc_html_e( 'In the coming months, MainWP Dashboard will require PHP 8.1+. To avoid issues and stay secure, please update your Dashboard site to a supported version (for example PHP 8.3).', 'mainwp' ); ?> | |
| 715 | + <?php /* translators: 1: Opening link tag, 2: Closing link tag */ printf( esc_html__( 'You can check the list of actively maintained PHP versions %1$shere%2$s.', 'mainwp' ), '<a href="https://www.php.net/supported-versions.php" target="_blank">', '</a>' ); ?> | |
| 716 | + <br/><br/> | |
| 717 | + <strong><?php esc_html_e( 'This change affects only your MainWP Dashboard site, not your connected child sites.', 'mainwp' ); ?></strong> | |
| 718 | + <i class="close icon mainwp-notice-dismiss" notice-id="phpver_8_0"></i> | |
| 719 | + </div> | |
| 720 | + <?php | |
| 721 | + } | |
| 538 | 722 | } |
| 539 | 723 | } |
| 540 | 724 | |
| 725 | + | |
| 541 | 726 | /** |
| 542 | 727 | * Renders Guided Tours Notice. |
| 543 | 728 | * |
| 544 | 729 | * @uses \MainWP\Dashboard\MainWP_Utility::show_mainwp_message() |
| 545 | 730 | */ |
| 546 | - public static function render_trours_notice() { | |
| 547 | - if ( 0 === (int) get_option( 'mainwp_enable_guided_tours', 0 ) && MainWP_Utility::show_mainwp_message( 'notice', 'mainwp_guided_tours_notice' ) ) { | |
| 731 | + public static function render_tours_notice() { | |
| 732 | + if ( MainWP_DB::instance()->get_websites_count() > 4 && 0 === (int) get_option( 'mainwp_enable_guided_tours', 0 ) && MainWP_Utility::show_mainwp_message( 'notice', 'mainwp_guided_tours_notice' ) ) { | |
| 548 | 733 | ?> |
| 549 | - <div class="ui info message" style="margin-bottom: 0; border-radius: 0;"> | |
| 550 | - <h3><?php esc_html_e( 'Would you like to turn on guided tours?', 'mainwp' ); ?> <span class="ui green mini label"><?php esc_html_e( 'RECOMMENDED', 'mainwp' ); ?></span></h3> | |
| 551 | - <div><?php esc_html_e( 'MainWP guided tours are designed to provide information about all essential features on each MainWP Dashboard page.', 'mainwp' ); ?></div> | |
| 734 | + <div class="ui info message"> | |
| 735 | + <div class="header"><?php esc_html_e( 'Enable guided tours?', 'mainwp' ); ?></div> | |
| 736 | + <div><?php esc_html_e( 'Guided tours highlight essential features on each Dashboard page. You can turn them off anytime.', 'mainwp' ); ?></div> | |
| 737 | + <div class="ui hidden divider"></div> | |
| 552 | 738 | <div class="ui form"> |
| 553 | - <div class="field"> | |
| 554 | - <div class="ui hidden divider"></div> | |
| 555 | - <div class="ui toggle checkbox"> | |
| 556 | - <input type="checkbox" name="mainwp-select-guided-tours-option" onchange="mainwp_guidedtours_onchange(this);" id="mainwp-select-guided-tours-option" <?php echo 1 === (int) get_option( 'mainwp_enable_guided_tours', 0 ) ? 'checked="true"' : ''; ?>> | |
| 557 | - <label for="mainwp-select-guided-tours-option"><?php esc_html_e( 'Select to enable the MainWP Guided Tours.', 'mainwp' ); ?></label> | |
| 739 | + <div class="field"> | |
| 740 | + <div class="ui toggle checkbox"> | |
| 741 | + <input type="checkbox" name="mainwp-select-guided-tours-option" onchange="mainwp_guidedtours_onchange(this);" id="mainwp-select-guided-tours-option" <?php echo 1 === (int) get_option( 'mainwp_enable_guided_tours', 0 ) ? 'checked="true"' : ''; ?>> | |
| 742 | + <label for="mainwp-select-guided-tours-option"><?php esc_html_e( 'Select to enable the MainWP Guided Tours.', 'mainwp' ); ?></label> | |
| 743 | + </div> | |
| 558 | 744 | </div> |
| 559 | - </div> | |
| 560 | 745 | </div> |
| 561 | 746 | <i class="close icon mainwp-notice-dismiss" notice-id="mainwp_guided_tours_notice"></i> |
| 562 | 747 | </div> |
| 563 | 748 | <?php |
| @@ -571,13 +756,13 @@ | ||
| 571 | 756 | */ |
| 572 | 757 | public static function render_notice_config_warning() { |
| 573 | 758 | if ( MainWP_Server_Information_Handler::is_openssl_config_warning() && isset( $_GET['page'] ) && 'SettingsAdvanced' !== $_GET['page'] && MainWP_Utility::show_mainwp_message( 'notice', 'ssl_warn' ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 574 | 759 | ?> |
| 575 | - <div class="ui yellow message" style="margin-bottom: 0; border-radius: 0;"> | |
| 576 | - <button class="ui mini button yellow close icon mainwp-notice-dismiss" style="top:30%;margin-right:10px !important" notice-id="ssl_warn"><?php echo esc_html__( 'Error Fixed', 'mainwp' ); ?></button> | |
| 577 | - <div><?php printf( esc_html__( 'MainWP has detected that the %1$sOpenSSL.cnf%2$s file is not configured properly. It is required to configure this so you can start connecting your child sites. Please, %3$sclick here to configure it!%4$s', 'mainwp' ), '<strong>', '</strong>', '<a href="admin.php?page=SettingsAdvanced">', '</a>' ); ?></div> | |
| 578 | - <div><?php echo esc_html__( 'If your MainWP Dashboard has no issues with connecting child sites, you can dismiss this warning by clicking the Error Fixed button.', 'mainwp' ); ?></div> | |
| 579 | - </div> | |
| 760 | + <div class="ui yellow message"> | |
| 761 | + <div class="header"><?php esc_html_e( 'OpenSSL configuration required', 'mainwp' ); ?></div> | |
| 762 | + <div><?php esc_html_e( 'MainWP detected that OpenSSL.cnf isn’t configured correctly. This may prevent you from connecting child sites. Fix it in Settings → Advanced. If connections work fine, you can dismiss this message.', 'mainwp' ); ?></div> | |
| 763 | + <i class="close icon mainwp-notice-dismiss" notice-id="ssl_warn"></i> | |
| 764 | + </div> | |
| 580 | 765 | <?php |
| 581 | 766 | } |
| 582 | 767 | } |
| 583 | 768 | |
| @@ -582,25 +767,35 @@ | ||
| 582 | 767 | } |
| 583 | 768 | |
| 584 | 769 | /** Renders WP Multisite Error Message. */ |
| 585 | 770 | public static function render_notice_multi_sites() { |
| 586 | - ?> | |
| 587 | - <div class="ui icon red message" style="margin-bottom: 0; border-radius: 0;"> | |
| 588 | - <i class="exclamation circle icon"></i> | |
| 589 | - <?php esc_html_e( 'MainWP plugin is not designed nor fully tested on WordPress Multisite installations. Various features may not work properly. We highly recommend installing it on a single site installation!', 'mainwp' ); ?> | |
| 590 | - <i class="close icon mainwp-notice-dismiss" notice-id="multi_site"></i> | |
| 591 | - </div> | |
| 592 | - <?php | |
| 771 | + $current_options = get_option( 'mainwp_showhide_events_notice' ); | |
| 772 | + if ( ! is_array( $current_options ) ) { | |
| 773 | + $current_options = array(); | |
| 774 | + } | |
| 775 | + | |
| 776 | + if ( is_multisite() && ( ! isset( $current_options['hide_multi_site_notice'] ) || empty( $current_options['hide_multi_site_notice'] ) ) ) { | |
| 777 | + ?> | |
| 778 | + <div class="ui yellow message"> | |
| 779 | + <div class="header"><?php esc_html_e( 'Multisite detected (limited support)', 'mainwp' ); ?></div> | |
| 780 | + <?php esc_html_e( 'MainWP Dashboard is not fully tested on WordPress Multisite, and some features may not work as expected. For the best experience, install MainWP on a single-site WordPress installation.', 'mainwp' ); ?> | |
| 781 | + <i class="close icon mainwp-notice-dismiss" notice-id="multi_site"></i> | |
| 782 | + </div> | |
| 783 | + <?php | |
| 784 | + } | |
| 593 | 785 | } |
| 594 | 786 | |
| 595 | 787 | /** |
| 596 | 788 | * Renders MainWP Review Request. |
| 597 | 789 | * |
| 598 | - * @param bool $current_options false|true Weather or not to display request. | |
| 599 | - * | |
| 600 | 790 | * @uses \MainWP\Dashboard\MainWP_Extensions_Handler::get_extensions() |
| 601 | 791 | */ |
| 602 | - public static function check_rating_notice( $current_options ) { // phpcs:ignore -- NOSONAR - complex. | |
| 792 | + public static function check_rating_notice() { // phpcs:ignore -- NOSONAR - complex. | |
| 793 | + $current_options = get_option( 'mainwp_showhide_events_notice' ); | |
| 794 | + if ( ! is_array( $current_options ) ) { | |
| 795 | + $current_options = array(); | |
| 796 | + } | |
| 797 | + | |
| 603 | 798 | $display_request1 = false; |
| 604 | 799 | $display_request2 = false; |
| 605 | 800 | |
| 606 | 801 | if ( isset( $current_options['request_reviews1'] ) ) { |
| @@ -616,107 +811,87 @@ | ||
| 616 | 811 | $current_options['request_reviews1_starttime'] = time(); |
| 617 | 812 | update_option( 'mainwp_showhide_events_notice', $current_options ); |
| 618 | 813 | } |
| 619 | 814 | |
| 620 | - if ( isset( $current_options['request_reviews2'] ) ) { | |
| 621 | - if ( 'forever' === $current_options['request_reviews2'] ) { | |
| 622 | - $display_request2 = false; | |
| 623 | - } else { | |
| 624 | - $days = intval( $current_options['request_reviews2'] ); | |
| 625 | - $start_time = $current_options['request_reviews2_starttime']; | |
| 626 | - $display_request2 = ( ( time() - $start_time ) > $days * 24 * 3600 ) ? true : false; | |
| 627 | - } | |
| 628 | - } else { | |
| 629 | - $currentExtensions = MainWP_Extensions_Handler::get_extensions(); | |
| 630 | - if ( is_array( $currentExtensions ) && count( $currentExtensions ) > 10 ) { | |
| 631 | - $display_request2 = true; | |
| 632 | - } | |
| 633 | - } | |
| 815 | + $currentExtensions = MainWP_Extensions_Handler::get_extensions(); | |
| 816 | + $has_many_addons = is_array( $currentExtensions ) && count( $currentExtensions ) > 10; | |
| 634 | 817 | |
| 635 | - if ( $display_request1 ) { | |
| 636 | - static::render_rating_notice_1(); | |
| 637 | - } elseif ( $display_request2 ) { | |
| 638 | - static::render_rating_notice_2(); | |
| 818 | + if ( $display_request1 && $has_many_addons ) { | |
| 819 | + static::render_review_mainwp_notice( true ); | |
| 820 | + } elseif ( $display_request1 ) { | |
| 821 | + static::render_review_mainwp_notice( false ); | |
| 639 | 822 | } |
| 640 | 823 | } |
| 641 | 824 | |
| 642 | - /** Renders MainWP Dashboard & Child Plugin auto update Alert. */ | |
| 643 | - public static function render_notice_trust_update() { | |
| 644 | - $is_demo = MainWP_Demo_Handle::is_demo_mode(); | |
| 645 | - if ( ! $is_demo ) { | |
| 646 | - ?> | |
| 647 | - <div class="ui blue message" style="margin-bottom: 0; border-radius: 0;"> | |
| 648 | - <?php esc_html_e( 'Do you want MainWP Child to be updated automatically on your websites? This is highly recommended!', 'mainwp' ); ?> | |
| 649 | - <div class="ui hidden divider"></div> | |
| 650 | - <a id="mainwp_btn_autoupdate_and_trust" class="ui mini green button" href="#"><?php esc_html_e( 'Update MainWP Child Plugin Automatically', 'mainwp' ); ?></a> | |
| 651 | - <i class="close icon mainwp-events-notice-dismiss" notice="trust_child"></i> | |
| 652 | - </div> | |
| 653 | - <?php | |
| 654 | - } | |
| 655 | - } | |
| 656 | - | |
| 657 | - /** Renders MainWP 30 day review request. */ | |
| 658 | - public static function render_rating_notice_1() { | |
| 825 | + /** | |
| 826 | + * Renders MainWP review request notice. | |
| 827 | + * | |
| 828 | + * Displays a dismissible notice encouraging users to leave a review on WordPress.org. | |
| 829 | + * Message content varies based on whether user has extensions installed. | |
| 830 | + * | |
| 831 | + * @since 6.0.0 | |
| 832 | + * | |
| 833 | + * @param bool $addons Whether user has add-ons/extensions installed. Default false. | |
| 834 | + * @return void | |
| 835 | + */ | |
| 836 | + public static function render_review_mainwp_notice( $addons = false ) { | |
| 659 | 837 | ?> |
| 660 | - <div class="ui green icon message" style="margin-bottom: 0; border-radius: 0;"> | |
| 661 | - <i class="star icon"></i> | |
| 662 | - <div class="content"> | |
| 663 | - <p><?php esc_html_e( 'Hi, I noticed you have been using MainWP for over 30 days and that\'s awesome!', 'mainwp' ); ?></p> | |
| 664 | - <p><?php esc_html_e( 'Could you please do me a BIG favor and give it a 5-star rating? Reviews from users like YOU really help the MainWP community to grow.', 'mainwp' ); ?></p> | |
| 665 | - <div class="ui green floating mini labeled icon dropdown button"> | |
| 666 | - <i class="star icon"></i> | |
| 667 | - <span class="text">Rate MainWP</span> | |
| 668 | - <div class="menu"> | |
| 669 | - <a href="https://wordpress.org/support/plugin/mainwp/reviews/#new-post" class="item" target="_blank"> | |
| 670 | - <span class="text">WordPress.org</span> | |
| 671 | - </a> | |
| 672 | - <a href="https://www.trustpilot.com/review/mainwp.com" class="item" target="_blank"> | |
| 673 | - <span class="text">Trustpilot</span> | |
| 674 | - </a> | |
| 675 | - <a href="https://www.g2.com/products/mainwp/reviews" class="item" target="_blank"> | |
| 676 | - <span class="text">G2</span> | |
| 677 | - </a> | |
| 838 | + <div class="ui segment"> | |
| 839 | + <div class="ui icon message"> | |
| 840 | + <i class="yellow star icon"></i> | |
| 841 | + <div class="content"> | |
| 842 | + <div class="header"><?php esc_html_e( 'Enjoying MainWP?', 'mainwp' ); ?></div> | |
| 843 | + <div> | |
| 844 | + <?php if ( $addons ) : ?> | |
| 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' ); ?> | |
| 846 | + <?php else : ?> | |
| 847 | + <?php esc_html_e( 'You\'ve been using MainWP for a while.', 'mainwp' ); ?> | |
| 848 | + <?php endif; ?> | |
| 678 | 849 | </div> |
| 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> | |
| 679 | 851 | </div> |
| 680 | - <a href="" class="ui mini green basic button mainwp-events-notice-dismiss" notice="request_reviews1"><?php esc_html_e( 'Nope, maybe later.', 'mainwp' ); ?></a> | |
| 681 | - <a href="" class="ui mini green basic button mainwp-events-notice-dismiss" notice="request_reviews1_forever"><?php esc_html_e( 'I already did.', 'mainwp' ); ?></a> | |
| 852 | + <div class="" style="float:right"> | |
| 853 | + <div class="ui buttons"> | |
| 854 | + <a href="https://wordpress.org/support/plugin/mainwp/reviews/#new-post" class="ui green mini button" target="_blank" rel="noopener noreferrer"><?php esc_html_e( 'Review on WordPress.org', 'mainwp' ); ?></a> | |
| 855 | + <div class="ui floating dropdown icon green mini button" style="opacity:0.85"> | |
| 856 | + <i class="dropdown icon"></i> | |
| 857 | + <div class="menu"> | |
| 858 | + <a href="https://www.g2.com/products/mainwp/reviews" target="_blank" rel="noopener noreferrer" class="item" style="text-decoration:none!important;"><?php esc_html_e( 'Review on G2', 'mainwp' ); ?></a> | |
| 859 | + <a href="https://www.trustpilot.com/review/mainwp.com" target="_blank" rel="noopener noreferrer" class="item" style="text-decoration:none!important;"><?php esc_html_e( 'Review on Trustpilot', 'mainwp' ); ?></a> | |
| 860 | + </div> | |
| 861 | + </div> | |
| 862 | + </div> | |
| 863 | + <a href="" class="ui mini basic grey button mainwp-events-notice-dismiss" notice="request_reviews1"><?php esc_html_e( 'Remind me later', 'mainwp' ); ?></a> | |
| 864 | + </div> | |
| 865 | + <i class="close icon mainwp-events-notice-dismiss" notice="request_reviews1_forever"></i> | |
| 682 | 866 | </div> |
| 683 | - <i class="close icon mainwp-events-notice-dismiss" notice="request_reviews1_forever"></i> | |
| 684 | 867 | </div> |
| 685 | 868 | <?php |
| 686 | 869 | } |
| 687 | 870 | |
| 688 | - /** Renders MainWP review notice after a few extensions have been installed. */ | |
| 689 | - public static function render_rating_notice_2() { | |
| 690 | - ?> | |
| 691 | - <div class="ui green icon message" style="margin-bottom: 0; border-radius: 0;"> | |
| 692 | - <i class="star icon"></i> | |
| 693 | - <div class="content"> | |
| 694 | - <p><?php esc_html_e( 'Hi, I noticed you have a few MainWP Extensions installed and that\'s awesome!', 'mainwp' ); ?></p> | |
| 695 | - <p><?php esc_html_e( 'Could you please do me a BIG favor and give it a 5-star rating? Reviews from users like YOU really help the MainWP community to grow.', 'mainwp' ); ?></p> | |
| 696 | - <div class="ui green floating mini labeled icon dropdown button"> | |
| 697 | - <i class="star icon"></i> | |
| 698 | - <span class="text">Rate MainWP</span> | |
| 699 | - <div class="menu"> | |
| 700 | - <a href="https://wordpress.org/support/plugin/mainwp/reviews/#new-post" class="item" target="_blank"> | |
| 701 | - <span class="text">WordPress.org</span> | |
| 702 | - </a> | |
| 703 | - <a href="https://www.trustpilot.com/review/mainwp.com" class="item" target="_blank"> | |
| 704 | - <span class="text">Trustpilot</span> | |
| 705 | - </a> | |
| 706 | - <a href="https://www.g2.com/products/mainwp/reviews" class="item" target="_blank"> | |
| 707 | - <span class="text">G2</span> | |
| 708 | - </a> | |
| 709 | - </div> | |
| 710 | - </div> | |
| 711 | - <a href="" class="ui mini green basic button mainwp-events-notice-dismiss" notice="request_reviews2"><?php esc_html_e( 'Nope, maybe later.', 'mainwp' ); ?></a> | |
| 712 | - <a href="" class="ui mini green basic button mainwp-events-notice-dismiss" notice="request_reviews2_forever"><?php esc_html_e( 'I already did.', 'mainwp' ); ?></a> | |
| 871 | + /** | |
| 872 | + * Renders MainWP Dashboard & Child Plugin auto update Alert. | |
| 873 | + */ | |
| 874 | + public static function render_notice_trust_update() { | |
| 875 | + $current_options = get_option( 'mainwp_showhide_events_notice' ); | |
| 876 | + if ( ! is_array( $current_options ) ) { | |
| 877 | + $current_options = array(); | |
| 878 | + } | |
| 879 | + | |
| 880 | + if ( MainWP_DB::instance()->get_websites_count() > 4 && ( ! isset( $current_options['trust_child'] ) || empty( $current_options['trust_child'] ) ) && MainWP_System::is_mainwp_pages() && ! MainWP_Plugins_Handler::check_auto_update_plugin( 'mainwp-child/mainwp-child.php' ) ) { | |
| 881 | + ?> | |
| 882 | + <div class="ui info message"> | |
| 883 | + <div class="header"><?php esc_html_e( 'Keep MainWP Child up to date', 'mainwp' ); ?></div> | |
| 884 | + <div><?php esc_html_e( 'Enable automatic updates for MainWP Child on connected sites to improve security and reduce connection issues. You can change this anytime.', 'mainwp' ); ?></div> | |
| 885 | + <p><a id="mainwp_btn_autoupdate_and_trust" class="ui mini green button" href="#"><?php esc_html_e( 'Update MainWP Child Plugin Automatically', 'mainwp' ); ?></a></p> | |
| 886 | + <i class="close icon mainwp-events-notice-dismiss" notice="trust_child"></i> | |
| 713 | 887 | </div> |
| 714 | - <i class="close icon mainwp-events-notice-dismiss" notice="request_reviews2_forever"></i> | |
| 715 | - </div> | |
| 716 | - <?php | |
| 888 | + <?php | |
| 889 | + } | |
| 717 | 890 | } |
| 718 | 891 | |
| 892 | + | |
| 893 | + | |
| 719 | 894 | /** Renders Send Mail Function may have failed error. */ |
| 720 | 895 | public static function wp_admin_notices() { |
| 721 | 896 | |
| 722 | 897 | /** |
| @@ -739,9 +914,8 @@ | ||
| 739 | 914 | <?php |
| 740 | 915 | } |
| 741 | 916 | } |
| 742 | 917 | |
| 743 | - | |
| 744 | 918 | /** |
| 745 | 919 | * Method admin_footer() |
| 746 | 920 | * |
| 747 | 921 | * Renders admin footer. |
| @@ -822,9 +996,8 @@ | ||
| 822 | 996 | </style> |
| 823 | 997 | <?php |
| 824 | 998 | } |
| 825 | 999 | |
| 826 | - | |
| 827 | 1000 | /** |
| 828 | 1001 | * Productions site warning. |
| 829 | 1002 | * |
| 830 | 1003 | * Renders the warning if the production site is detected. |
| @@ -843,13 +1016,13 @@ | ||
| 843 | 1016 | return; |
| 844 | 1017 | } |
| 845 | 1018 | } |
| 846 | 1019 | ?> |
| 847 | - <div class="ui red message" style="margin-bottom: 0; border-radius: 0;"> | |
| 1020 | + <div class="ui blue message"> | |
| 848 | 1021 | <h4><?php esc_html_e( 'This appears to be a production site', 'mainwp' ); ?></h4> |
| 849 | - <?php esc_html_e( 'We HIGHLY recommend a NEW WordPress install for your MainWP Dashboard.', 'mainwp' ); ?> <?php printf( esc_html__( 'Using a new WordPress install will help to cut down on plugin conflicts and other issues that can be caused by trying to run your MainWP Dashboard off an active site. Most hosting companies provide free subdomains %s and we recommend creating one if you do not have a specific dedicated domain to run your MainWP Dashboard.', 'mainwp' ), '("<strong>demo.yourdomain.com</strong>")' ); ?> | |
| 850 | - <br /><br /> | |
| 851 | - <a href="#" class="ui red mini button" id="remove-mainwp-installation-warning"><?php esc_html_e( 'I have read the warning and I want to proceed', 'mainwp' ); ?></a> | |
| 1022 | + <?php esc_html_e( 'We HIGHLY recommend a NEW WordPress install for your MainWP Dashboard.', 'mainwp' ); ?> <?php /* translators: %s: Example subdomain string */ printf( esc_html__( 'Using a new WordPress install will help to cut down on plugin conflicts and other issues that can be caused by trying to run your MainWP Dashboard off an active site. Most hosting companies provide free subdomains %s and we recommend creating one if you do not have a specific dedicated domain to run your MainWP Dashboard.', 'mainwp' ), '("<strong>demo.yourdomain.com</strong>")' ); ?> | |
| 1023 | + <br /><br /> | |
| 1024 | + <a href="#" class="ui green mini button" id="remove-mainwp-installation-warning"><?php esc_html_e( 'I have read the warning and I want to proceed', 'mainwp' ); ?></a> | |
| 852 | 1025 | </div> |
| 853 | 1026 | <?php |
| 854 | 1027 | } |
| 855 | 1028 | |
| @@ -921,12 +1094,12 @@ | ||
| 921 | 1094 | |
| 922 | 1095 | if ( isset( $_GET['page'] ) && 'ManageClients' === $_GET['page'] && isset( $_GET['client_id'] ) && ! empty( $_GET['client_id'] ) ) { |
| 923 | 1096 | $class_string .= ' mainwp-individual-client-overview '; |
| 924 | 1097 | } |
| 925 | - if ( isset( $_GET['page'] ) && ( 'ServerInformation' === $_GET['page'] || 'ServerInformationCron' === $_GET['page'] || 'ErrorLog' === $_GET['page'] || 'ActionLogs' === $_GET['page'] || 'PluginPrivacy' === $_GET['page'] || 'Settings' === $_GET['page'] || 'SettingsAdvanced' === $_GET['page'] || 'SettingsEmail' === $_GET['page'] || 'MainWPTools' === $_GET['page'] || 'SettingsInsights' === $_GET['page'] || 'SettingsApiBackups' === $_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'] ) ) { | |
| 926 | 1099 | $class_string .= ' mainwp-individual-site-view '; |
| 927 | 1100 | } |
| 928 | - 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['emailsettingsid'] ) && ! empty( $_GET['emailsettingsid'] ) ) || ( isset( $_GET['scanid'] ) && ! empty( $_GET['scanid'] ) ) ) ) { | |
| 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'] ) ) ) ) { | |
| 929 | 1102 | $class_string .= ' mainwp-individual-site-view '; |
| 930 | 1103 | } |
| 931 | 1104 | // phpcs:enable |
| 932 | 1105 | $class_string = apply_filters( 'mainwp_page_admin_body_class', $class_string ); |
| @@ -976,9 +1149,10 @@ | ||
| 976 | 1149 | <div class="bar"><div class="progress"></div></div> |
| 977 | 1150 | <div class="label"></div> |
| 978 | 1151 | </div> |
| 979 | 1152 | <div class="scrolling content mainwp-modal-content"> |
| 980 | - <div class="ui middle aligned divided selection list" id="sync-sites-status"> | |
| 1153 | + <div class="sync-sites-content-massage"></div> | |
| 1154 | + <div class="ui middle aligned divided list" id="sync-sites-status"> | |
| 981 | 1155 | <?php |
| 982 | 1156 | if ( is_array( $websites ) ) { |
| 983 | 1157 | $count = count( $websites ); |
| 984 | 1158 | for ( $i = 0; $i < $count; $i++ ) { |
| @@ -1018,8 +1192,16 @@ | ||
| 1018 | 1192 | ?> |
| 1019 | 1193 | </div> |
| 1020 | 1194 | </div> |
| 1021 | 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> | |
| 1202 | + </div> | |
| 1203 | + </div> | |
| 1022 | 1204 | <input type="hidden" id="sync_selected_site_ids" value="" /> |
| 1023 | 1205 | <div class="ui tiny modal" id="mainwp-modal-confirm-select"> |
| 1024 | 1206 | <i class="close icon"></i> |
| 1025 | 1207 | <div class="header"><?php esc_html_e( 'Confirmation', 'mainwp' ); ?></div> |
| @@ -1042,11 +1224,11 @@ | ||
| 1042 | 1224 | ?> |
| 1043 | 1225 | <div class="ui tiny modal" id="mainwp-modal-confirm"> |
| 1044 | 1226 | <i class="close icon"></i> |
| 1045 | 1227 | <div class="header"><?php esc_html_e( 'Confirmation', 'mainwp' ); ?></div> |
| 1046 | - <div class="content"> | |
| 1228 | + <div class="scrolling content"> | |
| 1047 | 1229 | <div class="content-massage"></div> |
| 1048 | - <div class="ui mini yellow message hidden update-confirm-notice" ><?php printf( esc_html__( 'To disable update confirmations, go to the %1$sSettings%2$s page and disable the "Disable update confirmations" option', 'mainwp' ), '<a href="admin.php?page=Settings">', '</a>' ); ?></div> | |
| 1230 | + <div class="ui mini yellow message hidden update-confirm-notice" ><?php /* translators: 1: Opening link tag, 2: Closing link tag */ printf( esc_html__( 'To disable update confirmations, go to the %1$sSettings%2$s page and disable the "Disable update confirmations" option', 'mainwp' ), '<a href="admin.php?page=Settings">', '</a>' ); ?></div> | |
| 1049 | 1231 | <div class="ui form hidden" id="mainwp-confirm-form" style="display:none;"> |
| 1050 | 1232 | <div class="ui divider"></div> |
| 1051 | 1233 | <div class="field"> |
| 1052 | 1234 | <label></label> |
| @@ -1092,9 +1274,9 @@ | ||
| 1092 | 1274 | array( |
| 1093 | 1275 | 'page' => 'Extensions-Mainwp-Ithemes-Security-Extension', |
| 1094 | 1276 | 'slug' => 'better-wp-security/better-wp-security.php', |
| 1095 | 1277 | 'slug_pro' => 'ithemes-security-pro/ithemes-security-pro.php', |
| 1096 | - 'name' => 'iThemes Security', | |
| 1278 | + 'name' => 'Solid Security Integration', | |
| 1097 | 1279 | ), |
| 1098 | 1280 | array( |
| 1099 | 1281 | 'page' => 'Extensions-Mainwp-Updraftplus-Extension', |
| 1100 | 1282 | 'slug' => 'updraftplus/updraftplus.php', |
| @@ -1164,9 +1346,18 @@ | ||
| 1164 | 1346 | if ( $check_hidetime && time() < $check_hidetime + 30 * DAY_IN_SECONDS ) { |
| 1165 | 1347 | return; |
| 1166 | 1348 | } |
| 1167 | 1349 | |
| 1168 | - $websites = MainWP_DB::instance()->query( MainWP_DB::instance()->get_sql_websites_for_current_user() ); | |
| 1350 | + $wpsite_fields = array( 'id', 'name', 'url', 'plugins' ); | |
| 1351 | + $sync_fields = array( 'sync_errors', 'totalsize' ); | |
| 1352 | + $websites = MainWP_DB::instance()->query( | |
| 1353 | + MainWP_DB::instance()->get_sql_websites_for_current_user_by_params( | |
| 1354 | + array( | |
| 1355 | + 'select_wp_fields' => $wpsite_fields, | |
| 1356 | + 'select_sync_fields' => $sync_fields, | |
| 1357 | + ) | |
| 1358 | + ) | |
| 1359 | + ); | |
| 1169 | 1360 | |
| 1170 | 1361 | if ( empty( $websites ) ) { |
| 1171 | 1362 | return; |
| 1172 | 1363 | } |
| @@ -1199,8 +1390,9 @@ | ||
| 1199 | 1390 | if ( empty( $missing_installed ) ) { |
| 1200 | 1391 | return; |
| 1201 | 1392 | } |
| 1202 | 1393 | |
| 1394 | + $items_list_id = 'sync-sites-status'; | |
| 1203 | 1395 | ?> |
| 1204 | 1396 | <div class="ui modal" id="mainwp-install-check-modal" noti-slug="<?php echo esc_html( $check_slug ); ?>"> |
| 1205 | 1397 | <i class="mainwp-modal-close close icon"></i> |
| 1206 | 1398 | <div class="header"><?php esc_html_e( 'Plugin Install Check', 'mainwp' ); ?></div> |
| @@ -1205,10 +1397,10 @@ | ||
| 1205 | 1397 | <i class="mainwp-modal-close close icon"></i> |
| 1206 | 1398 | <div class="header"><?php esc_html_e( 'Plugin Install Check', 'mainwp' ); ?></div> |
| 1207 | 1399 | <div class="scrolling content mainwp-modal-content"> |
| 1208 | 1400 | <div class="ui message" id="mainwp-message-zone-install" style="display:none;"></div> |
| 1209 | - <div class="ui message blue"><?php printf( esc_html__( 'We have detected the following sites do not have the %s plugin installed. This plugin is required to be installed on your Child Sites for the Extension to work on those sites. Please select sites where you want to install it and click the Install Plugin button. Uncheck any site you don\'t want to add the plugin to or cancel to skip this step. After the installation process, resync your sites to see sites with the newly installed plugin.', 'mainwp' ), esc_html( $plugin_name ) ); ?></div> | |
| 1210 | - <div class="ui middle aligned divided selection list" id="sync-sites-status"> | |
| 1401 | + <div class="ui message blue"><?php /* translators: %s: Plugin name */ printf( esc_html__( 'We have detected the following sites do not have the %s plugin installed. This plugin is required to be installed on your Child Sites for the Extension to work on those sites. Please select sites where you want to install it and click the Install Plugin button. Uncheck any site you don\'t want to add the plugin to or cancel to skip this step. After the installation process, resync your sites to see sites with the newly installed plugin.', 'mainwp' ), esc_html( $plugin_name ) ); ?></div> | |
| 1402 | + <div class="ui middle aligned divided list" id="<?php echo esc_attr( $items_list_id ); ?>"> | |
| 1211 | 1403 | <?php foreach ( $missing_installed as $siteid => $site_name ) : ?> |
| 1212 | 1404 | <div class="item siteBulkInstall" siteid="<?php echo intval( $siteid ); ?>" status=""> |
| 1213 | 1405 | <div class="right floated content"> |
| 1214 | 1406 | <span class="queue" data-inverted="" data-position="left center" data-tooltip="<?php echo esc_html__( 'Queued', 'mainwp' ); ?>"><i class="clock outline icon"></i></span> |
| @@ -1245,9 +1437,9 @@ | ||
| 1245 | 1437 | onHide: function () { |
| 1246 | 1438 | let noti_id = jQuery('#mainwp-install-check-modal').attr('noti-slug'); |
| 1247 | 1439 | mainwp_notice_dismiss(noti_id, 1); |
| 1248 | 1440 | setTimeout(function () { |
| 1249 | - window.location.href = location.href; | |
| 1441 | + mainwp_forceReload(); | |
| 1250 | 1442 | }, 1000); |
| 1251 | 1443 | }, |
| 1252 | 1444 | }).modal('show'); |
| 1253 | 1445 | jQuery(document).on('click', '#mainwp-install-check-btn', function () { |