WordPress.org

Forums

Web Fonts
Error messages with WP_DEBUG=true (3 posts)

  1. netaesthetics
    Member
    Posted 1 year ago #

    I get the following error messages when using the web-fonts plugin with define('WP_DEBUG', true); set in wp-config.php:

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/modules/fonts-com/fonts-com.php on line 693

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/modules/fonts-com/fonts-com.php on line 735

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/web-fonts.php on line 134

    Notice: Undefined variable: selector_data in /wp-content/plugins/web-fonts/modules/google-web-fonts/google-web-fonts.php on line 320

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/modules/google-web-fonts/google-web-fonts.php on line 322

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/modules/fonts-com/fonts-com.php on line 715

    Notice: Undefined variable: selector_data in /wp-content/plugins/web-fonts/modules/google-web-fonts/google-web-fonts.php on line 320

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/modules/google-web-fonts/google-web-fonts.php on line 322

    Notice: Use of undefined constant CACHE_PERIOD - assumed 'CACHE_PERIOD' in /wp-content/plugins/web-fonts/modules/google-web-fonts/google-web-fonts.php on line 342

    http://wordpress.org/plugins/web-fonts/

  2. ereckers
    Member
    Posted 1 year ago #

    I receive the same thing. You have to go in and manually replace CACHE_PERIOD with the actual value.

    This is in addition to a all kinds of Undefined variable errors in the admin.

    This will probably need to get cleaned up at some point as WordPress will start rejecting plugins in the repository with such errors:

    https://make.wordpress.org/plugins/2013/12/22/notice-svn-will-reject-php-with-errors/

  3. coreybroderick
    Member
    Posted 8 months ago #

    Same issue here.

    I altered the files to using the CACHE_PERIOD from 'CACHE_PERIOD' to 'Web_Fonts::CACHE_Period'. Bit of work, but most errors gone.

    Had to alter the google-web-fonts on line 320 from

    !is_array($selector_data)) {
    to
    !is_array($font_data)) {

    to get rid of the last error.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Web Fonts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags