The real question is why do you want to cache anything at all. If the widget is a common “recent posts” then all the practical object caching you are doing is mostly a duplication of the caching done in `WP_query’ when you query for the posts. Or in other words, the simplest solution is to remove the caching related code.
Update
As @jami0821 pointed out in the comments, the latest version of the theme check tool removes that specific check, so you might ask the reviewer to make sure he uses the latest version. That said, there is still no reason to keep that code around.
Related Posts:
- Creating your own widgets: using cache?
- How does the default recent posts widget work with cache?
- Custom php Widget keeps disappearing from the front end
- Can a widget in the Customizer be “single-use” (i.e. disabled after 1 instance has been added)?
- Why is the $old_instance needed for the widget update function?
- How to add color picker to widgets?
- How to delete cached transients from a widget instance properly?
- What is this instance variable doing in the Widgets class
- Remove All Widgets from Sidebar
- Unregistering a Sidebar in Child Theme
- Problems with the sidebar args and wp_list_bookmarks
- Ban certain widgets from certain sidebars
- How could a Widget behave differently depending on sidebar
- iris color picker in widget – click event doesn’t fire when initially when widget is first created
- Find if widget block is active
- Elegantly using JavaScript on widget admin forms
- Multiple users editting widgets
- How to rename wordpress Widget
- jQuery UI inside widget on admin page
- How to activate or install the Gallery Widget?
- Custom User Field in Dashboard Widget
- Getting a div wrapped around two widgets
- Widgets not adding div on before and after title
- Dynamically add content to an existing widget area
- is_tax() not working in Widget Logic [closed]
- How to position custom dashboard widgets on side column
- One register_sidebar function works, the other doesn’t?
- WordPress widget title coding
- Text Widget in Footer for just 1 page template
- Modify WordPress widgets Screen
- What does apply_filters() do exactly? [duplicate]
- How to change color of registered widget areas in admin?
- Filter Text from sidebar widget?
- How to filter widget(s) based on a specific category landing page
- How do I remove/reset all current widgets from the database?
- Search transients through widget
- what is the difference between these two types of widget form method
- Change the background color of my theme widgets
- Ampersand breaking Widget title
- How to allow editing of text in sidebar?
- Shortcode into widget
- Creating a dynamic class name in my custom widget
- Want to add more option in “Sexy Login”
- How to show avatar of current logged in user in a widget
- Got a problem with a widget
- Widget control – putting a slideshow in the widget area
- WordPress Local to Live and The Missing Widgets!
- Extending the WordPress Recent Posts Widget
- delete widget upon uninstall
- How to paste widget to a specific page
- How do I find out which
- Unable to see Widget Submenu under Appearance with Class Based WP_Widget
- How to update a widget data?
- An archive widget, coming from nowhere on my posts and pages
- custom widget not saved to sidebar
- When editing in block editor, the post/article gets under the floating widgets
- Recently changed domain name. Home page widgets are now not in the customize menu yet still being on the page
- Make widget with media upload repeatable
- Is it possible to dynamically output the name of the widgets?
- I accidentally added a widget area called sidebar 1
- wp_registered_widgets doesn’t contains my widgets
- How can I write this code snippet so that it echo’s the response when submitting empty fields?
- What is the difference between widget object and widget instance?
- Apply two different styles to Wiget Titles along with a decorative line
- How Can I Replicate & Register a Widget from the Child Theme
- How to retrieve category ID’s from widget settings?
- My plugin works in home page, but doesn’t work in post page
- Widget text color change
- Widget to embed youtube video
- Can I use wp_widget_rss_output to show my site’s feed in the dashboard?
- How to make featured area?
- Checking if widget has title not working
- wp_list_categories + widget
- How can I add widgets to the category page?
- How to create another widgets.php page
- Remove default WordPress widgets
- widget that will do shortcodes that user inputs
- Disable wordpress widget automatically on error
- Can I add a widget to the of my site?
- Widget dynamically add new input field
- How to show widget in frontend?
- Widget Development – Displaying dropdown content
- WordPress function breaks widget’s markup?
- Registering multiple copies of a widget
- How do I stop out of stock items from appearing on my WooCommerce site when using the Layered Nav widget [closed]
- Single Widget Multi Sidebar
- An issue with register_sidebar and the admin interface
- page url in shortcode
- iframe/embed vid in text widget loads outside container and moves around when scrolling the page?
- menu in different page in different style
- Add text to Text Widget using Javascript
- Widget on home page displays wrong time compared to same widget on inside pages
- Widget logic not working
- Subpages menu on sidebar plus widgets
- Widgets in PHP files?
- Text Widget Not Working
- Sample widget code which get data(1-5 record) from Wp_Admin panel and display to Homepage(WordPress Custom Theme)
- Widget block editor: Unable to collect checkbox values inside widget update() method
- Theme Widget Area Defaults
- How to add the “page” post type to Recent Activity widget displayed in admin?