WPSEO_Recalculate_Scores

Class WPSEO_Recalculate_Scores.

Defined (1)

The class is defined in the following location(s).

/admin/class-recalculate-scores.php  
  1. class WPSEO_Recalculate_Scores { 
  2.  
  3. /** 
  4. * Constructing the object by modalbox, the localization and the totals. 
  5. */ 
  6. public function __construct() { 
  7. add_action( 'admin_enqueue_scripts', array( $this, 'recalculate_assets' ) ); 
  8. add_action( 'admin_footer', array( $this, 'modal_box' ), 20 ); 
  9.  
  10. /** 
  11. * Run the localize script. 
  12. */ 
  13. public function recalculate_assets() { 
  14. $asset_manager = new WPSEO_Admin_Asset_Manager(); 
  15. $asset_manager->enqueue_script( 'recalculate' ); 
  16.  
  17. /** 
  18. * Initialize the modal box to be displayed when needed. 
  19. */ 
  20. public function modal_box() { 
  21. // Adding the thickbox. 
  22. add_thickbox(); 
  23.  
  24. $progress = sprintf( 
  25. /** translators: 1: expands to a <span> containing the number of posts recalculated. 2: expands to a <strong> containing the total number of posts. */ 
  26. __( '%1$s of %2$s done.', 'wordpress-seo' ),  
  27. '<span id="wpseo_count">0</span>',  
  28. '<strong id="wpseo_count_total">0</strong>' 
  29. ); 
  30.  
  31. ?> 
  32. <div id="wpseo_recalculate" class="hidden"> 
  33. <p><?php esc_html_e( 'Recalculating SEO scores for all pieces of content with a focus keyword.', 'wordpress-seo' ); ?></p> 
  34.  
  35. <div id="wpseo_progressbar"></div> 
  36. <p><?php echo $progress; ?></p> 
  37. </div> 
  38. <?php