1,2. this is not true, if user submits ad description in HTML should i first escape and then unescape it?
In the plugin i have functions that are responsible for handling user submitted data and this functions make sure that submitted data is not dangerous.
3. this is not true again, try doing search for “Test ‘) OR 1” this will not break the plugin as WP_Query is escaping params before querying DB. With your customized adverts_request() function i would have data escaped twice and some unexpected results in search at best.
The only case when my adverts_request() function is unsafe is when i am querying DB directly using $wpdb->query() function, but i do not have any code that does this.
Either way in the next version i will add adverts_request filter in the plugin and you will be able to apply your sanitize functions to this query.
No offence, but unless you can find actual loophole in the code i do not really feel like discussing this further.
—
On advert-category pages i am using kind of a hack to display the list because by default WordPress will use archive.php or taxonomy.php which will completely ignore WPAdverts styling for adverts list and use it’s own layout to list ads.
You can disable this hack by adding following code to your theme functions.php
add_action("init", "twentytwelve_for_wpadverts_init", 20);
function twentytwelve_for_wpadverts_init() {
remove_filter('template_include', 'adverts_template_include');
}
Next in your theme directory create file taxonomy-advert_category.php copy to it content from either taxonomy.php or archive.php, usually it will have something like
<?php if ( have_posts() ) : ?>
...
<?php endif; ?>
remove all this code and replace it with
<?php
global $wp_query;
remove_filter("the_content", "adverts_the_content");
echo shortcode_adverts_list(array(
"category" => $wp_query->get_queried_object_id()
));
?>
This should make the plugin work like on a page with [adverts_list] shortcode. Here is https://dl.dropboxusercontent.com/u/30001999/snippets/twentytwelve-for-wpadverts.zip a working example of TwentyTwelve child theme that has this implemented properly.