Problem with plugin customization
-
Hello,
We are currently using Job Manager in a project. However, our initial expectations were exceeded and the website received more than 900 applications for the offered jobs. This caused a problem in the shared hosting because whenever you list or filter the applications available, all of them are first stored in memory, and then they are filtered one by one. So, the limit defined by the config directive memory_limit was not enough and the shared hosting didn’t allow us to increase this value.
For this reason, I applied several changes to the plugin. Everytime you list or filter the applications, they are loaded through several steps using Ajax.
I created my own function, which is called at the end of job-manager.php:
if( array_key_exists( ‘jobman-ajax-call’, $_REQUEST ) )
jobman_list_applications_ajax();
?>This function receives the filter parameters, and also an offset value. Next, it launches a query and shows the results (table rows) for maybe 100 or 200 records. This process is called iteratively from jobman_list_applications() until all the applications are processed and thanks to it all the memory issues are solved.
Everything seemed to be working fine, but I realized that the filtering by job wasn’t being applied. The categories are loaded using
$cats = wp_get_object_terms( $app->ID, ‘jobman_category’ );
and then they are compared to the filter value received by URL. However, when I make this call from my own function, it returns an error (Invalid taxonomy).
I assume that the taxonomies must be loaded at some point, and my call using Ajax is being launched before this. However, I don’t have much experience working with WordPress Plugins and after trying dozens different things I’ve run out of ideas.
If anyone could shed light about how to fix this, I’d really appreciate it. Thanks to all!
- The topic ‘Problem with plugin customization’ is closed to new replies.