Advertisement
SergeyBiryukov

Untitled

Sep 21st, 2018
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. <?php
  2. // define( 'WP_USE_THEMES', true );
  3. include 'wp-load.php';
  4. require_once 'wp-content/plugins/wordpress-seo/inc/class-post-type.php';
  5. require_once 'wp-content/plugins/wordpress-seo/inc/interface-wpseo-wordpress-integration.php';
  6. require_once 'wp-content/plugins/wordpress-seo/inc/class-wpseo-utils.php';
  7. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-options.php';
  8. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-options-backfill.php';
  9. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option.php';
  10. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option-ms.php';
  11. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option-social.php';
  12. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option-titles.php';
  13. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-option-wpseo.php';
  14. require_once 'wp-content/plugins/wordpress-seo/inc/options/class-wpseo-taxonomy-meta.php';
  15. require_once 'wp-content/plugins/wordpress-seo/frontend/class-breadcrumbs.php';
  16. require_once 'wp-content/plugins/wordpress-seo/frontend/class-woocommerce-shop-page.php';
  17.  
  18. for ( $i = 0; $i < 10; $i++ ) {
  19.     register_post_type( "custom-post-type-$i", array( 'public' => true ) );
  20.     register_taxonomy( "custom-taxonomy-$i", "custom-post-type-$i" );
  21. }
  22.  
  23. $start = microtime( true );
  24.  
  25. for ( $i = 0; $i < 10000; $i++ ) {
  26.     get_option( 'wpseo_titles' );
  27.     WPSEO_Options::get_instance()::get_all();
  28. }
  29.  
  30. $end = microtime( true );
  31.  
  32. printf( 'The code took %.3f seconds to complete.', $end - $start );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement