Favorites

Descripción

¿Por qué favoritos?

Favorites está diseñado para usuarios finales y desarrolladores de temas. Proporciona una API fácil de usar para añadir la funcionalidad del botón favorito a cualquier tipo de entrada.

El plugin puede proporcionar una forma de guardar favoritos, me gusta, marcadores o cualquier otro tipo de datos similar con su texto de botón personalizable.

Visita favoriteposts.com para obtener una lista completa de las funciones de plantilla y los shortcodes disponibles.

Características

Usar con cualquier tipo de publicación: activa o desactiva la funcionalidad favorita por tipo de entrada mientras agrega automáticamente un botón de favorito antes y/o después del contenido. O utiliza las funciones incluidas para mostrar el botón en cualquier lugar de tu plantilla.

Disponible para todos los usuarios: ¿No deseas ocultar la funcionalidad detrás de un acceso? Favoritos incluye una opción para guardar los favoritos de los usuarios anónimos por Sesión o Cookie. Los favoritos de los usuarios que han iniciado sesión también se guardan como meta de usuario

Diseñado para desarrolladores: los favoritos funcionan muy bien para principiantes, pero un conjunto completo de funciones de plantilla desbloquea casi cualquier tipo de funcionalidad personalizada que los desarrolladores puedan necesitar. Favoritos genera la cantidad mínima de marcado necesaria, poniendo el estilo y el control en tus manos.

RGPD

As of version 2.2, a setting is provided to help comply with GDPR standards. To enable this setting, visit Settings > Favorites > Users, and check the field under «User Cookie Consent.» When this setting is enabled, the content saved under the setting displays in a modal window, and the user must agree to the terms you provide before favorite cookies can be saved. Note: There is no language provided by default. This should be supplied by a qualified attorney or legal entity. Once the user has approved or denied cookies, that is saved in the «simplefavorites» cookie along with the timestamp of approval or denial. If the site is part of a multi-site installation, the setting will carry through to all sites.

Si tu sitio ya cuenta con una solución de cumplimiento de cookies, hay dos eventos jQuery a nivel de documento que pueden activarse para aprobar o denegar cookies en segundo plano.

Para aprobar el uso de cookies, activa el evento «favorites-user-consent-approved». Para denegar el uso de cookies, activa el evento «favorites-user-consent-denied».

Compatible con varios sitios: a partir de la versión 1.1.0, Favoritos es compatible con varios sitios. Los favoritos de los usuarios se guardan en un sitio/blog y se pueden recuperar y mostrar en todos los sitios.

Para obtener más información, visita favoriteposts.com.

Importante: Favoritos requiere la versión 3.8 o superior de WordPress y la versión 5.4 o superior de PHP.

Uso

Botón favorito

El botón favorito se puede añadir automáticamente al contenido activando tipos de entradas específicas en los ajustes del plugin. También se puede añadir a los archivos de plantilla o a través del editor de contenido utilizando las funciones o shortcodes incluidos. La identificación de la entrada puede dejarse en blanco en todos los casos si está dentro del bucle. El parámetro de identificación del sitio es opcional, para uso en instalaciones de múltiples sitios (el valor por defecto es el sitio actual).

  • Obtener función: get_favorites_button($post_id, $site_id)
  • Función de impresión: the_favorites_button($post_id, $site_id)
  • Shortcode: [favorite_button post_id="" site_id=""]

Recuento de favoritos (por entrada)

Los favoritos totales de cada entrada se guardan como un número entero simple. Si un usuario desfavorece una entrada este recuento se actualiza. Los favoritos de los usuarios anónimos cuentan para el total de forma predeterminada, pero pueden desactivarse mediante el ajuste del plugin. La identificación de la entrada puede dejarse en blanco en todos los casos si está dentro del ciclo.

  • Obtener función: get_favorites_count($post_id)
  • Función de impresión: the_favorites_count($post_id)
  • Shortcode: [favorite_count post_id=""]

Recuento de favoritos (por usuario)
Muestra el número total de favoritos que ha marcado un usuario. Las funciones de plantilla aceptan el mismo parámetro de filtros que las funciones favoritas del usuario.

  • Obtener función: get_user_favorites_count($user_id, $site_id, $filters)
  • Función de impresión: the_user_favorites_count($user_id, $site_id, $filters)
  • Shortcode: [user_favorites user_id="" site_id="" post_types=""]

Favoritos del usuario

Los favoritos del usuario se almacenan como un array de ID de entrada. Los favoritos de los usuarios que han iniciado sesión se almacenan como un metacampo de usuario personalizado, mientras que los favoritos de los usuarios anónimos se almacenan en la sesión o en la cookie del navegador (configurable en los ajustes del plugin). Si se omite el parámetro de identificación de usuario, los favoritos son los predeterminados para el usuario actual. El parámetro de identificación del sitio es opcional, para su uso en instalaciones de varios sitios (por defecto, el sitio actual).

  • Obtener función (devuelve un array de ID): get_user_favorites ($ user_id, $ site_id)
  • Obtener función (devuelve la lista html): get_user_favorites_list($user_id, $site_id, $include_links, $filters, $include_button, $include_thumbnails = false, $thumbnail_size = 'thumbnail', $include_excerpt = false)
  • Función de impresión (imprime una lista html): the_user_favorites_list ($ user_id, $ site_id, $ include_links, $ filtros, $ include_button, $ include_thumbnails = false, $ thumbnail_size = 'miniatura', $ include_excerpt = falso)
  • Shortcode (imprime una lista html, con la opción de omitir enlaces): `[user_favorites user_id =» «include_links =» true «site_id =» «include_buttons =» false «post_types =» post «include_thumbnails = «false» thumbnail_size = «thumbnail» include_excerpt = «false»]

Lista de usuarios que han marcado una entrada como favorita

Muestra una lista de usuarios que han marcado como favorito una entrada específica. Si se omite el parámetro de identificación de usuario, los favoritos son los por defecto para el usuario actual. El parámetro de identificación del sitio es opcional, para su uso en instalaciones de varios sitios (por defecto, el sitio actual). La función get devuelve un array de objetos de usuario.

  • Obtener función (devuelve un array de objetos de usuario): get_users_who_favorited_post ($ post_id, $ site_id)
  • Función de impresión (imprime una lista html): the_users_who_favorited_post ($ post_id = null, $ site_id = null, $ separator = 'list', $ include_anonymous = true, $ anonymous_label = 'Usuarios anónimos' , $ anonymous_label_single = 'Usuario anónimo')
  • Shortcode (imprime una lista html): `[post_favorites post_id =» «site_id =» «separator =» list «include_anonymous =» true «anonymous_label =» Usuarios anónimos «anonymous_label_single =» Usuario anónimo «]

Botón vaciar favoritos

