Complex classes like Give_Updates often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Give_Updates, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 8 | class Give_Updates { |
||
|
|
|||
| 9 | |||
| 10 | /** |
||
| 11 | * Instance. |
||
| 12 | * |
||
| 13 | * @since |
||
| 14 | * @access static |
||
| 15 | * @var |
||
| 16 | */ |
||
| 17 | static private $instance; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Instance. |
||
| 21 | * |
||
| 22 | * @since |
||
| 23 | * @access static |
||
| 24 | * @var Give_Background_Updater |
||
| 25 | */ |
||
| 26 | static private $background_updater; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Updates |
||
| 30 | * |
||
| 31 | * @since 1.8.12 |
||
| 32 | * @access private |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | private $updates = array(); |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Current update percentage number |
||
| 39 | * |
||
| 40 | * @since 1.8.12 |
||
| 41 | * @access private |
||
| 42 | * @var array |
||
| 43 | */ |
||
| 44 | public $percentage = 0; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Current update step number |
||
| 48 | * |
||
| 49 | * @since 1.8.12 |
||
| 50 | * @access private |
||
| 51 | * @var array |
||
| 52 | */ |
||
| 53 | public $step = 1; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Current update number |
||
| 57 | * |
||
| 58 | * @since 1.8.12 |
||
| 59 | * @access private |
||
| 60 | * @var array |
||
| 61 | */ |
||
| 62 | public $update = 1; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Singleton pattern. |
||
| 66 | * |
||
| 67 | * @since 1.8.12 |
||
| 68 | * @access private |
||
| 69 | * |
||
| 70 | * @param Give_Updates . |
||
| 71 | */ |
||
| 72 | private function __construct() { |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * Register updates |
||
| 77 | * |
||
| 78 | * @since 1.8.12 |
||
| 79 | * @access public |
||
| 80 | * |
||
| 81 | * @param array $args |
||
| 82 | */ |
||
| 83 | public function register( $args ) { |
||
| 84 | $args_default = array( |
||
| 85 | 'id' => '', |
||
| 86 | 'version' => '', |
||
| 87 | 'callback' => '', |
||
| 88 | ); |
||
| 89 | |||
| 90 | $args = wp_parse_args( $args, $args_default ); |
||
| 91 | |||
| 92 | // You can only register database upgrade. |
||
| 93 | $args['type'] = 'database'; |
||
| 94 | |||
| 95 | // Bailout. |
||
| 96 | if ( |
||
| 97 | empty( $args['id'] ) || |
||
| 98 | empty( $args['version'] ) || |
||
| 99 | empty( $args['callback'] ) || |
||
| 100 | ! is_callable( $args['callback'] ) |
||
| 101 | ) { |
||
| 102 | return; |
||
| 103 | } |
||
| 104 | |||
| 105 | // Change depend param to array. |
||
| 106 | if ( isset( $args['depend'] ) && is_string( $args['depend'] ) ) { |
||
| 107 | $args['depend'] = array( $args['depend'] ); |
||
| 108 | } |
||
| 109 | |||
| 110 | $this->updates[ $args['type'] ][] = $args; |
||
| 111 | } |
||
| 112 | |||
| 113 | /** |
||
| 114 | * Get instance. |
||
| 115 | * |
||
| 116 | * @since |
||
| 117 | * @access static |
||
| 118 | * @return static |
||
| 119 | */ |
||
| 120 | static function get_instance() { |
||
| 121 | if ( is_null( self::$instance ) ) { |
||
| 122 | self::$instance = new self(); |
||
| 123 | } |
||
| 124 | |||
| 125 | return self::$instance; |
||
| 126 | } |
||
| 127 | |||
| 128 | /** |
||
| 129 | * |
||
| 130 | * Setup hook |
||
| 131 | * |
||
| 132 | * @since 1.8.12 |
||
| 133 | * @access public |
||
| 134 | */ |
||
| 135 | public function setup() { |
||
| 136 | /** |
||
| 137 | * Load file |
||
| 138 | */ |
||
| 139 | require_once GIVE_PLUGIN_DIR . 'includes/class-give-background-updater.php'; |
||
| 140 | require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
||
| 141 | |||
| 142 | self::$background_updater = new Give_Background_Updater(); |
||
| 143 | |||
| 144 | /** |
||
| 145 | * Setup hooks. |
||
| 146 | */ |
||
| 147 | add_action( 'init', array( $this, '__register_upgrade' ), 9999 ); |
||
| 148 | add_action( 'give_set_upgrade_completed', array( $this, '__flush_resume_updates' ), 9999 ); |
||
| 149 | add_action( 'wp_ajax_give_db_updates_info', array( $this, '__give_db_updates_info' ) ); |
||
| 150 | add_action( 'wp_ajax_give_run_db_updates', array( $this, '__give_start_updating' ) ); |
||
| 151 | add_action( 'admin_init', array( $this, '__redirect_admin' ) ); |
||
| 152 | add_action( 'admin_notices', array( $this, '__show_notice' ) ); |
||
| 153 | |||
| 154 | if ( is_admin() ) { |
||
| 155 | add_action( 'admin_init', array( $this, '__change_donations_label' ), 9999 ); |
||
| 156 | add_action( 'admin_menu', array( $this, '__register_menu' ), 9999 ); |
||
| 157 | } |
||
| 158 | } |
||
| 159 | |||
| 160 | /** |
||
| 161 | * Register plugin add-on updates. |
||
| 162 | * |
||
| 163 | * @since 1.8.12 |
||
| 164 | * @access public |
||
| 165 | */ |
||
| 166 | public function __register_plugin_addon_updates() { |
||
| 167 | $addons = give_get_plugins(); |
||
| 168 | $plugin_updates = get_plugin_updates(); |
||
| 169 | |||
| 170 | foreach ( $addons as $key => $info ) { |
||
| 171 | if ( 'active' != $info['Status'] || 'add-on' != $info['Type'] || empty( $plugin_updates[ $key ] ) ) { |
||
| 172 | continue; |
||
| 173 | } |
||
| 174 | |||
| 175 | $this->updates['plugin'][] = array_merge( $info, (array) $plugin_updates[ $key ] ); |
||
| 176 | } |
||
| 177 | } |
||
| 178 | |||
| 179 | |||
| 180 | /** |
||
| 181 | * Fire custom action hook to register updates |
||
| 182 | * |
||
| 183 | * @since 1.8.12 |
||
| 184 | * @access public |
||
| 185 | */ |
||
| 186 | public function __register_upgrade() { |
||
| 187 | if ( ! is_admin() ) { |
||
| 188 | return; |
||
| 189 | } |
||
| 190 | |||
| 191 | /** |
||
| 192 | * Fire the hook |
||
| 193 | * |
||
| 194 | * @since 1.8.12 |
||
| 195 | */ |
||
| 196 | do_action( 'give_register_updates', $this ); |
||
| 197 | } |
||
| 198 | |||
| 199 | /** |
||
| 200 | * Rename `Donations` menu title if updates exists |
||
| 201 | * |
||
| 202 | * @since 1.8.12 |
||
| 203 | * @access public |
||
| 204 | */ |
||
| 205 | function __change_donations_label() { |
||
| 206 | global $menu; |
||
| 207 | |||
| 208 | // Bailout. |
||
| 209 | if ( empty( $menu ) || ! $this->get_total_update_count() ) { |
||
| 210 | return; |
||
| 211 | } |
||
| 212 | |||
| 213 | foreach ( $menu as $index => $menu_item ) { |
||
| 214 | if ( 'edit.php?post_type=give_forms' !== $menu_item[2] ) { |
||
| 215 | continue; |
||
| 216 | } |
||
| 217 | |||
| 218 | $menu[ $index ][0] = sprintf( |
||
| 219 | '%1$s <span class="update-plugins"><span class="plugin-count give-update-progress-count">%2$s%3$s</span></span>', |
||
| 220 | __( 'Donations', 'give' ), |
||
| 221 | $this->is_doing_updates() ? |
||
| 222 | $this->get_db_update_processing_percentage() : |
||
| 223 | $this->get_total_update_count(), |
||
| 224 | $this->is_doing_updates() ? '%' : '' |
||
| 225 | ); |
||
| 226 | |||
| 227 | break; |
||
| 228 | } |
||
| 229 | } |
||
| 230 | |||
| 231 | /** |
||
| 232 | * Register updates menu |
||
| 233 | * |
||
| 234 | * @since 1.8.12 |
||
| 235 | * @access public |
||
| 236 | */ |
||
| 237 | public function __register_menu() { |
||
| 238 | |||
| 239 | // Load plugin updates. |
||
| 240 | $this->__register_plugin_addon_updates(); |
||
| 241 | |||
| 242 | // Bailout. |
||
| 243 | if ( ! $this->get_total_update_count() ) { |
||
| 244 | // Show complete update message if still on update setting page. |
||
| 245 | if ( isset( $_GET['page'] ) && 'give-updates' === $_GET['page'] ) { |
||
| 246 | // Upgrades |
||
| 247 | add_submenu_page( |
||
| 248 | 'edit.php?post_type=give_forms', |
||
| 249 | esc_html__( 'Give Updates Complete', 'give' ), |
||
| 250 | __( 'Updates', 'give' ), |
||
| 251 | 'manage_give_settings', |
||
| 252 | 'give-updates', |
||
| 253 | array( $this, 'render_complete_page' ) |
||
| 254 | ); |
||
| 255 | } |
||
| 256 | |||
| 257 | return; |
||
| 258 | } |
||
| 259 | |||
| 260 | // Upgrades |
||
| 261 | add_submenu_page( |
||
| 262 | 'edit.php?post_type=give_forms', |
||
| 263 | esc_html__( 'Give Updates', 'give' ), |
||
| 264 | sprintf( |
||
| 265 | '%1$s <span class="update-plugins"><span class="plugin-count give-update-progress-count">%2$s%3$s</span></span>', |
||
| 266 | __( 'Updates', 'give' ), |
||
| 267 | $this->is_doing_updates() ? |
||
| 268 | $this->get_db_update_processing_percentage() : |
||
| 269 | $this->get_total_update_count(), |
||
| 270 | $this->is_doing_updates() ? '%' : '' |
||
| 271 | ), |
||
| 272 | 'manage_give_settings', |
||
| 273 | 'give-updates', |
||
| 274 | array( $this, 'render_page' ) |
||
| 275 | ); |
||
| 276 | } |
||
| 277 | |||
| 278 | |||
| 279 | /** |
||
| 280 | * Show update related notices |
||
| 281 | * |
||
| 282 | * @since 2.0 |
||
| 283 | * @access public |
||
| 284 | */ |
||
| 285 | public function __redirect_admin() { |
||
| 286 | // Show db upgrade completed notice. |
||
| 287 | if ( |
||
| 288 | ! wp_doing_ajax() && |
||
| 289 | current_user_can( 'manage_give_settings' ) && |
||
| 290 | get_option( 'give_show_db_upgrade_complete_notice' ) && |
||
| 291 | ! isset( $_GET['give-db-update-completed'] ) |
||
| 292 | ) { |
||
| 293 | delete_option( 'give_show_db_upgrade_complete_notice' ); |
||
| 294 | |||
| 295 | wp_redirect( add_query_arg( array( 'give-db-update-completed' => 'give_db_upgrade_completed' ) ) ); |
||
| 296 | exit(); |
||
| 297 | } |
||
| 298 | } |
||
| 299 | |||
| 300 | |||
| 301 | /** |
||
| 302 | * Show update related notices |
||
| 303 | * |
||
| 304 | * @since 2.0 |
||
| 305 | * @access public |
||
| 306 | */ |
||
| 307 | public function __show_notice() { |
||
| 308 | // Bailout. |
||
| 309 | if ( ! current_user_can( 'manage_give_settings' ) || $this->is_doing_updates() ) { |
||
| 310 | return; |
||
| 311 | } |
||
| 312 | |||
| 313 | // Run DB updates. |
||
| 314 | if ( ! empty( $_GET['give-run-db-update'] ) ) { |
||
| 315 | $this->run_db_update(); |
||
| 316 | } |
||
| 317 | |||
| 318 | |||
| 319 | // Bailout. |
||
| 320 | if ( isset( $_GET['page'] ) && 'give-updates' === $_GET['page'] ) { |
||
| 321 | return; |
||
| 322 | } |
||
| 323 | |||
| 324 | // Show db upgrade completed notice. |
||
| 325 | if ( ! empty( $_GET['give-db-update-completed'] ) ) { |
||
| 326 | Give()->notices->register_notice( array( |
||
| 327 | 'id' => 'give_db_upgrade_completed', |
||
| 328 | 'type' => 'updated', |
||
| 329 | 'description' => __( 'Give database updates completed successfully. Thank you for updating to the latest version!', 'give' ), |
||
| 330 | 'show' => true, |
||
| 331 | ) ); |
||
| 332 | |||
| 333 | // Start update. |
||
| 334 | } elseif ( ! empty( $_GET['give-run-db-update'] ) ) { |
||
| 335 | $this->run_db_update(); |
||
| 336 | |||
| 337 | // Show run the update notice. |
||
| 338 | } elseif ( $this->get_total_new_db_update_count() ) { |
||
| 339 | ob_start(); |
||
| 340 | ?> |
||
| 341 | <p> |
||
| 342 | <strong><?php _e( 'Database Update', 'give' ); ?></strong> |
||
| 343 | – <?php _e( 'GiveWP needs to update your database to the latest version. The following process will make updates to your site\'s database. Please create a complete backup before proceeding.', 'give' ); ?> |
||
| 344 | </p> |
||
| 345 | <p class="submit"> |
||
| 346 | <a href="<?php echo esc_url( add_query_arg( array( 'give-run-db-update' => 1 ), admin_url( 'edit.php?post_type=give_forms&page=give-updates' ) ) ); ?>" class="button button-primary give-run-update-now"> |
||
| 347 | <?php _e( 'Run the updater', 'woocommerce' ); ?> |
||
| 348 | </a> |
||
| 349 | </p> |
||
| 350 | <script type="text/javascript"> |
||
| 351 | jQuery('.give-run-update-now').click('click', function () { |
||
| 352 | return window.confirm('<?php echo esc_js( __( 'It is strongly recommended that you backup your database before proceeding. Do you want to run the update now?', 'give' ) ); ?>'); // jshint ignore:line |
||
| 353 | }); |
||
| 354 | </script> |
||
| 355 | <?php |
||
| 356 | $desc_html = ob_get_clean(); |
||
| 357 | |||
| 358 | |||
| 359 | Give()->notices->register_notice( array( |
||
| 360 | 'id' => 'give_upgrade_db', |
||
| 361 | 'type' => 'updated', |
||
| 362 | 'dismissible' => false, |
||
| 363 | 'description' => $desc_html, |
||
| 364 | ) ); |
||
| 365 | } |
||
| 366 | } |
||
| 367 | |||
| 368 | /** |
||
| 369 | * Render Give Updates Completed page |
||
| 370 | * |
||
| 371 | * @since 1.8.12 |
||
| 372 | * @access public |
||
| 373 | */ |
||
| 374 | public function render_complete_page() { |
||
| 375 | include_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/upgrades-complete.php'; |
||
| 376 | } |
||
| 377 | |||
| 378 | /** |
||
| 379 | * Render Give Updates page |
||
| 380 | * |
||
| 381 | * @since 1.8.12 |
||
| 382 | * @access public |
||
| 383 | */ |
||
| 384 | public function render_page() { |
||
| 385 | include_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/views/upgrades.php'; |
||
| 386 | } |
||
| 387 | |||
| 388 | /** |
||
| 389 | * Run database upgrades |
||
| 390 | * |
||
| 391 | * @since 2.0 |
||
| 392 | * @access private |
||
| 393 | */ |
||
| 394 | private function run_db_update() { |
||
| 395 | // Bailout. |
||
| 396 | if ( $this->is_doing_updates() || ! $this->get_total_new_db_update_count() ) { |
||
| 397 | return; |
||
| 398 | } |
||
| 399 | |||
| 400 | $updates = $this->get_updates( 'database', 'new' ); |
||
| 401 | |||
| 402 | foreach ( $updates as $update ) { |
||
| 403 | self::$background_updater->push_to_queue( $update ); |
||
| 404 | } |
||
| 405 | |||
| 406 | add_option( 'give_db_update_count', count( $updates ), '', 'no' ); |
||
| 407 | |||
| 408 | add_option( 'give_doing_upgrade', array( |
||
| 409 | 'update_info' => $updates[0], |
||
| 410 | 'step' => 1, |
||
| 411 | 'update' => 1, |
||
| 412 | 'heading' => sprintf( 'Update %s of %s', 1, count( $updates ) ), |
||
| 413 | 'percentage' => 0, |
||
| 414 | 'total_percentage' => 0, |
||
| 415 | ), '', 'no' ); |
||
| 416 | |||
| 417 | self::$background_updater->save()->dispatch(); |
||
| 418 | } |
||
| 419 | |||
| 420 | |||
| 421 | /** |
||
| 422 | * Delete resume updates |
||
| 423 | * |
||
| 424 | * @since 1.8.12 |
||
| 425 | * @access public |
||
| 426 | */ |
||
| 427 | public function __flush_resume_updates() { |
||
| 428 | //delete_option( 'give_doing_upgrade' ); |
||
| 429 | update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
||
| 430 | |||
| 431 | // Reset counter. |
||
| 432 | $this->step = $this->percentage = 0; |
||
| 433 | ++ $this->update; |
||
| 434 | } |
||
| 435 | |||
| 436 | |||
| 437 | /** |
||
| 438 | * Initialize updates |
||
| 439 | * |
||
| 440 | * @since 2.0 |
||
| 441 | * @access public |
||
| 442 | * |
||
| 443 | * @return void |
||
| 444 | */ |
||
| 445 | public function __give_start_updating() { |
||
| 446 | // Check permission. |
||
| 447 | if ( |
||
| 448 | ! current_user_can( 'manage_give_settings' ) || |
||
| 449 | $this->is_doing_updates() |
||
| 450 | ) { |
||
| 451 | wp_send_json_error(); |
||
| 452 | } |
||
| 453 | |||
| 454 | // @todo: validate nonce |
||
| 455 | // @todo: set http method to post |
||
| 456 | if ( empty( $_POST['run_db_update'] ) ) { |
||
| 457 | wp_send_json_error(); |
||
| 458 | } |
||
| 459 | |||
| 460 | $this->run_db_update(); |
||
| 461 | |||
| 462 | wp_send_json_success(); |
||
| 463 | } |
||
| 464 | |||
| 465 | |||
| 466 | /** |
||
| 467 | * This function handle ajax query for dn update status. |
||
| 468 | * |
||
| 469 | * @since 2.0 |
||
| 470 | * @access public |
||
| 471 | * |
||
| 472 | * @return string |
||
| 473 | */ |
||
| 474 | public function __give_db_updates_info() { |
||
| 475 | $update_info = get_option( 'give_doing_upgrade' ); |
||
| 476 | $response_type = ''; |
||
| 477 | |||
| 478 | if ( empty( $update_info ) && ! $this->get_pending_db_update_count() ) { |
||
| 479 | $update_info = array( |
||
| 480 | 'message' => __( 'Give database updates completed successfully. Thank you for updating to the latest version!', 'give' ), |
||
| 481 | 'heading' => __( 'Updates Completed.', 'give' ), |
||
| 482 | 'percentage' => 0, |
||
| 483 | ); |
||
| 484 | $response_type = 'success'; |
||
| 485 | |||
| 486 | delete_option( 'give_show_db_upgrade_complete_notice' ); |
||
| 487 | } |
||
| 488 | |||
| 489 | $this->send_ajax_response( $update_info, $response_type ); |
||
| 490 | } |
||
| 491 | |||
| 492 | /** |
||
| 493 | * Send ajax response |
||
| 494 | * |
||
| 495 | * @since 1.8.12 |
||
| 496 | * @access public |
||
| 497 | * |
||
| 498 | * @param $data |
||
| 499 | * @param string $type |
||
| 500 | */ |
||
| 501 | public function send_ajax_response( $data, $type = '' ) { |
||
| 502 | $default = array( |
||
| 503 | 'message' => '', |
||
| 504 | 'heading' => '', |
||
| 505 | 'percentage' => 0, |
||
| 506 | 'step' => 0, |
||
| 507 | 'update' => 0, |
||
| 508 | ); |
||
| 509 | |||
| 510 | // Set data. |
||
| 511 | $data = wp_parse_args( $data, $default ); |
||
| 512 | |||
| 513 | // Enable cache. |
||
| 514 | Give_Cache::enable(); |
||
| 515 | |||
| 516 | switch ( $type ) { |
||
| 517 | case 'success': |
||
| 518 | wp_send_json_success( $data ); |
||
| 519 | break; |
||
| 520 | |||
| 521 | case 'error': |
||
| 522 | wp_send_json_error( $data ); |
||
| 523 | break; |
||
| 524 | |||
| 525 | default: |
||
| 526 | wp_send_json( array( |
||
| 527 | 'data' => $data, |
||
| 528 | ) ); |
||
| 529 | break; |
||
| 530 | } |
||
| 531 | } |
||
| 532 | |||
| 533 | /** |
||
| 534 | * Set current update percentage. |
||
| 535 | * |
||
| 536 | * @since 1.8.12 |
||
| 537 | * @access public |
||
| 538 | * |
||
| 539 | * @param $total |
||
| 540 | * @param $current_total |
||
| 541 | */ |
||
| 542 | public function set_percentage( $total, $current_total ) { |
||
| 549 | |||
| 550 | /** |
||
| 551 | * Check if parent update completed or not. |
||
| 552 | * |
||
| 553 | * @since 2.0 |
||
| 554 | * @access private |
||
| 555 | * |
||
| 556 | * @param array $update |
||
| 557 | * |
||
| 558 | * @return bool|null |
||
| 559 | */ |
||
| 560 | public function is_parent_updates_completed( $update ) { |
||
| 561 | // Bailout. |
||
| 562 | if ( empty( $update['depend'] ) ) { |
||
| 563 | return true; |
||
| 564 | } |
||
| 565 | |||
| 566 | $is_dependency_completed = true; |
||
| 583 | |||
| 584 | /** |
||
| 585 | * Flag to check if DB updates running or not. |
||
| 586 | * |
||
| 587 | * @since 2.0 |
||
| 588 | * @access public |
||
| 589 | * @return bool |
||
| 590 | */ |
||
| 591 | public function is_doing_updates() { |
||
| 594 | |||
| 595 | |||
| 596 | /** |
||
| 597 | * Check if update has valid dependency or not. |
||
| 598 | * |
||
| 599 | * @since 2.0 |
||
| 600 | * @access public |
||
| 601 | * |
||
| 602 | * @param $update |
||
| 603 | * |
||
| 604 | * @return bool |
||
| 605 | */ |
||
| 606 | public function has_valid_dependency( $update ) { |
||
| 620 | |||
| 621 | /** |
||
| 622 | * Get updates. |
||
| 623 | * |
||
| 624 | * @since 1.8.12 |
||
| 625 | * @access public |
||
| 626 | * |
||
| 627 | * @param string $update_type Tye of update. |
||
| 628 | * @param string $status Tye of update. |
||
| 629 | * |
||
| 630 | * @return array |
||
| 631 | */ |
||
| 632 | public function get_updates( $update_type = '', $status = 'all' ) { |
||
| 665 | |||
| 666 | /** |
||
| 667 | * Get addon update count. |
||
| 668 | * |
||
| 669 | * @since 1.8.12 |
||
| 670 | * @access public |
||
| 671 | * @return int |
||
| 672 | */ |
||
| 673 | public function get_total_plugin_update_count() { |
||
| 676 | |||
| 677 | /** |
||
| 678 | * Get total update count |
||
| 679 | * |
||
| 680 | * @since 1.8.12 |
||
| 681 | * @access public |
||
| 682 | * |
||
| 683 | * @return int |
||
| 684 | */ |
||
| 685 | public function get_total_update_count() { |
||
| 691 | |||
| 692 | /** |
||
| 693 | * Get total pending updates count |
||
| 694 | * |
||
| 695 | * @since 1.8.12 |
||
| 696 | * @access public |
||
| 697 | * |
||
| 698 | * @return int |
||
| 699 | */ |
||
| 700 | public function get_pending_db_update_count() { |
||
| 703 | |||
| 704 | /** |
||
| 705 | * Get total updates count |
||
| 706 | * |
||
| 707 | * @since 1.8.18 |
||
| 708 | * @access public |
||
| 709 | * |
||
| 710 | * @return int |
||
| 711 | */ |
||
| 712 | public function get_total_db_update_count() { |
||
| 715 | |||
| 716 | /** |
||
| 717 | * Get total new updates count |
||
| 718 | * |
||
| 719 | * @since 2.0 |
||
| 720 | * @access public |
||
| 721 | * |
||
| 722 | * @return int |
||
| 723 | */ |
||
| 724 | public function get_total_new_db_update_count() { |
||
| 729 | |||
| 730 | /** |
||
| 731 | * Get total new updates count |
||
| 732 | * |
||
| 733 | * @since 2.0 |
||
| 734 | * @access public |
||
| 735 | * |
||
| 736 | * @return int |
||
| 737 | */ |
||
| 738 | public function get_running_db_update() { |
||
| 745 | |||
| 746 | /** |
||
| 747 | * Get database update processing percentage. |
||
| 748 | * |
||
| 749 | * @since 2.0 |
||
| 750 | * @access public |
||
| 751 | * @return float|int |
||
| 752 | */ |
||
| 753 | public function get_db_update_processing_percentage() { |
||
| 773 | } |
||
| 774 | |||
| 776 |