Title: chriscombsdc's Replies | WordPress.org

---

# chriscombsdc

  [  ](https://wordpress.org/support/users/chriscombsdc/)

 *   [Profile](https://wordpress.org/support/users/chriscombsdc/)
 *   [Topics Started](https://wordpress.org/support/users/chriscombsdc/topics/)
 *   [Replies Created](https://wordpress.org/support/users/chriscombsdc/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/chriscombsdc/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/chriscombsdc/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/chriscombsdc/engagements/)
 *   [Favorites](https://wordpress.org/support/users/chriscombsdc/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/users/chriscombsdc/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/chriscombsdc/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cache-Control] 500s on redirects? Call to a member function get_queried_object_id() on null](https://wordpress.org/support/topic/500s-on-redirects-call-to-a-member-function-get_queried_object_id-on-null/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/500s-on-redirects-call-to-a-member-function-get_queried_object_id-on-null/#post-11861117)
 * They are redirects created with the Yoast SEO plugin. It automatically creates
   them when a post’s URL changes. There is really no object in the query, as far
   as I can tell.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gallery Custom Links] Performance improvement for resolve_image_id()](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/#post-11756183)
 * thanks! What was killing our database servers was searching by guid for every
   img tag in the page, whether or not they were part of a gallery dom element.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gallery Custom Links] Performance improvement for resolve_image_id()](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/#post-11756126)
 * *crickets*
 * we switched back to wp-gallery-custom-links by johnogg and our database cluster
   calmed down immediately.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gallery Custom Links] Performance improvement for resolve_image_id()](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/#post-11733492)
 * is it possible that the performance issues are caused by this line being commented
   out in the released plugin?
 *     ```
       		//$classes = apply_filters( 'gallery_custom_links_classes', array( '.entry-content', '.gallery', '.wp-block-gallery' ) );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gallery Custom Links] Performance issues related to gallery link queries](https://wordpress.org/support/topic/performance-issues-related-to-gallery-link-queries/)
 *  [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/performance-issues-related-to-gallery-link-queries/#post-11727369)
 * Same as we were seeing too — see this thread:
    [https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gallery Custom Links] Performance improvement for resolve_image_id()](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/#post-11727363)
 * P.S., we tried to enable the plugin only on pages that use it, but ran into some
   problems. I think it’s because it checks the filter at “init” hook (start() function),
   which is too early to have access to any information that would let us make a
   dynamic decision about whether the post actually needs it.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gallery Custom Links] Performance improvement for resolve_image_id()](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/performance-improvement-for-resolve_image_id/#post-11727360)
 * saw your reply in a similar thread. We noticed this because the queries were 
   melting our database servers (7x mariadb galera).
 * it is mostly for older, imported posts from another CMS, which don’t include 
   a post ID in their markup. I did notice it for a few hand placed img tags too,
   here and there in our templates, like this:
 *     ```
       <img src="https://www.washingtonian.com/wp-content/themes/washingtonian/assets/img/wash_logo_blue.svg" class="img-responsive" alt="Washingtonian.com">
       ```
   
 * In chasing this down further I found that the expensive query isn’t really needed.
   There is a core WP function that does the same thing faster. Here is the updated
   version of this function that works for us. Sorry about the indentation, this
   forum software seems to mess with it.
 *     ```
       function resolve_image_id( $url ) {
   
       	$pattern = '/[_-]\d+x\d+(?=\.[a-z]{3,4}$)/';
       	$url = preg_replace( $pattern, '', $url );
       	$url = $this->get_pathinfo_from_image_src( $url );
   
               $cacheKey = "gallery-custom-links-id-" . $url;
               $cacheGroup = "gallery-custom-links";
               $cached = wp_cache_get($cacheKey, $cacheGroup);
   
               if ($cached != null) {
                   return $cached;
               }
   
       	$result = attachment_url_to_postid($url);
       	wp_cache_set($cacheKey, $result, $cacheGroup, 7*24*60*60);
       	return $result;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Cache-Control] 500s on redirects? Call to a member function get_queried_object_id() on null](https://wordpress.org/support/topic/500s-on-redirects-call-to-a-member-function-get_queried_object_id-on-null/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/500s-on-redirects-call-to-a-member-function-get_queried_object_id-on-null/#post-11359425)
 * The fix works well for us in production.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel] Exceeded Max Vars 1000](https://wordpress.org/support/topic/exceeded-max-vars-1000/)
 *  [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/exceeded-max-vars-1000/#post-11192916)
 * [@wpallimport](https://wordpress.org/support/users/wpallimport/) You could also
   change the way that the data is passed from frontend to backend. It seems to 
   use a lot of individual booleans for each ACF field:
 *     ```
       cc_settings[]: 0
       cc_combine_multiple_fields[]: 0
       cc_combine_multiple_fields_value[]: 0
       ids[]: 1
       cc_label[]: title
       cc_php[]: 0
       cc_code[]: 
       cc_sql[]: 0
       ```
   
 * etc..
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Varnish/Nginx Proxy Caching] PHP notice on wp-login](https://wordpress.org/support/topic/php-notice-on-wp-login/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/php-notice-on-wp-login/#post-10664566)
 * (with plugin ver 1.6.9)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Instant Images - One-click Image Uploads from Unsplash, Openverse, Pixabay, Pexels, and Giphy] Include “Unsplash” in photo title](https://wordpress.org/support/topic/include-unsplash-in-photo-title/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/include-unsplash-in-photo-title/#post-10579194)
 * That’s great! Many thanks!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Co-Authors Plus] 3.2.2 to 3.3.0 Update Breaks ‘Mine’ Filter in Admin](https://wordpress.org/support/topic/3-2-2-to-3-3-0-update-breaks-mine-filter-in-admin/)
 *  [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/3-2-2-to-3-3-0-update-breaks-mine-filter-in-admin/#post-10286761)
 * We have the same problem.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets] create_function deprecated in php 7.2](https://wordpress.org/support/topic/create_function-deprecated-in-php-7-2-2/)
 *  [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/create_function-deprecated-in-php-7-2-2/#post-10260281)
 * Still seeing them in Pro 4.5.2-beta-1.43 , any guidance as to when it will be
   fixed?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Instant Images - One-click Image Uploads from Unsplash, Openverse, Pixabay, Pexels, and Giphy] Include “Unsplash” in photo title](https://wordpress.org/support/topic/include-unsplash-in-photo-title/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/include-unsplash-in-photo-title/#post-10091067)
 * where’s your github repo? We could submit a PR
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Media Library Assistant] cache query results in _months_dropdown() ?](https://wordpress.org/support/topic/cache-query-results-in-_months_dropdown/)
 *  Thread Starter [chriscombsdc](https://wordpress.org/support/users/chriscombsdc/)
 * (@chriscombsdc)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/cache-query-results-in-_months_dropdown/#post-9786896)
 * This does seem to be working well for us. Thanks again.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/users/chriscombsdc/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/chriscombsdc/replies/page/2/?output_format=md)