Muestra un botón que permite a los usuarios vaciar todos sus favoritos.

  • Obtener función: get_clear_favorites_button ($ site_id, $ text)
  • Función de impresión: the_clear_favorites_button ($ site_id, $ text)
  • Shortcode: `[clear_favorites_button site_id=»» text=»Clear Favorites»]

Recuento de favoritos (en todas las entradas)
Muestra el número total de favoritos de un sitio determinado.

  • Obtener función: get_total_favorites_count ($ site_id)
  • Función de impresión: the_total_favorites_count ($ site_id)

Capturas

  • Fácil de usar para desarrolladores - elimina estilos fácilmente si combinas y minimizas los tuyos propios.

  • Activar para usuarios anónimos y guardar en la sesión o una cookie del navegador. Los favoritos de los usuarios registrados se guardan en un meta campo de usuario personalizado.

  • Opcionalmente, añade una puerta de autenticación emergente para usuarios no autenticados

  • Activa y muestra por tipo de entrada, o usa las funciones/shortcodes para añadir plantillas manualmente.

  • Personaliza el marcado del botón para que se ajuste a tu tema

  • O utiliza un tipo de botón predefinido y personaliza los colores para que se adapten al estilo de tu sitio.

  • Todas las opciones son personalizables, incluido el estado de carga de los botones favoritos.

  • Personalizar listas de favoritos

Instalación

  1. Sube el directorio del plugin de favorites al directorio wp-content/plugins/
  2. Activa el plugin a través del menú «Plugins» en WordPress
  3. Visita los ajustes del plugin para configurar las opciones de visualización
  4. Utiliza las funciones de la plantilla, el ajuste de pantalla o los shortcodes para mostrar el botón favorito, los recuentos de favoritos y/o los favoritos del usuario.

FAQ

¿Funcionó esto en páginas almacenadas en caché?

Sí, aunque los botones pueden mostrar el estado incorrecto momentáneamente. Los estados de los botones se actualizan mediante una llamada AJAX después de la carga de la página para acomodar las páginas almacenadas en caché. Esto puede notarse en servidores más lentos.

¿Este plugin es compatible con multisitio?

A partir de la versión 1.1.0, Favorites es compatible con instalaciones multisitio. De forma por defecto, todos los shortcodes y las funciones de plantilla extraerán datos del sitio que se está viendo. Los ID de sitios específicos pueden pasarse como parámetros para un mayor control. Consulta la documentación para obtener más información.

Reseñas

20 de febrero de 2024
This plugin was a winner. But no more. Too bad. Two stars for the earlier success, 3 stars down for absence and silence. The plugin inserts text instead of a button (from the shortcode I suppose), so ALL my posts start with a BOLD F (for Favorited). No more buttons can be visible anymore. WP is now at version 6.4.3. I wish the developers all the best. They will be missed. Andre
30 de diciembre de 2023
This plugin is EXACTLY what I was looking for. The fact that you can use it "style-agnostic" and apply your own markup and styles to match your website is so great. This is for sure my new "go-to" plugin for bookmarks and favorites. AWESOME JOB!
8 de noviembre de 2023
This plugin deserves all the stars: simple, functional, customizable, developer-friendly, and free! Thank you, Kyle!
Leer todas las 128 reseñas

Colaboradores y desarrolladores

«Favorites» es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores

«Favorites» está traducido en 5 idiomas. Gracias a los traductores por sus contribuciones.

Traduce «Favorites» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

2.3.4

  • Tested with WordPress v6.4
  • Fixes various PHP errors
  • Security update

2.3.3

  • Actualización de seguridad.

2.3.2

  • Actualización de seguridad.

2.3.1

  • Bug Fix: Fixes issue where only one custom field was being output when multiple were specified in the custom list html.
  • Actualización de seguridad: elimina el posible problema de seguridad en el que el usuario puede marcar como favorita una entrada no pública o una entrada en la que los favoritos no están activados.

2.3.0

  • Security Update: Removes ability for users to manipulate favorites belonging to other users. Thanks to Arne van Hoorn for uncovering this issue.

2.2.0

  • Fixes multisite issue where favorites were not being retrieved correctly.
  • Adds setting to require consenting to cookies before saving favorites, in an effort to adhere to GDPR compliance. Note: the modal content that displays when this setting is enabled should be provided by a qualified attorney or legal entity. Should your site already have a cookie consent protocol in place, document-level events are provided for triggering the user preferences.

2.1.6

  • Adds option of redirecting to a page/post by ID if an anonmyous user attempts to favorite an item
  • Adds shortcode processing to authentication gate modal content
  • Bug fix that was causing unexpected errors in content filtered by ‘the_content’ filter.

2.1.5

  • Bug fix where button HTML filters were not being applied to AJAX/cache enabled sites. The post id is not available as a parameter on button html on cache-enabled sites.
  • Adds additional compatibility for logged-in favoriting on hosts with aggressive server-side caching

2.1.4

  • Post favorite counts using the shortcode [favorite_count] or the functions get_favorites_count/the_favorites_count now update without page reload.
  • Adds parameter to the [user_favorites] shortcode for «No Favorites» text. Overrides the plugin setting. [user_favorites no_favorites=»Your Custom Text»]
  • Updated code that was breaking in PHP versions less than 5.4. End-of-life PHP version support will be dropped in Favorites v3
  • Bug fix where total favorite count was showing «1» before a user had favorited any posts
  • Adds additional permalink field under the customized listing visual editor
  • Bug fix where nonce was not loading correctly on some sites, resulting in an «Incorrect form field» error
  • Adds status filter to function filter parameters

2.1.3

  • Bug fix where authentication gate modal was not appearing correctly due to a Javascript error on sites with the cache option disabled.
  • Bug fix where lists were being emptied on page load with the cache option enabled.

2.1.2

  • Added additional filters for the listing wrapper CSS classes and the listing element CSS classes. See the plugin website for details.
  • Added plugin setting and filter for customizing the button html element type.
  • Added a «Development Mode» setting for logging various data to the browser console in order to help with support and debugging.
  • Reverted default post types in favorites list to display all post types.
  • Updates filters run on authorization gate modal that were conflicting with some themes and plugins.

2.1.1

  • Fixes bug where Favorites admin javascript was loading outside the plugin settings area, causing preventing some sites from saving posts.

2.1.0

  • Option added to enable a modal notification for anonymous users. Modal content is editable under Settings > Favorites > Users. Anonymous users must be disabled, and the «Require Login & Show Modal» must be checked. The content is also available via a filter: favorites/authentication_modal_content. If the plugin css has been disabled and this feature is required, please see the plugin styles for new css classes required for modals to function.
  • Button customization options added, including color settings and preset button types. Visit Settings > Favorites > Display & Post Types to customize the button. In addition to now having the ability to choose a preset button type, button colors may be specified to better match your theme without editing CSS files.
  • Option added to customize the favorites list. Options are now included for specifying the HTML element type and custom CSS classes for both the list wrapper element and individua listing elements. Additionally, the listings may be fully customized using a standard WordPress editor field.
  • Various filters have been added. See the plugin website for a detailed list of available filters.

2.0.2

  • Option added to use a css/html loading indicator in place of an image. Additional filters added for theme use
  • Shortcode option added to the favorites list «user_favorites» for including the post thumbnail. To include the thumbnail, pass the option include_thumbnails=»true». To specify a thumbnail size, pass it in as an option: thumbnail_size=»thumbnail»
  • Shortcode option added to the favorites list «user_favorites» for including the post excerpt. To include the excerpt, pass the option include_excerpt=»true»
  • Filters added for the list thumbnail and list excerpt. See plugin documentation for names and parameters
  • Plugin settings redesigned

2.0.1

  • Javascript callback functions have been deprecated in place of events. Deprecated functions will be removed in a later version. Please see the plugin documentation on using the new events
  • App namespace renamed to «Favorites». Important: any developers extending the plugin core should update any references in PHP namespaces to \Favorites\
  • Plugin text domain updated to «favorites» to follow WordPress requirements
  • AJAX actions renamed to remove «simple» prefix
  • Bug fix where adding a favorite required a page refresh for it to appear in favorite lists
  • Added API function to get the total count of favorites across all posts
  • Tested with WordPress 4.8

1.2.4

  • Added option to display favorite counts in admin columns on a per-post type basis. Visit Settings > Favorites > Display to enable the columns.
  • Added filter option to change cookie expiration (thanks to Github user rlaan)

1.2.3

  • Bug fix – post type parameter in shortcode being overwritten by javascript on load

1.2.2

  • Bug fix – incorrect list being displayed when passing a specific user id to get_user_favorites_list();

1.2.1

  • Bug fix where [user_favorite_count] shortcode always returning 0 in multisite installations.
  • Added filter to customize user list output.
  • Tested for WordPress 4.3 compatibility

1.2.0

  • Added functionality to display users who have favorited a post. Use the shortcode [post_favorites] or one of the two new template functions: get_users_who_favorited_post or the_users_who_favorited_post. View the plugin website for options and usage examples.
  • Added shortcode and template functions to display a «Clear Favorites» button. Button clears all user favorites when clicked.
  • Added developer hooks for before and after a post has been favorited.
  • Added developer Javascript callback functions for after the page has loaded, and after a favorite has been submitted.
  • Option added to include favorite button in generated list (see «Other Notes» tab or plugins website for template functions and shortcode)
  • Option added to customize text that displays in lists when the user has no favorites (visit settings > favorites > display to customize the text)
  • Post type(s) parameter added to get_user_favorites_count template function and user_favorite_count shortcode.
  • User favorite count now updated dynamically (may require a cache reset if page cache is enabled)
  • Bug fix – Invalid posts removed from user favorites (trashed/unpublished posts).
  • Other various enhancements and minor bug fixes

1.1.4

  • Fixed bug that allowed multiple button submissions before the previous was processed

1.1.3

  • Option added to hide loading indication on page load.

1.1.2

  • Bug fix in plugin settings when deselecting all automatic post type insertions.

1.1.1

  • Optional filtering added to favorite list template functions. The functions now accept an array of arguments for fine-tuned favorite lists. Visit the documentation for more information.
  • An optional «post_type» parameter has been added to the user_favorites shortcode. The parameter allows for filtering of the generated list by post types, and will accept a comma separated list of post types
  • Option added to include post favorite count in the button (view settings > favorites > display to enable)
  • Button loading state option added (view settings > favorites > display to enable)
  • Added template function and shortcode for displaying total number of favorites by user (see documentation for more options)

1.1.0

  • Favorites is now multisite compatible. See documentation for added template function and shortcode parameters.

1.0.5

  • Autoloader bug fix (Thanks to Stefan Oderbolz)
  • User List page cache fix

1.0.4

  • User favorites list bug fix

1.0.3

  • Additional bug fixes for logged in users

1.0.2

  • Fixed array error bug for logged in users

1.0.1

  • Fixed bug where logged in user’s favorites were pulling from session/cookie rather than saved user meta
  • Tested for 4.2 compatibility

1.0

  • Initial release